blob: d5ea05f72b6f66c0cbf7b2084bb83bc96e899ab4 (
plain)
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
|
##############################################################################
# Provide custom install_* macros to account for all files
##############################################################################
include(CMakeParseArguments)
function(INSTALL_HEADERS)
set(options)
set(oneValueArgs COMPONENT)
set(multiValueArgs HEADERS)
cmake_parse_arguments(INSTALL_HEADERS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
FOREACH(HEADER ${INSTALL_HEADERS_HEADERS})
# message(STATUS "ADDING HEADER ${HEADER}")
if (${HEADER} MATCHES "${CMAKE_BINARY_DIR}.*")
STRING(REGEX REPLACE "${CMAKE_BINARY_DIR}/uscxml/" "" REL_HEADER ${HEADER})
STRING(REGEX MATCH "[^/\\](.*)[/\\]" REL_HEADER ${REL_HEADER})
SET(REL_HEADER "uscxml/${REL_HEADER}")
# message(STATUS "MATCHED CMAKE_BINARY_DIR -> ${REL_HEADER}")
elseif(${HEADER} MATCHES "${PROJECT_SOURCE_DIR}.*")
STRING(REGEX REPLACE "${PROJECT_SOURCE_DIR}/src/" "" REL_HEADER ${HEADER})
# message(STATUS "MATCHED PROJECT_SOURCE_DIR -> ${REL_HEADER}")
else()
message(STATUS "MATCHED no known prefix: ${HEADER}")
endif()
STRING(REGEX MATCH "(.*)[/\\]" DIR ${REL_HEADER})
# message("ADDING ${HEADER} in include/${DIR} for ${INSTALL_HEADERS_COMPONENT}")
INSTALL(FILES ${HEADER} DESTINATION include/${DIR} COMPONENT ${INSTALL_HEADERS_COMPONENT})
ENDFOREACH()
endfunction()
function(INSTALL_FILES)
set(options)
set(oneValueArgs COMPONENT DESTINATION)
set(multiValueArgs FILES)
cmake_parse_arguments(INSTALL_FILE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
install(FILES ${INSTALL_FILE_FILES} DESTINATION ${INSTALL_FILE_DESTINATION} COMPONENT ${INSTALL_FILE_COMPONENT})
endfunction()
function(INSTALL_LIBRARY)
set(options)
set(oneValueArgs COMPONENT)
set(multiValueArgs TARGETS)
cmake_parse_arguments(INSTALL_LIBRARY "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
install(TARGETS ${INSTALL_LIBRARY_TARGETS} DESTINATION lib COMPONENT ${INSTALL_LIBRARY_COMPONENT})
endfunction()
function(INSTALL_EXECUTABLE)
set(options)
set(oneValueArgs COMPONENT)
set(multiValueArgs TARGETS)
cmake_parse_arguments(INSTALL_EXECUTABLE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
install(
TARGETS ${INSTALL_EXECUTABLE_TARGETS}
DESTINATION bin
COMPONENT ${INSTALL_EXECUTABLE_COMPONENT}
PERMISSIONS WORLD_EXECUTE OWNER_EXECUTE GROUP_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
endfunction()
|