CMake: Make generated pkgconfig files relocatable
Don't write an absolute prefix into generated .pc files but one that's relative to ${pcfiledir}. This makes the files relocatable, and we don't have to patch them in the Qt online installer. Pick-to: 6.8 Fixes: QTBUG-136210 Change-Id: I5c2f9398917be03f6c63286e553c87ff52971285 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 731d9a13956ef40e3f563f5ff5ff5c250b8d6d94) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
80fdd12957
commit
223e2ecd14
@ -1,4 +1,4 @@
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
prefix=${pcfiledir}/@relative_install_prefix@
|
||||
exec_prefix=${prefix}
|
||||
bindir=${prefix}/@INSTALL_BINDIR@
|
||||
libexecdir=${prefix}/@INSTALL_LIBEXECDIR@
|
||||
|
@ -125,6 +125,9 @@ function(qt_internal_generate_pkg_config_file module)
|
||||
qt_path_join(pc_step1_path "${build_dir}" ${step_prefix}_step1.pc)
|
||||
qt_path_join(pc_step2_path "${build_dir}" ${step_prefix}_$<CONFIG>_step2.pc)
|
||||
|
||||
file(RELATIVE_PATH relative_install_prefix "/${path_suffix}" "/foo")
|
||||
get_filename_component(relative_install_prefix "${relative_install_prefix}" DIRECTORY)
|
||||
|
||||
configure_file("${template_pc}" "${pc_step1_path}" @ONLY)
|
||||
|
||||
file(GENERATE OUTPUT "${pc_step2_path}" INPUT "${pc_step1_path}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user