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/itemviews | |
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/itemviews')
21 files changed, 42 insertions, 21 deletions
diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt index 2831e860a5..8b0b8c9a9c 100644 --- a/examples/widgets/itemviews/addressbook/CMakeLists.txt +++ b/examples/widgets/itemviews/addressbook/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(addressbook WIN32 MACOSX_BUNDLE +add_qt_gui_executable(addressbook adddialog.cpp adddialog.h addresswidget.cpp addresswidget.h main.cpp @@ -28,4 +28,5 @@ target_link_libraries(addressbook PUBLIC install(TARGETS addressbook RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt index 8c4d84431e..234ab0eb33 100644 --- a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt +++ b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(basicsortfiltermodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basicsortfiltermodel main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(basicsortfiltermodel PUBLIC install(TARGETS basicsortfiltermodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt index 7aceadab54..1032784203 100644 --- a/examples/widgets/itemviews/chart/CMakeLists.txt +++ b/examples/widgets/itemviews/chart/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(chart WIN32 MACOSX_BUNDLE +add_qt_gui_executable(chart chart.qrc main.cpp mainwindow.cpp mainwindow.h @@ -26,4 +26,5 @@ target_link_libraries(chart PUBLIC install(TARGETS chart RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt index e3cea3e235..d3648bf3e5 100644 --- a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt +++ b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(coloreditorfactory WIN32 MACOSX_BUNDLE +add_qt_gui_executable(coloreditorfactory colorlisteditor.cpp colorlisteditor.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(coloreditorfactory PUBLIC install(TARGETS coloreditorfactory RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt index 175f78e773..5134666a3a 100644 --- a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt +++ b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(combowidgetmapper WIN32 MACOSX_BUNDLE +add_qt_gui_executable(combowidgetmapper main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(combowidgetmapper PUBLIC install(TARGETS combowidgetmapper RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt index 2c3627657a..2981ea3d45 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt +++ b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(customsortfiltermodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customsortfiltermodel customsortfiltermodel.qrc filterwidget.cpp filterwidget.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(customsortfiltermodel PUBLIC install(TARGETS customsortfiltermodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt index 105d420f1a..818fe8323e 100644 --- a/examples/widgets/itemviews/dirview/CMakeLists.txt +++ b/examples/widgets/itemviews/dirview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dirview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dirview main.cpp ) target_link_libraries(dirview PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(dirview PUBLIC install(TARGETS dirview RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt index f3e574c811..d0bc1ea930 100644 --- a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt +++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(editabletreemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(editabletreemodel editabletreemodel.qrc main.cpp mainwindow.cpp mainwindow.h mainwindow.ui @@ -27,4 +27,5 @@ target_link_libraries(editabletreemodel PUBLIC install(TARGETS editabletreemodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt index be2771970a..3880c61078 100644 --- a/examples/widgets/itemviews/fetchmore/CMakeLists.txt +++ b/examples/widgets/itemviews/fetchmore/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(fetchmore WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fetchmore filelistmodel.cpp filelistmodel.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(fetchmore PUBLIC install(TARGETS fetchmore RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt index b026b2442f..792287ff32 100644 --- a/examples/widgets/itemviews/flattreeview/CMakeLists.txt +++ b/examples/widgets/itemviews/flattreeview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(flattreeview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flattreeview main.cpp ) target_link_libraries(flattreeview PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(flattreeview PUBLIC install(TARGETS flattreeview RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt index fee5570bd6..a075fdc460 100644 --- a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt +++ b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(frozencolumn WIN32 MACOSX_BUNDLE +add_qt_gui_executable(frozencolumn freezetablewidget.cpp freezetablewidget.h grades.qrc main.cpp @@ -25,4 +25,5 @@ target_link_libraries(frozencolumn PUBLIC install(TARGETS frozencolumn RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt index 76a145c7d8..6da99388d1 100644 --- a/examples/widgets/itemviews/interview/CMakeLists.txt +++ b/examples/widgets/itemviews/interview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(interview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(interview interview.qrc main.cpp model.cpp model.h @@ -25,4 +25,5 @@ target_link_libraries(interview PUBLIC install(TARGETS interview RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt index e3e3388ba9..53f014d39a 100644 --- a/examples/widgets/itemviews/pixelator/CMakeLists.txt +++ b/examples/widgets/itemviews/pixelator/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(pixelator WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pixelator imagemodel.cpp imagemodel.h images.qrc main.cpp @@ -33,4 +33,5 @@ endif() install(TARGETS pixelator RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt index 77abd09eaf..e54d9dc770 100644 --- a/examples/widgets/itemviews/puzzle/CMakeLists.txt +++ b/examples/widgets/itemviews/puzzle/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(itemviews_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle +add_qt_gui_executable(itemviews_puzzle # special case: renamed puzzle main.cpp mainwindow.cpp mainwindow.h piecesmodel.cpp piecesmodel.h @@ -27,4 +27,5 @@ target_link_libraries(itemviews_puzzle PUBLIC # special case: renamed puzzle install(TARGETS itemviews_puzzle # special case: renamed puzzle RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt index 3573eca461..a77e654362 100644 --- a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt +++ b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(simpledommodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simpledommodel domitem.cpp domitem.h dommodel.cpp dommodel.h main.cpp @@ -28,4 +28,5 @@ target_link_libraries(simpledommodel PUBLIC install(TARGETS simpledommodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt index 34c59d55ae..dc3934abfa 100644 --- a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt +++ b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(simpletreemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simpletreemodel main.cpp simpletreemodel.qrc treeitem.cpp treeitem.h @@ -26,4 +26,5 @@ target_link_libraries(simpletreemodel PUBLIC install(TARGETS simpletreemodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt index dedf063b5f..69030f6398 100644 --- a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt +++ b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(simplewidgetmapper WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simplewidgetmapper main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(simplewidgetmapper PUBLIC install(TARGETS simplewidgetmapper RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt index ed2ebc8ab3..333a86faf7 100644 --- a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt +++ b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(spinboxdelegate WIN32 MACOSX_BUNDLE +add_qt_gui_executable(spinboxdelegate delegate.cpp delegate.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(spinboxdelegate PUBLIC install(TARGETS spinboxdelegate RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt index 7e3676e780..5c91eea5e3 100644 --- a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt +++ b/examples/widgets/itemviews/spreadsheet/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(spreadsheet WIN32 MACOSX_BUNDLE +add_qt_gui_executable(spreadsheet main.cpp printview.cpp printview.h spreadsheet.cpp spreadsheet.h spreadsheet.qrc @@ -33,4 +33,5 @@ endif() install(TARGETS spreadsheet RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt index 0d3bc684f8..39125cf76f 100644 --- a/examples/widgets/itemviews/stardelegate/CMakeLists.txt +++ b/examples/widgets/itemviews/stardelegate/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(stardelegate WIN32 MACOSX_BUNDLE +add_qt_gui_executable(stardelegate main.cpp stardelegate.cpp stardelegate.h stareditor.cpp stareditor.h @@ -26,4 +26,5 @@ target_link_libraries(stardelegate PUBLIC install(TARGETS stardelegate RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt index b254a217bc..56cb5a1e10 100644 --- a/examples/widgets/itemviews/storageview/CMakeLists.txt +++ b/examples/widgets/itemviews/storageview/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Core) find_package(Qt5 COMPONENTS Gui) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(storageview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(storageview main.cpp storagemodel.cpp storagemodel.h ) @@ -28,4 +28,5 @@ target_link_libraries(storageview PUBLIC install(TARGETS storageview RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) |