-
Notifications
You must be signed in to change notification settings - Fork 0
/
InstallUtils.cmake
87 lines (71 loc) · 2.61 KB
/
InstallUtils.cmake
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
macro(InstallHeaders)
foreach(header ${ARGN})
get_filename_component(DIR "${CMAKE_CURRENT_SOURCE_DIR}/${header}" DIRECTORY)
file(RELATIVE_PATH REL_DIR ${CPP_SCHEDULER_SOURCE_DIR} ${DIR})
install(FILES ${header} DESTINATION include/${REL_DIR})
endforeach()
endmacro()
macro(InstallAlgorithm TARGET_NAME)
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${CMAKE_BUILD_TYPE}/lib
ARCHIVE DESTINATION ${CMAKE_BUILD_TYPE}/lib
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/lib
)
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${CMAKE_BUILD_TYPE}/test
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/test
)
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${CMAKE_BUILD_TYPE}/benchmark
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/benchmark
)
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${CMAKE_BUILD_TYPE}/tools
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/tools
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/lib OPTIONAL)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/test OPTIONAL)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/benchmark OPTIONAL)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/tools OPTIONAL)
endif()
endmacro()
macro(InstallCoreComponent TARGET_NAME)
InstallAlgorithm(${TARGET_NAME})
endmacro()
macro(InstallCostFunction TARGET_NAME)
InstallAlgorithm(${TARGET_NAME})
endmacro()
macro(InstallSerializer TARGET_NAME)
InstallAlgorithm(${TARGET_NAME})
endmacro()
macro(InstallRoutingService TARGET_NAME)
InstallAlgorithm(${TARGET_NAME})
endmacro()
macro(InstallDebugRenderer TARGET_NAME)
InstallAlgorithm(${TARGET_NAME})
endmacro()
macro(InstallBenchmark TARGET_NAME)
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/benchmark
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/benchmark OPTIONAL)
endif()
endmacro()
macro(InstallTool TARGET_NAME)
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/tools
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/tools OPTIONAL)
endif()
endmacro()
macro(InstallTest TARGET_NAME)
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION ${CMAKE_BUILD_TYPE}/test
)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> DESTINATION ${CMAKE_BUILD_TYPE}/test OPTIONAL)
endif()
endmacro()