-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (33 loc) · 1007 Bytes
/
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
#
# Copyright (c) 2019,2022 Nicholas Corgan ([email protected])
#
# Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
# or copy at http://opensource.org/licenses/MIT)
#
# CMake configuration
cmake_minimum_required(VERSION 3.8)
project(cpp-callable-to-funcptr C CXX)
set(CMAKE_CXX_STANDARD 17)
#
# CMake target
#
include(GNUInstallDirs)
add_library(callable-to-funcptr INTERFACE)
target_include_directories(callable-to-funcptr INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
option(CALLABLE_TO_FUNCPTR_INSTALL_HEADERS "Install callable-to-funcptr headers")
if(CALLABLE_TO_FUNCPTR_INSTALL_HEADERS)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/nc
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
#
# Testing
#
# For testing only, not a requirement for the module itself
find_package(Boost 1.65)
if(Boost_FOUND)
enable_testing()
add_subdirectory(testing)
endif()