Skip to content

Commit

Permalink
Make dart.pc relocatable
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Dec 28, 2020
1 parent f717a11 commit 70d26f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,17 @@ install(
# Generate the DART pkg-config
set(PC_CONFIG_IN ${CMAKE_SOURCE_DIR}/cmake/dart.pc.in)
set(PC_CONFIG_OUT ${CMAKE_BINARY_DIR}/cmake/dart.pc)
set(PC_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig)
file(RELATIVE_PATH
RELATIVE_PATH_TO_INSTALL_PREFIX
"${PC_CONFIG_INSTALL_DIR}"
"${CMAKE_INSTALL_PREFIX}"
)
if(DART_VERBOSE)
message(STATUS ${PC_CONFIG_OUT})
endif()
configure_file(${PC_CONFIG_IN} ${PC_CONFIG_OUT} @ONLY)
install(FILES ${PC_CONFIG_OUT} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${PC_CONFIG_OUT} DESTINATION ${PC_CONFIG_INSTALL_DIR})

# Install a Catkin 'package.xml' file. This is required by REP-136.
install(FILES package.xml DESTINATION
Expand Down
6 changes: 3 additions & 3 deletions cmake/dart.pc.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file was generated by CMake for @PROJECT_NAME@
prefix=${pcfiledir}/../..
prefix=${pcfiledir}/@RELATIVE_PATH_TO_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/dart
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/dart

Name: @PROJECT_NAME@
Description: @DART_PKG_DESC@
Expand Down

0 comments on commit 70d26f8

Please sign in to comment.