-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
46 lines (39 loc) · 1.03 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.24)
project(
collections
LANGUAGES Fortran
VERSION 1.0.3
)
# Utilize the GNU installation structure
include(GNUInstallDirs)
# Get the macros and functions we'll need
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
# Configure everything
add_subdirectory(configure)
# Deal with dependencies
add_subdirectory(dependencies)
# Source
add_subdirectory(src)
add_fortran_library(
${PROJECT_NAME}
${PROJECT_INCLUDE_DIR}
${CMAKE_INSTALL_INCLUDEDIR}
${PROJECT_VERSION}
${PROJECT_VERSION_MAJOR}
${COLLECTIONS_SOURCES}
)
link_library(${PROJECT_NAME} ${ferror_LIBRARY} ${ferror_INCLUDE_DIR})
# Testing
option(BUILD_TESTING "Build tests")
include(CTest)
message(STATUS "Build tests: ${BUILD_TESTING}")
if (BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()
# Examples
option(BUILD_collections_EXAMPLES "Build examples")
message(STATUS "Build collections examples: ${BUILD_collections_EXAMPLES}")
if (BUILD_collections_EXAMPLES)
add_subdirectory(examples)
endif()