Merge pull request #885 from TinyTinni/develop

Includes CTest module/adds BUILD_TESTING option
This commit is contained in:
Niels Lohmann 2017-12-23 11:09:46 +01:00 committed by GitHub
commit 184e9c6aa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
@ -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)