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/threads/mandelbrot/CMakeLists.txt | 3 ++- examples/corelib/threads/queuedcustomtype/CMakeLists.txt | 3 ++- examples/corelib/threads/semaphores/CMakeLists.txt | 1 + examples/corelib/threads/waitconditions/CMakeLists.txt | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'examples/corelib/threads') diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt index cc0385a9ce..1d4e7eaf4d 100644 --- a/examples/corelib/threads/mandelbrot/CMakeLists.txt +++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mandelbrot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mandelbrot main.cpp mandelbrotwidget.cpp mandelbrotwidget.h renderthread.cpp renderthread.h @@ -24,4 +24,5 @@ target_link_libraries(mandelbrot PUBLIC install(TARGETS mandelbrot RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt index ef07b36301..3351018d72 100644 --- a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt +++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(queuedcustomtype WIN32 MACOSX_BUNDLE +add_qt_gui_executable(queuedcustomtype block.cpp block.h main.cpp renderthread.cpp renderthread.h @@ -25,4 +25,5 @@ target_link_libraries(queuedcustomtype PUBLIC install(TARGETS queuedcustomtype RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/semaphores/CMakeLists.txt b/examples/corelib/threads/semaphores/CMakeLists.txt index 51638e0ff8..45959f0c54 100644 --- a/examples/corelib/threads/semaphores/CMakeLists.txt +++ b/examples/corelib/threads/semaphores/CMakeLists.txt @@ -22,4 +22,5 @@ target_link_libraries(semaphores PUBLIC install(TARGETS semaphores RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/waitconditions/CMakeLists.txt b/examples/corelib/threads/waitconditions/CMakeLists.txt index 4d3e61050c..ee351493cc 100644 --- a/examples/corelib/threads/waitconditions/CMakeLists.txt +++ b/examples/corelib/threads/waitconditions/CMakeLists.txt @@ -22,4 +22,5 @@ target_link_libraries(waitconditions PUBLIC install(TARGETS waitconditions RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) -- cgit v1.2.3