* Add certain variables to find Qt's dependencies to the CMake toolchain file because these variables would otherwise needed to be set every time Qt 6 is used * Add a static variant * Not fully tested yet * Further repos besides base and svg will be added later
116 lines
4.9 KiB
Diff
116 lines
4.9 KiB
Diff
From 8073b269bb69ab091bb29600c1f7a493f3543a83 Mon Sep 17 00:00:00 2001
|
|
From: Martchus <martchus@gmx.net>
|
|
Date: Thu, 5 Nov 2020 22:08:10 +0100
|
|
Subject: [PATCH 1/5] Use CMake's default import library suffix
|
|
|
|
Change-Id: Iedc6a7ee8982a62ddd56ad0bf25ba0b8752a666a
|
|
---
|
|
cmake/QtPriHelpers.cmake | 12 ++++++++++--
|
|
cmake/QtPrlHelpers.cmake | 8 +++++++-
|
|
cmake/QtTargetHelpers.cmake | 2 --
|
|
mkspecs/common/g++-win32.conf | 1 +
|
|
mkspecs/features/create_cmake.prf | 5 +++--
|
|
5 files changed, 21 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake
|
|
index 56c60b1b18..18e1aeddb1 100644
|
|
--- a/cmake/QtPriHelpers.cmake
|
|
+++ b/cmake/QtPriHelpers.cmake
|
|
@@ -320,9 +320,13 @@ QT.${config_module_name}_private.disabled_features = ${disabled_private_features
|
|
qt_path_join(private_pri_file_path "${target_path}" "${private_pri_file_name}")
|
|
list(APPEND pri_files "${private_pri_file_path}")
|
|
|
|
- set(library_prefixes ${CMAKE_SHARED_LIBRARY_PREFIX} ${CMAKE_STATIC_LIBRARY_PREFIX})
|
|
+ set(library_prefixes
|
|
+ ${CMAKE_SHARED_LIBRARY_PREFIX}
|
|
+ ${CMAKE_IMPORT_LIBRARY_PREFIX}
|
|
+ ${CMAKE_STATIC_LIBRARY_PREFIX})
|
|
set(library_suffixes
|
|
${CMAKE_SHARED_LIBRARY_SUFFIX}
|
|
+ ${CMAKE_CMAKE_IMPORT_LIBRARY_SUFFIX}
|
|
${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}
|
|
${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
add_custom_command(
|
|
@@ -727,9 +731,13 @@ CONFIG += ${private_config_joined}
|
|
list(APPEND inputs "${preliminary_pri_root}/${cfg}/${pri_data_cmake_file}")
|
|
endforeach()
|
|
|
|
- set(library_prefixes ${CMAKE_SHARED_LIBRARY_PREFIX} ${CMAKE_STATIC_LIBRARY_PREFIX})
|
|
+ set(library_prefixes
|
|
+ ${CMAKE_SHARED_LIBRARY_PREFIX}
|
|
+ ${CMAKE_IMPORT_LIBRARY_PREFIX}
|
|
+ ${CMAKE_STATIC_LIBRARY_PREFIX})
|
|
set(library_suffixes
|
|
${CMAKE_SHARED_LIBRARY_SUFFIX}
|
|
+ ${CMAKE_CMAKE_IMPORT_LIBRARY_SUFFIX}
|
|
${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}
|
|
${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
add_custom_command(
|
|
diff --git a/cmake/QtPrlHelpers.cmake b/cmake/QtPrlHelpers.cmake
|
|
index 35d321420c..40a85e6c73 100644
|
|
--- a/cmake/QtPrlHelpers.cmake
|
|
+++ b/cmake/QtPrlHelpers.cmake
|
|
@@ -258,11 +258,17 @@ QMAKE_PRL_VERSION = ${PROJECT_VERSION}
|
|
CONTENT
|
|
"FINAL_PRL_FILE_PATH = ${final_prl_file_path}")
|
|
|
|
- set(library_prefixes ${CMAKE_SHARED_LIBRARY_PREFIX} ${CMAKE_STATIC_LIBRARY_PREFIX})
|
|
+ set(library_prefixes
|
|
+ ${CMAKE_SHARED_LIBRARY_PREFIX}
|
|
+ ${CMAKE_IMPORT_LIBRARY_PREFIX}
|
|
+ ${CMAKE_STATIC_LIBRARY_PREFIX})
|
|
set(library_suffixes
|
|
${CMAKE_SHARED_LIBRARY_SUFFIX}
|
|
+ ${CMAKE_CMAKE_IMPORT_LIBRARY_SUFFIX}
|
|
${CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES}
|
|
${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
+ list(REMOVE_DUPLICATES library_prefixes)
|
|
+ list(REMOVE_DUPLICATES library_suffixes)
|
|
|
|
if(QT_GENERATOR_IS_MULTI_CONFIG)
|
|
set(configs ${CMAKE_CONFIGURATION_TYPES})
|
|
diff --git a/cmake/QtTargetHelpers.cmake b/cmake/QtTargetHelpers.cmake
|
|
index fcbb3ab1f2..332ef6ee4c 100644
|
|
--- a/cmake/QtTargetHelpers.cmake
|
|
+++ b/cmake/QtTargetHelpers.cmake
|
|
@@ -283,8 +283,6 @@ function(qt_internal_apply_win_prefix_and_suffix target)
|
|
|
|
# This should cover both MINGW with GCC and CLANG.
|
|
if(NOT MSVC)
|
|
- set_property(TARGET "${target}" PROPERTY IMPORT_SUFFIX ".a")
|
|
-
|
|
get_target_property(target_type ${target} TYPE)
|
|
if(target_type STREQUAL "STATIC_LIBRARY")
|
|
set_property(TARGET "${target}" PROPERTY PREFIX "lib")
|
|
diff --git a/mkspecs/common/g++-win32.conf b/mkspecs/common/g++-win32.conf
|
|
index 67ad1e3b8c..b98c7121f6 100644
|
|
--- a/mkspecs/common/g++-win32.conf
|
|
+++ b/mkspecs/common/g++-win32.conf
|
|
@@ -54,6 +54,7 @@ QMAKE_PREFIX_SHLIB =
|
|
QMAKE_EXTENSION_SHLIB = dll
|
|
QMAKE_PREFIX_STATICLIB = lib
|
|
QMAKE_EXTENSION_STATICLIB = a
|
|
+QMAKE_EXTENSION_IMPORTLIB = dll.a
|
|
QMAKE_LIB_EXTENSIONS = a dll.a
|
|
|
|
QMAKE_LIBS =
|
|
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
|
|
index 24ed125f12..73ebe453d3 100644
|
|
--- a/mkspecs/features/create_cmake.prf
|
|
+++ b/mkspecs/features/create_cmake.prf
|
|
@@ -332,8 +332,9 @@ mac {
|
|
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}$${debug_suffix}.a
|
|
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
|
|
|
|
- CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.a
|
|
- CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
|
+ isEmpty(QMAKE_EXTENSION_IMPORTLIB): QMAKE_EXTENSION_IMPORTLIB = a
|
|
+ CMAKE_IMPLIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}$${debug_suffix}.$${QMAKE_EXTENSION_IMPORTLIB}
|
|
+ CMAKE_IMPLIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$${QMAKE_EXTENSION_IMPORTLIB}
|
|
} else {
|
|
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}$${debug_suffix}.lib
|
|
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
|
|
--
|
|
2.29.2
|
|
|