summaryrefslogtreecommitdiffstats
path: root/examples/sql
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-12 10:21:40 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-12 14:19:53 +0000
commitefa9998521cb061051fe8b75d0df3206d0b32ec5 (patch)
tree814ad216d5360cea3397a22ed1d649821d76fb17 /examples/sql
parent6732fa3a291e77acad3ab6ba829d1026462dc139 (diff)
Fix compiling of examples on Android
* Simplify add_qt_gui_executable() to not require WIN32/MACOSX_BUNDLE but provide it implicitly. It's redundant :) * When on Android, build a module (shared library), just like qmake. This requires an additional library destination in the install() call, but that's ignored on other platforms. * Fix typos in the android deployment generation settings function * Use the correct cache variable to determine whether we're inside a Qt build or not. Right now this only works inside Qt builds anyway as QtPlatformAndroid.cmake is not publically accessible. Change-Id: If1c763c31a7a83d0e0d854362ba7901657f63eb5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'examples/sql')
-rw-r--r--examples/sql/books/CMakeLists.txt3
-rw-r--r--examples/sql/cachedtable/CMakeLists.txt3
-rw-r--r--examples/sql/drilldown/CMakeLists.txt3
-rw-r--r--examples/sql/masterdetail/CMakeLists.txt3
-rw-r--r--examples/sql/querymodel/CMakeLists.txt3
-rw-r--r--examples/sql/relationaltablemodel/CMakeLists.txt3
-rw-r--r--examples/sql/sqlbrowser/CMakeLists.txt3
-rw-r--r--examples/sql/sqlwidgetmapper/CMakeLists.txt3
-rw-r--r--examples/sql/tablemodel/CMakeLists.txt3
9 files changed, 18 insertions, 9 deletions
diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt
index cfee3e237d..e9044e34b8 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_qt_gui_executable(books WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(books
bookdelegate.cpp bookdelegate.h
books.qrc
bookwindow.cpp bookwindow.h bookwindow.ui
@@ -32,4 +32,5 @@ target_link_libraries(books PUBLIC
install(TARGETS books
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt
index 16ef886b1c..f3341791a1 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_qt_gui_executable(cachedtable WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(cachedtable
../connection.h
main.cpp
tableeditor.cpp tableeditor.h
@@ -27,4 +27,5 @@ target_link_libraries(cachedtable PUBLIC
install(TARGETS cachedtable
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt
index ed411d1ca3..97a2620209 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_qt_gui_executable(drilldown WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(drilldown
../connection.h
drilldown.qrc
imageitem.cpp imageitem.h
@@ -30,4 +30,5 @@ target_link_libraries(drilldown PUBLIC
install(TARGETS drilldown
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt
index 832cbdea8b..59ce1eb77d 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_qt_gui_executable(masterdetail WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(masterdetail
database.h
dialog.cpp dialog.h
main.cpp
@@ -31,4 +31,5 @@ target_link_libraries(masterdetail PUBLIC
install(TARGETS masterdetail
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt
index 6dc59a4bb7..1f7bb512fc 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_qt_gui_executable(querymodel WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(querymodel
../connection.h
customsqlmodel.cpp customsqlmodel.h
editablesqlmodel.cpp editablesqlmodel.h
@@ -28,4 +28,5 @@ target_link_libraries(querymodel PUBLIC
install(TARGETS querymodel
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt
index 0d35a9abdb..6a9840b9df 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_qt_gui_executable(relationaltablemodel WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(relationaltablemodel
../connection.h
relationaltablemodel.cpp
)
@@ -26,4 +26,5 @@ target_link_libraries(relationaltablemodel PUBLIC
install(TARGETS relationaltablemodel
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt
index f52de00ce6..3f4d7cf908 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_qt_gui_executable(sqlbrowser WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(sqlbrowser
browser.cpp browser.h
browserwidget.ui
connectionwidget.cpp connectionwidget.h
@@ -29,4 +29,5 @@ target_link_libraries(sqlbrowser PUBLIC
install(TARGETS sqlbrowser
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt
index 48e68209c5..0ec052db0a 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_qt_gui_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(sqlwidgetmapper
main.cpp
window.cpp window.h
)
@@ -26,4 +26,5 @@ target_link_libraries(sqlwidgetmapper PUBLIC
install(TARGETS sqlwidgetmapper
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)
diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt
index fb7dbac927..8f7cfa3439 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_qt_gui_executable(tablemodel WIN32 MACOSX_BUNDLE
+add_qt_gui_executable(tablemodel
../connection.h
tablemodel.cpp
)
@@ -26,4 +26,5 @@ target_link_libraries(tablemodel PUBLIC
install(TARGETS tablemodel
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
)