-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (84 loc) · 1.65 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 3.0)
project(
CAVIS
VERSION 1.3.0
LANGUAGES CXX
)
# Dependencies {{{
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_SOURCE_DIR}/cmake/modules"
)
# SFML
find_package(
SFML 2 REQUIRED
window system
)
# }}}
# Definitions {{{
set(
${PROJECT_NAME}_src
./src/pixels.cpp
./src/window.cpp
./src/cavis.cpp
./src/grid.cpp
)
set(
${PROJECT_NAME}_headers
./include/cavis.h
./include/pixels.h
./include/grid.h
./include/agent.h
./include/window.h
./include/cellular_automaton.h
)
add_library(
${PROJECT_NAME}
SHARED
${${PROJECT_NAME}_src}
)
target_link_libraries(
${PROJECT_NAME}
PUBLIC
${SFML_LIBRARIES}
${SFML_DEPENDENCIES}
)
# }}}
# Install {{{
set(destination lib/cmake/${PROJECT_NAME})
# Packaging {{{
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY ExactVersion
)
install(
FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
DESTINATION ${destination}
)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/configs/${PROJECT_NAME}Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${destination}
)
install(
FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION ${destination}
)
# }}}
install(
FILES ${${PROJECT_NAME}_headers}
DESTINATION include
)
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib COMPONENT Development
)
install(
EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Targets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${destination}
)
# }}}