nameof_module/CMakeLists.txt

26 lines
720 B
Text
Raw Normal View History

2018-04-29 12:34:02 +00:00
cmake_minimum_required(VERSION 3.2)
2018-03-26 12:02:43 +00:00
2018-09-04 14:41:01 +00:00
include(GNUInstallDirs)
2018-08-29 11:57:44 +00:00
project(nameof LANGUAGES CXX)
2018-09-04 14:41:01 +00:00
set(${PROJECT_NAME} "0.5.0")
set(package_name ${PROJECT_NAME})
set(include_source_dir "${CMAKE_SOURCE_DIR}/include")
option(NAMEOF_OPT_BUILD_EXAMPLES "Build nameof examples" ON)
option(NAMEOF_OPT_BUILD_TESTS "Build and perform nameof tests" ON)
add_library(${package_name} INTERFACE)
target_include_directories(${package_name} INTERFACE "$<BUILD_INTERFACE:${include_source_dir}>")
if(NAMEOF_OPT_BUILD_EXAMPLES)
add_subdirectory(example)
endif()
2018-03-27 09:03:12 +00:00
2018-09-04 14:41:01 +00:00
if(NAMEOF_OPT_BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif()
2018-03-28 08:54:21 +00:00
2018-09-04 14:41:01 +00:00
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})