Rename MAIN_PROJECT to JSON_MAIN_PROJECT

This commit is contained in:
Florian Albrechtskirchinger 2022-09-22 11:21:52 +02:00
parent f4658de270
commit e1a815f350
No known key found for this signature in database
GPG Key ID: 19618CE9B2D4BE6D

View File

@ -7,12 +7,12 @@ cmake_minimum_required(VERSION 3.1)
project(nlohmann_json VERSION 3.11.2 LANGUAGES CXX) project(nlohmann_json VERSION 3.11.2 LANGUAGES CXX)
## ##
## MAIN_PROJECT CHECK ## JSON_MAIN_PROJECT CHECK
## determine if nlohmann_json is built as a subproject (using add_subdirectory) or if it is the main project ## determine if nlohmann_json is built as a subproject (using add_subdirectory) or if it is the main project
## ##
set(MAIN_PROJECT OFF) set(JSON_MAIN_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MAIN_PROJECT ON) set(JSON_MAIN_PROJECT ON)
endif() endif()
## ##
@ -32,7 +32,7 @@ if (POLICY CMP0077)
endif () endif ()
# VERSION_GREATER_EQUAL is not available in CMake 3.1 # VERSION_GREATER_EQUAL is not available in CMake 3.1
if(${MAIN_PROJECT} AND (${CMAKE_VERSION} VERSION_EQUAL 3.13 OR ${CMAKE_VERSION} VERSION_GREATER 3.13)) if(${JSON_MAIN_PROJECT} AND (${CMAKE_VERSION} VERSION_EQUAL 3.13 OR ${CMAKE_VERSION} VERSION_GREATER 3.13))
set(JSON_BuildTests_INIT ON) set(JSON_BuildTests_INIT ON)
else() else()
set(JSON_BuildTests_INIT OFF) set(JSON_BuildTests_INIT OFF)
@ -44,7 +44,7 @@ option(JSON_GlobalUDLs "Place use-defined string literals in
option(JSON_ImplicitConversions "Enable implicit conversions." ON) option(JSON_ImplicitConversions "Enable implicit conversions." ON)
option(JSON_DisableEnumSerialization "Disable default integer enum serialization." OFF) option(JSON_DisableEnumSerialization "Disable default integer enum serialization." OFF)
option(JSON_LegacyDiscardedValueComparison "Enable legacy discarded value comparison." OFF) option(JSON_LegacyDiscardedValueComparison "Enable legacy discarded value comparison." OFF)
option(JSON_Install "Install CMake targets during install step." ${MAIN_PROJECT}) option(JSON_Install "Install CMake targets during install step." ${JSON_MAIN_PROJECT})
option(JSON_MultipleHeaders "Use non-amalgamated version of the library." ON) option(JSON_MultipleHeaders "Use non-amalgamated version of the library." ON)
option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)." OFF) option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)." OFF)