@@ -21,7 +21,7 @@ project(rmw_microxrcedds
2121 ${PACKAGE_VERSION}
2222 LANGUAGES
2323 C
24- )
24+ )
2525
2626find_package (ament_cmake_ros REQUIRED )
2727find_package (rcutils REQUIRED )
@@ -34,9 +34,8 @@ find_package(rmw REQUIRED)
3434
3535# Build options
3636option (BUILD_DOCUMENTATION "Use doxygen to create product documentation" OFF )
37-
38- # RMW profile options
3937option (RMW_UXRCE_GRAPH "Allows to perform graph-related operations to the user" OFF )
38+
4039if (RMW_UXRCE_GRAPH)
4140 find_package (micro_ros_msgs REQUIRED )
4241endif ()
@@ -159,7 +158,7 @@ set(SRCS
159158 $<$<BOOL :${RMW_UXRCE_TRANSPORT_UDP} >:src /rmw_microros /discovery .c >
160159 $<$<BOOL :${RMW_UXRCE_TRANSPORT_CUSTOM} >:src /rmw_microros /custom_transport .c >
161160 $<$<BOOL :${RMW_UXRCE_GRAPH} >:src /rmw_graph .c >
162- )
161+ )
163162
164163add_library (${PROJECT_NAME }
165164 ${SRCS} )
@@ -175,7 +174,7 @@ if(RMW_UXRCE_GRAPH)
175174
176175 ament_target_dependencies (${PROJECT_NAME }
177176 "micro_ros_msgs"
178- )
177+ )
179178endif ()
180179
181180target_link_libraries (${PROJECT_NAME }
@@ -189,44 +188,47 @@ find_package(rosidl_typesupport_microxrcedds_c)
189188if (rosidl_typesupport_microxrcedds_c_FOUND)
190189 ament_target_dependencies (${PROJECT_NAME }
191190 "rosidl_typesupport_microxrcedds_c"
192- )
191+ )
193192 target_compile_definitions (${PROJECT_NAME }
194193 PUBLIC
195194 HAVE_C_TYPESUPPORT
196- )
195+ )
197196 find_package (rosidl_typesupport_microxrcedds_cpp )
198197else ()
199198 find_package (rosidl_typesupport_microxrcedds_cpp REQUIRED )
200199endif ()
201200if (rosidl_typesupport_microxrcedds_cpp_FOUND)
202201 ament_target_dependencies (${PROJECT_NAME }
203202 "rosidl_typesupport_microxrcedds_cpp"
204- )
203+ )
205204 target_compile_definitions (${PROJECT_NAME }
206205 PUBLIC
207206 HAVE_CPP_TYPESUPPORT
208- )
207+ )
209208endif ()
210209
211210ament_target_dependencies (${PROJECT_NAME }
212211 "rcutils"
213212 "rmw"
214213 "microxrcedds_client"
215- )
214+ )
216215
217216configure_rmw_library (${PROJECT_NAME } )
218217
219218target_include_directories (${PROJECT_NAME }
220219 PUBLIC
221220 $<BUILD_INTERFACE :${PROJECT_SOURCE_DIR } /include >
222- $<BUILD_INTERFACE :${PROJECT_BINARY_DIR } /include >)
221+ $<BUILD_INTERFACE :${PROJECT_BINARY_DIR } /include >
222+ PRIVATE
223+ $<BUILD_INTERFACE :${PROJECT_SOURCE_DIR } /src >
224+ )
223225
224226set_target_properties (${PROJECT_NAME } PROPERTIES
225227 C_STANDARD
226228 99
227229 C_STANDARD_REQUIRED
228230 YES
229- )
231+ )
230232
231233target_compile_options (${PROJECT_NAME }
232234 PRIVATE
@@ -237,7 +239,7 @@ target_compile_options(${PROJECT_NAME}
237239 $<$<C_COMPILER_ID :GNU >:$<$<VERSION_GREATER :$<C_COMPILER_VERSION >,8.1>:-Wcast -align =strict >>
238240 $<$<C_COMPILER_ID :GNU >:-Wvla >
239241 $<$<C_COMPILER_ID :MSVC >:/Wall >
240- )
242+ )
241243
242244file (MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX } /include )
243245
@@ -250,7 +252,7 @@ ament_export_dependencies(
250252 rcutils
251253 rmw
252254 microxrcedds_client
253- )
255+ )
254256
255257if (rosidl_typesupport_microxrcedds_c_FOUND)
256258 ament_export_dependencies (rosidl_typesupport_microxrcedds_c )
@@ -261,13 +263,13 @@ if(rosidl_typesupport_microxrcedds_cpp_FOUND)
261263 set (implementations
262264 ${implementations}
263265 "cpp:rosidl_typesupport_cpp:rosidl_typesupport_microxrcedds_cpp"
264- )
266+ )
265267endif ()
266268
267269register_rmw_implementation (${implementations} )
268270
269271if (BUILD_TESTING)
270- # Pedantic in CI
272+ # Pedantic in CI
271273 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } -Wall -Werror" )
272274 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -Wall -Werror" )
273275
@@ -324,15 +326,15 @@ install(
324326 ${PROJECT_SOURCE_DIR } /include/
325327 DESTINATION
326328 include
327- )
329+ )
328330
329331# Install config.h file.
330332install (
331333 FILES
332334 ${PROJECT_BINARY_DIR } /include/rmw_microxrcedds_c/config.h
333335 DESTINATION
334336 include/rmw_microxrcedds_c
335- )
337+ )
336338
337339# Install library.
338340install (
@@ -344,12 +346,11 @@ install(
344346 lib
345347 RUNTIME DESTINATION
346348 bin
347- )
349+ )
348350
349351if (BUILD_DOCUMENTATION)
350352 # Instalation of doxygen files
351353 install (DIRECTORY ${PROJECT_BINARY_DIR } /doc/api_reference
352354 DESTINATION ${DOC_INSTALL_DIR}
353- COMPONENT documentation
354- )
355+ COMPONENT documentation)
355356endif ()
0 commit comments