summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/CMakeLists.txt12
-rw-r--r--src/corelib/mimetypes/mimetypes_resources.cmake21
2 files changed, 28 insertions, 5 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index c901169735..d74a38f51a 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -1037,11 +1037,13 @@ extend_target(Core CONDITION QT_FEATURE_mimetype
)
# Resources:
-set_source_files_properties("mimetypes/mime/packages/freedesktop.org.xml"
- PROPERTIES alias "freedesktop.org.xml")
-add_qt_resource(Core "mimetypes" PREFIX "/qt-project.org/qmime/packages" BASE "mimetypes" FILES
- mime/packages/freedesktop.org.xml)
-
+# special case begin
+# We can't specify the resources directly as we have unit tests that
+# depend on these as well and we no longer support the use of hand
+# edited qrc files.
+include(${CMAKE_CURRENT_SOURCE_DIR}/mimetypes/mimetypes_resources.cmake)
+corelib_add_mimetypes_resources(Core)
+# special case end
extend_target(Core CONDITION WASM
SOURCES
diff --git a/src/corelib/mimetypes/mimetypes_resources.cmake b/src/corelib/mimetypes/mimetypes_resources.cmake
new file mode 100644
index 0000000000..42454beb87
--- /dev/null
+++ b/src/corelib/mimetypes/mimetypes_resources.cmake
@@ -0,0 +1,21 @@
+# List of files that need to be packaged as resources.
+# This file exists solely because of unit tests that need access to this
+# information as well. This was previosly handled by referrencing a qrc
+# file with the same information
+
+set(corelib_mimetypes_resource_file
+ "${CMAKE_CURRENT_LIST_DIR}/mime/packages/freedesktop.org.xml"
+)
+
+function(corelib_add_mimetypes_resources target)
+ set(source_file "${corelib_mimetypes_resource_file}")
+ set_source_files_properties("${source_file}"
+ PROPERTIES alias "freedesktop.org.xml"
+ )
+ add_qt_resource(${target} "mimetypes"
+ PREFIX
+ "/qt-project.org/qmime/packages"
+ FILES
+ "${source_file}"
+ )
+endfunction()