Skip to content

Commit

Permalink
Change logic to enable tests for dependent projects (foonathan#85)
Browse files Browse the repository at this point in the history
Also fixes foonathan#84.
  • Loading branch information
Manu343726 authored and foonathan committed Jul 13, 2018
1 parent 30b47f1 commit bce1b6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ endif()
# only add if not inside add_subdirectory()
option(TYPE_SAFE_BUILD_TEST_EXAMPLE "build test and example" OFF)
option(BUILD_TESTING "build test and example" OFF) # The ctest variable for building tests
if(${TYPE_SAFE_BUILD_TEST_EXAMPLE} OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) OR ${BUILD_TESTING})
if(${TYPE_SAFE_BUILD_TEST_EXAMPLE} OR ((CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) AND ${BUILD_TESTING}))
enable_testing()
add_subdirectory(example/)
add_subdirectory(test/)
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/catch.hpp)
file(DOWNLOAD
https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp
https://raw.githubusercontent.com/catchorg/Catch2/master/single_include/catch2/catch.hpp
${CMAKE_CURRENT_BINARY_DIR}/catch.hpp
STATUS status
LOG log)
Expand Down

0 comments on commit bce1b6a

Please sign in to comment.