@@ -52,7 +52,7 @@ add_library(cras_type_traits INTERFACE)
5252target_sources (cras_type_traits INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE} /type_utils/string_traits.hpp>)
5353
5454add_library (cras_literal_sz INTERFACE )
55- target_sources (cras_literal_sz INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE} /type_utils/literal_sz.h >)
55+ target_sources (cras_literal_sz INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE} /type_utils/literal_sz.hpp >)
5656
5757#add_library(cras_urdf_utils src/urdf_utils.cpp)
5858##catkin_lint: ignore_once external_interface_path
@@ -116,7 +116,7 @@ target_include_directories(cras_string_utils PUBLIC
116116 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>"
117117 "$<INSTALL_INTERFACE:include/${PROJECT_NAME} >" )
118118target_link_libraries (cras_string_utils PUBLIC cras_type_traits)
119- if (HAS_FROM_CHARS_FLOAT)
119+ if (HAS_FROM_CHARS_FLOAT)
120120 target_compile_definitions (cras_string_utils PRIVATE HAS_FROM_CHARS_FLOAT=1)
121121endif ()
122122
@@ -236,13 +236,16 @@ target_link_libraries(cras_qos_utils PUBLIC rclcpp::rclcpp)
236236# src/nodelet_utils/stateful_nodelet.cpp)
237237#target_sources(cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils.hpp>)
238238#target_sources(cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils/log_macros.h>)
239- #target_sources(cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils/nodelet_with_diagnostics.hpp>)
239+ #target_sources(
240+ # cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils/nodelet_with_diagnostics.hpp>)
240241#target_sources(cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils/param_helper.hpp>)
241- #target_sources(cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils/thread_name_updating_nodelet.hpp>)
242+ #target_sources(
243+ # cras_nodelet_utils INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/nodelet_utils/thread_name_updating_nodelet.hpp>)
242244#add_dependencies(cras_nodelet_utils ${catkin_EXPORTED_TARGETS})
243245#target_link_libraries(cras_nodelet_utils
244- # PUBLIC cras_diag_updater cras_diag_utils cras_log_utils cras_message_utils cras_node_utils cras_param_utils cras_resettable
245- # cras_string_utils cras_thread_utils cras_time_utils cras_tf2_utils ${catkin_LIBRARIES} Boost::boost)
246+ # PUBLIC cras_diag_updater cras_diag_utils cras_log_utils cras_message_utils cras_node_utils cras_param_utils
247+ # cras_resettable cras_string_utils cras_thread_utils cras_time_utils cras_tf2_utils ${catkin_LIBRARIES}
248+ # Boost::boost)
246249
247250#add_library(cras_filter_chain_nodelet INTERFACE)
248251#target_sources(cras_filter_chain_nodelet INTERFACE $<BUILD_INTERFACE:${CCC_INCLUDE_BASE}/filter_chain_nodelet.hpp>)
@@ -300,7 +303,6 @@ install(TARGETS
300303 cras_type_traits
301304 cras_type_utils
302305# cras_urdf_utils
303- # nodelet_manager_sharing_tf_buffer # Technically, having the executable here is wrong, but we keep it for compatibility
304306
305307 EXPORT export_${PROJECT_NAME}
306308 ARCHIVE DESTINATION lib
@@ -314,33 +316,65 @@ install(TARGETS
314316# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
315317#)
316318
317- #if (CATKIN_ENABLE_TESTING)
318- # find_package(roslaunch REQUIRED)
319- # find_package(roslint REQUIRED)
320- # find_package(rostest REQUIRED)
321- #
322- # roslint_custom(catkin_lint "-W2" .)
323- #
324- # # Roslint C++ - checks formatting and some other rules for C++ files
325- #
326- # file(GLOB_RECURSE ROSLINT_INCLUDE include/*.h include/*.hpp)
327- # list(FILTER ROSLINT_INCLUDE EXCLUDE REGEX ".*/external/.*")
328- # list(FILTER ROSLINT_INCLUDE EXCLUDE REGEX ".*/cloud.hpp") # The big macro is full of false positives
329- # list(FILTER ROSLINT_INCLUDE EXCLUDE REGEX ".*/nodelet_utils/nodelet_with_diagnostics.hpp") # Macros have false positives
330- #
331- # file(GLOB_RECURSE ROSLINT_SRC src/*.cpp src/*.hpp src/*.h)
332- #
333- # file(GLOB_RECURSE ROSLINT_TEST test/*.cpp)
334- #
335- # set(ROSLINT_CPP_OPTS "--extensions=h,hpp,hh,c,cpp,cc;--linelength=120;--filter=\
336- # -build/header_guard,-readability/namespace,-whitespace/braces,-runtime/references,\
337- # -build/c++11,-readability/nolint,-readability/todo,-legal/copyright")
338- # roslint_cpp(${ROSLINT_INCLUDE} ${ROSLINT_SRC})
339- #
340- # set(ROSLINT_CPP_OPTS "${ROSLINT_CPP_OPTS},-build/namespaces") # allow "using namespace cras;" in tests
341- # roslint_cpp(${ROSLINT_TEST})
342- #
343- # roslint_add_test()
319+ if (BUILD_TESTING)
320+ # cras_lint - checks formatting and some other rules for C++ files
321+ find_package (cras_lint REQUIRED)
322+ cras_lint_common()
323+ set (cras_lint_FILE_EXCLUDE
324+ include /${PROJECT_NAME} /cloud/impl/*
325+ include /${PROJECT_NAME} /diag_utils/*
326+ include /${PROJECT_NAME} /diag_utils/deprecated/*
327+ include /${PROJECT_NAME} /diag_utils/impl/*
328+ include /${PROJECT_NAME} /diagnostics/*
329+ include /${PROJECT_NAME} /filter_utils/*
330+ include /${PROJECT_NAME} /filter_utils/impl/*
331+ include /${PROJECT_NAME} /log_utils/*
332+ include /${PROJECT_NAME} /log_utils/deprecated/*
333+ include /${PROJECT_NAME} /node_utils/*
334+ include /${PROJECT_NAME} /nodelet_utils/*
335+ include /${PROJECT_NAME} /nodelet_utils/impl/*
336+ include /${PROJECT_NAME} /string_utils/ros.hpp
337+ include /${PROJECT_NAME} /string_utils/tf2.hpp
338+ include /${PROJECT_NAME} /test_utils/*
339+ include /${PROJECT_NAME} /tf2_utils/*
340+ include /${PROJECT_NAME} /time_utils/*
341+ include /${PROJECT_NAME} /cloud.hpp
342+ include /${PROJECT_NAME} /diag_utils.hpp
343+ include /${PROJECT_NAME} /filter_chain_nodelet.hpp
344+ include /${PROJECT_NAME} /filter_utils.hpp
345+ include /${PROJECT_NAME} /log_utils.h
346+ include /${PROJECT_NAME} /message_utils.hpp
347+ include /${PROJECT_NAME} /node_utils.hpp
348+ include /${PROJECT_NAME} /nodelet_utils.hpp
349+ include /${PROJECT_NAME} /rate_limiter.h
350+ include /${PROJECT_NAME} /resettable.h
351+ include /${PROJECT_NAME} /tf2_sensor_msgs.h
352+ include /${PROJECT_NAME} /tf2_utils.hpp
353+ include /${PROJECT_NAME} /time_utils.hpp
354+ include /${PROJECT_NAME} /urdf_utils.h
355+ nodes/*
356+ src/diag_utils/*
357+ src/log_utils/*
358+ src/node_utils/*
359+ src/nodelet_utils/*
360+ src/string_utils/ros.cpp
361+ src/tf2_utils/interruptible_buffer.cpp
362+ src/time_utils/*
363+ src/cloud.cpp
364+ src/log_utils.cpp
365+ src/rate_limiter.cpp
366+ src/resettable.cpp
367+ src/tf2_sensor_msgs.cpp
368+ src/tf2_utils.cpp
369+ src/time_utils.cpp
370+ src/urdf_utils.cpp
371+ test /*
372+ )
373+ cras_lint_cpp(EXCLUDE
374+ include /${PROJECT_NAME} /external/fast_float/*
375+ include /${PROJECT_NAME} /external/tcb/*
376+ include /${PROJECT_NAME} /external/tl/*
377+ )
344378#
345379# # GTEST tests (no rosmaster required)
346380#
@@ -406,7 +440,8 @@ install(TARGETS
406440#
407441# # ROSTEST tests (need rosmaster)
408442#
409- # add_rostest_gtest(test_cras_filter_chain_nodelet test/test_filter_chain_nodelet.test test/test_filter_chain_nodelet.cpp)
443+ # add_rostest_gtest(
444+ # test_cras_filter_chain_nodelet test/test_filter_chain_nodelet.test test/test_filter_chain_nodelet.cpp)
410445# target_link_libraries(test_cras_filter_chain_nodelet cras_filter_chain_nodelet ${catkin_LIBRARIES})
411446# roslaunch_add_file_check(test/test_filter_chain_nodelet.test USE_TEST_DEPENDENCIES)
412447#
@@ -439,7 +474,8 @@ install(TARGETS
439474# add_rostest_gtest(test_cras_nodelet_get_param test/test_nodelet_get_param.test test/test_nodelet_get_param.cpp)
440475# target_link_libraries(test_cras_nodelet_get_param cras_nodelet_utils cras_param_utils ${catkin_LIBRARIES})
441476# target_compile_options(test_cras_nodelet_get_param PRIVATE -fno-var-tracking-assignments) # speed up build
442- # # roslaunch_add_file_check(test/test_nodelet_get_param.test USE_TEST_DEPENDENCIES) # Disabled due to conflicting params
477+ # # Disabled due to conflicting params
478+ # # roslaunch_add_file_check(test/test_nodelet_get_param.test USE_TEST_DEPENDENCIES)
443479#
444480# # node_utils runs multiple tests from a single rostest launch file
445481#
@@ -448,15 +484,17 @@ install(TARGETS
448484# target_compile_options(test_cras_node_utils_get_param PRIVATE -fno-var-tracking-assignments) # speed up build
449485# add_dependencies(tests test_cras_node_utils_get_param)
450486#
451- # catkin_add_executable_with_gtest(test_cras_node_utils_diagnostics test/test_node_utils_diagnostics.cpp EXCLUDE_FROM_ALL)
487+ # catkin_add_executable_with_gtest(
488+ # test_cras_node_utils_diagnostics test/test_node_utils_diagnostics.cpp EXCLUDE_FROM_ALL)
452489# target_link_libraries(test_cras_node_utils_diagnostics cras_node_utils cras_param_utils ${catkin_LIBRARIES})
453490# target_compile_options(test_cras_node_utils_diagnostics PRIVATE -fno-var-tracking-assignments) # speed up build
454491# add_dependencies(tests test_cras_node_utils_diagnostics)
455492# if (HAS_DESIGNATED_INITIALIZERS)
456493# target_compile_definitions(test_cras_node_utils_diagnostics PRIVATE HAS_DESIGNATED_INITIALIZERS=1)
457494# endif()
458495#
459- # catkin_add_executable_with_gtest(test_cras_node_with_master test/test_node_utils_node_with_master.cpp EXCLUDE_FROM_ALL)
496+ # catkin_add_executable_with_gtest(
497+ # test_cras_node_with_master test/test_node_utils_node_with_master.cpp EXCLUDE_FROM_ALL)
460498# target_link_libraries(test_cras_node_with_master cras_node_utils cras_param_utils ${catkin_LIBRARIES})
461499# add_dependencies(tests test_cras_node_with_master)
462500#
@@ -468,7 +506,8 @@ install(TARGETS
468506#
469507# # nodelet_utils runs multiple tests from a single rostest launch file
470508#
471- # catkin_add_executable_with_gtest(test_cras_nodelet_aware_tf_buffer test/test_nodelet_aware_tf_buffer.cpp EXCLUDE_FROM_ALL)
509+ # catkin_add_executable_with_gtest(
510+ # test_cras_nodelet_aware_tf_buffer test/test_nodelet_aware_tf_buffer.cpp EXCLUDE_FROM_ALL)
472511# target_link_libraries(test_cras_nodelet_aware_tf_buffer cras_nodelet_utils ${catkin_LIBRARIES})
473512# add_dependencies(tests test_cras_nodelet_aware_tf_buffer)
474513#
@@ -480,7 +519,8 @@ install(TARGETS
480519# target_link_libraries(test_cras_nodelet_log_macros cras_nodelet_utils ${catkin_LIBRARIES})
481520# add_dependencies(tests test_cras_nodelet_log_macros)
482521#
483- # catkin_add_executable_with_gtest(test_cras_nodelet_with_shared_tf_buffer test/test_nodelet_with_shared_tf_buffer.cpp EXCLUDE_FROM_ALL)
522+ # catkin_add_executable_with_gtest(
523+ # test_cras_nodelet_with_shared_tf_buffer test/test_nodelet_with_shared_tf_buffer.cpp EXCLUDE_FROM_ALL)
484524# target_link_libraries(test_cras_nodelet_with_shared_tf_buffer cras_nodelet_utils ${catkin_LIBRARIES})
485525# add_dependencies(tests test_cras_nodelet_with_shared_tf_buffer)
486526#
@@ -503,7 +543,7 @@ install(TARGETS
503543# add_rostest_gtest(test_resettable test/test_resettable.test test/test_resettable.cpp)
504544# target_link_libraries(test_resettable cras_resettable cras_test_utils ${catkin_LIBRARIES})
505545# roslaunch_add_file_check(test/test_resettable.test USE_TEST_DEPENDENCIES)
506- # endif()
546+ endif ()
507547
508548ament_export_include_directories("include/${PROJECT_NAME} " )
509549
0 commit comments