Skip to content

Commit f201c28

Browse files
pkohoutPeter Kohout
authored and
Peter Kohout
committed
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 <[email protected]>
1 parent d1d87c3 commit f201c28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function(_ament_add_gtest_executable target)
4848
# should be EXCLUDE_FROM_ALL if it would be possible
4949
# to add this target as a dependency to the "test" target
5050
add_executable("${target}" ${ARG_UNPARSED_ARGUMENTS})
51-
target_include_directories("${target}" BEFORE PUBLIC "${GTEST_INCLUDE_DIRS}")
51+
target_include_directories("${target}" SYSTEM BEFORE PUBLIC "${GTEST_INCLUDE_DIRS}")
5252
if(NOT ARG_SKIP_LINKING_MAIN_LIBRARIES)
5353
target_link_libraries("${target}" ${GTEST_MAIN_LIBRARIES})
5454
endif()

0 commit comments

Comments
 (0)