-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
109 lines (95 loc) · 2.98 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
108
109
cmake_minimum_required(VERSION 3.10)
project(controllers)
#############################
## ADD Targets for install ##
#############################
include_directories(include)
# add cpp files here
set(SRCS
src/map.cpp
src/a_star_node.cpp
src/a_star_test.cpp
)
set(BUILDER
src/map.cpp
# src/map_builder.cpp
)
set(A_STAR
src/a_star_node.cpp
src/a_star_test.cpp
src/map.cpp
)
# for builder tests
if ( NOT ("${BUILDER}" STREQUAL "") )
set(MAP_LIBS )
message(STATUS "${PROJECT_NAME} library compiling: ${BUILDER}")
message(STATUS "BINARY DIR: ${PROJECT_BINARY_DIR}")
add_library(builder SHARED ${BUILDER} )
target_link_libraries(builder
PUBLIC
${MAP_LIBS})
# set_target_properties(builder PROPERTIES LINKER_LANGUAGE Fortran)
#############
## Install ##
#############
install(TARGETS builder
LIBRARY DESTINATION ${PROJECT_BINARY_DIR}
ARCHIVE DESTINATION ${PROJECT_BINARY_DIR}/archive
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
RUNTIME DESTINATION ${PROJECT_BINARY_DIR}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${PROJECT_BINARY_DIR}
FILES_MATCHING PATTERN "*.h"
)
add_executable(map_builder src/map_test.cpp ${BUILDER})
endif()
if ( NOT ("${A_STAR}" STREQUAL "") )
set(LIBS)
message(STATUS "${PROJECT_NAME} library compiling: ${A_STAR}")
message(STATUS "BINARY DIR: ${PROJECT_BINARY_DIR}")
add_library(a_star ${A_STAR})
target_link_libraries(a_star
PUBLIC
${LIBS})
#############
## Install ##
#############
install(TARGETS a_star
LIBRARY DESTINATION ${PROJECT_BINARY_DIR}
ARCHIVE DESTINATION ${PROJECT_BINARY_DIR}/archive
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
RUNTIME DESTINATION ${PROJECT_BINARY_DIR}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${PROJECT_BINARY_DIR}
FILES_MATCHING PATTERN "*.h"
)
add_executable(a_star_logic ${A_STAR})
endif()
# for final code`
if ( NOT ("${SRCS}" STREQUAL "") )
set(LIBS)
message(STATUS "${PROJECT_NAME} library compiling: ${SRCS}")
message(STATUS "BINARY DIR: ${PROJECT_BINARY_DIR}")
add_library(controllers ${SRCS})
target_link_libraries(controllers
PUBLIC
${LIBS})
#############
## Install ##
#############
install(TARGETS controllers
LIBRARY DESTINATION ${PROJECT_BINARY_DIR}
ARCHIVE DESTINATION ${PROJECT_BINARY_DIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
RUNTIME DESTINATION ${PROJECT_BINARY_DIR}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${PROJECT_BINARY_DIR}
FILES_MATCHING PATTERN "*.h"
)
endif()