forked from Markuu-s/scale-codec-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
73 lines (53 loc) · 1.88 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
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
cmake_minimum_required(VERSION 3.12)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/HunterGate.cmake)
HunterGate(
URL https://github.com/soramitsu/soramitsu-hunter/archive/tags/v0.23.257-soramitsu17.tar.gz
SHA1 c7ccd337314b27485b75d0f0f5d5b42e7e3c2629
)
project(Scale LANGUAGES CXX VERSION 1.0.0)
set(CMAKE_CXX_STANDARD 17)
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(Microsoft.GSL)
find_package(Microsoft.GSL CONFIG REQUIRED)
add_subdirectory(src)
enable_testing()
add_subdirectory(test ${CMAKE_BINARY_DIR}/tests_bin)
###############################################################################
# INSTALLATION
###############################################################################
include(GNUInstallDirs)
install(TARGETS scale buffer scale_encode_append 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 ${CMAKE_INSTALL_LIBDIR}/cmake/scale
)
install(
EXPORT scaleConfig
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/scale
NAMESPACE scale::
)