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

Use relative paths for pkg-config install directory #443

Merged
merged 1 commit into from
Aug 16, 2024
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
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ set(gz_version_output "${PROJECT_NAME_LOWER}-config-version.cmake")
set(gz_config_install_dir "${CMAKE_INSTALL_DATAROOTDIR}/cmake/${PROJECT_NAME_LOWER}")
set(gz_pkgconfig_input "${CMAKE_CURRENT_SOURCE_DIR}/config/gz-cmake.pc.in")
set(gz_pkgconfig_output "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc")
set(gz_pkgconfig_install_dir "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
set(gz_pkgconfig_install_dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
set(gz_pkgconfig_abs_install_dir "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
set(gz_utilities_target ${PROJECT_EXPORT_NAME}-utilities)
set(gz_utilities_import_target_name ${PROJECT_EXPORT_NAME}::${gz_utilities_target})
set(gz_utilities_target_output_filename "${gz_utilities_target}-targets.cmake")
Expand Down Expand Up @@ -96,7 +97,7 @@ install(
# Configure and install the pkgconfig file (needed for utilities headers)
file(RELATIVE_PATH
GZ_PC_CONFIG_RELATIVE_PATH_TO_PREFIX
"${gz_pkgconfig_install_dir}"
"${gz_pkgconfig_abs_install_dir}"
"${CMAKE_INSTALL_PREFIX}"
)

Expand Down
5 changes: 3 additions & 2 deletions cmake/GzPackaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,11 @@ function(_gz_create_pkgconfig)
endif()

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

Expand Down
Loading