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

Ensure relocatable config files #129

Merged
merged 7 commits into from
Feb 4, 2021
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
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
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/ignition-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ foreach(component ${@PKG_NAME@_FIND_COMPONENTS})
endforeach()

# Specify the doxygen tag file
set(@PROJECT_NAME_NO_VERSION_UPPER@_DOXYGEN_TAGFILE "@CMAKE_INSTALL_PREFIX@/@IGN_DATA_INSTALL_DIR@/@PROJECT_NAME_LOWER@.tag.xml")
set(@PROJECT_NAME_NO_VERSION_UPPER@_DOXYGEN_TAGFILE "${PACKAGE_PREFIX_DIR}/@IGN_DATA_INSTALL_DIR@/@PROJECT_NAME_LOWER@.tag.xml")

# Specify the API url. This is where the doxygen tag file will resolve URLS to.
set(@PROJECT_NAME_NO_VERSION_UPPER@_API_URL "https://ignitionrobotics.org/api/@IGN_DESIGNATION@/@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@")
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=@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 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