Skip to content

Commit

Permalink
Compute path to prefix for ignition-cmake.pc
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 1e39fa0 commit b95d20f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ set(ign_version_output "${PROJECT_NAME_LOWER}-config-version.cmake")
set(ign_config_install_dir "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME_LOWER}")
set(ign_pkgconfig_input "${CMAKE_CURRENT_SOURCE_DIR}/config/ignition-cmake.pc.in")
set(ign_pkgconfig_output "${CMAKE_BINARY_DIR}/ignition-cmake${PROJECT_VERSION_MAJOR}.pc")
set(ign_pkgconfig_install_dir "${IGN_LIB_INSTALL_DIR}/pkgconfig")
set(ign_utilities_target ${PROJECT_EXPORT_NAME}-utilities)
set(ign_utilities_import_target_name ${PROJECT_EXPORT_NAME}::${ign_utilities_target})
set(ign_utilities_target_output_filename "${ign_utilities_target}-targets.cmake")
Expand Down Expand Up @@ -86,11 +87,16 @@ install(

#--------------------------------------
# Configure and install the pkgconfig file (needed for utilities headers)
file(RELATIVE_PATH
IGN_PC_CONFIG_RELATIVE_PATH_TO_PREFIX
"${CMAKE_INSTALL_PREFIX}/${ign_pkgconfig_install_dir}"
"${CMAKE_INSTALL_PREFIX}"
)
configure_file(${ign_pkgconfig_input} ${ign_pkgconfig_output} @ONLY)

install(
FILES ${ign_pkgconfig_output}
DESTINATION ${IGN_LIB_INSTALL_DIR}/pkgconfig
DESTINATION ${ign_pkgconfig_install_dir}
COMPONENT pkgconfig)

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

Name: Ignition @IGN_DESIGNATION@
Expand Down

0 comments on commit b95d20f

Please sign in to comment.