Skip to content

Commit 030d660

Browse files
committed
ignore redundent interface build
1 parent 0beacf4 commit 030d660

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

rtmbuild/cmake/rtmbuild.cmake

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,18 @@ macro(rtmbuild_genbridge)
259259
if(NOT ${PROJECT_NAME}_autogen_interfaces)
260260
message(AUTHOR_WARNING "[rtmbuild_genbridge] - no interface is defined")
261261
endif()
262+
list(APPEND interface_list "")
262263
foreach(_comp ${${PROJECT_NAME}_autogen_interfaces})
263-
message("[rtmbuild_genbridge] - rtmbuild_add_executable : ${_comp}ROSBridgeComp")
264-
rtmbuild_add_executable("${_comp}ROSBridgeComp" "src_gen/${_comp}ROSBridge.cpp" "src_gen/${_comp}ROSBridgeComp.cpp")
265-
add_custom_target(RTMBUILD_${PROJECT_NAME}_${_comp}_genbridge DEPENDS src_gen/${_comp}ROSBridge.cpp src_gen/${_comp}ROSBridgeComp.cpp)
266-
add_dependencies(RTMBUILD_${PROJECT_NAME}_genbridge RTMBUILD_${PROJECT_NAME}_${_comp}_genbridge)
264+
list(FIND interface_list ${_comp} _index)
265+
if(_index EQUAL -1)
266+
message("[rtmbuild_genbridge] - rtmbuild_add_executable : ${_comp}ROSBridgeComp")
267+
rtmbuild_add_executable("${_comp}ROSBridgeComp" "src_gen/${_comp}ROSBridge.cpp" "src_gen/${_comp}ROSBridgeComp.cpp")
268+
add_custom_target(RTMBUILD_${PROJECT_NAME}_${_comp}_genbridge DEPENDS src_gen/${_comp}ROSBridge.cpp src_gen/${_comp}ROSBridgeComp.cpp)
269+
add_dependencies(RTMBUILD_${PROJECT_NAME}_genbridge RTMBUILD_${PROJECT_NAME}_${_comp}_genbridge)
270+
list(APPEND interface_list ${_comp})
271+
else()
272+
message("[rtmbuild_genbridge] ${_comp} already generated.")
273+
endif()
267274
endforeach(_comp)
268275

269276
# TARGET

0 commit comments

Comments
 (0)