includes CTest module resp. BUILD_TESTING option
This commit is contained in:
parent
88ddb12afc
commit
d1cda6888e
1 changed files with 4 additions and 2 deletions
|
@ -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()
|
||||||
## 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)
|
||||||
|
|
Loading…
Reference in a new issue