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/widgets/richtext/calendar/CMakeLists.txt | 3 ++- examples/widgets/richtext/orderform/CMakeLists.txt | 3 ++- examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt | 3 ++- examples/widgets/richtext/textedit/CMakeLists.txt | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'examples/widgets/richtext') diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt index 803deb9243..f0ce5defc9 100644 --- a/examples/widgets/richtext/calendar/CMakeLists.txt +++ b/examples/widgets/richtext/calendar/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(calendar WIN32 MACOSX_BUNDLE +add_qt_gui_executable(calendar main.cpp mainwindow.cpp mainwindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(calendar PUBLIC install(TARGETS calendar RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/orderform/CMakeLists.txt b/examples/widgets/richtext/orderform/CMakeLists.txt index 4fc3c57919..12406d183a 100644 --- a/examples/widgets/richtext/orderform/CMakeLists.txt +++ b/examples/widgets/richtext/orderform/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) -add_qt_gui_executable(orderform WIN32 MACOSX_BUNDLE +add_qt_gui_executable(orderform detailsdialog.cpp detailsdialog.h main.cpp mainwindow.cpp mainwindow.h @@ -29,4 +29,5 @@ endif() install(TARGETS orderform RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt index d70211e24c..96d824e559 100644 --- a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt +++ b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(syntaxhighlighter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(syntaxhighlighter highlighter.cpp highlighter.h main.cpp mainwindow.cpp mainwindow.h @@ -25,4 +25,5 @@ target_link_libraries(syntaxhighlighter PUBLIC install(TARGETS syntaxhighlighter RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/textedit/CMakeLists.txt b/examples/widgets/richtext/textedit/CMakeLists.txt index 602baa84f2..12b428c6c4 100644 --- a/examples/widgets/richtext/textedit/CMakeLists.txt +++ b/examples/widgets/richtext/textedit/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(textedit WIN32 MACOSX_BUNDLE +add_qt_gui_executable(textedit main.cpp textedit.cpp textedit.h textedit.qrc ) @@ -30,4 +30,5 @@ endif() install(TARGETS textedit RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) -- cgit v1.2.3