diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-08-18 16:49:11 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-19 14:14:52 +0000 |
commit | a7fa5b4b76b0098e60b32ba8cd0e95e0946f1aa8 (patch) | |
tree | 723609561c3c6ad9501de94fcaab7cf90d84b2e5 /cmake | |
parent | 8359615cf984ed84ab358570c6a0ab0344de7b0c (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.
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>
(cherry picked from commit e7455644a28e4d4b569a1f3fee421d9eeed00d3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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 df440a2800..e0c897ee59 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -586,12 +586,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}) |