Skip to content

Commit

Permalink
Compute ignition .pc file relative path to prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
scpeters committed Jan 8, 2021
1 parent e3c39ee commit 1e39fa0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion cmake/IgnPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,18 @@ function(_ign_create_pkgconfig)
endif()

set(pkgconfig_output "${CMAKE_BINARY_DIR}/cmake/pkgconfig/${target_name}.pc")
set(pkgconfig_install_dir "${IGN_LIB_INSTALL_DIR}/pkgconfig")
file(RELATIVE_PATH
PC_CONFIG_RELATIVE_PATH_TO_PREFIX
"${CMAKE_INSTALL_PREFIX}/${pkgconfig_install_dir}"
"${CMAKE_INSTALL_PREFIX}"
)

configure_file(${pkgconfig_input} ${pkgconfig_output} @ONLY)

install(
FILES ${pkgconfig_output}
DESTINATION ${IGN_LIB_INSTALL_DIR}/pkgconfig
DESTINATION ${pkgconfig_install_dir}
COMPONENT pkgconfig)

endfunction()
Expand Down
2 changes: 1 addition & 1 deletion cmake/pkgconfig/ignition-component.pc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=@CMAKE_INSTALL_PREFIX@
prefix=${pcfiledir}/@PC_CONFIG_RELATIVE_PATH_TO_PREFIX@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/ignition/@IGN_DESIGNATION@@PROJECT_VERSION_MAJOR@

Expand Down
2 changes: 1 addition & 1 deletion cmake/pkgconfig/ignition.pc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
prefix=${pcfiledir}/../..
prefix=${pcfiledir}/@PC_CONFIG_RELATIVE_PATH_TO_PREFIX@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/ignition/@IGN_DESIGNATION@@PROJECT_VERSION_MAJOR@

Expand Down

0 comments on commit 1e39fa0

Please sign in to comment.