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/widgets/touch | |
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/widgets/touch')
-rw-r--r-- | examples/widgets/touch/dials/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/widgets/touch/fingerpaint/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/widgets/touch/knobs/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/widgets/touch/pinchzoom/CMakeLists.txt | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt index fa31852b3d..2bfe6b78cf 100644 --- a/examples/widgets/touch/dials/CMakeLists.txt +++ b/examples/widgets/touch/dials/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dials WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dials dials.ui main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(dials PUBLIC install(TARGETS dials RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt index 606e6bbc64..4ba2710e67 100644 --- a/examples/widgets/touch/fingerpaint/CMakeLists.txt +++ b/examples/widgets/touch/fingerpaint/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) # special case -add_qt_gui_executable(fingerpaint WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fingerpaint main.cpp mainwindow.cpp mainwindow.h scribblearea.cpp scribblearea.h @@ -31,4 +31,5 @@ endif() install(TARGETS fingerpaint RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt index c23a11f024..55f9820f68 100644 --- a/examples/widgets/touch/knobs/CMakeLists.txt +++ b/examples/widgets/touch/knobs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(knobs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(knobs knob.cpp knob.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(knobs PUBLIC install(TARGETS knobs RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt index 44951db727..f0cece0acd 100644 --- a/examples/widgets/touch/pinchzoom/CMakeLists.txt +++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(pinchzoom WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pinchzoom graphicsview.cpp graphicsview.h main.cpp mice.qrc @@ -26,4 +26,5 @@ target_link_libraries(pinchzoom PUBLIC install(TARGETS pinchzoom RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) |