mirror of https://github.com/nlohmann/json.git
Compare to CMAKE_CURRENT_SOURCE_DIR for main project check
parent
790508887e
commit
ea759d0360
|
@ -8,9 +8,10 @@ project(nlohmann_json VERSION 3.9.1 LANGUAGES CXX)
|
|||
|
||||
##
|
||||
## MAIN_PROJECT CHECK
|
||||
## determine if nlohmann_json is built as a subproject (using add_subdirectory) or if it is the main project
|
||||
##
|
||||
set(MAIN_PROJECT OFF)
|
||||
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
||||
set(MAIN_PROJECT ON)
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue