Skip to content

Commit d283d94

Browse files
lsk567claude
andcommitted
Let ament handle export installation in ROS2 builds
When using ament, ament_package() should handle installing the export files and generating the Config.cmake. The explicit install(EXPORT ...) was interfering with this, causing find_package(reactor-cpp) to fail in downstream packages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9970f1a commit d283d94

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,9 @@ if(REACTOR_CPP_INSTALL)
6666
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
6767
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
6868

69-
install(EXPORT ${LIB_TARGET}Targets DESTINATION share/${LIB_TARGET}/cmake)
69+
# Only install export file manually when not using ament.
70+
# When using ament, ament_package() handles export installation.
71+
if(NOT REACTOR_CPP_USE_AMENT)
72+
install(EXPORT ${LIB_TARGET}Targets DESTINATION share/${LIB_TARGET}/cmake)
73+
endif()
7074
endif()

0 commit comments

Comments
 (0)