From b22d878870de913dc15c46b3f2c35ee90d7689b2 Mon Sep 17 00:00:00 2001 From: onqtam Date: Sun, 24 Mar 2019 13:29:57 +0200 Subject: re-introduced the DOCTEST_WITH_TESTS option - shouldn't have removed it in the first place --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') 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 $ $) @@ -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) -- cgit v1.2.3