-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (37 loc) · 1.41 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
# CMakeLists files in this project can
# refer to the root source directory of the project as ${PROJECT_SOURCE_DIR} and
# to the root binary directory of the project as ${PROJECT_BINARY_DIR}.
cmake_minimum_required(VERSION 3.20)
cmake_policy(SET CMP0135 NEW)
project (anderson)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)
add_library(${PROJECT_NAME} INTERFACE)
# Use headers from qutility.
# Note that after qutility is switched to cmake, the following line should be changed
include(FetchContent)
FetchContent_Declare(qutility
GIT_REPOSITORY git@github.com:qiangyicheng/qutility_cmake.git
GIT_TAG main
)
if(NOT qutility_POPULATED)
FetchContent_Populate(qutility)
add_subdirectory(${qutility_SOURCE_DIR} ${qutility_BINARY_DIR})
endif()
target_link_libraries(${PROJECT_NAME} INTERFACE qutility)
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
target_link_libraries(${PROJECT_NAME} INTERFACE OpenMP::OpenMP_CXX)
endif()
set(BLA_VENDOR OpenBLAS)
find_package(BLAS REQUIRED)
target_link_libraries(${PROJECT_NAME} INTERFACE BLAS::BLAS)
# find_package(LAPACK REQUIRED)
# target_link_libraries(${PROJECT_NAME} INTERFACE LAPACK::LAPACK)
find_package(OpenBLAS REQUIRED)
target_link_libraries(${PROJECT_NAME} INTERFACE OpenBLAS::OpenBLAS)
target_include_directories(${PROJECT_NAME} INTERFACE include/)
add_subdirectory(include)
add_subdirectory(src)
enable_testing()
add_subdirectory(test)