Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ endif()

project(${LIB_TARGET} LANGUAGES CXX VERSION 0.0.1)

if (NOT DEFINED LF_REACTOR_CPP_SUFFIX)
find_package(ament_cmake QUIET)
if(ament_cmake_FOUND)
set(REACTOR_CPP_USE_AMENT ON)
endif()
endif()

# require C++17
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -78,17 +71,3 @@ if (DEFINED LF_REACTOR_CPP_SUFFIX)
else()
install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
endif()

if (REACTOR_CPP_USE_AMENT)
# Install the export file - must be in root CMakeLists.txt for ament compatibility
install(EXPORT ${LIB_TARGET} DESTINATION share/${LIB_TARGET}/cmake NAMESPACE ${LIB_TARGET}::)
ament_export_targets(${LIB_TARGET} HAS_LIBRARY_TARGET)
ament_export_include_directories(include)
ament_export_libraries(${LIB_TARGET})
ament_package()
else()
# For non-ament builds, install export file from here
if(REACTOR_CPP_INSTALL)
install(EXPORT ${LIB_TARGET} DESTINATION share/${LIB_TARGET}/cmake)
endif()
endif()
7 changes: 5 additions & 2 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ if(REACTOR_CPP_INSTALL)
install(FILES "${PROJECT_BINARY_DIR}/include/reactor-cpp/config.hh" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/reactor-cpp")
endif()

install(TARGETS ${LIB_TARGET} EXPORT ${LIB_TARGET}
install(TARGETS ${LIB_TARGET} EXPORT ${LIB_TARGET}Config
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" OPTIONAL
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
# Note: install(EXPORT ...) moved to root CMakeLists.txt for ament compatibility

install(EXPORT ${LIB_TARGET}Config DESTINATION share/${LIB_TARGET}/cmake)

export(TARGETS ${PROJECT_NAME} FILE ${LIB_TARGET}Config.cmake)
endif()
13 changes: 11 additions & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@
<description>A C++ reactor runtime</description>
<maintainer email="[email protected]">user</maintainer>
<license>ISC License</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<export>
<build_type>ament_cmake</build_type>
<build_type>cmake</build_type>
</export>
</package>
<package format="3">
<name>reactor-cpp-foo</name>
<version>0.0.0</version>
<description>A C++ reactor runtime</description>
<maintainer email="[email protected]">user</maintainer>
<license>ISC License</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
Loading