Skip to content

Commit

Permalink
re-introduced the DOCTEST_WITH_TESTS option - shouldn't have removed …
Browse files Browse the repository at this point in the history
…it in the first place
  • Loading branch information
onqtam committed Mar 24, 2019
1 parent a3ae958 commit b22d878
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Expand Up @@ -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)

Expand All @@ -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}>)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b22d878

Please sign in to comment.