@@ -4,7 +4,7 @@ project(grid_map_core)
4
4
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS} " )
5
5
6
6
## Find catkin macros and libraries
7
- find_package (catkin REQUIRED COMPONENTS )
7
+ find_package (catkin REQUIRED)
8
8
9
9
## Define Eigen addons.
10
10
include (cmake/${PROJECT_NAME} -extras.cmake)
@@ -105,39 +105,46 @@ install(
105
105
#############
106
106
107
107
if (CATKIN_ENABLE_TESTING)
108
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
109
- ## Add gtest based cpp test target and link libraries
110
- catkin_add_gtest(${PROJECT_NAME} -test
111
- test /test_grid_map_core.cpp
112
- test /test_helpers.cpp
113
- test /CubicConvolutionInterpolationTest.cpp
114
- test /CubicInterpolationTest.cpp
115
- test /GridMapMathTest.cpp
116
- test /GridMapTest.cpp
117
- test /GridMapIteratorTest.cpp
118
- test /LineIteratorTest.cpp
119
- test /EllipseIteratorTest.cpp
120
- test /SubmapIteratorTest.cpp
121
- test /PolygonIteratorTest.cpp
122
- test /PolygonTest.cpp
123
- test /EigenPluginsTest.cpp
124
- test /SpiralIteratorTest.cpp
125
- test /SlidingWindowIteratorTest.cpp
108
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
109
+ find_package (catkin REQUIRED)
110
+
111
+ ## Add gtest based cpp test target and link libraries
112
+ catkin_add_gtest(${PROJECT_NAME} -test
113
+ test /test_grid_map_core.cpp
114
+ test /test_helpers.cpp
115
+ test /CubicConvolutionInterpolationTest.cpp
116
+ test /CubicInterpolationTest.cpp
117
+ test /GridMapMathTest.cpp
118
+ test /GridMapTest.cpp
119
+ test /GridMapIteratorTest.cpp
120
+ test /LineIteratorTest.cpp
121
+ test /EllipseIteratorTest.cpp
122
+ test /SubmapIteratorTest.cpp
123
+ test /PolygonIteratorTest.cpp
124
+ test /PolygonTest.cpp
125
+ test /EigenPluginsTest.cpp
126
+ test /SpiralIteratorTest.cpp
127
+ test /SlidingWindowIteratorTest.cpp
126
128
)
127
- endif ()
128
-
129
- if (TARGET ${PROJECT_NAME} -test )
130
- target_link_libraries (${PROJECT_NAME} -test ${PROJECT_NAME} )
131
- endif ()
132
-
133
- ###################
134
- ## Code_coverage ##
135
- ###################
136
-
137
- find_package (cmake_code_coverage QUIET )
138
- if (cmake_code_coverage_FOUND)
139
- add_gtest_coverage(
140
- TEST_BUILD_TARGETS
141
- ${PROJECT_NAME} -test
129
+ target_include_directories (${PROJECT_NAME} -test
130
+ PRIVATE
131
+ include
132
+ PUBLIC SYSTEM
133
+ ${catkin_INCLUDE_DIRS}
134
+ ${EIGEN3_INCLUDE_DIR}
135
+ )
136
+ target_link_libraries (${PROJECT_NAME} -test
137
+ ${PROJECT_NAME}
142
138
)
143
- endif (cmake_code_coverage_FOUND)
139
+
140
+ ###################
141
+ ## Code_coverage ##
142
+ ###################
143
+ find_package (cmake_code_coverage QUIET )
144
+ if (cmake_code_coverage_FOUND)
145
+ add_gtest_coverage(
146
+ TEST_BUILD_TARGETS
147
+ ${PROJECT_NAME} -test
148
+ )
149
+ endif ()
150
+ endif ()
0 commit comments