summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-06-07 09:34:43 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-06-07 14:17:46 +0200
commit33aa461ec96201a2d32ce4ec80319f75878fed60 (patch)
tree2c1bccbf3ec7c17ff568d90e147440292263d167
parentd23613acf7bfe37c1c78eb9aadc489e888e34dfb (diff)
Remove legacy code path from qt_add_resource
All repos use the updated version of qt_add_resource, and we can remove the legacy code path. Change-Id: I15ba64a08c3fad9712a5cf05715594b1ee755bfc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--CMakeLists.txt3
-rw-r--r--src/corelib/Qt6CoreMacros.cmake48
2 files changed, 11 insertions, 40 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 537656ab11..8462007ae5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,9 +43,6 @@ project(QtBase
LANGUAGES CXX C ASM
)
-# Make sure we use the fixed BASE argument of qt_add_resource.
-set(QT_USE_FIXED_QT_ADD_RESOURCE_BASE TRUE)
-
if(NOT QT_BUILD_STANDALONE_TESTS)
## Add some paths to check for cmake modules:
list(PREPEND CMAKE_MODULE_PATH
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index 0352a03413..819fbbfb9c 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1541,43 +1541,17 @@ function(_qt_internal_process_resource target resourceName)
string(REPLACE "." "_" resourceName ${resourceName})
set(output_targets "")
- if(NOT DEFINED QT_REPO_MODULE_VERSION OR QT_USE_FIXED_QT_ADD_RESOURCE_BASE)
- # Use the fixed BASE argument instead of the slightly broken one from 6.0.
- set(resource_files ${rcc_FILES})
- if(NOT "${rcc_BASE}" STREQUAL "")
- get_filename_component(abs_base "${rcc_BASE}" ABSOLUTE)
- foreach(file_path IN LISTS resource_files)
- get_source_file_property(alias "${file_path}" QT_RESOURCE_ALIAS)
- if(alias STREQUAL "NOTFOUND")
- get_filename_component(abs_file "${file_path}" ABSOLUTE)
- file(RELATIVE_PATH rel_file "${abs_base}" "${abs_file}")
- set_property(SOURCE "${file_path}" PROPERTY QT_RESOURCE_ALIAS "${rel_file}")
- endif()
- endforeach()
- endif()
- else()
- # TODO: Remove this else branch, once every Qt module defines
- # QT_USE_FIXED_QT_ADD_RESOURCE_BASE.
-
- # Apply base to all files
- if (rcc_BASE)
- foreach(file_path IN LISTS rcc_FILES)
- set(resource_file "${rcc_BASE}/${file_path}")
- __qt_get_relative_resource_path_for_file(alias ${resource_file})
- # Handle case where resources were generated from a directory
- # different than the one where the main .pro file resides.
- # Unless otherwise specified, we should use the original file path
- # as alias.
- if (alias STREQUAL resource_file)
- set_source_files_properties(${resource_file} PROPERTIES
- QT_RESOURCE_ALIAS ${file_path})
- endif()
- file(TO_CMAKE_PATH ${resource_file} resource_file)
- list(APPEND resource_files ${resource_file})
- endforeach()
- else()
- set(resource_files ${rcc_FILES})
- endif()
+ set(resource_files ${rcc_FILES})
+ if(NOT "${rcc_BASE}" STREQUAL "")
+ get_filename_component(abs_base "${rcc_BASE}" ABSOLUTE)
+ foreach(file_path IN LISTS resource_files)
+ get_source_file_property(alias "${file_path}" QT_RESOURCE_ALIAS)
+ if(alias STREQUAL "NOTFOUND")
+ get_filename_component(abs_file "${file_path}" ABSOLUTE)
+ file(RELATIVE_PATH rel_file "${abs_base}" "${abs_file}")
+ set_property(SOURCE "${file_path}" PROPERTY QT_RESOURCE_ALIAS "${rel_file}")
+ endif()
+ endforeach()
endif()
if(NOT rcc_PREFIX)