From f201c28a91324889b8526f40fa9cf7cacabfc722 Mon Sep 17 00:00:00 2001 From: pkohout Date: Tue, 23 Feb 2021 13:08:32 +0100 Subject: [PATCH] Update ament_add_gtest_executable.cmake add SYSTEM parameter to target_include_directories so that GTEST headers are treaded as sysetem headers, and no warnings are produced. Signed-off-by: Peter Kohout --- ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake b/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake index 6c335818..51f0989c 100644 --- a/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake +++ b/ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake @@ -48,7 +48,7 @@ function(_ament_add_gtest_executable target) # should be EXCLUDE_FROM_ALL if it would be possible # to add this target as a dependency to the "test" target add_executable("${target}" ${ARG_UNPARSED_ARGUMENTS}) - target_include_directories("${target}" BEFORE PUBLIC "${GTEST_INCLUDE_DIRS}") + target_include_directories("${target}" SYSTEM BEFORE PUBLIC "${GTEST_INCLUDE_DIRS}") if(NOT ARG_SKIP_LINKING_MAIN_LIBRARIES) target_link_libraries("${target}" ${GTEST_MAIN_LIBRARIES}) endif()