summaryrefslogtreecommitdiffstats
path: root/examples/dbus
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/dbus
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/dbus')
-rw-r--r--examples/dbus/chat/CMakeLists.txt2
-rw-r--r--examples/dbus/complexpingpong/CMakeLists.txt2
-rw-r--r--examples/dbus/listnames/CMakeLists.txt2
-rw-r--r--examples/dbus/pingpong/CMakeLists.txt2
-rw-r--r--examples/dbus/remotecontrolledcar/car/CMakeLists.txt2
-rw-r--r--examples/dbus/remotecontrolledcar/controller/CMakeLists.txt2
6 files changed, 6 insertions, 6 deletions
diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt
index 26388c51eb..85da98583c 100644
--- a/examples/dbus/chat/CMakeLists.txt
+++ b/examples/dbus/chat/CMakeLists.txt
@@ -27,7 +27,7 @@ qt5_add_dbus_adaptor(chat_SRCS
chat_adaptor
)
# special case end
-add_executable(chat WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(chat WIN32 MACOSX_BUNDLE
chat.cpp chat.h
chatmainwindow.ui
chatsetnickname.ui
diff --git a/examples/dbus/complexpingpong/CMakeLists.txt b/examples/dbus/complexpingpong/CMakeLists.txt
index 543af8491b..fb96f826b4 100644
--- a/examples/dbus/complexpingpong/CMakeLists.txt
+++ b/examples/dbus/complexpingpong/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS DBus)
-add_executable(complexpong WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(complexpong WIN32 MACOSX_BUNDLE
complexpong.cpp complexpong.h
)
target_link_libraries(complexpong PUBLIC
diff --git a/examples/dbus/listnames/CMakeLists.txt b/examples/dbus/listnames/CMakeLists.txt
index 5fe935f24a..c888a1df49 100644
--- a/examples/dbus/listnames/CMakeLists.txt
+++ b/examples/dbus/listnames/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS DBus)
-add_executable(listnames WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(listnames WIN32 MACOSX_BUNDLE
listnames.cpp
)
target_link_libraries(listnames PUBLIC
diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt
index e82fe78c51..1e93e3cef3 100644
--- a/examples/dbus/pingpong/CMakeLists.txt
+++ b/examples/dbus/pingpong/CMakeLists.txt
@@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS DBus)
-add_executable(pong WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(pong WIN32 MACOSX_BUNDLE
ping-common.h
pong.cpp pong.h
)
diff --git a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt
index 9532d0ccee..cee3b2bb50 100644
--- a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt
+++ b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt
@@ -23,7 +23,7 @@ qt5_add_dbus_adaptor(car_SRCS
car_adaptor
)
# special case end
-add_executable(car WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(car WIN32 MACOSX_BUNDLE
car.cpp car.h
main.cpp
${car_SRCS} # special case
diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
index 00bf809392..ee97e0d1e4 100644
--- a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
+++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt
@@ -21,7 +21,7 @@ qt5_add_dbus_interface(controller_SRCS
car_interface
)
# special case end
-add_executable(controller WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(controller WIN32 MACOSX_BUNDLE
controller.cpp controller.h controller.ui
main.cpp
${controller_SRCS} # special case