diff options
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b0de85d..71011b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,11 +51,21 @@ target_compile_definitions(GSL INTERFACE ) # add include folders to the library and targets that consume it -target_include_directories(GSL INTERFACE - $<BUILD_INTERFACE: - ${CMAKE_CURRENT_SOURCE_DIR}/include - > -) +# the SYSTEM keyword suppresses warnings for users of the library +if(GSL_STANDALONE_PROJECT) + target_include_directories(GSL INTERFACE + $<BUILD_INTERFACE: + ${CMAKE_CURRENT_SOURCE_DIR}/include + > + ) +else() + target_include_directories(GSL SYSTEM INTERFACE + $<BUILD_INTERFACE: + ${CMAKE_CURRENT_SOURCE_DIR}/include + > + ) +endif() + if ((CMAKE_VERSION GREATER 3.7.9) OR (CMAKE_VERSION EQUAL 3.7.9)) if (MSVC_IDE) |