summaryrefslogtreecommitdiffstats
path: root/cmake/QtBuild.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-07-30 19:17:09 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-07-31 14:29:45 +0200
commit9c0f448f5a4e2e96e9b801c751c0a145c0eb6dad (patch)
tree504356a5fa4c369cdcb1c862518e99911f301d7c /cmake/QtBuild.cmake
parent26c742c1e1c96740646bb1896df52bad2fbe105d (diff)
CMake: Fix generated content of prl files (again)
Apply the same kind of transformations to the contents of the prl files as we do for pri files. Mainly, transform system library paths that are absolute, into link flags to make them relocatable across systems. Also change the Qt frameworks to be linked via the -framework flags instead of via absolute paths. Implementation notes Move the common required functions for both QtFinishPrlFile and QtGenerateLibPri into a common QtGenerateLibHelpers.cmake file. Make sure it's listed as a dependency for the custom commands. Also make sure to pass the necessary input values like possible library prefixes and suffixes, as well as the link flag. Task-number: QTBUG-85240 Task-number: QTBUG-85801 Change-Id: I36f24207f92a1d2ed3ed2d81bb96e4e62d927b6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r--cmake/QtBuild.cmake20
1 files changed, 16 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index 9fd5b3c244..e20985c2a3 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -949,7 +949,9 @@ QT.${config_module_name}_private.disabled_features = ${disabled_private_features
${CMAKE_STATIC_LIBRARY_SUFFIX})
add_custom_command(
OUTPUT "${private_pri_file_path}"
- DEPENDS ${inputs} "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake"
+ DEPENDS ${inputs}
+ "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake"
+ "${QT_CMAKE_DIR}/QtGenerateLibHelpers.cmake"
COMMAND ${CMAKE_COMMAND} "-DIN_FILES=${inputs}" "-DOUT_FILE=${private_pri_file_path}"
"-DLIBRARY_PREFIXES=${library_prefixes}"
"-DLIBRARY_SUFFIXES=${library_suffixes}"
@@ -1393,7 +1395,9 @@ CONFIG += ${private_config_joined}
${CMAKE_STATIC_LIBRARY_SUFFIX})
add_custom_command(
OUTPUT "${qmodule_pri_target_path}"
- DEPENDS ${inputs} "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake"
+ DEPENDS ${inputs}
+ "${QT_CMAKE_DIR}/QtGenerateLibPri.cmake"
+ "${QT_CMAKE_DIR}/QtGenerateLibHelpers.cmake"
COMMAND ${CMAKE_COMMAND} "-DIN_FILES=${inputs}" "-DOUT_FILE=${qmodule_pri_target_path}"
"-DLIBRARY_PREFIXES=${library_prefixes}"
"-DLIBRARY_SUFFIXES=${library_suffixes}"
@@ -3398,7 +3402,11 @@ QMAKE_PRL_LIBS_FOR_CMAKE = ${prl_libs}
CONTENT
"FINAL_PRL_FILE_PATH = ${final_prl_file_path}")
- set(library_suffixes ${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_SUFFIX})
+ set(library_prefixes ${CMAKE_SHARED_LIBRARY_PREFIX} ${CMAKE_STATIC_LIBRARY_PREFIX})
+ set(library_suffixes
+ ${CMAKE_SHARED_LIBRARY_SUFFIX}
+ ${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}
+ ${CMAKE_STATIC_LIBRARY_SUFFIX})
if(QT_GENERATOR_IS_MULTI_CONFIG)
set(configs ${CMAKE_CONFIGURATION_TYPES})
@@ -3421,13 +3429,17 @@ QMAKE_PRL_LIBS_FOR_CMAKE = ${prl_libs}
"${prl_meta_info_name_prefix}${config}${prl_meta_info_name_suffix}")
add_custom_command(
OUTPUT "${prl_step2_path}"
- DEPENDS "${prl_step1_path}" "${prl_meta_info_path}"
+ DEPENDS "${prl_step1_path}"
+ "${prl_meta_info_path}"
"${QT_CMAKE_DIR}/QtFinishPrlFile.cmake"
+ "${QT_CMAKE_DIR}/QtGenerateLibHelpers.cmake"
COMMAND ${CMAKE_COMMAND}
"-DIN_FILE=${prl_step1_path}"
"-DIN_META_FILE=${prl_meta_info_path}"
"-DOUT_FILE=${prl_step2_path}"
+ "-DLIBRARY_PREFIXES=${library_prefixes}"
"-DLIBRARY_SUFFIXES=${library_suffixes}"
+ "-DLINK_LIBRARY_FLAG=${CMAKE_LINK_LIBRARY_FLAG}"
"-DQT_BUILD_LIBDIR=${QT_BUILD_DIR}/${INSTALL_LIBDIR}"
-P "${QT_CMAKE_DIR}/QtFinishPrlFile.cmake"
VERBATIM