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/statemachine | |
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/statemachine')
6 files changed, 10 insertions, 4 deletions
diff --git a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt index 21372f8856..902bc009d0 100644 --- a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt +++ b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(eventtransitions WIN32 MACOSX_BUNDLE +add_qt_gui_executable(eventtransitions main.cpp ) target_link_libraries(eventtransitions PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(eventtransitions PUBLIC install(TARGETS eventtransitions RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/factorial/CMakeLists.txt b/examples/widgets/statemachine/factorial/CMakeLists.txt index e383225705..e7eba926c4 100644 --- a/examples/widgets/statemachine/factorial/CMakeLists.txt +++ b/examples/widgets/statemachine/factorial/CMakeLists.txt @@ -23,4 +23,5 @@ target_link_libraries(factorial PUBLIC install(TARGETS factorial RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/pingpong/CMakeLists.txt b/examples/widgets/statemachine/pingpong/CMakeLists.txt index e3745a280d..7f255dd4d1 100644 --- a/examples/widgets/statemachine/pingpong/CMakeLists.txt +++ b/examples/widgets/statemachine/pingpong/CMakeLists.txt @@ -23,4 +23,5 @@ target_link_libraries(pingpong PUBLIC install(TARGETS pingpong RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/rogue/CMakeLists.txt b/examples/widgets/statemachine/rogue/CMakeLists.txt index 1ae6b511da..25ca4f45f1 100644 --- a/examples/widgets/statemachine/rogue/CMakeLists.txt +++ b/examples/widgets/statemachine/rogue/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(rogue WIN32 MACOSX_BUNDLE +add_qt_gui_executable(rogue main.cpp movementtransition.h window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(rogue PUBLIC install(TARGETS rogue RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/trafficlight/CMakeLists.txt b/examples/widgets/statemachine/trafficlight/CMakeLists.txt index 0122fa72cd..89f05f22ff 100644 --- a/examples/widgets/statemachine/trafficlight/CMakeLists.txt +++ b/examples/widgets/statemachine/trafficlight/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(trafficlight WIN32 MACOSX_BUNDLE +add_qt_gui_executable(trafficlight main.cpp ) target_link_libraries(trafficlight PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(trafficlight PUBLIC install(TARGETS trafficlight RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt index 6c68cdd2fb..9c5bf3cb45 100644 --- a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt +++ b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(twowaybutton WIN32 MACOSX_BUNDLE +add_qt_gui_executable(twowaybutton main.cpp ) target_link_libraries(twowaybutton PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(twowaybutton PUBLIC install(TARGETS twowaybutton RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) |