forked from kamchatka-volcano/sfun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (26 loc) · 834 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
cmake_minimum_required(VERSION 3.18)
if(NOT DEFINED SFUN_SUBPROJECT)
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(SFUN_SUBPROJECT OFF)
else()
set(SFUN_SUBPROJECT ON)
endif()
endif()
project(sfun DESCRIPTION "stuff from unnamed namespaces")
add_library(sfun INTERFACE)
target_compile_features(sfun INTERFACE cxx_std_17)
target_include_directories(
sfun
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
option(ENABLE_TESTS "Enable tests" OFF)
if (ENABLE_TESTS AND NOT SFUN_SUBPROJECT)
enable_testing()
add_subdirectory(tests)
endif()
include(GNUInstallDirs)
if(NOT SFUN_SUBPROJECT)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/sfun DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()