Skip to content

Commit

Permalink
Make dart.pc relocatable (#1529)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Profanter <[email protected]>
  • Loading branch information
jslee02 and Pro authored Dec 29, 2020
1 parent 41dac54 commit 3ba45af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
* Removed gccfilter: [#1464](https://github.com/dartsim/dart/pull/1464)
* Allowed to set CMAKE_INSTALL_PREFIX on Windows: [#1478](https://github.com/dartsim/dart/pull/1478)
* Enforced to use OpenSceneGraph 3.7.0 or greater on macOS Catalina: [#1479](https://github.com/dartsim/dart/pull/1479)
* Made `dart.pc` relocatable: [#1529](https://github.com/dartsim/dart/pull/1529)

* Documentation

Expand Down
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=@CMAKE_INSTALL_PREFIX@
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 3ba45af

Please sign in to comment.