cmake_minimum_required(VERSION 3.20) cmake_policy(SET CMP0048 NEW) set(DTL_VERSION 2.01) project( dtl VERSION ${DTL_VERSION} ) 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() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/dtl/variables.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/include/dtl/variables.hpp @ONLY ) 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" )