-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
56 lines (40 loc) · 1.43 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
cmake_minimum_required(VERSION 3.8)
project(tser VERSION 1.0.0 LANGUAGES CXX)
# ---- Warning guard ----
# Protect dependents from this project's warnings if the guard isn't disabled
set(tser_warning_guard SYSTEM)
if(tser_INCLUDE_WITHOUT_SYSTEM)
set(tser_warning_guard "")
endif()
# ---- Declare library ----
add_library(tser INTERFACE)
add_library(KonanM::tser ALIAS tser)
target_include_directories(tser
${tser_warning_guard}
INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>")
target_compile_features(tser INTERFACE cxx_std_17)
# ---- Install ----
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(tser_directory "tser-${PROJECT_VERSION}")
set(tser_include_directory
"${CMAKE_INSTALL_INCLUDEDIR}/${tser_directory}")
install(TARGETS tser
EXPORT tserTargets
INCLUDES DESTINATION "${tser_include_directory}")
set(tser_install_cmakedir
"${CMAKE_INSTALL_LIBDIR}/cmake/${tser_directory}")
write_basic_package_version_file(
tserConfigVersion.cmake
COMPATIBILITY SameMajorVersion
ARCH_INDEPENDENT)
install(EXPORT tserTargets
FILE tserConfig.cmake
NAMESPACE KonanM::
DESTINATION "${tser_install_cmakedir}")
install(FILES
"${PROJECT_BINARY_DIR}/tserConfigVersion.cmake"
DESTINATION "${tser_install_cmakedir}")
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION "${tser_include_directory}")