Catch2: Treat catch2 headers as system.

This commit is contained in:
Alexander Shaduri
2021-03-22 16:48:42 +04:00
parent cdb9a4c603
commit 3b7576d95c
+13 -5
View File
@@ -271,11 +271,19 @@ target_compile_features(Catch2
cxx_variadic_macros
)
target_include_directories(Catch2
PUBLIC
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if (NOT_SUBPROJECT)
target_include_directories(Catch2
PUBLIC
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
else()
target_include_directories(Catch2
SYSTEM PUBLIC
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
endif()
add_library(Catch2WithMain STATIC