-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
55 lines (46 loc) · 1.33 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
# cmake -DCMAKE_BUILD_TYPE=Debug ..
# cmake -DSANITIZE=ON -DCMAKE_BUILD_TYPE=Debug ..
# cmake -DCMAKE_BUILD_TYPE=Release ..
cmake_minimum_required( VERSION 3.0.0 )
project( groho )
# set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules")
# cmake -D SANITIZE=ON ..
option(SANITIZE "Sanitize" OFF)
if(SANITIZE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
endif()
if( CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR )
message( FATAL_ERROR "Please make an out of source build: create a build directory and invoke cmake from there." )
endif()
set(CMAKE_CXX_COMPILER "c++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++17 -Wall -Wextra -Wpedantic")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
# NDEBUG will suppress some loguru outputs in Release
file(GLOB GROHO_SOURCES
src/*.cpp
src/lib/*.cpp
src/orrery/*.cpp
src/sampling/*.cpp
src/simulator/*.cpp
src/scenario/*.cpp
src/simulation/*.cpp
src/commands/*.cpp
)
add_executable( groho ${GROHO_SOURCES} )
include_directories(
src/
src/external
src/lib
src/orrery
src/sampling
src/simulator
src/scenario
src/simulation
src/commands
src/plotting
)
target_link_libraries(
groho
-ldl # gcc on linux requires this for loguru
-lpthread # gcc on linux requires this for loguru
)