-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
49 lines (38 loc) · 1.57 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
# SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(reloc-cpp
LANGUAGES CXX C
VERSION 0.1.0)
include(GNUInstallDirs)
# Make reloc_cpp_generate available
include(${CMAKE_CURRENT_SOURCE_DIR}/RelocCPPGenerate.cmake)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(RELOC_CPP_STANDALONE ON)
endif()
option(RELOC_CPP_INSTALL "Enable installation of reloc-cpp" ${RELOC_CPP_STANDALONE})
# Build test related commands?
option(BUILD_TESTING "Create tests using CMake" ${RELOC_CPP_STANDALONE})
if(BUILD_TESTING)
enable_testing()
endif()
if(RELOC_CPP_INSTALL)
set(RELOC_CPP_INSTALL_MODULE_DIR "${CMAKE_INSTALL_DATADIR}/reloc-cpp")
set(RELOC_CPP_INSTALL_CMAKE_DIR "${CMAKE_INSTALL_DATADIR}/reloc-cpp/cmake")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/RelocCPPGenerate.cmake
DESTINATION "${CMAKE_INSTALL_DATADIR}/reloc-cpp")
find_package(YCM REQUIRED)
include(InstallBasicPackageFiles)
install_basic_package_files(${PROJECT_NAME}
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion
VARS_PREFIX ${PROJECT_NAME}
NO_CHECK_REQUIRED_COMPONENTS_MACRO
ARCH_INDEPENDENT
NO_EXPORT)
include(AddUninstallTarget)
endif()
# Add integration tests (unit tests for each library should be in each sublibrary directory).
if(BUILD_TESTING)
add_subdirectory(tests)
endif()