-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
52 lines (46 loc) · 1.15 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
47
48
49
50
51
52
# Master CMAKE Build Script
cmake_minimum_required(VERSION 3.24)
project(
nonlin
LANGUAGES Fortran
VERSION 1.5.3
)
# Get helper macros and functions
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
# Confgiure everything
add_subdirectory(configure)
# Deal with the dependencies
find_package(BLAS)
find_package(LAPACK)
add_subdirectory(dependencies)
# Source
add_subdirectory(src)
add_fortran_library(
${PROJECT_NAME}
${PROJECT_INCLUDE_DIR}
${CMAKE_INSTALL_INCLUDEDIR}
${PROJECT_VERSION}
${PROJECT_VERSION_MAJOR}
${NONLIN_SOURCES}
)
target_link_libraries(
${PROJECT_NAME}
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
)
link_library(${PROJECT_NAME} ${ferror_LIBRARY} ${ferror_INCLUDE_DIR})
link_library(${PROJECT_NAME} ${linalg_LIBRARY} ${linalg_INCLUDE_DIR})
# Testing
option(BUILD_TESTING "Build tests")
include(CTest)
message(STATUS "Build tests: ${BUILD_TESTING}")
if (BUILD_TESTING)
enable_testing()
add_subdirectory(tests)
endif()
# Examples
option(BUILD_NONLIN_EXAMPLES "Build nonlin examples")
message(STATUS "Build nonlin examples: ${BUILD_NONLIN_EXAMPLES}")
if (BUILD_NONLIN_EXAMPLES)
add_subdirectory(examples)
endif()