forked from Harrm/scale-codec
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
79 lines (59 loc) · 1.89 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
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# Copyright Quadrivium LLC
# All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
cmake_minimum_required(VERSION 3.12)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.27")
cmake_policy(SET CMP0144 NEW)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/HunterGate.cmake)
HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm21.zip
SHA1 5b52ab9a309771f172ca609a46e26dde60a8edd7
)
project(Scale LANGUAGES CXX VERSION 1.1.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(BUILD_TESTS "Whether to include the test suite in build" OFF)
hunter_add_package(Boost)
find_package(Boost CONFIG REQUIRED)
hunter_add_package(qtils)
find_package(qtils CONFIG REQUIRED)
add_subdirectory(src)
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test ${CMAKE_BINARY_DIR}/test_bin)
endif ()
###############################################################################
# INSTALLATION
###############################################################################
include(GNUInstallDirs)
install(TARGETS scale EXPORT scaleConfig
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FRAMEWORK DESTINATION ${CMAKE_INSTALL_PREFIX}
)
install(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/scale
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/scaleConfigVersion.cmake
COMPATIBILITY SameMajorVersion
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/scaleConfigVersion.cmake
DESTINATION share/scale
)
install(
EXPORT scaleConfig
DESTINATION share/scale
NAMESPACE scale::
)