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