aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2022-04-19 17:16:21 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2022-04-19 17:39:07 +0200
commitaf93406a7d5ff8531d5849936408abcc75d30c74 (patch)
treefe63304acb7b391ed62197afb454e487e6454365 /src/qml/CMakeLists.txt
parentd141804e6fb9dd3ea22de2fedf7a75174da25f03 (diff)
CMake: Work around moc issue in static builds when building snippets
Static builds create additional targets for each resource, which are not covered by calls to qt_autogen_tools, and listing all of them manually is brittle. This ends up in an error at generate time: CMake Error: AUTOMOC for target qt_target_qml_sources_example_resources_3: The "moc" executable "~/build/qtbase/libexec/moc" does not exist Work around the issue by not building the doc snippets in a static build. Pick-to: 6.2 6.3 Fixes: QTBUG-99063 Change-Id: I313515a83d82f17a6930f7beeb7bb8acd7f8ce5b Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/qml/CMakeLists.txt')
-rw-r--r--src/qml/CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/CMakeLists.txt b/src/qml/CMakeLists.txt
index 6420411427..80ba7cbd0e 100644
--- a/src/qml/CMakeLists.txt
+++ b/src/qml/CMakeLists.txt
@@ -677,8 +677,11 @@ qt_internal_add_docs(Qml
doc/qtqml.qdocconf
)
-# include snippet projects for developer builds
-if(QT_FEATURE_private_tests AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.19")
+# include snippet projects for developer shared builds
+# static builds fail with
+# CMake Error: AUTOMOC for target qt_target_qml_sources_example_resources_3:
+# The "moc" executable does not exist
+if(QT_FEATURE_private_tests AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.19" AND QT_BUILD_SHARED_LIBS)
add_subdirectory(doc/snippets/cmake/qt_target_qml_sources)
qt_autogen_tools(qt_target_qml_sources_example ENABLE_AUTOGEN_TOOLS moc)
qt_autogen_tools(qt_target_qml_sources_exampleplugin ENABLE_AUTOGEN_TOOLS moc)