From fe59c788a65579bbeeb550fcad96cf26443df77a Mon Sep 17 00:00:00 2001 From: Oliver Eftevaag Date: Mon, 4 Oct 2021 23:38:05 +0200 Subject: 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 --- examples/quick/customitems/painteditem/TextBalloon/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'examples') 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 -- cgit v1.2.3