aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2021-10-04 23:38:05 +0200
committerOliver Eftevaag <oliver.eftevaag@qt.io>2021-11-11 13:11:40 +0200
commitfe59c788a65579bbeeb550fcad96cf26443df77a (patch)
tree7f71855dc6e7e402ed9f4eefafd8eecc149eaff8 /examples
parentfb264129529dc39cf94bc3e69ef14cc08d26df78 (diff)
painteditem: better error message when running cmake on textballoon
Building the TextBalloon in isolation doesn't make any sense. Its purpose is to implement a delegate, for the painteditem example to use, and should therefore only be built as part of the painteditem project. To build the example, cmake should be invoked with examples/quick/customitems/painteditem/CMakeLists.txt as its source path. The CMakeLists.txt in examples/quick/customitems/painteditem/TextBalloon should only be used from another CMakeLists.txt file via the add_subdirectory() command. If invoked directly it makes sense to print an error message and stop processing. Task-number: QTBUG-96806 Pick-to: 6.2 Change-Id: I1ebd2157790afbf7307498a4fb64049794ae6c5b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/customitems/painteditem/TextBalloon/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/quick/customitems/painteditem/TextBalloon/CMakeLists.txt b/examples/quick/customitems/painteditem/TextBalloon/CMakeLists.txt
index eb0ef1fd87..fb2bf7568e 100644
--- a/examples/quick/customitems/painteditem/TextBalloon/CMakeLists.txt
+++ b/examples/quick/customitems/painteditem/TextBalloon/CMakeLists.txt
@@ -1,3 +1,7 @@
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ message(FATAL_ERROR "TextBalloon should be built as part of the 'painteditem' project, and not in isolation.")
+endif()
+
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quick/customitems/painteditem/TextBalloon")
qt_add_qml_module(qmltextballoon