dtl/CMakeLists.txt
2024-06-03 14:41:00 -05:00

38 lines
756 B
CMake

cmake_minimum_required(VERSION 3.20)
cmake_policy(SET CMP0048 NEW)
project(
dtl
VERSION 1.21
)
include(CheckIncludeFile)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
check_include_file(unistd.h HAVE_UNISTD_H)
if(HAVE_UNISTD_H)
add_definitions(-DHAVE_UNISTD_H)
endif()
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
option(DTL_ENABLE_TESTING "Enable DTL unit tests" OFF)
if(DTL_ENABLE_TESTING)
include(test/CMakeLists.txt)
endif()
option(DTL_ENABLE_EXAMPLES "Enable DTL examples" OFF)
if(DTL_ENABLE_EXAMPLES)
include(examples/CMakeLists.txt)
endif()
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION include
FILES_MATCHING PATTERN "*.hpp"
)