Skip to content

Commit

Permalink
Shorten some excessively long lines of CMake (#571)
Browse files Browse the repository at this point in the history
The line length enforcement in ament_lint_cmake has been broken for some
time, but will be fixed by ament/ament_lint#236. This change brings this
package into compliance with a 120 column limit.

Signed-off-by: Scott K Logan <[email protected]>
  • Loading branch information
cottsay authored Feb 12, 2021
1 parent 279d129 commit 57befb8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ if(NOT _exported_typesupport_libraries STREQUAL "")

if(NOT _lib)
# the library wasn't found
message(FATAL_ERROR "Package '@PROJECT_NAME@' exports the typesupport library '${_library}' which couldn't be found")
message(FATAL_ERROR
"Package '@PROJECT_NAME@' exports the typesupport library '${_library}' which couldn't be found")
elseif(NOT IS_ABSOLUTE "${_lib}")
# the found library must be an absolute path
message(FATAL_ERROR "Package '@PROJECT_NAME@' found the typesupport library '${_library}' at '${_lib}' which is not an absolute path")
message(FATAL_ERROR
"Package '@PROJECT_NAME@' found the typesupport library '${_library}' at '${_lib}' "
"which is not an absolute path")
elseif(NOT EXISTS "${_lib}")
# the found library must exist
message(FATAL_ERROR "Package '@PROJECT_NAME@' found the typesupport library '${_lib}' which doesn't exist")
Expand Down
6 changes: 4 additions & 2 deletions rosidl_cmake/cmake/rosidl_target_interfaces.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ function(rosidl_target_interfaces target interface_target typesupport_name)
"rosidl_target_interfaces() called with unused arguments: ${ARGN}")
endif()
if(NOT TARGET ${target})
message(FATAL_ERROR "rosidl_target_interfaces() the first argument '${target}' must be a valid target name")
message(FATAL_ERROR
"rosidl_target_interfaces() the first argument '${target}' must be a valid target name")
endif()
if(NOT TARGET ${interface_target})
message(FATAL_ERROR "rosidl_target_interfaces() the second argument '${interface_target}' must be a valid target name")
message(FATAL_ERROR
"rosidl_target_interfaces() the second argument '${interface_target}' must be a valid target name")
endif()
set(typesupport_target "${interface_target}__${typesupport_name}")
if(NOT TARGET ${typesupport_target})
Expand Down
3 changes: 2 additions & 1 deletion rosidl_runtime_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
find_package(performance_test_fixture REQUIRED)
# Give cppcheck hints about macro definitions coming from outside this package
get_target_property(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS performance_test_fixture::performance_test_fixture INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS performance_test_fixture::performance_test_fixture
INTERFACE_INCLUDE_DIRECTORIES)
ament_lint_auto_find_test_dependencies()

# For gtest
Expand Down

0 comments on commit 57befb8

Please sign in to comment.