-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (52 loc) · 1.66 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
cmake_minimum_required(VERSION 3.26)
project(CliParse)
set(CMAKE_CXX_STANDARD 20)
include(CTest)
add_subdirectory(tests)
if (CLIPARSE_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
add_library(cliparse INTERFACE)
target_include_directories(cliparse
INTERFACE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<INSTALL_INTERFACE:include>"
)
if (CLIPARSE_INSTALL)
install(
TARGETS cliparse
EXPORT cliparseTargets
INCLUDES DESTINATION include
)
install(DIRECTORY include DESTINATION .)
install(
EXPORT cliparseTargets
FILE cliparseTargets.cmake
NAMESPACE cliparse::
DESTINATION lib/cmake/cliparse
)
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/cliparseConfig.cmake"
INSTALL_DESTINATION lib/cmake/cliparse
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/cliparseConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cliparseConfigVersion.cmake"
DESTINATION lib/cmake/cliparse
)
set(version 0.0.1)
set_property(TARGET cliparse PROPERTY VERSION ${version})
set_property(TARGET cliparse PROPERTY SOVERSION 0)
set_property(TARGET cliparse PROPERTY INTERFACE_cliparse_MAJOR_VERSION 0)
set_property(TARGET cliparse APPEND PROPERTY
COMPATIBLE_INTERFACE_STRING cliparse_MAJOR_VERSION
)
# generate the version file for the config file
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/cliparseConfigVersion.cmake"
VERSION "${version}"
COMPATIBILITY AnyNewerVersion
)
endif()