-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
executable file
·59 lines (39 loc) · 1.2 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
cmake_minimum_required(VERSION 3.0)
#Use CPP 17
set(CMAKE_CXX_STANDARD 17)
#The name of the project
project(DCM)
#Check if the python bindings should be compiled
if(NOT DEFINED ENABLE_PYTHON_BINDINGS)
set(ENABLE_PYTHON_BINDINGS FALSE)
endif()
if(ENABLE_PYTHON_BINDINGS)
message(STATUS "Python bindings enabled")
else()
message(STATUS "Python bindings disabled")
endif()
#Activate unit testing
enable_testing()
#Contains the external library such as tinyxml (the xml reader)
add_subdirectory(lib)
#Contains the source files (.cpp)
add_subdirectory(src bin)
#Library containing all the tests to run
add_subdirectory(test)
#Locate the openMP library to parallelize the code
find_package(OpenMP REQUIRED)
#Create the main executable
add_executable(simucell3d main.cpp)
#Indicate to main the path to project source directory
add_definitions(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
#Link the lib, include and source libraries with the main library
target_link_libraries(simucell3d PUBLIC
src
OpenMP::OpenMP_CXX
)
#In debog mode, we do not use openMP
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Building in debug mode")
else()
message("-- Building in release mode")
endif()