Unverified Commit 184e9c6a authored by Niels Lohmann's avatar Niels Lohmann Committed by GitHub

Merge pull request #885 from TinyTinni/develop

Includes CTest module/adds BUILD_TESTING option
parents 88ddb12a d1cda688
...@@ -9,7 +9,7 @@ project(nlohmann_json VERSION 3.0.0 LANGUAGES CXX) ...@@ -9,7 +9,7 @@ project(nlohmann_json VERSION 3.0.0 LANGUAGES CXX)
## ##
## OPTIONS ## OPTIONS
## ##
option(JSON_BuildTests "Build the unit tests" ON) option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ON)
## ##
## CONFIGURATION ## CONFIGURATION
...@@ -54,7 +54,9 @@ endif() ...@@ -54,7 +54,9 @@ endif()
## TESTS ## TESTS
## create and configure the unit test target ## 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() enable_testing()
include_directories(${NLOHMANN_JSON_SOURCE_DIR}) include_directories(${NLOHMANN_JSON_SOURCE_DIR})
add_subdirectory(test) add_subdirectory(test)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment