2018-10-12 23:22:37 +00:00
|
|
|
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
|
2020-05-04 23:50:37 +00:00
|
|
|
project(duckhandy VERSION 0.1.0)
|
2016-07-14 14:23:36 +00:00
|
|
|
list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
|
|
|
|
2017-04-12 12:54:55 +00:00
|
|
|
include(CTest)
|
|
|
|
|
2020-05-04 23:58:17 +00:00
|
|
|
find_package(Sprout REQUIRED)
|
|
|
|
|
2017-04-12 12:54:55 +00:00
|
|
|
set(DUCKHANDY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
2020-05-04 23:50:37 +00:00
|
|
|
if (BUILD_TESTING)
|
2021-05-27 23:44:49 +00:00
|
|
|
set(BUILD_TESTING CACHE BOOL ON)
|
2020-05-04 23:50:37 +00:00
|
|
|
else()
|
2021-05-27 23:44:49 +00:00
|
|
|
set(BUILD_TESTING CACHE BOOL OFF)
|
2020-05-04 23:50:37 +00:00
|
|
|
endif()
|
2016-07-14 14:23:36 +00:00
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} INTERFACE)
|
|
|
|
|
|
|
|
target_compile_features(${PROJECT_NAME}
|
|
|
|
INTERFACE cxx_nullptr
|
|
|
|
INTERFACE cxx_range_for
|
|
|
|
INTERFACE cxx_lambdas
|
|
|
|
INTERFACE cxx_decltype_auto
|
|
|
|
INTERFACE cxx_defaulted_functions
|
|
|
|
INTERFACE cxx_deleted_functions
|
|
|
|
INTERFACE cxx_auto_type
|
|
|
|
INTERFACE cxx_decltype_incomplete_return_types
|
|
|
|
INTERFACE cxx_noexcept
|
|
|
|
INTERFACE cxx_rvalue_references
|
2021-04-22 11:02:51 +00:00
|
|
|
INTERFACE cxx_std_20
|
2016-07-14 14:23:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
)
|
2020-05-04 23:58:17 +00:00
|
|
|
target_include_directories(${PROJECT_NAME} SYSTEM
|
|
|
|
INTERFACE ${SPROUT_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2017-04-25 08:33:27 +00:00
|
|
|
target_compile_definitions(${PROJECT_NAME}
|
|
|
|
INTERFACE SPROUT_NO_CXX11_NUMERIC_LIMITS
|
|
|
|
INTERFACE SPROUT_USE_TEMPLATE_ALIASES
|
|
|
|
)
|
|
|
|
|
2017-04-12 12:54:55 +00:00
|
|
|
if (BUILD_TESTING)
|
|
|
|
add_subdirectory(test/unit)
|
|
|
|
endif()
|
2020-05-04 23:50:37 +00:00
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY include/duckhandy
|
|
|
|
DESTINATION include
|
|
|
|
)
|