summaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-11 15:46:31 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-12 14:19:34 +0000
commit6732fa3a291e77acad3ab6ba829d1026462dc139 (patch)
treeeae7522ffebf148907ff58421ea4681e7726f99a /examples/widgets/graphicsview
parent82840d2660202c6d8f3c53ad1d620667901cb954 (diff)
Fix linking of examples
Provide add_qt_gui_executable() as function in our public API that takes care of automaticWinMain linkage. We can use this in the future to encapsulate similarplatform-specific behavior and adjustments, such as module generation onAndroid. In order for the examples to see the function in Qt5CoreMacros, three more additional fixes were required: * Do the build_repo_end() call _before_ attempting to build the examples, as we need the build_repo_end() to include QtPostProcess and complete the creation of all the target config files. Otherwise the find_package() calls in the examples see something incomplete. * Add more QT_NO_CREATE_TARGET guards * Always call find_dependency on the dependencies, regardless of the target creation mode. This way a find_package(Qt5 COMPONENTS Widgets) will still load Qt5CoreMacros. Change-Id: I03ce856e2f4312a050fe8043b8331cbe8a6c93e6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/widgets/graphicsview')
-rw-r--r--examples/widgets/graphicsview/anchorlayout/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/boxes/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/chip/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/collidingmice/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/diagramscene/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/elasticnodes/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/flowlayout/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt2
-rw-r--r--examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt2
12 files changed, 12 insertions, 12 deletions
diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
index 1488f394c6..9676dbbcba 100644
--- a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(anchorlayout WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(anchorlayout WIN32 MACOSX_BUNDLE
main.cpp
)
target_link_libraries(anchorlayout PUBLIC
diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
index 0ce632e6b6..982fd541c6 100644
--- a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
+++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(basicgraphicslayouts WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(basicgraphicslayouts WIN32 MACOSX_BUNDLE
basicgraphicslayouts.qrc
layoutitem.cpp layoutitem.h
main.cpp
diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt
index 4e1d105a3a..b5441bcfdf 100644
--- a/examples/widgets/graphicsview/boxes/CMakeLists.txt
+++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt
@@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS OpenGL)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(boxes WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(boxes WIN32 MACOSX_BUNDLE
3rdparty/fbm.c 3rdparty/fbm.h
boxes.qrc
glbuffers.cpp glbuffers.h
diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt
index 81f290be99..141645a22c 100644
--- a/examples/widgets/graphicsview/chip/CMakeLists.txt
+++ b/examples/widgets/graphicsview/chip/CMakeLists.txt
@@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Widgets)
find_package(Qt5 COMPONENTS OpenGL) # special case
find_package(Qt5 COMPONENTS PrintSupport) # special case
-add_executable(chip WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(chip WIN32 MACOSX_BUNDLE
chip.cpp chip.h
images.qrc
main.cpp
diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
index 36b1fb85c1..9001858817 100644
--- a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
+++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(collidingmice WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(collidingmice WIN32 MACOSX_BUNDLE
main.cpp
mice.qrc
mouse.cpp mouse.h
diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
index 76f60aabaa..bfdd3b8f5b 100644
--- a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
+++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(diagramscene WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(diagramscene WIN32 MACOSX_BUNDLE
arrow.cpp arrow.h
diagramitem.cpp diagramitem.h
diagramscene.cpp diagramscene.h diagramscene.qrc
diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
index 2adcff3ae5..d85dcd1ff9 100644
--- a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
+++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(dragdroprobot WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(dragdroprobot WIN32 MACOSX_BUNDLE
coloritem.cpp coloritem.h
main.cpp
robot.cpp robot.h robot.qrc
diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
index 42fd71fa5f..b1e04b2a20 100644
--- a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
+++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(elasticnodes WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(elasticnodes WIN32 MACOSX_BUNDLE
edge.cpp edge.h
graphwidget.cpp graphwidget.h
main.cpp
diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
index 2652b985df..fc9f6086ce 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
+++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(embeddeddialogs WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(embeddeddialogs WIN32 MACOSX_BUNDLE
customproxy.cpp customproxy.h
embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui
embeddeddialogs.qrc
diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
index 96b82b7955..ef5a4d5564 100644
--- a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(graphicsview_flowlayout WIN32 MACOSX_BUNDLE # special case: renamed flowlayout
+add_qt_gui_executable(graphicsview_flowlayout WIN32 MACOSX_BUNDLE # special case: renamed flowlayout
flowlayout.cpp flowlayout.h
main.cpp
window.cpp window.h
diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
index afb35675d8..bc1564cb8c 100644
--- a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(simpleanchorlayout WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(simpleanchorlayout WIN32 MACOSX_BUNDLE
main.cpp
)
target_link_libraries(simpleanchorlayout PUBLIC
diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
index 750352e325..22e92cc68b 100644
--- a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
+++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Widgets)
-add_executable(weatheranchorlayout WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(weatheranchorlayout WIN32 MACOSX_BUNDLE
main.cpp
weatheranchorlayout.qrc
)