Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build of downstream packages. #407

Merged
merged 2 commits into from
Sep 24, 2020
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
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS pointmatcher)
get_property(CONF_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)

# Create variable with the library location
set(POINTMATCHER_LIB $<TARGET_FILE:libpointmatcher>)
set(POINTMATCHER_LIB $<TARGET_FILE:pointmatcher>)

# Configure config file for local build tree
configure_file(libpointmatcherConfig.cmake.in
Expand All @@ -504,10 +504,6 @@ set(CONF_INCLUDE_DIRS ${INSTALL_INCLUDE_DIR} ${CONF_INCLUDE_DIRS} )
# because we added an include for the local yaml-cpp-pm we should also remove it
list(REMOVE_ITEM CONF_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/contrib/yaml-cpp-pm/include)

# Change the library location for an install location
get_filename_component(POINTMATCHER_LIB_NAME ${POINTMATCHER_LIB} NAME)
set(POINTMATCHER_LIB ${INSTALL_LIB_DIR}/${POINTMATCHER_LIB_NAME})

# We put the generated file for installation in a different repository (i.e., ./CMakeFiles/)
configure_file(libpointmatcherConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libpointmatcherConfig.cmake" @ONLY)
Expand Down
7 changes: 7 additions & 0 deletions contrib/yaml-cpp-pm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,10 @@ set_target_properties(yaml-cpp-pm PROPERTIES
PROJECT_LABEL "yaml-cpp ${LABEL_SUFFIX}"
)

install(TARGETS yaml-cpp-pm EXPORT yaml-cpp-pm-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(EXPORT yaml-cpp-pm-targets DESTINATION share/${PROJECT_NAME}/cmake)
11 changes: 7 additions & 4 deletions libpointmatcherConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
include(CMakeFindDependencyMacro)
find_dependency(libnabo REQUIRED)

include(${CMAKE_CURRENT_LIST_DIR}/libpointmatcher-config.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/yaml-cpp-pm-targets.cmake)

# Compute paths
get_filename_component(POINTMATCHER_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(libpointmatcher_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
set(LIBPOINTMATCHER_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
set(pointmatcher_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
set(POINTMATCHER_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")

set(libpointmatcher_LIBRARIES "@POINTMATCHER_LIB@;@EXTERNAL_LIBS@")
set(LIBPOINTMATCHER_LIBRARIES "@POINTMATCHER_LIB@;@EXTERNAL_LIBS@")
set(pointmatcher_LIBRARIES "@POINTMATCHER_LIB@;@EXTERNAL_LIBS@")
set(POINTMATCHER_LIBRARIES "@POINTMATCHER_LIB@;@EXTERNAL_LIBS@")
set(libpointmatcher_LIBRARIES "@POINTMATCHER_LIB@;@libnabo_LIBRARIES@;@EXTERNAL_LIBS@")
set(LIBPOINTMATCHER_LIBRARIES "@POINTMATCHER_LIB@;@libnabo_LIBRARIES@;@EXTERNAL_LIBS@")
set(pointmatcher_LIBRARIES "@POINTMATCHER_LIB@;@libnabo_LIBRARIES@;@EXTERNAL_LIBS@")
set(POINTMATCHER_LIBRARIES "@POINTMATCHER_LIB@;@libnabo_LIBRARIES@;@EXTERNAL_LIBS@")

# This causes catkin simple to link against these libraries
set(libpointmatcher_FOUND_CATKIN_PROJECT true)
Expand Down