From efa9998521cb061051fe8b75d0df3206d0b32ec5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jun 2019 10:21:40 +0200 Subject: 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 Reviewed-by: Qt CMake Build Bot --- examples/widgets/tools/codecs/CMakeLists.txt | 3 ++- examples/widgets/tools/completer/CMakeLists.txt | 3 ++- examples/widgets/tools/customcompleter/CMakeLists.txt | 3 ++- examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt | 3 ++- examples/widgets/tools/i18n/CMakeLists.txt | 3 ++- examples/widgets/tools/plugandpaint/app/CMakeLists.txt | 3 ++- examples/widgets/tools/regexp/CMakeLists.txt | 3 ++- examples/widgets/tools/regularexpression/CMakeLists.txt | 3 ++- examples/widgets/tools/settingseditor/CMakeLists.txt | 3 ++- examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt | 3 ++- examples/widgets/tools/treemodelcompleter/CMakeLists.txt | 3 ++- examples/widgets/tools/undo/CMakeLists.txt | 3 ++- examples/widgets/tools/undoframework/CMakeLists.txt | 3 ++- 13 files changed, 26 insertions(+), 13 deletions(-) (limited to 'examples/widgets/tools') diff --git a/examples/widgets/tools/codecs/CMakeLists.txt b/examples/widgets/tools/codecs/CMakeLists.txt index 0bb5f37938..5a1f429788 100644 --- a/examples/widgets/tools/codecs/CMakeLists.txt +++ b/examples/widgets/tools/codecs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(codecs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(codecs codecs.qrc encodingdialog.cpp encodingdialog.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(codecs PUBLIC install(TARGETS codecs RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt index 8e86cc6b89..855fd54930 100644 --- a/examples/widgets/tools/completer/CMakeLists.txt +++ b/examples/widgets/tools/completer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(completer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(completer completer.qrc fsmodel.cpp fsmodel.h main.cpp @@ -26,4 +26,5 @@ target_link_libraries(completer PUBLIC install(TARGETS completer RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt index 7ac00d7345..22481eab5c 100644 --- a/examples/widgets/tools/customcompleter/CMakeLists.txt +++ b/examples/widgets/tools/customcompleter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(customcompleter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customcompleter customcompleter.qrc main.cpp mainwindow.cpp mainwindow.h @@ -26,4 +26,5 @@ target_link_libraries(customcompleter PUBLIC install(TARGETS customcompleter RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt index 20615d1e3b..bb5ec4c96a 100644 --- a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt +++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(echopluginwindow WIN32 MACOSX_BUNDLE # special case: renamed target +add_qt_gui_executable(echopluginwindow # special case: renamed target echointerface.h echowindow.cpp echowindow.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(echopluginwindow PUBLIC # special case: renamed target install(TARGETS echopluginwindow # special case: renamed target RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt index a0347d8453..45d51351ba 100644 --- a/examples/widgets/tools/i18n/CMakeLists.txt +++ b/examples/widgets/tools/i18n/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(i18n WIN32 MACOSX_BUNDLE +add_qt_gui_executable(i18n i18n.qrc languagechooser.cpp languagechooser.h main.cpp @@ -26,4 +26,5 @@ target_link_libraries(i18n PUBLIC install(TARGETS i18n RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt index a7c642a1be..54c6b15310 100644 --- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(plugandpaint WIN32 MACOSX_BUNDLE +add_qt_gui_executable(plugandpaint interfaces.h main.cpp mainwindow.cpp mainwindow.h @@ -30,4 +30,5 @@ target_link_libraries(plugandpaint PUBLIC pnp_basictools) # special case install(TARGETS plugandpaint RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/regexp/CMakeLists.txt b/examples/widgets/tools/regexp/CMakeLists.txt index 0b64cf06f8..8e3eb4abe8 100644 --- a/examples/widgets/tools/regexp/CMakeLists.txt +++ b/examples/widgets/tools/regexp/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(regexp WIN32 MACOSX_BUNDLE +add_qt_gui_executable(regexp main.cpp regexpdialog.cpp regexpdialog.h ) @@ -24,4 +24,5 @@ target_link_libraries(regexp PUBLIC install(TARGETS regexp RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt index a9ce374ce2..dcd69756b4 100644 --- a/examples/widgets/tools/regularexpression/CMakeLists.txt +++ b/examples/widgets/tools/regularexpression/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(regularexpression WIN32 MACOSX_BUNDLE +add_qt_gui_executable(regularexpression main.cpp regularexpression.qrc regularexpressiondialog.cpp regularexpressiondialog.h @@ -25,4 +25,5 @@ target_link_libraries(regularexpression PUBLIC install(TARGETS regularexpression RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt index 49a014e359..77177beadd 100644 --- a/examples/widgets/tools/settingseditor/CMakeLists.txt +++ b/examples/widgets/tools/settingseditor/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(settingseditor WIN32 MACOSX_BUNDLE +add_qt_gui_executable(settingseditor locationdialog.cpp locationdialog.h main.cpp mainwindow.cpp mainwindow.h @@ -27,4 +27,5 @@ target_link_libraries(settingseditor PUBLIC install(TARGETS settingseditor RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt index 6e47082471..f23d53c3aa 100644 --- a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt +++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(styleplugin WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styleplugin main.cpp stylewindow.cpp stylewindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(styleplugin PUBLIC install(TARGETS styleplugin RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt index 9fa16e06dd..d8f3dff929 100644 --- a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt +++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(treemodelcompleter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(treemodelcompleter main.cpp mainwindow.cpp mainwindow.h treemodelcompleter.cpp treemodelcompleter.h treemodelcompleter.qrc @@ -25,4 +25,5 @@ target_link_libraries(treemodelcompleter PUBLIC install(TARGETS treemodelcompleter RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt index bc4a876211..c8188b8f0f 100644 --- a/examples/widgets/tools/undo/CMakeLists.txt +++ b/examples/widgets/tools/undo/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(undo WIN32 MACOSX_BUNDLE +add_qt_gui_executable(undo commands.cpp commands.h document.cpp document.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(undo PUBLIC install(TARGETS undo RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt index 064cb65150..27672edd82 100644 --- a/examples/widgets/tools/undoframework/CMakeLists.txt +++ b/examples/widgets/tools/undoframework/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(undoframework WIN32 MACOSX_BUNDLE +add_qt_gui_executable(undoframework commands.cpp commands.h diagramitem.cpp diagramitem.h diagramscene.cpp diagramscene.h @@ -28,4 +28,5 @@ target_link_libraries(undoframework PUBLIC install(TARGETS undoframework RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) -- cgit v1.2.3