Disable tests if used as subproject
This commit is contained in:
parent
ef90d62ddf
commit
2841afa2bc
@ -40,6 +40,10 @@ else()
|
|||||||
message(STATUS "Using the single-header code from ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}")
|
message(STATUS "Using the single-header code from ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT "${PROJECT_NAME}" STREQUAL "${CMAKE_PROJECT_NAME}")
|
||||||
|
set(SUBPROJECT ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
##
|
##
|
||||||
## TARGET
|
## TARGET
|
||||||
## create target and add include path
|
## create target and add include path
|
||||||
@ -73,7 +77,7 @@ endif()
|
|||||||
##
|
##
|
||||||
include(CTest) #adds option BUILD_TESTING (default ON)
|
include(CTest) #adds option BUILD_TESTING (default ON)
|
||||||
|
|
||||||
if(BUILD_TESTING AND JSON_BuildTests)
|
if(BUILD_TESTING AND JSON_BuildTests AND NOT SUBPROJECT)
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user