diff options
Diffstat (limited to 'tomlplusplus/cmake/variables.cmake')
| -rw-r--r-- | tomlplusplus/cmake/variables.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tomlplusplus/cmake/variables.cmake b/tomlplusplus/cmake/variables.cmake new file mode 100644 index 0000000000..7e379eb001 --- /dev/null +++ b/tomlplusplus/cmake/variables.cmake @@ -0,0 +1,19 @@ +# ---- Warning guard ---- + +# target_include_directories with the SYSTEM modifier will request the compiler +# to omit warnings from the provided paths, if the compiler supports that +# This is to provide a user experience similar to find_package when +# add_subdirectory or FetchContent is used to consume this project +set(tomlplusplus_warning_guard "") +option(tomlplusplus_INSTALL "Enable generation of tomlplusplus install targets" ${PROJECT_IS_TOP_LEVEL}) +if(NOT PROJECT_IS_TOP_LEVEL) + option( + tomlplusplus_INCLUDES_WITH_SYSTEM + "Use SYSTEM modifier for tomlplusplus's includes, disabling warnings" + ON + ) + mark_as_advanced(tomlplusplus_INCLUDES_WITH_SYSTEM) + if(tomlplusplus_INCLUDES_WITH_SYSTEM) + set(tomlplusplus_warning_guard SYSTEM) + endif() +endif() |
