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 /src/corelib/Qt5CoreMacros.cmake | |
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 'src/corelib/Qt5CoreMacros.cmake')
-rw-r--r-- | src/corelib/Qt5CoreMacros.cmake | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 8d4943aa3f..7b4c7e9d3b 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -390,12 +390,19 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) endif() function(add_qt_gui_executable target) - add_executable(${ARGV}) + if(ANDROID) + add_library("${target}" MODULE ${ARGN}) + else() + add_executable("${target}" WIN32 MACOSX_BUNDLE ${ARGN}) + endif() target_link_libraries("${target}" PRIVATE Qt::Core Qt::Gui) - list(FIND ARGV WIN32 WIN32_OPTION_IDX) - if(WIN32 AND NOT WIN32_OPTION_IDX EQUAL -1) + if(WIN32) target_link_libraries("${target}" PRIVATE Qt::WinMain) endif() + + if(ANDROID) + qt_android_generate_deployment_settings("${target}") + endif() endfunction() |