diff options
author | onqtam <vik.kirilov@gmail.com> | 2019-03-24 14:29:57 +0300 |
---|---|---|
committer | onqtam <vik.kirilov@gmail.com> | 2019-03-24 14:32:00 +0300 |
commit | b22d878870de913dc15c46b3f2c35ee90d7689b2 (patch) | |
tree | 9ed1ff8154f87896c5c574d85948c6b072335371 /CMakeLists.txt | |
parent | a3ae95865eb78a2303e0028822ebac01082d9be3 (diff) |
re-introduced the DOCTEST_WITH_TESTS option - shouldn't have removed it in the first place2.3.1
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7746ca5c..f5da2f40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.0) file(READ ${CMAKE_CURRENT_SOURCE_DIR}/scripts/version.txt ver) project(doctest VERSION ${ver}) +option(DOCTEST_WITH_TESTS "Build tests/examples" ON) option(DOCTEST_WITH_MAIN_IN_STATIC_LIB "Build a static lib (cmake target) with a default main entry point" ON) option(DOCTEST_NO_INSTALL "Skip the installation process" OFF) @@ -15,7 +16,7 @@ add_library(${PROJECT_NAME} INTERFACE) set(doctest_parts_folder "${CMAKE_CURRENT_SOURCE_DIR}/doctest/parts") if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) - # use a special hidden version of the doctest header which directly includes the 2 parts - much easier during development + # use a special hidden version of the header which directly includes the 2 parts - proper reporting of file/line locations during dev target_include_directories(${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/scripts/development_only/> $<BUILD_INTERFACE:${doctest_parts_folder}>) @@ -51,7 +52,7 @@ if(${DOCTEST_WITH_MAIN_IN_STATIC_LIB}) target_link_libraries(${PROJECT_NAME}_with_main PUBLIC ${PROJECT_NAME}) endif() -if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) +if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR AND DOCTEST_WITH_TESTS) include(scripts/cmake/common.cmake) add_subdirectory(examples/all_features) |