Skip to content

Commit 8bdf598

Browse files
nadavelkabetsrkent
authored andcommitted
Fix missing generated messages
Signed-off-by: Nadav Elkabets <[email protected]>
1 parent 58a777f commit 8bdf598

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

ament_cmake_python/cmake/ament_python_install_registered_packages.cmake

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,24 @@ macro(_ament_cmake_python_install_sources package_name)
142142
PATTERN "__pycache__" EXCLUDE
143143
)
144144
else()
145-
# we merge during build as cmake doesn't guarantee install sequence
146-
install(
147-
DIRECTORY "${_build_dir}/${package_name}/"
148-
DESTINATION "${_DESTINATION}/${package_name}"
149-
PATTERN "*.pyc" EXCLUDE
150-
PATTERN "__pycache__" EXCLUDE
145+
# cmake does not support overwriting a more recently modified file
146+
# we must remove any existing files before installing the new package
147+
install(CODE
148+
"set(_dest \"\${CMAKE_INSTALL_PREFIX}/${_DESTINATION}/${package_name}\")
149+
set(_dirs ${_DIRS_TO_INSTALL})
150+
foreach(_dir IN LISTS _dirs)
151+
file(GLOB_RECURSE _rel_files RELATIVE \"\${_dir}\" \"\${_dir}/*\")
152+
foreach(_file IN LISTS _rel_files)
153+
file(REMOVE \"\${_dest}/\${_file}\")
154+
endforeach()
155+
file(INSTALL
156+
DESTINATION \"\${_dest}\"
157+
TYPE DIRECTORY
158+
FILES \"\${_dir}\"
159+
PATTERN \"*.pyc\" EXCLUDE
160+
PATTERN \"__pycache__\" EXCLUDE
161+
)
162+
endforeach()"
151163
)
152164
endif()
153165
endmacro()

0 commit comments

Comments
 (0)