Skip to content

Commit

Permalink
includes CTest module resp. BUILD_TESTING option
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyTinni committed Dec 20, 2017
1 parent 88ddb12 commit d1cda68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(nlohmann_json VERSION 3.0.0 LANGUAGES CXX)
##
## OPTIONS
##
option(JSON_BuildTests "Build the unit tests" ON)
option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ON)

##
## CONFIGURATION
Expand Down Expand Up @@ -54,7 +54,9 @@ endif()
## TESTS
## create and configure the unit test target
##
if(JSON_BuildTests)
include(CTest) #adds option BUILD_TESTING (default ON)

if(BUILD_TESTING AND JSON_BuildTests)
enable_testing()
include_directories(${NLOHMANN_JSON_SOURCE_DIR})
add_subdirectory(test)
Expand Down

0 comments on commit d1cda68

Please sign in to comment.