2019-03-12 13:55:56 +00:00
|
|
|
cmake_minimum_required(VERSION 3.6)
|
2018-03-26 12:02:43 +00:00
|
|
|
|
2019-04-18 17:00:59 +00:00
|
|
|
project(nameof VERSION "0.8.1" LANGUAGES CXX)
|
2018-09-04 14:41:01 +00:00
|
|
|
|
2019-04-18 09:27:35 +00:00
|
|
|
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
|
|
|
set(IS_TOPLEVEL_PROJECT TRUE)
|
|
|
|
else()
|
|
|
|
set(IS_TOPLEVEL_PROJECT FALSE)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(NAMEOF_OPT_BUILD_EXAMPLES "Build nameof examples" ${IS_TOPLEVEL_PROJECT})
|
|
|
|
option(NAMEOF_OPT_BUILD_TESTS "Build and perform nameof tests" ${IS_TOPLEVEL_PROJECT})
|
2018-09-04 14:41:01 +00:00
|
|
|
|
|
|
|
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()
|