-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
65 lines (50 loc) · 1.5 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
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.5...3.22)
project(
fintamath
LANGUAGES CXX
VERSION 0.9.0)
include(cmake/PreventInSourceBuilds.cmake)
include(cmake/CCache.cmake)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
option(${PROJECT_NAME}_build_shared "Build shared" OFF)
option(${PROJECT_NAME}_build_tests "Build tests" OFF)
add_subdirectory(thirdparty)
find_package(MPFR REQUIRED)
file(
GLOB_RECURSE
SOURCES
CONFIGURE_DEPENDS
"include/*.hpp"
"src/*.hpp"
"src/*.cpp")
if(${PROJECT_NAME}_build_shared)
add_library(${PROJECT_NAME} SHARED ${SOURCES})
else()
add_library(${PROJECT_NAME} ${SOURCES})
endif()
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set_target_properties(${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
target_include_directories(
${PROJECT_NAME}
PUBLIC include
PRIVATE src)
target_link_libraries(
${PROJECT_NAME}
PUBLIC fmt::fmt-header-only
cppcoro
MPFR
Boost::multiprecision
Boost::math)
include(cmake/CompilerWarnings.cmake)
include(cmake/Coverage.cmake)
include(cmake/Sanitizers.cmake)
include(cmake/ClangFormat.cmake)
if(${PROJECT_NAME}_build_tests)
enable_testing()
add_subdirectory(tests)
endif()