diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-18 16:49:11 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-19 13:35:40 +0200 |
commit | e7455644a28e4d4b569a1f3fee421d9eeed00d3d (patch) | |
tree | 70ea38c73cf5716df42c4ed023d622cd17783467 /cmake | |
parent | 11d1dcc6e263c5059f34b44d531c9ccdf7c0b1d6 (diff) |
CMake: Don't install metatypes files for user projects
Installing extracted metatypes json files for user projects was an
oversight. We shouldn't install anything on behalf of user projects,
but rather give them enough information so they can do it the
themselves.
Make all the install options of qt6_extract_metatypes internal,
change the behavior not to install the files by default, unless
__QT_INTERNAL_INSTALL is passed, which is used for the Qt build only.
__QT_INTERNAL_NO_INSTALL is now a no-op and should be removed from
projects.
This is behavior change for existing public API, but it's better to
fix this now before 6.2.0 release.
Introduce a new OUTPUT_FILES option to allow assigning the extracted
metatype file paths into a variable that the project provides.
The project can then install the files where they need them.
[ChangeLog][CMake] qt6_extract_metatypes does not install metatypes
files anymore. Instead the OUTPUT_FILES option can be provided to get
the list of extracted files for further processing.
Pick-to: 6.2
Task-number: QTBUG-95845
Change-Id: If5dd0255a5fea2b598e15118c29ec2ab2ba4324e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtModuleHelpers.cmake | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index a2d220202f..634c4a4c33 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -596,12 +596,11 @@ set(QT_LIBINFIX \"${QT_LIBINFIX}\")") endif() if (NOT ${arg_NO_GENERATE_METATYPES}) if (NOT target_type STREQUAL "INTERFACE_LIBRARY") - set(metatypes_install_dir ${INSTALL_LIBDIR}/metatypes) - set(args) - if (NOT QT_WILL_INSTALL) - set(args __QT_INTERNAL_NO_INSTALL) - else() - set(args INSTALL_DIR "${metatypes_install_dir}") + set(args "") + if(QT_WILL_INSTALL) + set(metatypes_install_dir "${INSTALL_LIBDIR}/metatypes") + list(APPEND args + __QT_INTERNAL_INSTALL __QT_INTERNAL_INSTALL_DIR "${metatypes_install_dir}") endif() qt6_extract_metatypes(${target} ${args}) elseif(${arg_GENERATE_METATYPES}) |