Skip to content

Commit 9970f1a

Browse files
committed
Fix ament export targets
Use a standard target export name so ament generates reactor-cppConfig.cmake for downstream find_package calls.
1 parent 0626031 commit 9970f1a

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ else()
8080
endif()
8181

8282
if (REACTOR_CPP_USE_AMENT)
83-
ament_export_targets(${LIB_TARGET}Config HAS_LIBRARY_TARGET)
83+
ament_export_targets(${LIB_TARGET}Targets HAS_LIBRARY_TARGET)
8484
ament_export_include_directories(include)
8585
ament_package()
8686
endif()

lib/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ if(REACTOR_CPP_INSTALL)
6161
install(FILES "${PROJECT_BINARY_DIR}/include/reactor-cpp/config.hh" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/reactor-cpp")
6262
endif()
6363

64-
install(TARGETS ${LIB_TARGET} EXPORT ${LIB_TARGET}Config
64+
install(TARGETS ${LIB_TARGET} EXPORT ${LIB_TARGET}Targets
6565
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
6666
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
6767
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
6868

69-
install(EXPORT ${LIB_TARGET}Config DESTINATION share/${LIB_TARGET}/cmake)
70-
71-
export(TARGETS ${PROJECT_NAME} FILE ${LIB_TARGET}Config.cmake)
69+
install(EXPORT ${LIB_TARGET}Targets DESTINATION share/${LIB_TARGET}/cmake)
7270
endif()

0 commit comments

Comments
 (0)