-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathCMakeLists.txt
66 lines (49 loc) · 2.13 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
66
cmake_minimum_required(VERSION 3.14)
project(consteval_huffman
VERSION 0.0.1
DESCRIPTION "Compile-time Huffman coding compression using C++20"
HOMEPAGE_URL "https://github.com/tcsullivan/consteval-huffman"
LANGUAGES CXX)
# ---- Warning guard ----
# Protect dependents from this project's warnings if the guard isn't disabled
set(consteval_huffman_warning_guard SYSTEM)
if(consteval_huffman_INCLUDE_WITHOUT_SYSTEM)
set(consteval_huffman_warning_guard "")
endif()
# ---- Declare library ----
add_library(consteval_huffman INTERFACE)
add_library(tcsullivan::consteval_huffman ALIAS consteval_huffman)
target_include_directories(consteval_huffman
${consteval_huffman_warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
target_compile_features(consteval_huffman INTERFACE cxx_std_20)
# ---- Install ----
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(consteval_huffman_directory "consteval_huffman-${PROJECT_VERSION}")
set(consteval_huffman_include_directory
"${CMAKE_INSTALL_INCLUDEDIR}/${consteval_huffman_directory}")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION "${consteval_huffman_include_directory}"
COMPONENT consteval_huffman_Development)
install(TARGETS consteval_huffman
EXPORT consteval_huffmanTargets
INCLUDES DESTINATION "${consteval_huffman_include_directory}")
write_basic_package_version_file(
consteval_huffman-config-version.cmake
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT)
set(consteval_huffman_install_cmakedir
"${CMAKE_INSTALL_LIBDIR}/cmake/${consteval_huffman_directory}")
install(FILES "${PROJECT_BINARY_DIR}/consteval_huffman-config-version.cmake"
DESTINATION "${consteval_huffman_install_cmakedir}"
COMPONENT consteval_huffman_Package)
install(EXPORT consteval_huffmanTargets
FILE consteval_huffman-config.cmake
NAMESPACE tcsullivan::
DESTINATION "${consteval_huffman_install_cmakedir}"
COMPONENT consteval_huffman_Package)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
include(CPack)
endif()