summaryrefslogtreecommitdiffstats
path: root/examples/sql
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/sql
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/sql')
-rw-r--r--examples/sql/books/CMakeLists.txt2
-rw-r--r--examples/sql/cachedtable/CMakeLists.txt2
-rw-r--r--examples/sql/drilldown/CMakeLists.txt2
-rw-r--r--examples/sql/masterdetail/CMakeLists.txt2
-rw-r--r--examples/sql/querymodel/CMakeLists.txt2
-rw-r--r--examples/sql/relationaltablemodel/CMakeLists.txt2
-rw-r--r--examples/sql/sqlbrowser/CMakeLists.txt2
-rw-r--r--examples/sql/sqlwidgetmapper/CMakeLists.txt2
-rw-r--r--examples/sql/tablemodel/CMakeLists.txt2
9 files changed, 9 insertions, 9 deletions
diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt
index 294a764a9b..cfee3e237d 100644
--- a/examples/sql/books/CMakeLists.txt
+++ b/examples/sql/books/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(books WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(books WIN32 MACOSX_BUNDLE
bookdelegate.cpp bookdelegate.h
books.qrc
bookwindow.cpp bookwindow.h bookwindow.ui
diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt
index 3ccea061ff..16ef886b1c 100644
--- a/examples/sql/cachedtable/CMakeLists.txt
+++ b/examples/sql/cachedtable/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(cachedtable WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(cachedtable WIN32 MACOSX_BUNDLE
../connection.h
main.cpp
tableeditor.cpp tableeditor.h
diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt
index b8fab77b0c..ed411d1ca3 100644
--- a/examples/sql/drilldown/CMakeLists.txt
+++ b/examples/sql/drilldown/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(drilldown WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(drilldown WIN32 MACOSX_BUNDLE
../connection.h
drilldown.qrc
imageitem.cpp imageitem.h
diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt
index d1f4883da1..832cbdea8b 100644
--- a/examples/sql/masterdetail/CMakeLists.txt
+++ b/examples/sql/masterdetail/CMakeLists.txt
@@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
find_package(Qt5 COMPONENTS Xml)
-add_executable(masterdetail WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(masterdetail WIN32 MACOSX_BUNDLE
database.h
dialog.cpp dialog.h
main.cpp
diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt
index 7f617c7c33..6dc59a4bb7 100644
--- a/examples/sql/querymodel/CMakeLists.txt
+++ b/examples/sql/querymodel/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(querymodel WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(querymodel WIN32 MACOSX_BUNDLE
../connection.h
customsqlmodel.cpp customsqlmodel.h
editablesqlmodel.cpp editablesqlmodel.h
diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt
index de4dba49cc..0d35a9abdb 100644
--- a/examples/sql/relationaltablemodel/CMakeLists.txt
+++ b/examples/sql/relationaltablemodel/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(relationaltablemodel WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(relationaltablemodel WIN32 MACOSX_BUNDLE
../connection.h
relationaltablemodel.cpp
)
diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt
index dee4d4a58e..f52de00ce6 100644
--- a/examples/sql/sqlbrowser/CMakeLists.txt
+++ b/examples/sql/sqlbrowser/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(sqlbrowser WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(sqlbrowser WIN32 MACOSX_BUNDLE
browser.cpp browser.h
browserwidget.ui
connectionwidget.cpp connectionwidget.h
diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt
index 586592fb18..48e68209c5 100644
--- a/examples/sql/sqlwidgetmapper/CMakeLists.txt
+++ b/examples/sql/sqlwidgetmapper/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE
main.cpp
window.cpp window.h
)
diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt
index 9972927166..fb7dbac927 100644
--- a/examples/sql/tablemodel/CMakeLists.txt
+++ b/examples/sql/tablemodel/CMakeLists.txt
@@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples")
find_package(Qt5 COMPONENTS Sql)
find_package(Qt5 COMPONENTS Widgets)
-add_executable(tablemodel WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(tablemodel WIN32 MACOSX_BUNDLE
../connection.h
tablemodel.cpp
)