-
Notifications
You must be signed in to change notification settings - Fork 40
/
CMakeLists.txt
55 lines (44 loc) · 1.59 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_minimum_required(VERSION 3.10)
# define project name, version
project(PSEMolDyn VERSION 0.0.1)
# let ccmake and cmake-gui offer the default build type options
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel")
# set Release as the default build type if it is not yet set.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# collect all cpp files
file(GLOB_RECURSE MY_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
# header don't need to be included but this might be necessary for some IDEs
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.h"
)
# create make target
add_executable(MolSim ${MY_SRC})
# set cxx standard. You may raise this if you want.
target_compile_features(MolSim
PRIVATE
cxx_std_17
)
target_include_directories(MolSim
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/libs/libxsd
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
)
target_link_libraries(MolSim
# stuff that is used in headers and source files
PUBLIC
xerces-c
)
# activate all compiler warnings. Clean up your code :P
# depending on the compiler different flags are used
target_compile_options(MolSim
PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wall>
# disable some spam warnings for icpc...
$<$<CXX_COMPILER_ID:Intel>:-w3 -wd383,981,1418,1572,2259>
)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)
include(doxygen)