Skip to content

Commit

Permalink
Update ament_add_gtest_executable.cmake
Browse files Browse the repository at this point in the history
add SYSTEM parameter to target_include_directories so that GTEST headers are treaded as sysetem headers, and no warnings are produced.
  • Loading branch information
pkohout authored Feb 23, 2021
1 parent d1d87c3 commit 32c4883
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ament_cmake_gtest/cmake/ament_add_gtest_executable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 32c4883

Please sign in to comment.