-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
55 lines (48 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
53
54
55
# Master CMAKE Build Script
cmake_minimum_required(VERSION 3.24)
project(
linalg
LANGUAGES Fortran C
VERSION 1.8.2
)
# Get helper macros and functions
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake")
# Build the C API?
option(BUILD_C_API "Build C API?" OFF)
# 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}
${LINALG_SOURCES}
)
target_link_libraries(
${PROJECT_NAME}
${BLAS_LIBRARIES}
${LAPACK_LIBRARIES}
)
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(tests)
add_subdirectory(tests_c)
endif()
# Examples
option(BUILD_LINALG_EXAMPLES "Build LINALG examples")
message(STATUS "Build LINALG examples: ${BUILD_LINALG_EXAMPLES}")
if (BUILD_LINALG_EXAMPLES)
add_subdirectory(examples)
endif()