-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
69 lines (52 loc) · 1.83 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
#
# Copyright Soramitsu Co., Ltd. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
cmake_minimum_required(VERSION 3.12)
# NOTE: We have to define this option BEFORE adding thirdparties
# because it affects on the boost components list which should
# be defined once for Conan package manager
option(BUILD_TESTS "Whether to include the test suite in build" OFF)
include("${CMAKE_SOURCE_DIR}/cmake/3rdpartyUtils.cmake")
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)
add_3rdparty("Boost")
add_3rdparty("Microsoft.GSL")
add_subdirectory(src)
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test ${CMAKE_BINARY_DIR}/tests_bin)
endif ()
###############################################################################
# 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::
)