Skip to content

Commit d712e66

Browse files
committed
Remove special GTest handling for ROS
Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>
1 parent 446a361 commit d712e66

3 files changed

Lines changed: 3 additions & 29 deletions

File tree

‎cmake/common/find_or_add_gtest.cmake‎

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,6 @@
1313
# limitations under the License.
1414

1515
macro(find_or_add_gtest)
16-
# Check if building on an ament context, i.e. ROS 2
17-
# Thanks to https://github.com/facontidavide/PlotJuggler/blob/main/CMakeLists.txt#L66
18-
find_package(ament_cmake QUIET)
19-
20-
# This is a ROS 2 build
21-
if(ament_cmake_FOUND)
22-
# Find all GTest vendor required packages
23-
find_package(ament_cmake REQUIRED)
24-
find_package(gtest_vendor REQUIRED)
25-
find_package(ament_cmake_gtest REQUIRED)
26-
27-
# Find GTest
28-
ament_find_gtest()
29-
30-
# Add aliases for GTest libraries so we can use them as targets independently of the context
31-
add_library(GTest::gtest ALIAS gtest)
32-
add_library(GTest::gtest_main ALIAS gtest_main)
33-
target_link_libraries(gtest_main gtest)
34-
35-
# This is a non-ROS 2 build
36-
else()
37-
# Find GTest normally
38-
find_package(GTest CONFIG REQUIRED)
39-
endif()
16+
# Find GTest normally
17+
find_package(GTest CONFIG REQUIRED)
4018
endmacro()

‎colcon.pkg‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: fastcdr
22
type: cmake
33
test-dependencies:
4-
# Needed for test compilation in ROS 2 CI
5-
- ament_cmake_gtest
6-
- ament_cmake
74
# Needed for test compilation in eProsima CI
85
- googletest-distribution

‎package.xml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
<buildtool_depend>cmake</buildtool_depend>
1818
<doc_depend>doxygen</doc_depend>
1919

20-
<test_depend>ament_cmake_gtest</test_depend>
21-
<test_depend>ament_cmake</test_depend>
20+
<test_depend>libgtest-dev</test_depend>
2221

2322
<export>
2423
<build_type>cmake</build_type>

0 commit comments

Comments
 (0)