File tree Expand file tree Collapse file tree 3 files changed +25
-16
lines changed
Expand file tree Collapse file tree 3 files changed +25
-16
lines changed Original file line number Diff line number Diff line change 99
1010project (${LIB_TARGET} LANGUAGES CXX VERSION 0.0.1)
1111
12+ if (NOT DEFINED LF_REACTOR_CPP_SUFFIX)
13+ find_package (ament_cmake QUIET )
14+ if (ament_cmake_FOUND)
15+ set (REACTOR_CPP_USE_AMENT ON )
16+ endif ()
17+ endif ()
18+
1219# require C++17
1320set (CMAKE_CXX_STANDARD 17)
1421set (CMAKE_CXX_STANDARD_REQUIRED ON )
@@ -71,3 +78,17 @@ if (DEFINED LF_REACTOR_CPP_SUFFIX)
7178else ()
7279 install (DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} " )
7380endif ()
81+
82+ if (REACTOR_CPP_USE_AMENT)
83+ # Install the export file - must be in root CMakeLists.txt for ament compatibility
84+ install (EXPORT ${LIB_TARGET} DESTINATION share/${LIB_TARGET} /cmake NAMESPACE ${LIB_TARGET} ::)
85+ ament_export_targets (${LIB_TARGET} HAS_LIBRARY_TARGET )
86+ ament_export_include_directories (include )
87+ ament_export_libraries (${LIB_TARGET} )
88+ ament_package ()
89+ else ()
90+ # For non-ament builds, install export file from here
91+ if (REACTOR_CPP_INSTALL)
92+ install (EXPORT ${LIB_TARGET} DESTINATION share/${LIB_TARGET} /cmake)
93+ endif ()
94+ endif ()
Original file line number Diff line number Diff line change @@ -61,12 +61,9 @@ 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}
6565 ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR} " OPTIONAL
6666 LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR} " OPTIONAL
6767 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR} " OPTIONAL )
68-
69- install (EXPORT ${LIB_TARGET} Config DESTINATION share/${LIB_TARGET} /cmake)
70-
71- export (TARGETS ${PROJECT_NAME} FILE ${LIB_TARGET} Config.cmake )
68+ # Note: install(EXPORT ...) moved to root CMakeLists.txt for ament compatibility
7269endif ()
Original file line number Diff line number Diff line change 66 <description >A C++ reactor runtime</description >
77 <maintainer email =" christian.menard@tu-dresden.de" >user</maintainer >
88 <license >ISC License</license >
9+ <buildtool_depend >ament_cmake</buildtool_depend >
910 <export >
10- <build_type >cmake</build_type >
11- </export >
12- </package >
13- <package format =" 3" >
14- <name >reactor-cpp-foo</name >
15- <version >0.0.0</version >
16- <description >A C++ reactor runtime</description >
17- <maintainer email =" christian.menard@tu-dresden.de" >user</maintainer >
18- <license >ISC License</license >
19- <export >
20- <build_type >cmake</build_type >
11+ <build_type >ament_cmake</build_type >
2112 </export >
2213</package >
You can’t perform that action at this time.
0 commit comments