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/corelib/ipc/localfortuneclient/CMakeLists.txt | 3 ++- examples/corelib/ipc/localfortuneserver/CMakeLists.txt | 3 ++- examples/corelib/ipc/sharedmemory/CMakeLists.txt | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'examples/corelib/ipc') diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt index a171965bbb..a49a5451dd 100644 --- a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(localfortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(localfortuneclient client.cpp client.h main.cpp ) @@ -25,4 +25,5 @@ target_link_libraries(localfortuneclient PUBLIC install(TARGETS localfortuneclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt index 5804aa69fa..48dec3318d 100644 --- a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(localfortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(localfortuneserver main.cpp server.cpp server.h ) @@ -25,4 +25,5 @@ target_link_libraries(localfortuneserver PUBLIC install(TARGETS localfortuneserver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt index 55f42ada88..c63cf569bd 100644 --- a/examples/corelib/ipc/sharedmemory/CMakeLists.txt +++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sharedmemory WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sharedmemory dialog.cpp dialog.h dialog.ui main.cpp ) @@ -23,4 +23,5 @@ target_link_libraries(sharedmemory PUBLIC install(TARGETS sharedmemory RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) -- cgit v1.2.3