-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-rules.cmake
78 lines (66 loc) · 1.95 KB
/
install-rules.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
if(PROJECT_IS_TOP_LEVEL)
set(
CMAKE_INSTALL_INCLUDEDIR "include/crillab-universe-${PROJECT_VERSION}"
CACHE PATH ""
)
endif()
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
# find_package(<package>) call for consumers to find this project
set(package crillab-universe)
install(
DIRECTORY
include/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT crillab-universe_Development
)
install(
TARGETS crillab-universe_crillab-universe
EXPORT crillab-universeTargets
RUNTIME #
COMPONENT crillab-universe_Runtime
LIBRARY #
COMPONENT crillab-universe_Runtime
NAMELINK_COMPONENT crillab-universe_Development
ARCHIVE #
COMPONENT crillab-universe_Development
INCLUDES #
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
write_basic_package_version_file(
"${package}ConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
)
if (VCPKG_TARGET_TRIPLET)
# Allow package maintainers to freely override the path for the configs
set(
crillab-universe_INSTALL_CMAKEDIR "${CMAKE_INSTALL_PREFIX}/share/${package}"
CACHE PATH "CMake package config location relative to the install prefix"
)
else ()
set(
crillab-universe_INSTALL_CMAKEDIR "${CMAKE_INSTALL_INCLUDEDIR}/cmake/${package}"
CACHE PATH "CMake package config location relative to the install prefix"
)
endif ()
mark_as_advanced(crillab-universe_INSTALL_CMAKEDIR)
install(
FILES cmake/install-config.cmake
DESTINATION "${crillab-universe_INSTALL_CMAKEDIR}"
RENAME "${package}Config.cmake"
COMPONENT crillab-universe_Development
)
install(
FILES "${PROJECT_BINARY_DIR}/${package}ConfigVersion.cmake"
DESTINATION "${crillab-universe_INSTALL_CMAKEDIR}"
COMPONENT crillab-universe_Development
)
install(
EXPORT crillab-universeTargets
NAMESPACE crillab-universe::
DESTINATION "${crillab-universe_INSTALL_CMAKEDIR}"
COMPONENT crillab-universe_Development
)
if(PROJECT_IS_TOP_LEVEL)
include(CPack)
endif()