From 92d827c1e9e2a18a6aa8c78bc3d98496949aab18 Mon Sep 17 00:00:00 2001 From: Alexander Shaduri Date: Wed, 17 Mar 2021 14:49:53 +0400 Subject: [PATCH] When used as subproject, treat Catch2 cmake target include paths as SYSTEM to avoid compiler warnings in Catch2 headers. --- src/CMakeLists.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2f3dd4ab..20644472 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -271,11 +271,20 @@ target_compile_features(Catch2 cxx_variadic_macros ) -target_include_directories(Catch2 - PUBLIC - $ - $ -) + +if (NOT_SUBPROJECT) + target_include_directories(Catch2 + PUBLIC + $ + $ + ) +else() + target_include_directories(Catch2 + SYSTEM PUBLIC + $ + $ + ) +endif() add_library(Catch2WithMain STATIC