diff --git a/test_communication/CMakeLists.txt b/test_communication/CMakeLists.txt index 6fda4397..09d0e756 100644 --- a/test_communication/CMakeLists.txt +++ b/test_communication/CMakeLists.txt @@ -41,20 +41,18 @@ if(BUILD_TESTING) foreach(interface_file ${interface_files}) get_filename_component(interface_ns "${interface_file}" DIRECTORY) get_filename_component(interface_ns "${interface_ns}" NAME) - string_ends_with("${interface_file}" ".msg" is_message) - if(is_message AND interface_ns STREQUAL "msg") - list(APPEND message_files "${interface_file}") + # Only process IDL interfaces + string_ends_with("${interface_file}" ".idl" is_idl) + if(NOT is_idl) continue() endif() - string_ends_with("${interface_file}" ".srv" is_service) - if(is_service AND interface_ns STREQUAL "srv") + # Decide category based on interface_ns + if(interface_ns STREQUAL "msg") + list(APPEND message_files "${interface_file}") + elseif(interface_ns STREQUAL "srv") list(APPEND service_files "${interface_file}") - continue() - endif() - string_ends_with("${interface_file}" ".idl" is_action) - if(is_action AND interface_ns STREQUAL "action") + elseif(interface_ns STREQUAL "action") list(APPEND action_files "${interface_file}") - continue() endif() endforeach()