Skip to content

Commit

Permalink
Merge pull request #2762 from jpl-mac/no.tidy.warnings.dev
Browse files Browse the repository at this point in the history
Add a cmake option to use SYSTEM in target_include_directories
  • Loading branch information
nlohmann authored Jul 16, 2021
2 parents f907f95 + afbb84b commit b2d2106
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ option(JSON_MultipleHeaders "Use non-amalgamated version of the library." OFF)
option(JSON_ImplicitConversions "Enable implicit conversions." ON)
option(JSON_Diagnostics "Enable better diagnostic messages." OFF)
option(JSON_CI "Enable CI build targets." OFF)
option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)" OFF)

if (JSON_CI)
include(cmake/ci.cmake)
Expand Down Expand Up @@ -73,6 +74,10 @@ if (JSON_Diagnostics)
message(STATUS "Diagnostics enabled")
endif()

if (JSON_SystemInclude)
set(NLOHMANN_JSON_SYSTEM_INCLUDE "SYSTEM")
endif()

##
## TARGET
## create target and add include path
Expand All @@ -94,7 +99,7 @@ target_compile_definitions(

target_include_directories(
${NLOHMANN_JSON_TARGET_NAME}
INTERFACE
${NLOHMANN_JSON_SYSTEM_INCLUDE} INTERFACE
$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_BUILD_DIR}>
$<INSTALL_INTERFACE:include>
)
Expand Down

0 comments on commit b2d2106

Please sign in to comment.