forked from JBenda/inkcpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (52 loc) · 1.87 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
cmake_minimum_required(VERSION 3.16)
# Testing enabled
enable_testing()
# Project setup
project(inkcpp VERSION 0.1)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_INSTALL_LIBRARY_DIR lib)
SET(CMAKE_INSTALL_INCLUDE_DIR include)
# Add subdirectories
add_subdirectory(shared)
add_subdirectory(inkcpp)
add_subdirectory(inkcpp_compiler)
add_subdirectory(inkcpp_cl)
add_subdirectory(inkcpp_test)
add_subdirectory(unreal)
get_target_property(TEE inkcpp PUBLIC_HEADER)
install(TARGETS inkcpp inkcpp_compiler inkcpp_shared
EXPORT inkcppTarget
ARCHIVE DESTINATION "lib/ink"
COMPONENT lib EXCLUDE_FROM_ALL
PUBLIC_HEADER DESTINATION "include/ink"
COMPONENT lib EXCLUDE_FROM_ALL
)
install(EXPORT inkcppTarget
FILE inkcppTargets.cmake DESTINATION "lib/cmake/inkcpp"
COMPONENT lib EXCLUDE_FROM_ALL)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/inkcppConfig.cmake"
INSTALL_DESTINATION "lib/cmake/inkcpp"
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/inkcppConfigVersion.cmake"
VERSION "${inkcpp_VERSION_MAJOR}.${inkcpp_VERSION_MINOR}"
COMPATIBILITY AnyNewerVersion)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/inkcppConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/inkcppConfigVersion.cmake
DESTINATION lib/cmake/inkcpp COMPONENT lib EXCLUDE_FROM_ALL)
export(EXPORT inkcppTarget
FILE "${CMAKE_CURRENT_BINARY_DIR}/inkcppTargets.cmake")
# include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${inkcpp_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${inkcpp_VERSION_MINOR}")
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_GENERATOR "ZIP")
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_GROUPING IGNORE)
include(CPack)