-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
69 lines (55 loc) · 1.61 KB
/
CMakeLists.txt
File metadata and controls
69 lines (55 loc) · 1.61 KB
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
66
67
68
69
# General setup
# =============
cmake_minimum_required(VERSION 3.16)
project(
cfdSCOPE
VERSION 0.0.1
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Target setup
# ============
add_library(simulation
src/Simulation.cpp
)
add_executable(cfdscope
src/cfdSCOPE.cpp
)
target_link_libraries(cfdscope PRIVATE simulation)
# Dependency setup
# ================
find_package(OpenMP REQUIRED)
if(OpenMP_CXX_FOUND)
target_link_libraries(simulation PUBLIC OpenMP::OpenMP_CXX)
endif()
include(FetchContent)
FetchContent_Declare(
cxxopts
GIT_REPOSITORY https://github.com/jarro2783/cxxopts
GIT_TAG v3.3.1
)
FetchContent_MakeAvailable(cxxopts)
target_link_libraries(cfdscope PRIVATE cxxopts)
include(FetchContent)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.15.3
)
FetchContent_MakeAvailable(spdlog)
target_link_libraries(cfdscope PRIVATE spdlog::spdlog_header_only)
target_link_libraries(simulation PUBLIC spdlog::spdlog_header_only)
# Options and tests
# =================
option(ENABLE_TRACE_LOG "Print log with level TRACE." OFF)
option(BUILD_TESTS "Build test suite" OFF)
if(ENABLE_TRACE_LOG)
target_compile_definitions(cfdscope PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
target_compile_definitions(simulation PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
else()
target_compile_definitions(cfdscope PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG)
target_compile_definitions(simulation PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG)
endif()
if(BUILD_TESTS)
add_subdirectory(tests)
endif()