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/embedded | |
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/embedded')
-rw-r--r-- | examples/embedded/digiflip/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/embedded/flickable/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/embedded/flightinfo/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/embedded/lightmaps/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/embedded/raycasting/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/embedded/styleexample/CMakeLists.txt | 3 |
6 files changed, 12 insertions, 6 deletions
diff --git a/examples/embedded/digiflip/CMakeLists.txt b/examples/embedded/digiflip/CMakeLists.txt index ee20c34c11..340dc34859 100644 --- a/examples/embedded/digiflip/CMakeLists.txt +++ b/examples/embedded/digiflip/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(digiflip WIN32 MACOSX_BUNDLE +add_qt_gui_executable(digiflip digiflip.cpp ) target_link_libraries(digiflip PUBLIC @@ -22,4 +22,5 @@ target_link_libraries(digiflip PUBLIC install(TARGETS digiflip RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/flickable/CMakeLists.txt b/examples/embedded/flickable/CMakeLists.txt index c71699b693..cc2611cc1b 100644 --- a/examples/embedded/flickable/CMakeLists.txt +++ b/examples/embedded/flickable/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(flickable WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flickable flickable.cpp flickable.h main.cpp ) @@ -23,4 +23,5 @@ target_link_libraries(flickable PUBLIC install(TARGETS flickable RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/flightinfo/CMakeLists.txt b/examples/embedded/flightinfo/CMakeLists.txt index e905531114..4415ab91b5 100644 --- a/examples/embedded/flightinfo/CMakeLists.txt +++ b/examples/embedded/flightinfo/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(flightinfo WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flightinfo flightinfo.cpp form.ui flightinfo.qrc # special case: add @@ -26,4 +26,5 @@ target_link_libraries(flightinfo PUBLIC install(TARGETS flightinfo RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/lightmaps/CMakeLists.txt b/examples/embedded/lightmaps/CMakeLists.txt index ea7239b7ac..3a3ab6fd43 100644 --- a/examples/embedded/lightmaps/CMakeLists.txt +++ b/examples/embedded/lightmaps/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(lightmaps WIN32 MACOSX_BUNDLE +add_qt_gui_executable(lightmaps lightmaps.cpp lightmaps.h main.cpp mapzoom.cpp mapzoom.h @@ -27,4 +27,5 @@ target_link_libraries(lightmaps PUBLIC install(TARGETS lightmaps RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/raycasting/CMakeLists.txt b/examples/embedded/raycasting/CMakeLists.txt index d27dbbe7a4..64844bca56 100644 --- a/examples/embedded/raycasting/CMakeLists.txt +++ b/examples/embedded/raycasting/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(raycasting WIN32 MACOSX_BUNDLE +add_qt_gui_executable(raycasting raycasting.cpp raycasting.qrc ) target_link_libraries(raycasting PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(raycasting PUBLIC install(TARGETS raycasting RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/styleexample/CMakeLists.txt b/examples/embedded/styleexample/CMakeLists.txt index 34ab6e4a22..44b9a8ae1e 100644 --- a/examples/embedded/styleexample/CMakeLists.txt +++ b/examples/embedded/styleexample/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(styleexample WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styleexample main.cpp stylewidget.cpp stylewidget.h stylewidget.ui styleexample.qrc # special case: add @@ -24,4 +24,5 @@ target_link_libraries(styleexample PUBLIC install(TARGETS styleexample RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) |