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/corelib/threads | |
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/corelib/threads')
4 files changed, 6 insertions, 2 deletions
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}" ) |