-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
67 lines (47 loc) · 1.69 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
66
67
cmake_minimum_required(VERSION 3.5)
# the project
project(SimDriver VERSION 0.1)
set(CMAKE_CXX_STANDARD 14)
# options
option(CREATE_DOXYGEN_TARGET "Creates the doxygen documentation if set." OFF)
option(BUILD_WITH_INJECTION "Building the agent model with injection functionality." OFF)
# documentation
if (CREATE_DOXYGEN_TARGET)
# message
message("-- Generation of doxygen target enabled")
# Require dot, treat the other components as optional
find_package(Doxygen
REQUIRED dot
OPTIONAL_COMPONENTS mscgen dia)
if (DOXYGEN_FOUND)
# create doc directory
file(MAKE_DIRECTORY ${PROJECT_SOURCE_DIR}/docs)
# settings
set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_GENERATE_MAN YES)
set(DOXYGEN_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/docs)
set(DOXYGEN_EXCLUDE_PATTERNS AgentModelInjection.*)
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md)
# create target
doxygen_add_docs(
doxygen
${PROJECT_SOURCE_DIR}/src README.md
COMMENT "Generate man pages"
)
endif (DOXYGEN_FOUND)
# unset doxygen target
set(CREATE_DOXYGEN_TARGET OFF CACHE BOOL "disabled doxygen target for submodules" FORCE)
endif (CREATE_DOXYGEN_TARGET)
# injection
if(BUILD_WITH_INJECTION)
# add injection sources
add_subdirectory(lib/Injection)
# add definition
add_definitions(-DWITH_INJECTION=true)
endif(BUILD_WITH_INJECTION)
# library code
if(UNIX)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
endif()
add_subdirectory(src/)