mirror of https://github.com/nlohmann/json.git
Merge pull request #2762 from jpl-mac/no.tidy.warnings.dev
Add a cmake option to use SYSTEM in target_include_directoriespull/2825/head
commit
b2d21067d1
|
@ -36,6 +36,7 @@ option(JSON_MultipleHeaders "Use non-amalgamated version of the library." OFF)
|
||||||
option(JSON_ImplicitConversions "Enable implicit conversions." ON)
|
option(JSON_ImplicitConversions "Enable implicit conversions." ON)
|
||||||
option(JSON_Diagnostics "Enable better diagnostic messages." OFF)
|
option(JSON_Diagnostics "Enable better diagnostic messages." OFF)
|
||||||
option(JSON_CI "Enable CI build targets." OFF)
|
option(JSON_CI "Enable CI build targets." OFF)
|
||||||
|
option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)" OFF)
|
||||||
|
|
||||||
if (JSON_CI)
|
if (JSON_CI)
|
||||||
include(cmake/ci.cmake)
|
include(cmake/ci.cmake)
|
||||||
|
@ -73,6 +74,10 @@ if (JSON_Diagnostics)
|
||||||
message(STATUS "Diagnostics enabled")
|
message(STATUS "Diagnostics enabled")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (JSON_SystemInclude)
|
||||||
|
set(NLOHMANN_JSON_SYSTEM_INCLUDE "SYSTEM")
|
||||||
|
endif()
|
||||||
|
|
||||||
##
|
##
|
||||||
## TARGET
|
## TARGET
|
||||||
## create target and add include path
|
## create target and add include path
|
||||||
|
@ -94,7 +99,7 @@ target_compile_definitions(
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
${NLOHMANN_JSON_TARGET_NAME}
|
${NLOHMANN_JSON_TARGET_NAME}
|
||||||
INTERFACE
|
${NLOHMANN_JSON_SYSTEM_INCLUDE} INTERFACE
|
||||||
$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_BUILD_DIR}>
|
$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_BUILD_DIR}>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue