diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-12 10:21:40 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-06-12 14:19:53 +0000 |
commit | efa9998521cb061051fe8b75d0df3206d0b32ec5 (patch) | |
tree | 814ad216d5360cea3397a22ed1d649821d76fb17 /examples/widgets/mainwindows | |
parent | 6732fa3a291e77acad3ab6ba829d1026462dc139 (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/widgets/mainwindows')
6 files changed, 12 insertions, 6 deletions
diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt index 090cac61c7..67b00de33a 100644 --- a/examples/widgets/mainwindows/application/CMakeLists.txt +++ b/examples/widgets/mainwindows/application/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(application WIN32 MACOSX_BUNDLE +add_qt_gui_executable(application application.qrc main.cpp mainwindow.cpp mainwindow.h @@ -25,4 +25,5 @@ target_link_libraries(application PUBLIC install(TARGETS application RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt index b3fe472db4..f07fbbcd9b 100644 --- a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt +++ b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) # special case -add_qt_gui_executable(dockwidgets WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dockwidgets dockwidgets.qrc main.cpp mainwindow.cpp mainwindow.h @@ -31,4 +31,5 @@ endif() install(TARGETS dockwidgets RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt index 15824de79c..63fe927e92 100644 --- a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt +++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mainwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mainwindow colorswatch.cpp colorswatch.h main.cpp mainwindow.cpp mainwindow.h mainwindow.qrc @@ -26,4 +26,5 @@ target_link_libraries(mainwindow PUBLIC install(TARGETS mainwindow RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt index fda2522b90..806e96ed14 100644 --- a/examples/widgets/mainwindows/mdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mdi WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mdi main.cpp mainwindow.cpp mainwindow.h mdi.qrc @@ -26,4 +26,5 @@ target_link_libraries(mdi PUBLIC install(TARGETS mdi RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt index 1e4d21248e..92c6fd2284 100644 --- a/examples/widgets/mainwindows/menus/CMakeLists.txt +++ b/examples/widgets/mainwindows/menus/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(menus WIN32 MACOSX_BUNDLE +add_qt_gui_executable(menus main.cpp mainwindow.cpp mainwindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(menus PUBLIC install(TARGETS menus RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt index 89c929fc5e..be09a0c240 100644 --- a/examples/widgets/mainwindows/sdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sdi WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sdi main.cpp mainwindow.cpp mainwindow.h sdi.qrc @@ -25,4 +25,5 @@ target_link_libraries(sdi PUBLIC install(TARGETS sdi RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) |