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/layouts/basiclayouts/CMakeLists.txt | 3 ++- examples/widgets/layouts/borderlayout/CMakeLists.txt | 3 ++- examples/widgets/layouts/dynamiclayouts/CMakeLists.txt | 3 ++- examples/widgets/layouts/flowlayout/CMakeLists.txt | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'examples/widgets/layouts') diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt index 927cbd7520..374d66bdf4 100644 --- a/examples/widgets/layouts/basiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(basiclayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basiclayouts dialog.cpp dialog.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(basiclayouts PUBLIC install(TARGETS basiclayouts RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt index 74e867f6f1..1cdaa5738f 100644 --- a/examples/widgets/layouts/borderlayout/CMakeLists.txt +++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(borderlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(borderlayout borderlayout.cpp borderlayout.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(borderlayout PUBLIC install(TARGETS borderlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt index fad7509823..a10fc71f26 100644 --- a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dynamiclayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dynamiclayouts dialog.cpp dialog.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(dynamiclayouts PUBLIC install(TARGETS dynamiclayouts RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt index b8257d9b4c..56cc086a70 100644 --- a/examples/widgets/layouts/flowlayout/CMakeLists.txt +++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(flowlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flowlayout flowlayout.cpp flowlayout.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(flowlayout PUBLIC install(TARGETS flowlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) -- cgit v1.2.3