From 345e6b0213b1273b698163064f80d33bc7ce64a9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 12 Oct 2018 10:33:12 +0200 Subject: [PATCH 0001/1322] Set qlogging test helper executable name via define In the cmake port the helper executable may have a different name. Change-Id: I0af68e73253c7f0e6680ca6f10a6ae25e336e923 --- tests/auto/corelib/global/qlogging/test/test.pro | 1 + tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/global/qlogging/test/test.pro b/tests/auto/corelib/global/qlogging/test/test.pro index 91896d44949..81445247e09 100644 --- a/tests/auto/corelib/global/qlogging/test/test.pro +++ b/tests/auto/corelib/global/qlogging/test/test.pro @@ -19,3 +19,4 @@ SOURCES = ../tst_qlogging.cpp DEFINES += QT_MESSAGELOGCONTEXT DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 +DEFINES += HELPER_BINARY=\\\"helper\\\" diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index d3ed1a6d0d6..9df54e17d32 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -822,7 +822,7 @@ void tst_qmessagehandler::qMessagePattern() QProcess process; #ifndef Q_OS_ANDROID - const QString appExe(QLatin1String("helper")); + const QString appExe(QLatin1String(HELPER_BINARY)); #else const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so")); #endif @@ -872,7 +872,7 @@ void tst_qmessagehandler::setMessagePattern() QProcess process; #ifndef Q_OS_ANDROID - const QString appExe(QLatin1String("helper")); + const QString appExe(QLatin1String(HELPER_BINARY)); #else const QString appExe(QCoreApplication::applicationDirPath() + QLatin1String("/libhelper.so")); #endif From e9c45bbdddd4df005bdaa5eea9740d351e6eaea2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 24 Oct 2018 15:20:27 +0200 Subject: [PATCH 0002/1322] Begin port of qtbase to CMake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Done-by: Alexandru Croitor Done-by: Frederik Gladhorn Done-by: Kevin Funk Done-by: Mikhail Svetkin Done-by: Simon Hausmann Done-by: Tobias Hunger Done-by: Tor Arne Vestbø Done-by: Volker Krause Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger Reviewed-by: Mikhail Svetkin --- .gitignore | 2 + CMakeLists.txt | 43 + .../extra-cmake-modules/COPYING-CMAKE-SCRIPTS | 22 + .../ECMFindModuleHelpersStub.cmake | 1 + .../find-modules/FindWayland.cmake | 143 +++ .../find-modules/FindX11_XCB.cmake | 118 ++ .../find-modules/FindXCB.cmake | 201 +++ .../modules/ECMEnableSanitizers.cmake | 173 +++ .../modules/ECMFindModuleHelpers.cmake | 297 +++++ .../extra-cmake-modules/qt_attribution.json | 15 + cmake/3rdparty/kwin/COPYING-CMAKE-SCRIPTS | 22 + cmake/3rdparty/kwin/FindFontconfig.cmake | 50 + cmake/3rdparty/kwin/FindLibdrm.cmake | 126 ++ cmake/3rdparty/kwin/FindLibinput.cmake | 125 ++ cmake/3rdparty/kwin/FindXKB.cmake | 101 ++ cmake/3rdparty/kwin/Findgbm.cmake | 125 ++ cmake/3rdparty/kwin/qt_attribution.json | 17 + cmake/FindAtomic.cmake | 37 + cmake/FindGLib.cmake | 3 + cmake/FindLibsystemd.cmake | 3 + cmake/FindLibudev.cmake | 3 + cmake/FindPCRE2.cmake | 13 + cmake/FindWrapDoubleConversion.cmake | 36 + cmake/Finddouble-conversion.cmake | 30 + cmake/QtBaseConfigureTests.cmake | 139 +++ cmake/QtBaseGlobalTargets.cmake | 58 + cmake/QtBuild.cmake | 1080 +++++++++++++++++ cmake/QtCompilerOptimization.cmake | 106 ++ cmake/QtConfig.cmake.in | 43 + cmake/QtFeature.cmake | 435 +++++++ cmake/QtModuleConfig.cmake.in | 9 + cmake/QtPlatformSupport.cmake | 41 + cmake/QtPostProcess.cmake | 32 + cmake/QtSetup.cmake | 47 + cmake/README.md | 103 ++ cmake/tests/features/CMakeLists.txt | 42 + cmake/tests/features/configure.cmake | 35 + cmake/tests/features/src/CMakeLists.txt | 7 + configure.cmake | 421 +++++++ configure.json | 11 +- examples/CMakeLists.txt | 3 + examples/gui/CMakeLists.txt | 1 + examples/gui/rasterwindow/CMakeLists.txt | 18 + qmake/CMakeLists.txt | 2 + src/3rdparty/CMakeLists.txt | 2 + src/3rdparty/harfbuzz/CMakeLists.txt | 11 + src/3rdparty/tinycbor/CMakeLists.txt | 2 + src/CMakeLists.txt | 65 + src/corelib/CMakeLists.txt | 781 ++++++++++++ src/corelib/configure.cmake | 712 +++++++++++ src/corelib/configure.json | 27 +- src/corelib/global/qconfig.cpp.in | 65 + src/dbus/CMakeLists.txt | 58 + src/gui/CMakeLists.txt | 494 ++++++++ src/gui/configure.cmake | 946 +++++++++++++++ src/gui/configure.json | 20 +- src/gui/painting/qcoregraphics.mm | 2 +- src/network/CMakeLists.txt | 382 ++++++ src/network/configure.cmake | 265 ++++ src/network/configure.json | 18 +- src/opengl/CMakeLists.txt | 58 + src/platformheaders/CMakeLists.txt | 7 + src/platformheaders/fake.cpp | 0 src/platformsupport/CMakeLists.txt | 23 + .../accessibility/CMakeLists.txt | 16 + src/platformsupport/clipboard/CMakeLists.txt | 27 + src/platformsupport/edid/CMakeLists.txt | 15 + .../eventdispatchers/CMakeLists.txt | 39 + .../fontdatabases/CMakeLists.txt | 106 ++ src/platformsupport/fontdatabases/fake.cpp | 0 src/platformsupport/graphics/CMakeLists.txt | 15 + src/platformsupport/services/CMakeLists.txt | 24 + src/platformsupport/themes/CMakeLists.txt | 55 + src/plugins/CMakeLists.txt | 3 + src/plugins/platforms/CMakeLists.txt | 10 + src/plugins/platforms/cocoa/CMakeLists.txt | 115 ++ src/plugins/platforms/xcb/CMakeLists.txt | 172 +++ src/plugins/sqldrivers/configure.json | 4 +- src/testlib/CMakeLists.txt | 89 ++ src/testlib/configure.cmake | 21 + src/tools/CMakeLists.txt | 2 + src/tools/bootstrap/CMakeLists.txt | 151 +++ src/tools/moc/CMakeLists.txt | 10 + src/tools/qfloat16-tables/CMakeLists.txt | 2 + src/tools/qmocscanner/CMakeLists.txt | 10 + src/tools/qmocscanner/main.cpp | 623 ++++++++++ src/tools/qvkgen/CMakeLists.txt | 5 + src/tools/rcc/CMakeLists.txt | 1 + src/tools/tracegen/CMakeLists.txt | 10 + src/tools/uic/CMakeLists.txt | 16 + src/widgets/CMakeLists.txt | 612 ++++++++++ src/widgets/configure.cmake | 567 +++++++++ src/xml/CMakeLists.txt | 30 + src/xml/configure.cmake | 22 + tests/CMakeLists.txt | 1 + tests/auto/CMakeLists.txt | 55 + tests/auto/corelib/CMakeLists.txt | 12 + tests/auto/corelib/animation/CMakeLists.txt | 6 + .../qabstractanimation/CMakeLists.txt | 1 + .../animation/qanimationgroup/CMakeLists.txt | 1 + .../qparallelanimationgroup/CMakeLists.txt | 1 + .../animation/qpauseanimation/CMakeLists.txt | 1 + .../qsequentialanimationgroup/CMakeLists.txt | 1 + .../qvariantanimation/CMakeLists.txt | 1 + tests/auto/corelib/codecs/CMakeLists.txt | 3 + .../corelib/codecs/qtextcodec/CMakeLists.txt | 5 + .../codecs/qtextcodec/echo/CMakeLists.txt | 1 + tests/auto/corelib/codecs/utf8/CMakeLists.txt | 1 + tests/auto/corelib/global/CMakeLists.txt | 12 + .../corelib/global/q_func_info/CMakeLists.txt | 1 + .../auto/corelib/global/qflags/CMakeLists.txt | 1 + .../corelib/global/qfloat16/CMakeLists.txt | 1 + .../corelib/global/qgetputenv/CMakeLists.txt | 1 + .../corelib/global/qglobal/CMakeLists.txt | 1 + .../global/qglobalstatic/CMakeLists.txt | 8 + .../auto/corelib/global/qhooks/CMakeLists.txt | 1 + .../corelib/global/qlogging/CMakeLists.txt | 10 + .../corelib/global/qnumeric/CMakeLists.txt | 1 + .../auto/corelib/global/qrand/CMakeLists.txt | 1 + .../global/qrandomgenerator/CMakeLists.txt | 1 + .../corelib/global/qtendian/CMakeLists.txt | 1 + tests/auto/corelib/io/CMakeLists.txt | 12 + .../auto/corelib/io/largefile/CMakeLists.txt | 6 + tests/auto/corelib/io/qbuffer/CMakeLists.txt | 1 + tests/auto/corelib/io/qdataurl/CMakeLists.txt | 1 + .../io/qfilesystementry/CMakeLists.txt | 7 + .../io/qfilesystemwatcher/CMakeLists.txt | 1 + .../auto/corelib/io/qipaddress/CMakeLists.txt | 1 + .../io/qloggingcategory/CMakeLists.txt | 1 + tests/auto/corelib/io/qnodebug/CMakeLists.txt | 1 + .../io/qprocessenvironment/CMakeLists.txt | 1 + .../corelib/io/qstorageinfo/CMakeLists.txt | 1 + .../auto/corelib/io/qurlquery/CMakeLists.txt | 1 + tests/auto/corelib/itemmodels/CMakeLists.txt | 4 + .../qabstractproxymodel/CMakeLists.txt | 1 + .../qitemselectionmodel/CMakeLists.txt | 1 + .../qstringlistmodel/CMakeLists.txt | 4 + tests/auto/corelib/kernel/CMakeLists.txt | 13 + .../kernel/qdeadlinetimer/CMakeLists.txt | 1 + .../kernel/qelapsedtimer/CMakeLists.txt | 1 + .../kernel/qeventdispatcher/CMakeLists.txt | 1 + .../auto/corelib/kernel/qmath/CMakeLists.txt | 1 + .../corelib/kernel/qmetaenum/CMakeLists.txt | 1 + .../corelib/kernel/qmetamethod/CMakeLists.txt | 1 + .../corelib/kernel/qmetaobject/CMakeLists.txt | 1 + .../kernel/qmetaobjectbuilder/CMakeLists.txt | 1 + .../kernel/qmetaproperty/CMakeLists.txt | 1 + .../corelib/kernel/qmimedata/CMakeLists.txt | 1 + .../kernel/qsignalmapper/CMakeLists.txt | 1 + .../kernel/qwineventnotifier/CMakeLists.txt | 1 + tests/auto/corelib/mimetypes/CMakeLists.txt | 2 + .../mimetypes/qmimetype/CMakeLists.txt | 1 + .../auto/corelib/serialization/CMakeLists.txt | 5 + .../qcborstreamreader/CMakeLists.txt | 6 + .../qcborstreamwriter/CMakeLists.txt | 5 + .../serialization/qcborvalue/CMakeLists.txt | 6 + .../qcborvalue_json/CMakeLists.txt | 1 + .../auto/corelib/statemachine/CMakeLists.txt | 2 + .../statemachine/qstate/CMakeLists.txt | 1 + tests/auto/corelib/thread/CMakeLists.txt | 13 + .../corelib/thread/qatomicint/CMakeLists.txt | 1 + .../thread/qatomicpointer/CMakeLists.txt | 1 + .../corelib/thread/qfuture/CMakeLists.txt | 1 + .../thread/qfuturesynchronizer/CMakeLists.txt | 1 + .../thread/qmutexlocker/CMakeLists.txt | 1 + .../corelib/thread/qreadlocker/CMakeLists.txt | 1 + .../thread/qreadwritelock/CMakeLists.txt | 1 + .../thread/qresultstore/CMakeLists.txt | 1 + .../corelib/thread/qsemaphore/CMakeLists.txt | 1 + .../corelib/thread/qthreadpool/CMakeLists.txt | 1 + .../thread/qwaitcondition/CMakeLists.txt | 1 + .../thread/qwritelocker/CMakeLists.txt | 1 + tests/auto/corelib/tools/CMakeLists.txt | 47 + .../corelib/tools/qalgorithms/CMakeLists.txt | 1 + .../corelib/tools/qarraydata/CMakeLists.txt | 4 + .../corelib/tools/qbitarray/CMakeLists.txt | 1 + .../tools/qbytearraylist/CMakeLists.txt | 1 + .../tools/qbytedatabuffer/CMakeLists.txt | 1 + .../auto/corelib/tools/qcache/CMakeLists.txt | 1 + .../tools/qcommandlineparser/CMakeLists.txt | 1 + .../tools/qcontiguouscache/CMakeLists.txt | 1 + tests/auto/corelib/tools/qdate/CMakeLists.txt | 1 + .../corelib/tools/qeasingcurve/CMakeLists.txt | 1 + .../CMakeLists.txt | 1 + tests/auto/corelib/tools/qhash/CMakeLists.txt | 1 + .../tools/qhashfunctions/CMakeLists.txt | 1 + .../corelib/tools/qlinkedlist/CMakeLists.txt | 1 + tests/auto/corelib/tools/qlist/CMakeLists.txt | 1 + .../corelib/tools/qmakearray/CMakeLists.txt | 1 + tests/auto/corelib/tools/qmap/CMakeLists.txt | 1 + .../corelib/tools/qmargins/CMakeLists.txt | 1 + .../qmessageauthenticationcode/CMakeLists.txt | 1 + tests/auto/corelib/tools/qpair/CMakeLists.txt | 1 + .../auto/corelib/tools/qpoint/CMakeLists.txt | 1 + .../auto/corelib/tools/qpointf/CMakeLists.txt | 1 + .../auto/corelib/tools/qqueue/CMakeLists.txt | 1 + tests/auto/corelib/tools/qrect/CMakeLists.txt | 1 + .../auto/corelib/tools/qregexp/CMakeLists.txt | 1 + .../tools/qregularexpression/CMakeLists.txt | 1 + .../corelib/tools/qringbuffer/CMakeLists.txt | 1 + .../tools/qscopedpointer/CMakeLists.txt | 1 + .../tools/qscopedvaluerollback/CMakeLists.txt | 1 + .../corelib/tools/qscopeguard/CMakeLists.txt | 1 + tests/auto/corelib/tools/qset/CMakeLists.txt | 1 + tests/auto/corelib/tools/qsize/CMakeLists.txt | 1 + .../auto/corelib/tools/qsizef/CMakeLists.txt | 1 + tests/auto/corelib/tools/qstl/CMakeLists.txt | 1 + .../CMakeLists.txt | 1 + .../qstringbuilder1/CMakeLists.txt | 1 + .../qstringbuilder2/CMakeLists.txt | 1 + .../qstringbuilder3/CMakeLists.txt | 1 + .../qstringbuilder4/CMakeLists.txt | 1 + .../tools/qstringiterator/CMakeLists.txt | 1 + .../corelib/tools/qstringlist/CMakeLists.txt | 1 + .../tools/qstringmatcher/CMakeLists.txt | 1 + .../corelib/tools/qstringref/CMakeLists.txt | 1 + tests/auto/corelib/tools/qtime/CMakeLists.txt | 1 + .../corelib/tools/qtimeline/CMakeLists.txt | 1 + .../tools/qvarlengtharray/CMakeLists.txt | 1 + tests/auto/dbus/CMakeLists.txt | 33 + .../dbus/qdbusabstractadaptor/CMakeLists.txt | 4 + .../qdbusabstractadaptor/CMakeLists.txt | 14 + .../qmyserver/CMakeLists.txt | 13 + .../qdbusabstractinterface/CMakeLists.txt | 4 + .../qdbusabstractinterface/CMakeLists.txt | 13 + .../qpinger/CMakeLists.txt | 13 + .../auto/dbus/qdbusconnection/CMakeLists.txt | 12 + .../qdbusconnection_delayed/CMakeLists.txt | 14 + .../qdbusconnection_no_app/CMakeLists.txt | 16 + .../qdbusconnection_no_bus/CMakeLists.txt | 12 + .../qdbusconnection_no_libdbus/CMakeLists.txt | 15 + .../tst_qdbusconnection_no_libdbus.cpp | 73 ++ .../qdbusconnection_spyhook/CMakeLists.txt | 17 + tests/auto/dbus/qdbuscontext/CMakeLists.txt | 12 + tests/auto/dbus/qdbusinterface/CMakeLists.txt | 4 + .../qdbusinterface/CMakeLists.txt | 28 + .../qdbusinterface/qmyserver/CMakeLists.txt | 13 + .../auto/dbus/qdbuslocalcalls/CMakeLists.txt | 12 + tests/auto/dbus/qdbusmarshall/CMakeLists.txt | 4 + .../qdbusmarshall/CMakeLists.txt | 26 + .../dbus/qdbusmarshall/qpong/CMakeLists.txt | 12 + .../auto/dbus/qdbusmetaobject/CMakeLists.txt | 12 + tests/auto/dbus/qdbusmetatype/CMakeLists.txt | 12 + .../auto/dbus/qdbuspendingcall/CMakeLists.txt | 12 + .../dbus/qdbuspendingreply/CMakeLists.txt | 12 + tests/auto/dbus/qdbusreply/CMakeLists.txt | 12 + .../dbus/qdbusservicewatcher/CMakeLists.txt | 12 + tests/auto/dbus/qdbusthreading/CMakeLists.txt | 12 + tests/auto/dbus/qdbustype/CMakeLists.txt | 26 + tests/auto/dbus/qdbusxmlparser/CMakeLists.txt | 14 + tests/auto/gui/CMakeLists.txt | 19 + tests/auto/gui/image/CMakeLists.txt | 15 + .../gui/image/qimageiohandler/CMakeLists.txt | 1 + tests/auto/gui/image/qpicture/CMakeLists.txt | 1 + tests/auto/gui/itemmodels/CMakeLists.txt | 4 + .../itemmodels/qstandarditem/CMakeLists.txt | 1 + tests/auto/gui/kernel/CMakeLists.txt | 38 + tests/auto/gui/kernel/qcursor/CMakeLists.txt | 1 + tests/auto/gui/kernel/qevent/CMakeLists.txt | 1 + .../gui/kernel/qfileopenevent/CMakeLists.txt | 2 + .../qfileopeneventexternal/CMakeLists.txt | 1 + .../kernel/qfileopenevent/test/CMakeLists.txt | 1 + .../gui/kernel/qguivariant/CMakeLists.txt | 2 + .../qguivariant/no_application/CMakeLists.txt | 1 + .../gui/kernel/qmouseevent/CMakeLists.txt | 1 + tests/auto/gui/kernel/qpalette/CMakeLists.txt | 1 + tests/auto/gui/math3d/CMakeLists.txt | 3 + .../auto/gui/math3d/qmatrixnxn/CMakeLists.txt | 5 + .../gui/math3d/qquaternion/CMakeLists.txt | 1 + .../auto/gui/math3d/qvectornd/CMakeLists.txt | 1 + tests/auto/gui/painting/CMakeLists.txt | 19 + .../gui/painting/qpagesize/CMakeLists.txt | 1 + .../gui/painting/qpaintengine/CMakeLists.txt | 1 + .../gui/painting/qpainterpath/CMakeLists.txt | 1 + .../qpainterpathstroker/CMakeLists.txt | 1 + tests/auto/gui/painting/qpen/CMakeLists.txt | 1 + tests/auto/gui/util/CMakeLists.txt | 13 + .../gui/util/qdoublevalidator/CMakeLists.txt | 1 + .../gui/util/qintvalidator/CMakeLists.txt | 1 + .../gui/util/qregexpvalidator/CMakeLists.txt | 1 + .../CMakeLists.txt | 1 + tests/auto/opengl/CMakeLists.txt | 6 + tests/auto/opengl/qgl/CMakeLists.txt | 7 + tests/auto/opengl/qglbuffer/CMakeLists.txt | 1 + tests/auto/opengl/qglfunctions/CMakeLists.txt | 1 + tests/auto/opengl/qglthreads/CMakeLists.txt | 7 + .../auto/other/qtokenautomaton/CMakeLists.txt | 15 + tests/auto/other/toolsupport/CMakeLists.txt | 1 + tests/auto/testlib/CMakeLists.txt | 4 + .../qabstractitemmodeltester/CMakeLists.txt | 8 + tests/auto/testlib/qsignalspy/CMakeLists.txt | 1 + tests/auto/testlib/selftests/CMakeLists.txt | 42 + .../testlib/selftests/alive/CMakeLists.txt | 1 + .../testlib/selftests/assert/CMakeLists.txt | 1 + .../testlib/selftests/badxml/CMakeLists.txt | 1 + .../benchlibcallgrind/CMakeLists.txt | 1 + .../selftests/benchlibcounting/CMakeLists.txt | 1 + .../benchlibeventcounter/CMakeLists.txt | 1 + .../selftests/benchliboptions/CMakeLists.txt | 1 + .../selftests/benchlibwalltime/CMakeLists.txt | 1 + .../selftests/commandlinedata/CMakeLists.txt | 1 + .../testlib/selftests/counting/CMakeLists.txt | 1 + .../testlib/selftests/crashes/CMakeLists.txt | 1 + .../selftests/datatable/CMakeLists.txt | 1 + .../testlib/selftests/datetime/CMakeLists.txt | 1 + .../selftests/deleteLater/CMakeLists.txt | 1 + .../deleteLater_noApp/CMakeLists.txt | 1 + .../selftests/differentexec/CMakeLists.txt | 1 + .../selftests/expectfail/CMakeLists.txt | 1 + .../selftests/failcleanup/CMakeLists.txt | 1 + .../testlib/selftests/failinit/CMakeLists.txt | 1 + .../selftests/failinitdata/CMakeLists.txt | 1 + .../selftests/fetchbogus/CMakeLists.txt | 1 + .../testlib/selftests/float/CMakeLists.txt | 1 + .../selftests/globaldata/CMakeLists.txt | 1 + .../selftests/longstring/CMakeLists.txt | 1 + .../selftests/maxwarnings/CMakeLists.txt | 1 + .../selftests/multiexec/CMakeLists.txt | 1 + .../selftests/pairdiagnostics/CMakeLists.txt | 1 + .../selftests/printdatatags/CMakeLists.txt | 1 + .../CMakeLists.txt | 1 + .../selftests/qexecstringlist/CMakeLists.txt | 1 + .../selftests/singleskip/CMakeLists.txt | 1 + .../testlib/selftests/skip/CMakeLists.txt | 1 + .../selftests/skipcleanup/CMakeLists.txt | 1 + .../testlib/selftests/skipinit/CMakeLists.txt | 1 + .../selftests/skipinitdata/CMakeLists.txt | 1 + .../testlib/selftests/sleep/CMakeLists.txt | 1 + .../testlib/selftests/strcmp/CMakeLists.txt | 1 + .../testlib/selftests/subtest/CMakeLists.txt | 1 + .../selftests/tuplediagnostics/CMakeLists.txt | 1 + .../testlib/selftests/warnings/CMakeLists.txt | 1 + .../testlib/selftests/xunit/CMakeLists.txt | 1 + tests/auto/tools/qdbusxml2cpp/CMakeLists.txt | 1 + tests/auto/tools/uic/CMakeLists.txt | 1 + tests/auto/widgets/CMakeLists.txt | 10 + tests/auto/widgets/dialogs/CMakeLists.txt | 19 + .../dialogs/qcolordialog/CMakeLists.txt | 1 + .../widgets/dialogs/qdialog/CMakeLists.txt | 8 + .../dialogs/qerrormessage/CMakeLists.txt | 1 + .../dialogs/qfiledialog/CMakeLists.txt | 9 + .../dialogs/qfiledialog2/CMakeLists.txt | 10 + .../dialogs/qfilesystemmodel/CMakeLists.txt | 5 + .../dialogs/qfontdialog/CMakeLists.txt | 9 + .../dialogs/qinputdialog/CMakeLists.txt | 1 + .../dialogs/qmessagebox/CMakeLists.txt | 6 + .../dialogs/qprogressdialog/CMakeLists.txt | 1 + .../widgets/dialogs/qsidebar/CMakeLists.txt | 5 + .../widgets/dialogs/qwizard/CMakeLists.txt | 8 + tests/auto/widgets/effects/CMakeLists.txt | 2 + .../effects/qgraphicseffect/CMakeLists.txt | 6 + .../effects/qpixmapfilter/CMakeLists.txt | 5 + .../auto/widgets/graphicsview/CMakeLists.txt | 25 + .../qgraphicsanchorlayout/CMakeLists.txt | 6 + .../qgraphicsanchorlayout1/CMakeLists.txt | 6 + .../qgraphicseffectsource/CMakeLists.txt | 6 + .../qgraphicsgridlayout/CMakeLists.txt | 1 + .../graphicsview/qgraphicsitem/CMakeLists.txt | 11 + .../qgraphicsitemanimation/CMakeLists.txt | 6 + .../qgraphicslayout/CMakeLists.txt | 6 + .../qgraphicslayoutitem/CMakeLists.txt | 1 + .../qgraphicslinearlayout/CMakeLists.txt | 1 + .../qgraphicsobject/CMakeLists.txt | 1 + .../qgraphicspixmapitem/CMakeLists.txt | 1 + .../qgraphicspolygonitem/CMakeLists.txt | 1 + .../qgraphicsproxywidget/CMakeLists.txt | 10 + .../qgraphicsscene/CMakeLists.txt | 15 + .../qgraphicssceneindex/CMakeLists.txt | 6 + .../qgraphicstransform/CMakeLists.txt | 1 + .../graphicsview/qgraphicsview/CMakeLists.txt | 12 + .../qgraphicswidget/CMakeLists.txt | 6 + tests/auto/widgets/itemviews/CMakeLists.txt | 21 + .../qabstractitemview/CMakeLists.txt | 5 + .../itemviews/qcolumnview/CMakeLists.txt | 11 + .../qdatawidgetmapper/CMakeLists.txt | 1 + .../itemviews/qdirmodel/CMakeLists.txt | 19 + .../qfileiconprovider/CMakeLists.txt | 1 + .../itemviews/qheaderview/CMakeLists.txt | 6 + .../itemviews/qitemdelegate/CMakeLists.txt | 3 + .../qitemeditorfactory/CMakeLists.txt | 1 + .../itemviews/qitemview/CMakeLists.txt | 1 + .../itemviews/qlistview/CMakeLists.txt | 13 + .../itemviews/qlistwidget/CMakeLists.txt | 8 + .../itemviews/qtableview/CMakeLists.txt | 7 + .../itemviews/qtablewidget/CMakeLists.txt | 1 + .../itemviews/qtreeview/CMakeLists.txt | 11 + .../itemviews/qtreewidget/CMakeLists.txt | 1 + .../qtreewidgetitemiterator/CMakeLists.txt | 1 + tests/auto/widgets/kernel/CMakeLists.txt | 27 + tests/auto/widgets/kernel/kernel.pro | 2 +- .../widgets/kernel/qaction/CMakeLists.txt | 6 + .../kernel/qactiongroup/CMakeLists.txt | 1 + .../widgets/kernel/qboxlayout/CMakeLists.txt | 1 + .../kernel/qdesktopwidget/CMakeLists.txt | 1 + .../widgets/kernel/qformlayout/CMakeLists.txt | 1 + .../kernel/qgesturerecognizer/CMakeLists.txt | 6 + .../widgets/kernel/qgridlayout/CMakeLists.txt | 10 + .../widgets/kernel/qlayout/CMakeLists.txt | 3 + .../widgets/kernel/qshortcut/CMakeLists.txt | 1 + .../widgets/kernel/qsizepolicy/CMakeLists.txt | 1 + .../kernel/qstackedlayout/CMakeLists.txt | 1 + .../widgets/kernel/qtooltip/CMakeLists.txt | 1 + .../widgets/kernel/qwidget/CMakeLists.txt | 16 + .../kernel/qwidget_window/CMakeLists.txt | 7 + .../kernel/qwidgetaction/CMakeLists.txt | 1 + .../kernel/qwidgetmetatype/CMakeLists.txt | 1 + .../kernel/qwidgetsvariant/CMakeLists.txt | 8 + .../kernel/qwindowcontainer/CMakeLists.txt | 1 + tests/auto/widgets/styles/CMakeLists.txt | 12 + .../widgets/styles/qmacstyle/CMakeLists.txt | 1 + .../auto/widgets/styles/qstyle/CMakeLists.txt | 3 + .../styles/qstyleoption/CMakeLists.txt | 1 + .../styles/qstylesheetstyle/CMakeLists.txt | 9 + tests/auto/widgets/util/CMakeLists.txt | 7 + .../widgets/util/qcompleter/CMakeLists.txt | 1 + .../widgets/util/qscroller/CMakeLists.txt | 1 + .../util/qsystemtrayicon/CMakeLists.txt | 1 + .../widgets/util/qundogroup/CMakeLists.txt | 1 + .../widgets/util/qundostack/CMakeLists.txt | 1 + tests/auto/widgets/widgets/CMakeLists.txt | 55 + .../widgets/qabstractbutton/CMakeLists.txt | 1 + .../qabstractscrollarea/CMakeLists.txt | 1 + .../widgets/qabstractslider/CMakeLists.txt | 1 + .../widgets/qabstractspinbox/CMakeLists.txt | 7 + .../widgets/qbuttongroup/CMakeLists.txt | 1 + .../widgets/qcalendarwidget/CMakeLists.txt | 1 + .../widgets/widgets/qcheckbox/CMakeLists.txt | 1 + .../widgets/widgets/qcombobox/CMakeLists.txt | 8 + .../widgets/qcommandlinkbutton/CMakeLists.txt | 1 + .../widgets/qdatetimeedit/CMakeLists.txt | 6 + .../auto/widgets/widgets/qdial/CMakeLists.txt | 1 + .../widgets/qdialogbuttonbox/CMakeLists.txt | 1 + .../widgets/qdockwidget/CMakeLists.txt | 6 + .../widgets/qdoublespinbox/CMakeLists.txt | 1 + .../widgets/qfocusframe/CMakeLists.txt | 1 + .../widgets/qfontcombobox/CMakeLists.txt | 1 + .../widgets/widgets/qframe/CMakeLists.txt | 1 + .../widgets/widgets/qgroupbox/CMakeLists.txt | 1 + .../widgets/qkeysequenceedit/CMakeLists.txt | 1 + .../widgets/widgets/qlabel/CMakeLists.txt | 6 + .../widgets/widgets/qlcdnumber/CMakeLists.txt | 1 + .../widgets/widgets/qlineedit/CMakeLists.txt | 9 + .../widgets/qmainwindow/CMakeLists.txt | 1 + .../widgets/widgets/qmdiarea/CMakeLists.txt | 14 + .../widgets/qmdisubwindow/CMakeLists.txt | 7 + .../auto/widgets/widgets/qmenu/CMakeLists.txt | 13 + .../widgets/widgets/qmenubar/CMakeLists.txt | 6 + .../widgets/qopenglwidget/CMakeLists.txt | 6 + .../widgets/qplaintextedit/CMakeLists.txt | 7 + .../widgets/qprogressbar/CMakeLists.txt | 1 + .../widgets/qpushbutton/CMakeLists.txt | 1 + .../widgets/qradiobutton/CMakeLists.txt | 1 + .../widgets/qscrollarea/CMakeLists.txt | 1 + .../widgets/widgets/qscrollbar/CMakeLists.txt | 1 + .../widgets/widgets/qsizegrip/CMakeLists.txt | 1 + .../widgets/widgets/qslider/CMakeLists.txt | 1 + .../widgets/widgets/qspinbox/CMakeLists.txt | 1 + .../widgets/qsplashscreen/CMakeLists.txt | 1 + .../widgets/widgets/qsplitter/CMakeLists.txt | 1 + .../widgets/qstackedwidget/CMakeLists.txt | 1 + .../widgets/widgets/qstatusbar/CMakeLists.txt | 1 + .../widgets/widgets/qtabbar/CMakeLists.txt | 1 + .../widgets/widgets/qtabwidget/CMakeLists.txt | 3 + .../widgets/qtextbrowser/CMakeLists.txt | 3 + .../widgets/widgets/qtextedit/CMakeLists.txt | 8 + .../widgets/widgets/qtoolbar/CMakeLists.txt | 1 + .../widgets/widgets/qtoolbox/CMakeLists.txt | 1 + .../widgets/qtoolbutton/CMakeLists.txt | 1 + .../corelib/io/qdir/10000/CMakeLists.txt | 1 + .../corelib/io/qprocess/test/CMakeLists.txt | 5 + .../corelib/kernel/events/CMakeLists.txt | 1 + .../kernel/qcoreapplication/CMakeLists.txt | 1 + .../corelib/kernel/qmetatype/CMakeLists.txt | 1 + .../mimetypes/qmimedatabase/CMakeLists.txt | 1 + .../corelib/plugin/quuid/CMakeLists.txt | 1 + .../corelib/thread/qmutex/CMakeLists.txt | 1 + .../corelib/thread/qthreadpool/CMakeLists.txt | 1 + .../thread/qthreadstorage/CMakeLists.txt | 1 + .../thread/qwaitcondition/CMakeLists.txt | 1 + .../containers-associative/CMakeLists.txt | 1 + .../containers-sequential/CMakeLists.txt | 1 + .../corelib/tools/qalgorithms/CMakeLists.txt | 1 + .../corelib/tools/qchar/CMakeLists.txt | 1 + .../corelib/tools/qdatetime/CMakeLists.txt | 1 + .../corelib/tools/qlist/CMakeLists.txt | 1 + .../corelib/tools/qlocale/CMakeLists.txt | 1 + .../corelib/tools/qstring/CMakeLists.txt | 1 + .../corelib/tools/qtimezone/CMakeLists.txt | 1 + .../gui/image/blendbench/CMakeLists.txt | 3 + .../gui/image/qimagescale/CMakeLists.txt | 3 + .../gui/image/qpixmapcache/CMakeLists.txt | 3 + .../gui/kernel/qguimetatype/CMakeLists.txt | 3 + .../gui/kernel/qguivariant/CMakeLists.txt | 3 + .../gui/math3d/qmatrix4x4/CMakeLists.txt | 3 + .../gui/math3d/qquaternion/CMakeLists.txt | 3 + .../gui/painting/qtransform/CMakeLists.txt | 3 + .../gui/text/qfontmetrics/CMakeLists.txt | 3 + tests/manual/CMakeLists.txt | 92 ++ .../manual/qcursor/childwindow/CMakeLists.txt | 5 + tests/manual/qmetatype/CMakeLists.txt | 5 + .../qopenglwindow/multiwindow/CMakeLists.txt | 3 + util/cmake/Pipfile | 14 + util/cmake/cmakeconversionrate.py | 127 ++ util/cmake/configurejson2cmake.py | 860 +++++++++++++ util/cmake/generate_module_map.sh | 38 + util/cmake/helper.py | 206 ++++ util/cmake/pro2cmake.py | 736 +++++++++++ util/cmake/run_pro2cmake.py | 44 + util/cmake/tests/__init__.py | 0 util/cmake/tests/data/complex_values.pro | 22 + util/cmake/tests/data/definetest.pro | 6 + util/cmake/tests/data/else.pro | 6 + util/cmake/tests/data/else2.pro | 4 + util/cmake/tests/data/else3.pro | 7 + util/cmake/tests/data/else4.pro | 6 + util/cmake/tests/data/else5.pro | 10 + util/cmake/tests/data/else6.pro | 11 + util/cmake/tests/data/else7.pro | 2 + util/cmake/tests/data/else8.pro | 5 + util/cmake/tests/data/function_if.pro | 4 + util/cmake/tests/data/include.pro | 3 + util/cmake/tests/data/load.pro | 3 + util/cmake/tests/data/quoted.pro | 5 + util/cmake/tests/data/unset.pro | 2 + util/cmake/tests/test_parsing.py | 162 +++ 525 files changed, 15211 insertions(+), 61 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/3rdparty/extra-cmake-modules/COPYING-CMAKE-SCRIPTS create mode 100644 cmake/3rdparty/extra-cmake-modules/find-modules/ECMFindModuleHelpersStub.cmake create mode 100644 cmake/3rdparty/extra-cmake-modules/find-modules/FindWayland.cmake create mode 100644 cmake/3rdparty/extra-cmake-modules/find-modules/FindX11_XCB.cmake create mode 100644 cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake create mode 100644 cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake create mode 100644 cmake/3rdparty/extra-cmake-modules/modules/ECMFindModuleHelpers.cmake create mode 100644 cmake/3rdparty/extra-cmake-modules/qt_attribution.json create mode 100644 cmake/3rdparty/kwin/COPYING-CMAKE-SCRIPTS create mode 100644 cmake/3rdparty/kwin/FindFontconfig.cmake create mode 100644 cmake/3rdparty/kwin/FindLibdrm.cmake create mode 100644 cmake/3rdparty/kwin/FindLibinput.cmake create mode 100644 cmake/3rdparty/kwin/FindXKB.cmake create mode 100644 cmake/3rdparty/kwin/Findgbm.cmake create mode 100644 cmake/3rdparty/kwin/qt_attribution.json create mode 100644 cmake/FindAtomic.cmake create mode 100644 cmake/FindGLib.cmake create mode 100644 cmake/FindLibsystemd.cmake create mode 100644 cmake/FindLibudev.cmake create mode 100644 cmake/FindPCRE2.cmake create mode 100644 cmake/FindWrapDoubleConversion.cmake create mode 100644 cmake/Finddouble-conversion.cmake create mode 100644 cmake/QtBaseConfigureTests.cmake create mode 100644 cmake/QtBaseGlobalTargets.cmake create mode 100644 cmake/QtBuild.cmake create mode 100644 cmake/QtCompilerOptimization.cmake create mode 100644 cmake/QtConfig.cmake.in create mode 100644 cmake/QtFeature.cmake create mode 100644 cmake/QtModuleConfig.cmake.in create mode 100644 cmake/QtPlatformSupport.cmake create mode 100644 cmake/QtPostProcess.cmake create mode 100644 cmake/QtSetup.cmake create mode 100644 cmake/README.md create mode 100644 cmake/tests/features/CMakeLists.txt create mode 100644 cmake/tests/features/configure.cmake create mode 100644 cmake/tests/features/src/CMakeLists.txt create mode 100644 configure.cmake create mode 100644 examples/CMakeLists.txt create mode 100644 examples/gui/CMakeLists.txt create mode 100644 examples/gui/rasterwindow/CMakeLists.txt create mode 100644 qmake/CMakeLists.txt create mode 100644 src/3rdparty/CMakeLists.txt create mode 100644 src/3rdparty/harfbuzz/CMakeLists.txt create mode 100644 src/3rdparty/tinycbor/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/corelib/CMakeLists.txt create mode 100644 src/corelib/configure.cmake create mode 100644 src/corelib/global/qconfig.cpp.in create mode 100644 src/dbus/CMakeLists.txt create mode 100644 src/gui/CMakeLists.txt create mode 100644 src/gui/configure.cmake create mode 100644 src/network/CMakeLists.txt create mode 100644 src/network/configure.cmake create mode 100644 src/opengl/CMakeLists.txt create mode 100644 src/platformheaders/CMakeLists.txt create mode 100644 src/platformheaders/fake.cpp create mode 100644 src/platformsupport/CMakeLists.txt create mode 100644 src/platformsupport/accessibility/CMakeLists.txt create mode 100644 src/platformsupport/clipboard/CMakeLists.txt create mode 100644 src/platformsupport/edid/CMakeLists.txt create mode 100644 src/platformsupport/eventdispatchers/CMakeLists.txt create mode 100644 src/platformsupport/fontdatabases/CMakeLists.txt create mode 100644 src/platformsupport/fontdatabases/fake.cpp create mode 100644 src/platformsupport/graphics/CMakeLists.txt create mode 100644 src/platformsupport/services/CMakeLists.txt create mode 100644 src/platformsupport/themes/CMakeLists.txt create mode 100644 src/plugins/CMakeLists.txt create mode 100644 src/plugins/platforms/CMakeLists.txt create mode 100644 src/plugins/platforms/cocoa/CMakeLists.txt create mode 100644 src/plugins/platforms/xcb/CMakeLists.txt create mode 100644 src/testlib/CMakeLists.txt create mode 100644 src/testlib/configure.cmake create mode 100644 src/tools/CMakeLists.txt create mode 100644 src/tools/bootstrap/CMakeLists.txt create mode 100644 src/tools/moc/CMakeLists.txt create mode 100644 src/tools/qfloat16-tables/CMakeLists.txt create mode 100644 src/tools/qmocscanner/CMakeLists.txt create mode 100644 src/tools/qmocscanner/main.cpp create mode 100644 src/tools/qvkgen/CMakeLists.txt create mode 100644 src/tools/rcc/CMakeLists.txt create mode 100644 src/tools/tracegen/CMakeLists.txt create mode 100644 src/tools/uic/CMakeLists.txt create mode 100644 src/widgets/CMakeLists.txt create mode 100644 src/widgets/configure.cmake create mode 100644 src/xml/CMakeLists.txt create mode 100644 src/xml/configure.cmake create mode 100644 tests/CMakeLists.txt create mode 100644 tests/auto/CMakeLists.txt create mode 100644 tests/auto/corelib/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt create mode 100644 tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt create mode 100644 tests/auto/corelib/codecs/CMakeLists.txt create mode 100644 tests/auto/corelib/codecs/qtextcodec/CMakeLists.txt create mode 100644 tests/auto/corelib/codecs/qtextcodec/echo/CMakeLists.txt create mode 100644 tests/auto/corelib/codecs/utf8/CMakeLists.txt create mode 100644 tests/auto/corelib/global/CMakeLists.txt create mode 100644 tests/auto/corelib/global/q_func_info/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qflags/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qfloat16/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qgetputenv/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qglobal/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qglobalstatic/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qhooks/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qlogging/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qnumeric/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qrand/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt create mode 100644 tests/auto/corelib/global/qtendian/CMakeLists.txt create mode 100644 tests/auto/corelib/io/CMakeLists.txt create mode 100644 tests/auto/corelib/io/largefile/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qbuffer/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qdataurl/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qfilesystementry/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qipaddress/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qloggingcategory/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qnodebug/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qstorageinfo/CMakeLists.txt create mode 100644 tests/auto/corelib/io/qurlquery/CMakeLists.txt create mode 100644 tests/auto/corelib/itemmodels/CMakeLists.txt create mode 100644 tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt create mode 100644 tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt create mode 100644 tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmath/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmetaobjectbuilder/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmetaproperty/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qmimedata/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qsignalmapper/CMakeLists.txt create mode 100644 tests/auto/corelib/kernel/qwineventnotifier/CMakeLists.txt create mode 100644 tests/auto/corelib/mimetypes/CMakeLists.txt create mode 100644 tests/auto/corelib/mimetypes/qmimetype/CMakeLists.txt create mode 100644 tests/auto/corelib/serialization/CMakeLists.txt create mode 100644 tests/auto/corelib/serialization/qcborstreamreader/CMakeLists.txt create mode 100644 tests/auto/corelib/serialization/qcborstreamwriter/CMakeLists.txt create mode 100644 tests/auto/corelib/serialization/qcborvalue/CMakeLists.txt create mode 100644 tests/auto/corelib/serialization/qcborvalue_json/CMakeLists.txt create mode 100644 tests/auto/corelib/statemachine/CMakeLists.txt create mode 100644 tests/auto/corelib/statemachine/qstate/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qatomicint/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qatomicpointer/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qfuture/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qfuturesynchronizer/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qmutexlocker/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qreadlocker/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qreadwritelock/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qresultstore/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qsemaphore/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qthreadpool/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qwaitcondition/CMakeLists.txt create mode 100644 tests/auto/corelib/thread/qwritelocker/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qalgorithms/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qarraydata/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qbitarray/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qbytearraylist/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qbytedatabuffer/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qcache/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qcontiguouscache/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qdate/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qeasingcurve/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qexplicitlyshareddatapointer/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qhash/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qhashfunctions/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qlinkedlist/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qlist/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qmakearray/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qmap/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qmargins/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qmessageauthenticationcode/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qpair/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qpoint/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qpointf/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qqueue/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qrect/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qregexp/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qregularexpression/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qringbuffer/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qscopedpointer/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qscopedvaluerollback/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qscopeguard/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qset/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qsize/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qsizef/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstl/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstring_no_cast_from_bytearray/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringiterator/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringlist/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringmatcher/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qstringref/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qtime/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qtimeline/CMakeLists.txt create mode 100644 tests/auto/corelib/tools/qvarlengtharray/CMakeLists.txt create mode 100644 tests/auto/dbus/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusconnection/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusconnection_delayed/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusconnection_no_app/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusconnection_no_bus/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusconnection_no_libdbus/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusconnection_no_libdbus/tst_qdbusconnection_no_libdbus.cpp create mode 100644 tests/auto/dbus/qdbusconnection_spyhook/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbuscontext/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusinterface/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbuslocalcalls/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusmarshall/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusmarshall/qdbusmarshall/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusmarshall/qpong/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusmetaobject/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusmetatype/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbuspendingcall/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbuspendingreply/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusreply/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusservicewatcher/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusthreading/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbustype/CMakeLists.txt create mode 100644 tests/auto/dbus/qdbusxmlparser/CMakeLists.txt create mode 100644 tests/auto/gui/CMakeLists.txt create mode 100644 tests/auto/gui/image/CMakeLists.txt create mode 100644 tests/auto/gui/image/qimageiohandler/CMakeLists.txt create mode 100644 tests/auto/gui/image/qpicture/CMakeLists.txt create mode 100644 tests/auto/gui/itemmodels/CMakeLists.txt create mode 100644 tests/auto/gui/itemmodels/qstandarditem/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qcursor/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qevent/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qfileopenevent/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qfileopenevent/test/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qguivariant/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qguivariant/no_application/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qmouseevent/CMakeLists.txt create mode 100644 tests/auto/gui/kernel/qpalette/CMakeLists.txt create mode 100644 tests/auto/gui/math3d/CMakeLists.txt create mode 100644 tests/auto/gui/math3d/qmatrixnxn/CMakeLists.txt create mode 100644 tests/auto/gui/math3d/qquaternion/CMakeLists.txt create mode 100644 tests/auto/gui/math3d/qvectornd/CMakeLists.txt create mode 100644 tests/auto/gui/painting/CMakeLists.txt create mode 100644 tests/auto/gui/painting/qpagesize/CMakeLists.txt create mode 100644 tests/auto/gui/painting/qpaintengine/CMakeLists.txt create mode 100644 tests/auto/gui/painting/qpainterpath/CMakeLists.txt create mode 100644 tests/auto/gui/painting/qpainterpathstroker/CMakeLists.txt create mode 100644 tests/auto/gui/painting/qpen/CMakeLists.txt create mode 100644 tests/auto/gui/util/CMakeLists.txt create mode 100644 tests/auto/gui/util/qdoublevalidator/CMakeLists.txt create mode 100644 tests/auto/gui/util/qintvalidator/CMakeLists.txt create mode 100644 tests/auto/gui/util/qregexpvalidator/CMakeLists.txt create mode 100644 tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt create mode 100644 tests/auto/opengl/CMakeLists.txt create mode 100644 tests/auto/opengl/qgl/CMakeLists.txt create mode 100644 tests/auto/opengl/qglbuffer/CMakeLists.txt create mode 100644 tests/auto/opengl/qglfunctions/CMakeLists.txt create mode 100644 tests/auto/opengl/qglthreads/CMakeLists.txt create mode 100644 tests/auto/other/qtokenautomaton/CMakeLists.txt create mode 100644 tests/auto/other/toolsupport/CMakeLists.txt create mode 100644 tests/auto/testlib/CMakeLists.txt create mode 100644 tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt create mode 100644 tests/auto/testlib/qsignalspy/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/alive/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/assert/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/badxml/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/counting/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/crashes/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/datatable/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/datetime/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/deleteLater/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/differentexec/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/expectfail/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failcleanup/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failinit/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failinitdata/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/float/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/globaldata/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/longstring/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/multiexec/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/printdatatags/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/singleskip/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skip/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skipinit/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/sleep/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/strcmp/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/subtest/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/warnings/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/xunit/CMakeLists.txt create mode 100644 tests/auto/tools/qdbusxml2cpp/CMakeLists.txt create mode 100644 tests/auto/tools/uic/CMakeLists.txt create mode 100644 tests/auto/widgets/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qcolordialog/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qdialog/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qerrormessage/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qfiledialog2/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qfilesystemmodel/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qinputdialog/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qmessagebox/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qprogressdialog/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qsidebar/CMakeLists.txt create mode 100644 tests/auto/widgets/dialogs/qwizard/CMakeLists.txt create mode 100644 tests/auto/widgets/effects/CMakeLists.txt create mode 100644 tests/auto/widgets/effects/qgraphicseffect/CMakeLists.txt create mode 100644 tests/auto/widgets/effects/qpixmapfilter/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt create mode 100644 tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qabstractitemview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qcolumnview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qdatawidgetmapper/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qdirmodel/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qfileiconprovider/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qheaderview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qitemdelegate/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qitemeditorfactory/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qitemview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qlistview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qlistwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qtableview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qtablewidget/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qtreeview/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qtreewidget/CMakeLists.txt create mode 100644 tests/auto/widgets/itemviews/qtreewidgetitemiterator/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qaction/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qactiongroup/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qboxlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qdesktopwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qformlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qgesturerecognizer/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qshortcut/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qstackedlayout/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qtooltip/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qwidget_window/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qwidgetaction/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qwidgetmetatype/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qwidgetsvariant/CMakeLists.txt create mode 100644 tests/auto/widgets/kernel/qwindowcontainer/CMakeLists.txt create mode 100644 tests/auto/widgets/styles/CMakeLists.txt create mode 100644 tests/auto/widgets/styles/qmacstyle/CMakeLists.txt create mode 100644 tests/auto/widgets/styles/qstyle/CMakeLists.txt create mode 100644 tests/auto/widgets/styles/qstyleoption/CMakeLists.txt create mode 100644 tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt create mode 100644 tests/auto/widgets/util/CMakeLists.txt create mode 100644 tests/auto/widgets/util/qcompleter/CMakeLists.txt create mode 100644 tests/auto/widgets/util/qscroller/CMakeLists.txt create mode 100644 tests/auto/widgets/util/qsystemtrayicon/CMakeLists.txt create mode 100644 tests/auto/widgets/util/qundogroup/CMakeLists.txt create mode 100644 tests/auto/widgets/util/qundostack/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qabstractbutton/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qabstractscrollarea/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qabstractslider/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qabstractspinbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qbuttongroup/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qcalendarwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qcheckbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qcombobox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qcommandlinkbutton/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qdatetimeedit/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qdial/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qdialogbuttonbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qdockwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qdoublespinbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qfocusframe/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qfontcombobox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qframe/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qgroupbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qkeysequenceedit/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qlabel/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qlcdnumber/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qlineedit/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qmainwindow/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qmdisubwindow/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qmenu/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qmenubar/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qpushbutton/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qradiobutton/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qscrollarea/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qsizegrip/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qslider/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qspinbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qsplashscreen/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qsplitter/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qstatusbar/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtabbar/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtabwidget/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtextbrowser/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtextedit/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtoolbar/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtoolbox/CMakeLists.txt create mode 100644 tests/auto/widgets/widgets/qtoolbutton/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/kernel/events/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qalgorithms/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qchar/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qdatetime/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qlist/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qlocale/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qstring/CMakeLists.txt create mode 100644 tests/benchmarks/corelib/tools/qtimezone/CMakeLists.txt create mode 100644 tests/benchmarks/gui/image/blendbench/CMakeLists.txt create mode 100644 tests/benchmarks/gui/image/qimagescale/CMakeLists.txt create mode 100644 tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt create mode 100644 tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt create mode 100644 tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt create mode 100644 tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt create mode 100644 tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt create mode 100644 tests/benchmarks/gui/painting/qtransform/CMakeLists.txt create mode 100644 tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt create mode 100644 tests/manual/CMakeLists.txt create mode 100644 tests/manual/qcursor/childwindow/CMakeLists.txt create mode 100644 tests/manual/qmetatype/CMakeLists.txt create mode 100644 tests/manual/qopenglwindow/multiwindow/CMakeLists.txt create mode 100644 util/cmake/Pipfile create mode 100755 util/cmake/cmakeconversionrate.py create mode 100755 util/cmake/configurejson2cmake.py create mode 100755 util/cmake/generate_module_map.sh create mode 100644 util/cmake/helper.py create mode 100755 util/cmake/pro2cmake.py create mode 100755 util/cmake/run_pro2cmake.py create mode 100644 util/cmake/tests/__init__.py create mode 100644 util/cmake/tests/data/complex_values.pro create mode 100644 util/cmake/tests/data/definetest.pro create mode 100644 util/cmake/tests/data/else.pro create mode 100644 util/cmake/tests/data/else2.pro create mode 100644 util/cmake/tests/data/else3.pro create mode 100644 util/cmake/tests/data/else4.pro create mode 100644 util/cmake/tests/data/else5.pro create mode 100644 util/cmake/tests/data/else6.pro create mode 100644 util/cmake/tests/data/else7.pro create mode 100644 util/cmake/tests/data/else8.pro create mode 100644 util/cmake/tests/data/function_if.pro create mode 100644 util/cmake/tests/data/include.pro create mode 100644 util/cmake/tests/data/load.pro create mode 100644 util/cmake/tests/data/quoted.pro create mode 100644 util/cmake/tests/data/unset.pro create mode 100755 util/cmake/tests/test_parsing.py diff --git a/.gitignore b/.gitignore index f133a2124e2..9461e0bb7b1 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ qt*-config.h qt*-config_p.h qt*-config.pri +*.pyc +.mypy_cache /include/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000000..0030bc5662e --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(QtBase + VERSION 5.12.0 + DESCRIPTION "Qt Base Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin") + +## Qt specific setup common for all modules: +include(QtSetup) + +## Enable feature summary at the end of the configure run: +include(FeatureSummary) + +## QtBase specific configure tests: +include(QtBaseConfigureTests) + +## Targets for global features, etc.: +include(QtBaseGlobalTargets) + +## Should this Qt be static or dynamically linked? +option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON) +set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) + +## Visit all the directories: +add_subdirectory(src) + +if (BUILD_TESTING) + add_subdirectory(tests) +endif() + +add_subdirectory(qmake) +add_subdirectory(examples) + +## Delayed actions on some of the Qt targets: +include(QtPostProcess) + +## Print a feature summary: +feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/3rdparty/extra-cmake-modules/COPYING-CMAKE-SCRIPTS b/cmake/3rdparty/extra-cmake-modules/COPYING-CMAKE-SCRIPTS new file mode 100644 index 00000000000..4b417765f3a --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/COPYING-CMAKE-SCRIPTS @@ -0,0 +1,22 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/ECMFindModuleHelpersStub.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/ECMFindModuleHelpersStub.cmake new file mode 100644 index 00000000000..bb8c9a62fc6 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/ECMFindModuleHelpersStub.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../modules/ECMFindModuleHelpers.cmake) diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindWayland.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindWayland.cmake new file mode 100644 index 00000000000..233cc88d020 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindWayland.cmake @@ -0,0 +1,143 @@ +#.rst: +# FindWayland +# ----------- +# +# Try to find Wayland. +# +# This is a component-based find module, which makes use of the COMPONENTS +# and OPTIONAL_COMPONENTS arguments to find_module. The following components +# are available:: +# +# Client Server Cursor Egl +# +# If no components are specified, this module will act as though all components +# were passed to OPTIONAL_COMPONENTS. +# +# This module will define the following variables, independently of the +# components searched for or found: +# +# ``Wayland_FOUND`` +# TRUE if (the requested version of) Wayland is available +# ``Wayland_VERSION`` +# Found Wayland version +# ``Wayland_TARGETS`` +# A list of all targets imported by this module (note that there may be more +# than the components that were requested) +# ``Wayland_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the imported +# targets +# ``Wayland_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the targets are +# not used for linking +# ``Wayland_DEFINITIONS`` +# This should be passed to target_compile_options() if the targets are not +# used for linking +# +# For each searched-for components, ``Wayland__FOUND`` will be set to +# TRUE if the corresponding Wayland library was found, and FALSE otherwise. If +# ``Wayland__FOUND`` is TRUE, the imported target +# ``Wayland::`` will be defined. This module will also attempt to +# determine ``Wayland_*_VERSION`` variables for each imported target, although +# ``Wayland_VERSION`` should normally be sufficient. +# +# In general we recommend using the imported targets, as they are easier to use +# and provide more control. Bear in mind, however, that if any target is in the +# link interface of an exported library, it must be made available by the +# package config file. +# +# Since pre-1.0.0. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(Wayland) + +set(Wayland_known_components + Client + Server + Cursor + Egl +) +foreach(_comp ${Wayland_known_components}) + string(TOLOWER "${_comp}" _lc_comp) + set(Wayland_${_comp}_component_deps) + set(Wayland_${_comp}_pkg_config "wayland-${_lc_comp}") + set(Wayland_${_comp}_lib "wayland-${_lc_comp}") + set(Wayland_${_comp}_header "wayland-${_lc_comp}.h") +endforeach() +set(Wayland_Egl_component_deps Client) + +ecm_find_package_parse_components(Wayland + RESULT_VAR Wayland_components + KNOWN_COMPONENTS ${Wayland_known_components} +) +ecm_find_package_handle_library_components(Wayland + COMPONENTS ${Wayland_components} +) + +# If pkg-config didn't provide us with version information, +# try to extract it from wayland-version.h +# (Note that the version from wayland-egl.pc will probably be +# the Mesa version, rather than the Wayland version, but that +# version will be ignored as we always find wayland-client.pc +# first). +if(NOT Wayland_VERSION) + find_file(Wayland_VERSION_HEADER + NAMES wayland-version.h + HINTS ${Wayland_INCLUDE_DIRS} + ) + mark_as_advanced(Wayland_VERSION_HEADER) + if(Wayland_VERSION_HEADER) + file(READ ${Wayland_VERSION_HEADER} _wayland_version_header_contents) + string(REGEX REPLACE + "^.*[ \t]+WAYLAND_VERSION[ \t]+\"([0-9.]*)\".*$" + "\\1" + Wayland_VERSION + "${_wayland_version_header_contents}" + ) + unset(_wayland_version_header_contents) + endif() +endif() + +find_package_handle_standard_args(Wayland + FOUND_VAR + Wayland_FOUND + REQUIRED_VARS + Wayland_LIBRARIES + VERSION_VAR + Wayland_VERSION + HANDLE_COMPONENTS +) + +include(FeatureSummary) +set_package_properties(Wayland PROPERTIES + URL "http://wayland.freedesktop.org" + DESCRIPTION "C library implementation of the Wayland protocol: a protocol for a compositor to talk to its clients" +) diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindX11_XCB.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindX11_XCB.cmake new file mode 100644 index 00000000000..dd55fd7b301 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindX11_XCB.cmake @@ -0,0 +1,118 @@ +#.rst: +# FindX11_XCB +# ----------- +# +# Try to find the X11 XCB compatibility library. +# +# This will define the following variables: +# +# ``X11_XCB_FOUND`` +# True if (the requested version of) libX11-xcb is available +# ``X11_XCB_VERSION`` +# The version of libX11-xcb (this is not guaranteed to be set even when +# X11_XCB_FOUND is true) +# ``X11_XCB_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``EGL::EGL`` +# target +# ``X11_XCB_INCLUDE_DIR`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``X11_XCB_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``X11_XCB_FOUND`` is TRUE, it will also define the following imported +# target: +# +# ``X11::XCB`` +# The X11 XCB compatibility library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. +# +# Since pre-1.0.0. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2011 Fredrik Höglund +# Copyright 2008 Helio Chissini de Castro +# Copyright 2007 Matthias Kretz +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(X11_XCB) + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_X11_XCB QUIET x11-xcb) + +set(X11_XCB_DEFINITIONS ${PKG_X11_XCB_CFLAGS_OTHER}) +set(X11_XCB_VERSION ${PKG_X11_XCB_VERSION}) + +find_path(X11_XCB_INCLUDE_DIR + NAMES X11/Xlib-xcb.h + HINTS ${PKG_X11_XCB_INCLUDE_DIRS} +) +find_library(X11_XCB_LIBRARY + NAMES X11-xcb + HINTS ${PKG_X11_XCB_LIBRARY_DIRS} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(X11_XCB + FOUND_VAR + X11_XCB_FOUND + REQUIRED_VARS + X11_XCB_LIBRARY + X11_XCB_INCLUDE_DIR + VERSION_VAR + X11_XCB_VERSION +) + +if(X11_XCB_FOUND AND NOT TARGET X11::XCB) + add_library(X11::XCB UNKNOWN IMPORTED) + set_target_properties(X11::XCB PROPERTIES + IMPORTED_LOCATION "${X11_XCB_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${X11_XCB_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${X11_XCB_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(X11_XCB_INCLUDE_DIR X11_XCB_LIBRARY) + +# compatibility variables +set(X11_XCB_LIBRARIES ${X11_XCB_LIBRARY}) +set(X11_XCB_INCLUDE_DIRS ${X11_XCB_INCLUDE_DIR}) +set(X11_XCB_VERSION_STRING ${X11_XCB_VERSION}) + +include(FeatureSummary) +set_package_properties(X11_XCB PROPERTIES + URL "http://xorg.freedesktop.org/" + DESCRIPTION "A compatibility library for code that translates Xlib API calls into XCB calls" +) diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake new file mode 100644 index 00000000000..d530d2d7f46 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindXCB.cmake @@ -0,0 +1,201 @@ +#.rst: +# FindXCB +# ------- +# +# Try to find XCB. +# +# This is a component-based find module, which makes use of the COMPONENTS and +# OPTIONAL_COMPONENTS arguments to find_module. The following components are +# available:: +# +# XCB +# ATOM AUX COMPOSITE CURSOR DAMAGE +# DPMS DRI2 DRI3 EVENT EWMH +# GLX ICCCM IMAGE KEYSYMS PRESENT +# RANDR RECORD RENDER RENDERUTIL RES +# SCREENSAVER SHAPE SHM SYNC UTIL +# XEVIE XF86DRI XFIXES XINERAMA XINPUT +# XKB XPRINT XTEST XV XVMC +# +# If no components are specified, this module will act as though all components +# except XINPUT (which is considered unstable) were passed to +# OPTIONAL_COMPONENTS. +# +# This module will define the following variables, independently of the +# components searched for or found: +# +# ``XCB_FOUND`` +# True if (the requestion version of) xcb is available +# ``XCB_VERSION`` +# Found xcb version +# ``XCB_TARGETS`` +# A list of all targets imported by this module (note that there may be more +# than the components that were requested) +# ``XCB_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the imported +# targets +# ``XCB_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the targets are +# not used for linking +# ``XCB_DEFINITIONS`` +# This should be passed to target_compile_options() if the targets are not +# used for linking +# +# For each searched-for components, ``XCB__FOUND`` will be set to +# true if the corresponding xcb library was found, and false otherwise. If +# ``XCB__FOUND`` is true, the imported target ``XCB::`` +# will be defined. This module will also attempt to determine +# ``XCB_*_VERSION`` variables for each imported target, although +# ``XCB_VERSION`` should normally be sufficient. +# +# In general we recommend using the imported targets, as they are easier to use +# and provide more control. Bear in mind, however, that if any target is in the +# link interface of an exported library, it must be made available by the +# package config file. +# +# Since pre-1.0.0. + +#============================================================================= +# Copyright 2011 Fredrik Höglund +# Copyright 2013 Martin Gräßlin +# Copyright 2014-2015 Alex Merry +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) + +ecm_find_package_version_check(XCB) + +# Note that this list needs to be ordered such that any component +# appears after its dependencies +set(XCB_known_components + XCB + RENDER + SHAPE + XFIXES + SHM + ATOM + AUX + COMPOSITE + CURSOR + DAMAGE + DPMS + DRI2 + DRI3 + EVENT + EWMH + GLX + ICCCM + IMAGE + KEYSYMS + PRESENT + RANDR + RECORD + RENDERUTIL + RES + SCREENSAVER + SYNC + UTIL + XEVIE + XF86DRI + XINERAMA + XINPUT + XKB + XPRINT + XTEST + XV + XVMC +) + +# XINPUT is unstable; do not include it by default +set(XCB_default_components ${XCB_known_components}) +list(REMOVE_ITEM XCB_default_components "XINPUT") + +# default component info: xcb components have fairly predictable +# header files, library names and pkg-config names +foreach(_comp ${XCB_known_components}) + string(TOLOWER "${_comp}" _lc_comp) + set(XCB_${_comp}_component_deps XCB) + set(XCB_${_comp}_pkg_config "xcb-${_lc_comp}") + set(XCB_${_comp}_lib "xcb-${_lc_comp}") + set(XCB_${_comp}_header "xcb/${_lc_comp}.h") +endforeach() +# exceptions +set(XCB_XCB_component_deps) +set(XCB_COMPOSITE_component_deps XCB XFIXES) +set(XCB_DAMAGE_component_deps XCB XFIXES) +set(XCB_IMAGE_component_deps XCB SHM) +set(XCB_RENDERUTIL_component_deps XCB RENDER) +set(XCB_XFIXES_component_deps XCB RENDER SHAPE) +set(XCB_XVMC_component_deps XCB XV) +set(XCB_XV_component_deps XCB SHM) +set(XCB_XCB_pkg_config "xcb") +set(XCB_XCB_lib "xcb") +set(XCB_ATOM_header "xcb/xcb_atom.h") +set(XCB_ATOM_lib "xcb-util") +set(XCB_AUX_header "xcb/xcb_aux.h") +set(XCB_AUX_lib "xcb-util") +set(XCB_CURSOR_header "xcb/xcb_cursor.h") +set(XCB_EVENT_header "xcb/xcb_event.h") +set(XCB_EVENT_lib "xcb-util") +set(XCB_EWMH_header "xcb/xcb_ewmh.h") +set(XCB_ICCCM_header "xcb/xcb_icccm.h") +set(XCB_IMAGE_header "xcb/xcb_image.h") +set(XCB_KEYSYMS_header "xcb/xcb_keysyms.h") +set(XCB_PIXEL_header "xcb/xcb_pixel.h") +set(XCB_RENDERUTIL_header "xcb/xcb_renderutil.h") +set(XCB_RENDERUTIL_lib "xcb-render-util") +set(XCB_UTIL_header "xcb/xcb_util.h") + +ecm_find_package_parse_components(XCB + RESULT_VAR XCB_components + KNOWN_COMPONENTS ${XCB_known_components} + DEFAULT_COMPONENTS ${XCB_default_components} +) + +list(FIND XCB_components "XINPUT" _XCB_XINPUT_index) +if (NOT _XCB_XINPUT_index EQUAL -1) + message(AUTHOR_WARNING "XINPUT from XCB was requested: this is EXPERIMENTAL and is likely to unavailable on many systems!") +endif() + +ecm_find_package_handle_library_components(XCB + COMPONENTS ${XCB_components} +) + +find_package_handle_standard_args(XCB + FOUND_VAR + XCB_FOUND + REQUIRED_VARS + XCB_LIBRARIES + VERSION_VAR + XCB_VERSION + HANDLE_COMPONENTS +) + +include(FeatureSummary) +set_package_properties(XCB PROPERTIES + URL "http://xcb.freedesktop.org" + DESCRIPTION "X protocol C-language Binding" +) diff --git a/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake b/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake new file mode 100644 index 00000000000..06cc0b66d86 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake @@ -0,0 +1,173 @@ +#.rst: +# ECMEnableSanitizers +# ------------------- +# +# Enable compiler sanitizer flags. +# +# The following sanitizers are supported: +# +# - Address Sanitizer +# - Memory Sanitizer +# - Thread Sanitizer +# - Leak Sanitizer +# - Undefined Behaviour Sanitizer +# +# All of them are implemented in Clang, depending on your version, and +# there is an work in progress in GCC, where some of them are currently +# implemented. +# +# This module will check your current compiler version to see if it +# supports the sanitizers that you want to enable +# +# Usage +# ===== +# +# Simply add:: +# +# include(ECMEnableSanitizers) +# +# to your ``CMakeLists.txt``. Note that this module is included in +# KDECompilerSettings, so projects using that module do not need to also +# include this one. +# +# The sanitizers are not enabled by default. Instead, you must set +# ``ECM_ENABLE_SANITIZERS`` (either in your ``CMakeLists.txt`` or on the +# command line) to a semicolon-separated list of sanitizers you wish to enable. +# The options are: +# +# - address +# - memory +# - thread +# - leak +# - undefined +# +# The sanitizers "address", "memory" and "thread" are mutually exclusive. You +# cannot enable two of them in the same build. +# +# "leak" requires the "address" sanitizer. +# +# .. note:: +# +# To reduce the overhead induced by the instrumentation of the sanitizers, it +# is advised to enable compiler optimizations (``-O1`` or higher). +# +# Example +# ======= +# +# This is an example of usage:: +# +# mkdir build +# cd build +# cmake -DECM_ENABLE_SANITIZERS='address;leak;undefined' .. +# +# .. note:: +# +# Most of the sanitizers will require Clang. To enable it, use:: +# +# -DCMAKE_CXX_COMPILER=clang++ +# +# Since 1.3.0. + +#============================================================================= +# Copyright 2014 Mathieu Tarral +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# MACRO check_compiler_version +#----------------------------- +macro (check_compiler_version gcc_required_version clang_required_version) + if ( + ( + CMAKE_CXX_COMPILER_ID MATCHES "GNU" + AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_required_version} + ) + OR + ( + CMAKE_CXX_COMPILER_ID MATCHES "Clang" + AND + CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${clang_required_version} + ) + ) + # error ! + message(FATAL_ERROR "You ask to enable the sanitizer ${CUR_SANITIZER}, + but your compiler ${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION} + does not support it ! + You should use at least GCC ${gcc_required_version} or Clang ${clang_required_version} + (99.99 means not implemented yet)") + endif () +endmacro () + +# MACRO check_compiler_support +#------------------------------ +macro (enable_sanitizer_flags sanitize_option) + if (${sanitize_option} MATCHES "address") + check_compiler_version("4.8" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls") + set(XSAN_LINKER_FLAGS "asan") + elseif (${sanitize_option} MATCHES "thread") + check_compiler_version("4.8" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=thread") + set(XSAN_LINKER_FLAGS "tsan") + elseif (${sanitize_option} MATCHES "memory") + check_compiler_version("99.99" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=memory") + elseif (${sanitize_option} MATCHES "leak") + check_compiler_version("4.9" "3.4") + set(XSAN_COMPILE_FLAGS "-fsanitize=leak") + set(XSAN_LINKER_FLAGS "lsan") + elseif (${sanitize_option} MATCHES "undefined") + check_compiler_version("4.9" "3.1") + set(XSAN_COMPILE_FLAGS "-fsanitize=undefined -fno-omit-frame-pointer -fno-optimize-sibling-calls") + else () + message(FATAL_ERROR "Compiler sanitizer option \"${sanitize_option}\" not supported.") + endif () +endmacro () + +if (ECM_ENABLE_SANITIZERS) + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # for each element of the ECM_ENABLE_SANITIZERS list + foreach ( CUR_SANITIZER ${ECM_ENABLE_SANITIZERS} ) + # lowercase filter + string(TOLOWER ${CUR_SANITIZER} CUR_SANITIZER) + # check option and enable appropriate flags + enable_sanitizer_flags ( ${CUR_SANITIZER} ) + # TODO: GCC will not link pthread library if enabled ASan + if(CMAKE_C_COMPILER_ID MATCHES "Clang") + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XSAN_COMPILE_FLAGS}" ) + endif() + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" ) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + link_libraries(${XSAN_LINKER_FLAGS}) + endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") + endif () + endforeach() + else() + message(STATUS "Tried to enable sanitizers (-DECM_ENABLE_SANITIZERS=${ECM_ENABLE_SANITIZERS}), \ +but compiler (${CMAKE_CXX_COMPILER_ID}) does not have sanitizer support") + endif() +endif() diff --git a/cmake/3rdparty/extra-cmake-modules/modules/ECMFindModuleHelpers.cmake b/cmake/3rdparty/extra-cmake-modules/modules/ECMFindModuleHelpers.cmake new file mode 100644 index 00000000000..f2e32f959e8 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/modules/ECMFindModuleHelpers.cmake @@ -0,0 +1,297 @@ +#.rst: +# ECMFindModuleHelpers +# -------------------- +# +# Helper macros for find modules: ecm_find_package_version_check(), +# ecm_find_package_parse_components() and +# ecm_find_package_handle_library_components(). +# +# :: +# +# ecm_find_package_version_check() +# +# Prints warnings if the CMake version or the project's required CMake version +# is older than that required by extra-cmake-modules. +# +# :: +# +# ecm_find_package_parse_components( +# RESULT_VAR +# KNOWN_COMPONENTS [ [...]] +# [SKIP_DEPENDENCY_HANDLING]) +# +# This macro will populate with a list of components found in +# _FIND_COMPONENTS, after checking that all those components are in the +# list of KNOWN_COMPONENTS; if there are any unknown components, it will print +# an error or warning (depending on the value of _FIND_REQUIRED) and call +# return(). +# +# The order of components in is guaranteed to match the order they +# are listed in the KNOWN_COMPONENTS argument. +# +# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable +# __component_deps will be checked for dependent components. +# If is listed in _FIND_COMPONENTS, then all its (transitive) +# dependencies will also be added to . +# +# :: +# +# ecm_find_package_handle_library_components( +# COMPONENTS [ [...]] +# [SKIP_DEPENDENCY_HANDLING]) +# [SKIP_PKG_CONFIG]) +# +# Creates an imported library target for each component. The operation of this +# macro depends on the presence of a number of CMake variables. +# +# The __lib variable should contain the name of this library, +# and __header variable should contain the name of a header +# file associated with it (whatever relative path is normally passed to +# '#include'). __header_subdir variable can be used to specify +# which subdirectory of the include path the headers will be found in. +# ecm_find_package_components() will then search for the library +# and include directory (creating appropriate cache variables) and create an +# imported library target named ::. +# +# Additional variables can be used to provide additional information: +# +# If SKIP_PKG_CONFIG, the __pkg_config variable is set, and +# pkg-config is found, the pkg-config module given by +# __pkg_config will be searched for and used to help locate the +# library and header file. It will also be used to set +# __VERSION. +# +# Note that if version information is found via pkg-config, +# __FIND_VERSION can be set to require a particular version +# for each component. +# +# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property +# of the imported target for will be set to contain the imported +# targets for the components listed in __component_deps. +# _FOUND will also be set to false if any of the compoments in +# __component_deps are not found. This requires the components +# in __component_deps to be listed before in the +# COMPONENTS argument. +# +# The following variables will be set: +# +# ``_TARGETS`` +# the imported targets +# ``_LIBRARIES`` +# the found libraries +# ``_INCLUDE_DIRS`` +# the combined required include directories for the components +# ``_DEFINITIONS`` +# the "other" CFLAGS provided by pkg-config, if any +# ``_VERSION`` +# the value of ``__VERSION`` for the first component that +# has this variable set (note that components are searched for in the order +# they are passed to the macro), although if it is already set, it will not +# be altered +# +# Note that these variables are never cleared, so if +# ecm_find_package_handle_library_components() is called multiple times with +# different components (typically because of multiple find_package() calls) then +# ``_TARGETS``, for example, will contain all the targets found in any +# call (although no duplicates). +# +# Since pre-1.0.0. + +#============================================================================= +# Copyright 2014 Alex Merry +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include(CMakeParseArguments) + +macro(ecm_find_package_version_check module_name) + if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake") + endif() + if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake") + endif() +endmacro() + +macro(ecm_find_package_parse_components module_name) + set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING) + set(ecm_fppc_oneValueArgs RESULT_VAR) + set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS) + cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN}) + + if(ECM_FPPC_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}") + endif() + if(NOT ECM_FPPC_RESULT_VAR) + message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components") + endif() + if(NOT ECM_FPPC_KNOWN_COMPONENTS) + message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components") + endif() + if(NOT ECM_FPPC_DEFAULT_COMPONENTS) + set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS}) + endif() + + if(${module_name}_FIND_COMPONENTS) + set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS}) + + if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING) + # Make sure deps are included + foreach(ecm_fppc_comp ${ecm_fppc_requestedComps}) + foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps}) + list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index) + if("${ecm_fppc_index}" STREQUAL "-1") + if(NOT ${module_name}_FIND_QUIETLY) + message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}") + endif() + list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}") + endif() + endforeach() + endforeach() + else() + message(STATUS "Skipping dependency handling for ${module_name}") + endif() + list(REMOVE_DUPLICATES ecm_fppc_requestedComps) + + # This makes sure components are listed in the same order as + # KNOWN_COMPONENTS (potentially important for inter-dependencies) + set(${ECM_FPPC_RESULT_VAR}) + foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS}) + list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index) + if(NOT "${ecm_fppc_index}" STREQUAL "-1") + list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}") + list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index}) + endif() + endforeach() + # if there are any left, they are unknown components + if(ecm_fppc_requestedComps) + set(ecm_fppc_msgType STATUS) + if(${module_name}_FIND_REQUIRED) + set(ecm_fppc_msgType FATAL_ERROR) + endif() + if(NOT ${module_name}_FIND_QUIETLY) + message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}") + endif() + return() + endif() + else() + set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS}) + endif() +endmacro() + +macro(ecm_find_package_handle_library_components module_name) + set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING) + set(ecm_fpwc_oneValueArgs) + set(ecm_fpwc_multiValueArgs COMPONENTS) + cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN}) + + if(ECM_FPWC_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}") + endif() + if(NOT ECM_FPWC_COMPONENTS) + message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components") + endif() + + include(FindPackageHandleStandardArgs) + find_package(PkgConfig) + foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS}) + set(ecm_fpwc_dep_vars) + set(ecm_fpwc_dep_targets) + if(NOT SKIP_DEPENDENCY_HANDLING) + foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps}) + list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND") + list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}") + endforeach() + endif() + + if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config) + pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET + ${${module_name}_${ecm_fpwc_comp}_pkg_config}) + endif() + + find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR + NAMES ${${module_name}_${ecm_fpwc_comp}_header} + HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS} + PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir} + ) + find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY + NAMES ${${module_name}_${ecm_fpwc_comp}_lib} + HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS} + ) + + set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}") + if(NOT ${module_name}_VERSION) + set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION}) + endif() + + find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp} + FOUND_VAR + ${module_name}_${ecm_fpwc_comp}_FOUND + REQUIRED_VARS + ${module_name}_${ecm_fpwc_comp}_LIBRARY + ${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR + ${ecm_fpwc_dep_vars} + VERSION_VAR + ${module_name}_${ecm_fpwc_comp}_VERSION + ) + + mark_as_advanced( + ${module_name}_${ecm_fpwc_comp}_LIBRARY + ${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR + ) + + if(${module_name}_${ecm_fpwc_comp}_FOUND) + list(APPEND ${module_name}_LIBRARIES + "${${module_name}_${ecm_fpwc_comp}_LIBRARY}") + list(APPEND ${module_name}_INCLUDE_DIRS + "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}") + set(${module_name}_DEFINITIONS + ${${module_name}_DEFINITIONS} + ${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}) + if(NOT TARGET ${module_name}::${ecm_fpwc_comp}) + add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED) + set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES + IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}" + ) + endif() + list(APPEND ${module_name}_TARGETS + "${module_name}::${ecm_fpwc_comp}") + endif() + endforeach() + if(${module_name}_LIBRARIES) + list(REMOVE_DUPLICATES ${module_name}_LIBRARIES) + endif() + if(${module_name}_INCLUDE_DIRS) + list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS) + endif() + if(${module_name}_DEFINITIONS) + list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS) + endif() + if(${module_name}_TARGETS) + list(REMOVE_DUPLICATES ${module_name}_TARGETS) + endif() +endmacro() diff --git a/cmake/3rdparty/extra-cmake-modules/qt_attribution.json b/cmake/3rdparty/extra-cmake-modules/qt_attribution.json new file mode 100644 index 00000000000..cebebf82eb2 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/qt_attribution.json @@ -0,0 +1,15 @@ +{ + "Id": "extra-cmake-modules", + "Name": "extra-cmake-modules", + "QDocModule": "qtcore", + "QtUsage": "Used as part of the build system.", + + "Description": "Additional CMake modules.", + "Homepage": "https://api.kde.org/ecm/", + "Version": "5.50.0", + + "License": "BSD-3-Clause", + "LicenseId": "BSD 3-Clause License", + "LicenseFile": "COPYING-CMAKE-SCRIPTS", + "Copyright": "Copyright © 2011-2018 The KDE community" +} diff --git a/cmake/3rdparty/kwin/COPYING-CMAKE-SCRIPTS b/cmake/3rdparty/kwin/COPYING-CMAKE-SCRIPTS new file mode 100644 index 00000000000..4b417765f3a --- /dev/null +++ b/cmake/3rdparty/kwin/COPYING-CMAKE-SCRIPTS @@ -0,0 +1,22 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cmake/3rdparty/kwin/FindFontconfig.cmake b/cmake/3rdparty/kwin/FindFontconfig.cmake new file mode 100644 index 00000000000..d95e46b4844 --- /dev/null +++ b/cmake/3rdparty/kwin/FindFontconfig.cmake @@ -0,0 +1,50 @@ +# - Try to find the Fontconfig +# Once done this will define +# +# FONTCONFIG_FOUND - system has Fontconfig +# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers +# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG +# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG + +# Copyright (c) 2006,2007 Laurent Montel, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) + + # in cache already + set(FONTCONFIG_FOUND TRUE) + +else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) + + if (NOT WIN32) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PC_FONTCONFIG QUIET fontconfig) + + set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER}) + endif (NOT WIN32) + + find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h + PATHS + ${PC_FONTCONFIG_INCLUDEDIR} + ${PC_FONTCONFIG_INCLUDE_DIRS} + /usr/X11/include + ) + + find_library(FONTCONFIG_LIBRARIES NAMES fontconfig + PATHS + ${PC_FONTCONFIG_LIBDIR} + ${PC_FONTCONFIG_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR ) + + mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR) + +endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) + diff --git a/cmake/3rdparty/kwin/FindLibdrm.cmake b/cmake/3rdparty/kwin/FindLibdrm.cmake new file mode 100644 index 00000000000..9936e07eeed --- /dev/null +++ b/cmake/3rdparty/kwin/FindLibdrm.cmake @@ -0,0 +1,126 @@ +#.rst: +# FindLibdrm +# ------- +# +# Try to find libdrm on a Unix system. +# +# This will define the following variables: +# +# ``Libdrm_FOUND`` +# True if (the requested version of) libdrm is available +# ``Libdrm_VERSION`` +# The version of libdrm +# ``Libdrm_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``Libdrm::Libdrm`` +# target +# ``Libdrm_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``Libdrm_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``Libdrm_FOUND`` is TRUE, it will also define the following imported target: +# +# ``Libdrm::Libdrm`` +# The libdrm library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by FindLibdrm.cmake") +endif() +if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindLibdrm.cmake") +endif() + +if(NOT WIN32) + # Use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PKG_Libdrm QUIET libdrm) + + set(Libdrm_DEFINITIONS ${PKG_Libdrm_CFLAGS_OTHER}) + set(Libdrm_VERSION ${PKG_Libdrm_VERSION}) + + find_path(Libdrm_INCLUDE_DIR + NAMES + xf86drm.h + HINTS + ${PKG_Libdrm_INCLUDE_DIRS} + ) + find_library(Libdrm_LIBRARY + NAMES + drm + HINTS + ${PKG_Libdrm_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libdrm + FOUND_VAR + Libdrm_FOUND + REQUIRED_VARS + Libdrm_LIBRARY + Libdrm_INCLUDE_DIR + VERSION_VAR + Libdrm_VERSION + ) + + if(Libdrm_FOUND AND NOT TARGET Libdrm::Libdrm) + add_library(Libdrm::Libdrm UNKNOWN IMPORTED) + set_target_properties(Libdrm::Libdrm PROPERTIES + IMPORTED_LOCATION "${Libdrm_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${Libdrm_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}" + INTERFACE_INCLUDE_DIRECTORIES "${Libdrm_INCLUDE_DIR}/libdrm" + ) + endif() + + mark_as_advanced(Libdrm_LIBRARY Libdrm_INCLUDE_DIR) + + # compatibility variables + set(Libdrm_LIBRARIES ${Libdrm_LIBRARY}) + set(Libdrm_INCLUDE_DIRS ${Libdrm_INCLUDE_DIR} "${Libdrm_INCLUDE_DIR}/libdrm") + set(Libdrm_VERSION_STRING ${Libdrm_VERSION}) + +else() + message(STATUS "FindLibdrm.cmake cannot find libdrm on Windows systems.") + set(Libdrm_FOUND FALSE) +endif() + +include(FeatureSummary) +set_package_properties(Libdrm PROPERTIES + URL "https://wiki.freedesktop.org/dri/" + DESCRIPTION "Userspace interface to kernel DRM services." +) diff --git a/cmake/3rdparty/kwin/FindLibinput.cmake b/cmake/3rdparty/kwin/FindLibinput.cmake new file mode 100644 index 00000000000..b856e0bbcb6 --- /dev/null +++ b/cmake/3rdparty/kwin/FindLibinput.cmake @@ -0,0 +1,125 @@ +#.rst: +# FindLibinput +# ------- +# +# Try to find libinput on a Unix system. +# +# This will define the following variables: +# +# ``Libinput_FOUND`` +# True if (the requested version of) libinput is available +# ``Libinput_VERSION`` +# The version of libinput +# ``Libinput_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``Libinput::Libinput`` +# target +# ``Libinput_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``Libinput_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``Libinput_FOUND`` is TRUE, it will also define the following imported target: +# +# ``Libinput::Libinput`` +# The libinput library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by FindLibinput.cmake") +endif() +if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindLibinput.cmake") +endif() + +if(NOT WIN32) + # Use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PKG_Libinput QUIET libinput) + + set(Libinput_DEFINITIONS ${PKG_Libinput_CFLAGS_OTHER}) + set(Libinput_VERSION ${PKG_Libinput_VERSION}) + + find_path(Libinput_INCLUDE_DIR + NAMES + libinput.h + HINTS + ${PKG_Libinput_INCLUDE_DIRS} + ) + find_library(Libinput_LIBRARY + NAMES + input + HINTS + ${PKG_Libinput_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Libinput + FOUND_VAR + Libinput_FOUND + REQUIRED_VARS + Libinput_LIBRARY + Libinput_INCLUDE_DIR + VERSION_VAR + Libinput_VERSION + ) + + if(Libinput_FOUND AND NOT TARGET Libinput::Libinput) + add_library(Libinput::Libinput UNKNOWN IMPORTED) + set_target_properties(Libinput::Libinput PROPERTIES + IMPORTED_LOCATION "${Libinput_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${Libinput_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${Libinput_INCLUDE_DIR}" + ) + endif() + + mark_as_advanced(Libinput_LIBRARY Libinput_INCLUDE_DIR) + + # compatibility variables + set(Libinput_LIBRARIES ${Libinput_LIBRARY}) + set(Libinput_INCLUDE_DIRS ${Libinput_INCLUDE_DIR}) + set(Libinput_VERSION_STRING ${Libinput_VERSION}) + +else() + message(STATUS "FindLibinput.cmake cannot find libinput on Windows systems.") + set(Libinput_FOUND FALSE) +endif() + +include(FeatureSummary) +set_package_properties(Libinput PROPERTIES + URL "http://www.freedesktop.org/wiki/Software/libinput/" + DESCRIPTION "Library to handle input devices in Wayland compositors and to provide a generic X.Org input driver." +) diff --git a/cmake/3rdparty/kwin/FindXKB.cmake b/cmake/3rdparty/kwin/FindXKB.cmake new file mode 100644 index 00000000000..0d599df0fd4 --- /dev/null +++ b/cmake/3rdparty/kwin/FindXKB.cmake @@ -0,0 +1,101 @@ +# Try to find xkbcommon on a Unix system +# +# This will define: +# +# XKB_FOUND - True if XKB is available +# XKB_LIBRARIES - Link these to use XKB +# XKB_INCLUDE_DIRS - Include directory for XKB +# XKB_DEFINITIONS - Compiler flags for using XKB +# +# Additionally, the following imported targets will be defined: +# +# XKB::XKB +# +# Copyright (c) 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the University nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by FindXKB.cmake") +endif() +if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use FindXKB.cmake") +endif() + +if(NOT WIN32) + # Use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PKG_XKB QUIET xkbcommon) + + set(XKB_DEFINITIONS ${PKG_XKB_CFLAGS_OTHER}) + + find_path(XKB_INCLUDE_DIR + NAMES + xkbcommon/xkbcommon.h + HINTS + ${PKG_XKB_INCLUDE_DIRS} + ) + find_library(XKB_LIBRARY + NAMES + xkbcommon + HINTS + ${PKG_XKB_LIBRARY_DIRS} + ) + + set(XKB_LIBRARIES ${XKB_LIBRARY}) + set(XKB_INCLUDE_DIRS ${XKB_INCLUDE_DIR}) + set(XKB_VERSION ${PKG_XKB_VERSION}) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(XKB + FOUND_VAR + XKB_FOUND + REQUIRED_VARS + XKB_LIBRARY + XKB_INCLUDE_DIR + VERSION_VAR + XKB_VERSION + ) + + if(XKB_FOUND AND NOT TARGET XKB::XKB) + add_library(XKB::XKB UNKNOWN IMPORTED) + set_target_properties(XKB::XKB PROPERTIES + IMPORTED_LOCATION "${XKB_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${XKB_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${XKB_INCLUDE_DIR}" + ) + endif() + +else() + message(STATUS "FindXKB.cmake cannot find XKB on Windows systems.") + set(XKB_FOUND FALSE) +endif() + +include(FeatureSummary) +set_package_properties(XKB PROPERTIES + URL "http://xkbcommon.org" + DESCRIPTION "XKB API common to servers and clients." +) diff --git a/cmake/3rdparty/kwin/Findgbm.cmake b/cmake/3rdparty/kwin/Findgbm.cmake new file mode 100644 index 00000000000..6dfc895daac --- /dev/null +++ b/cmake/3rdparty/kwin/Findgbm.cmake @@ -0,0 +1,125 @@ +#.rst: +# Findgbm +# ------- +# +# Try to find gbm on a Unix system. +# +# This will define the following variables: +# +# ``gbm_FOUND`` +# True if (the requested version of) gbm is available +# ``gbm_VERSION`` +# The version of gbm +# ``gbm_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``gbm::gbm`` +# target +# ``gbm_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``gbm_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``gbm_FOUND`` is TRUE, it will also define the following imported target: +# +# ``gbm::gbm`` +# The gbm library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by Findgbm.cmake") +endif() +if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Findgbm.cmake") +endif() + +if(NOT WIN32) + # Use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + find_package(PkgConfig) + pkg_check_modules(PKG_gbm QUIET gbm) + + set(gbm_DEFINITIONS ${PKG_gbm_CFLAGS_OTHER}) + set(gbm_VERSION ${PKG_gbm_VERSION}) + + find_path(gbm_INCLUDE_DIR + NAMES + gbm.h + HINTS + ${PKG_gbm_INCLUDE_DIRS} + ) + find_library(gbm_LIBRARY + NAMES + gbm + HINTS + ${PKG_gbm_LIBRARY_DIRS} + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(gbm + FOUND_VAR + gbm_FOUND + REQUIRED_VARS + gbm_LIBRARY + gbm_INCLUDE_DIR + VERSION_VAR + gbm_VERSION + ) + + if(gbm_FOUND AND NOT TARGET gbm::gbm) + add_library(gbm::gbm UNKNOWN IMPORTED) + set_target_properties(gbm::gbm PROPERTIES + IMPORTED_LOCATION "${gbm_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${gbm_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${gbm_INCLUDE_DIR}" + ) + endif() + + mark_as_advanced(gbm_LIBRARY gbm_INCLUDE_DIR) + + # compatibility variables + set(gbm_LIBRARIES ${gbm_LIBRARY}) + set(gbm_INCLUDE_DIRS ${gbm_INCLUDE_DIR}) + set(gbm_VERSION_STRING ${gbm_VERSION}) + +else() + message(STATUS "Findgbm.cmake cannot find gbm on Windows systems.") + set(gbm_FOUND FALSE) +endif() + +include(FeatureSummary) +set_package_properties(gbm PROPERTIES + URL "http://www.mesa3d.org" + DESCRIPTION "Mesa gbm library." +) diff --git a/cmake/3rdparty/kwin/qt_attribution.json b/cmake/3rdparty/kwin/qt_attribution.json new file mode 100644 index 00000000000..5c226411323 --- /dev/null +++ b/cmake/3rdparty/kwin/qt_attribution.json @@ -0,0 +1,17 @@ +{ + "Id": "kwin", + "Name": "KWin", + "QDocModule": "qtcore", + "QtUsage": "Used as part of the build system.", + + "Description": "Additional CMake modules for graphics system dependencies.", + "Homepage": "https://www.kde.org/", + "Version": "5.13.4", + + "License": "BSD-3-Clause", + "LicenseId": "BSD 3-Clause License", + "LicenseFile": "COPYING-CMAKE-SCRIPTS", + "Copyright": "Copyright 2014 Alex Merry +Copyright 2014 Martin Gräßlin , +Copyright (c) 2006,2007 Laurent Montel, " +} diff --git a/cmake/FindAtomic.cmake b/cmake/FindAtomic.cmake new file mode 100644 index 00000000000..66763786863 --- /dev/null +++ b/cmake/FindAtomic.cmake @@ -0,0 +1,37 @@ +include(CheckCXXSourceCompiles) + +set (atomic_test_sources "#include +#include + +void test(volatile std::atomic &a) +{ + std::int64_t v = a.load(std::memory_order_acquire); + while (!a.compare_exchange_strong(v, v + 1, + std::memory_order_acq_rel, + std::memory_order_acquire)) { + v = a.exchange(v - 1); + } + a.store(v + 1, std::memory_order_release); +} + +int main(int, char **) +{ + void *ptr = (void*)0xffffffc0; // any random pointer + test(*reinterpret_cast *>(ptr)); + return 0; +}") + +check_cxx_source_compiles("${atomic_test_sources}" HAVE_STDATOMIC) +if(NOT HAVE_STDATOMIC) + set(_req_libraries "${CMAKE_REQUIRE_LIBRARIES}") + set(CMAKE_REQUIRE_LIBRARIES "atomic") + check_cxx_source_compiles("${atomic_test_sources}" HAVE_STDATOMIC_WITH_LIB) + set(CMAKE_REQUIRE_LIBRARIES "${_req_libraries}") +endif() + +add_library(Atomic INTERFACE) +if(HAVE_STDATOMIC_WITH_LIB) + target_link_libraries(Atomic INTERFACE atomic) +endif() + +set(Atomic_FOUND 1) diff --git a/cmake/FindGLib.cmake b/cmake/FindGLib.cmake new file mode 100644 index 00000000000..461564122a9 --- /dev/null +++ b/cmake/FindGLib.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) + +pkg_check_modules(GLib glib-2.0 IMPORTED_TARGET) diff --git a/cmake/FindLibsystemd.cmake b/cmake/FindLibsystemd.cmake new file mode 100644 index 00000000000..9c0082fd39a --- /dev/null +++ b/cmake/FindLibsystemd.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) + +pkg_check_modules(Libsystemd systemd IMPORTED_TARGET) diff --git a/cmake/FindLibudev.cmake b/cmake/FindLibudev.cmake new file mode 100644 index 00000000000..a36c81ff4a8 --- /dev/null +++ b/cmake/FindLibudev.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) + +pkg_check_modules(Libudev udev IMPORTED_TARGET) diff --git a/cmake/FindPCRE2.cmake b/cmake/FindPCRE2.cmake new file mode 100644 index 00000000000..7e45c963d7d --- /dev/null +++ b/cmake/FindPCRE2.cmake @@ -0,0 +1,13 @@ + +find_library(PCRE2_LIBRARIES NAMES pcre2-16) +find_path(PCRE2_INCLUDE_DIRS pcre2.h) + +if (PCRE2_LIBRARIES STREQUAL "PCRE2_LIBRARIES-NOTFOUND" OR PCRE2_INCLUDE_DIRS STREQUAL "PCRE2_INCLUDE_DIRS-NOTFOUND") + set(PCRE2_FOUND 0) +else() + add_library(PCRE2 INTERFACE) + target_link_libraries(PCRE2 INTERFACE ${PCRE2_LIBRARIES}) + target_include_directories(PCRE2 INTERFACE ${PCRE2_INCLUDE_DIRS}) + set(PCRE2_FOUND 1) +endif() + diff --git a/cmake/FindWrapDoubleConversion.cmake b/cmake/FindWrapDoubleConversion.cmake new file mode 100644 index 00000000000..c93525af23f --- /dev/null +++ b/cmake/FindWrapDoubleConversion.cmake @@ -0,0 +1,36 @@ +include(CheckCXXSourceCompiles) + +check_cxx_source_compiles(" +#include +#include + +int main(int argc, char *argv[]) { + _locale_t invalidLocale = NULL; + double a = 3.14; + const char *format = \"invalid format\"; + _sscanf_l(argv[0], invalidLocale, format, &a, &argc); + _snprintf_l(argv[0], 1, invalidLocale, format, a); +}" HAVE__SPRINTF_L) + +check_cxx_source_compiles(" +#include +#include + +int main(int argc, char *argv[]) { + locale_t invalidLocale = NULL; + double a = 3.14; + const char *format = \"invalid format\"; + snprintf_l(argv[0], 1, invalidLocale, format, a); + sscanf_l(argv[0], invalidLocale, format, &a, &argc); + return 0; +}" HAVE_SPRINTF_L) + +add_library(WrapDoubleConversion INTERFACE) +if (NOT HAVE__SPRINTF_L AND NOT HAVE_SPRINTF_L) + find_package(double-conversion) + set_package_properties(double-conversion PROPERTIES TYPE REQUIRED) + target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion) +endif() + +set(WrapDoubleConversion_FOUND 1) + diff --git a/cmake/Finddouble-conversion.cmake b/cmake/Finddouble-conversion.cmake new file mode 100644 index 00000000000..77785696b9e --- /dev/null +++ b/cmake/Finddouble-conversion.cmake @@ -0,0 +1,30 @@ +# Fallback find module for double-conversion +# if double-conversion is built with CMake it'll install a config module, which we prefer +# if it's built with Scons (their default), we search ourselves + +find_package(double-conversion CONFIG) +if (double-conversion_FOUND) + return() +endif() + +find_path(DOUBLE_CONVERSION_INCLUDE_DIR + NAMES + double-conversion.h + PATH_SUFFIXES + double-conversion +) +find_library(DOUBLE_CONVERSION_LIBRARY NAMES double-conversion) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + double-conversion DEFAULT_MSG + DOUBLE_CONVERSION_LIBRARY DOUBLE_CONVERSION_INCLUDE_DIR) + +if(double-conversion_FOUND AND NOT TARGET double-conversion::double-conversion) + add_library(double-conversion::double-conversion UNKNOWN IMPORTED) + set_target_properties(double-conversion::double-conversion PROPERTIES + IMPORTED_LOCATION "${DOUBLE_CONVERSION_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${DOUBLE_CONVERSION_INCLUDE_DIR}") +endif() + +mark_as_advanced(DOUBLE_CONVERSION_INCLUDE_DIR DOUBLE_CONVERSION_LIBRARY) diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake new file mode 100644 index 00000000000..d7f9788fc5d --- /dev/null +++ b/cmake/QtBaseConfigureTests.cmake @@ -0,0 +1,139 @@ +include(CheckCXXSourceCompiles) + +function(run_config_test_architecture) + # Test architecture + set(_arch_file "${CMAKE_CURRENT_BINARY_DIR}/architecture_test") + try_compile(_arch_result "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/arch/arch.cpp" + COPY_FILE "${_arch_file}") + if (NOT _arch_result) + message(FATAL_ERROR "Failed to compile architecture detection file.") + endif() + + file(STRINGS "${_arch_file}" _arch_lines LENGTH_MINIMUM 16 LENGTH_MAXIMUM 1024 ENCODING UTF-8) + + foreach (_line ${_arch_lines}) + string(FIND "${_line}" "==Qt=magic=Qt== Architecture:" _pos) + if (_pos GREATER -1) + math(EXPR _pos "${_pos}+29") + string(SUBSTRING "${_line}" ${_pos} -1 _architecture) + endif() + string(FIND "${_line}" "==Qt=magic=Qt== Sub-architecture:" _pos) + if (_pos GREATER -1) + math(EXPR _pos "${_pos}+34") + string(SUBSTRING "${_line}" ${_pos} -1 _sub_architecture) + string(REPLACE " " ";" _sub_architecture "${_sub_architecture}") + endif() + string(FIND "${_line}" "==Qt=magic=Qt== Build-ABI:" _pos) + if (_pos GREATER -1) + math(EXPR _pos "${_pos}+26") + string(SUBSTRING "${_line}" ${_pos} -1 _build_abi) + endif() + endforeach() + + if (NOT _architecture OR NOT _sub_architecture OR NOT _build_abi) + message(FATAL_ERROR "Failed to extract architecture data from file.") + endif() + + set(TEST_architecture 1 CACHE INTERNAL "Ran the architecture test") + set(TEST_architecture_arch "${_architecture}" CACHE INTERNAL "Target machine architecture") + set(TEST_subarch 1 CACHE INTERNAL "Ran machine subArchitecture test") + foreach(it ${_sub_architecture}) + set(TEST_subarch_${it} 1 CACHE INTERNAL "Target sub architecture result") + endforeach() + set(TEST_buildAbi "${_build_abi}" CACHE INTERNAL "Target machine buildAbi") +endfunction() + + +function(run_config_test_posix_iconv) + set(source "#include + +int main(int, char **) +{ + iconv_t x = iconv_open(\"\", \"\"); + + char *inp; + char *outp; + size_t inbytes, outbytes; + iconv(x, &inp, &inbytes, &outp, &outbytes); + + iconv_close(x); + + return 0; +}") + check_cxx_source_compiles("${source}" HAVE_POSIX_ICONV) + + if(NOT HAVE_POSIX_ICONV) + set(_req_libraries "${CMAKE_REQUIRE_LIBRARIES}") + set(CMAKE_REQUIRE_LIBRARIES "iconv") + check_cxx_source_compiles("${source}" HAVE_POSIX_ICONV) + set(CMAKE_REQUIRE_LIBRARIES "${_req_libraries}") + if(HAVE_POSIX_ICONV) + set(TEST_iconv_needlib 1 CACHE INTERNAL "Need to link against libiconv") + endif() + endif() + + set(TEST_posix_iconv "${HAVE_POSIX_ICONV}" CACHE INTERNAL "POSIX iconv") +endfunction() + + +function(run_config_test_sun_iconv) + set(source "#include + +int main(int, char **) +{ + iconv_t x = iconv_open(\"\", \"\"); + + const char *inp; + char *outp; + size_t inbytes, outbytes; + iconv(x, &inp, &inbytes, &outp, &outbytes); + + iconv_close(x); + + return 0; +}") + if(DARWIN) + # as per !config.darwin in configure.json + set(HAVE_SUN_ICONV OFF) + else() + check_cxx_source_compiles("${source}" HAVE_SUN_ICONV) + endif() + + set(TEST_sun_iconv "${HAVE_SUN_ICONV}" CACHE INTERNAL "SUN libiconv") +endfunction() + +function(run_linker_version_script_support) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/version_flag.map" "VERS_1 { global: sym; }; +VERS_2 { global: sym; } +VERS_1; +") + if(DEFINED CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + else() + set(CMAKE_REQUIRED_FLAGS "") + endif() + set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=\"${CMAKE_CURRENT_BINARY_DIR}/version_flag.map\"") + check_cxx_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT) + if(DEFINED CMAKE_REQUIRED_FLAGS_SAVE) + set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + endif() + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") + + set(TEST_ld_version_script "${HAVE_LD_VERSION_SCRIPT}" CACHE INTERNAL "linker version script support") +endfunction() + +function(run_config_tests) + run_config_test_posix_iconv() + + add_library(Iconv INTERFACE) + if(TEST_iconv_needlib) + target_link_libraries(Iconv PUBLIC iconv) + endif() + + run_config_test_sun_iconv() + run_config_test_architecture() + run_linker_version_script_support() +endfunction() + +run_config_tests() diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake new file mode 100644 index 00000000000..5b2b746ef10 --- /dev/null +++ b/cmake/QtBaseGlobalTargets.cmake @@ -0,0 +1,58 @@ +# Where QtBuild.cmake can find QtModuleConfig.cmake.in +set(Qt${PROJECT_VERSION_MAJOR}_DIR "${PROJECT_SOURCE_DIR}/cmake") + + +## QtPlatform Target: +set(name "Qt") +add_library("${name}" INTERFACE) +add_library("Qt::Platform" ALIAS "${name}") +target_include_directories("${name}" + INTERFACE + $ + $ + $ + $ + ) +target_compile_definitions("${name}" INTERFACE ${QT_PLATFORM_DEFINITIONS}) +set(config_install_dir "${INSTALL_LIBDIR}/cmake/${name}${PROJECT_VERSION_MAJOR}") +install(TARGETS "${name}" EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets") +install(EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}") + +configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}Config.cmake" + INSTALL_DESTINATION "${config_install_dir}" +) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}ConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}ConfigVersion.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel +) + + +## Library to hold global features: +add_library(Qt_global_Config INTERFACE) + +qt_feature_module_begin(LIBRARY QtCore + PUBLIC_FILE src/corelib/global/qconfig.h + PRIVATE_FILE src/corelib/global/qconfig_p.h +) +include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") +qt_feature_module_end(Qt_global_Config) + + +## Install some QtBase specific CMake files: +install(FILES + cmake/QtBuild.cmake + cmake/QtFeature.cmake + cmake/QtPostProcess.cmake + cmake/QtSetup.cmake + cmake/QtModuleConfig.cmake.in + DESTINATION "${config_install_dir}" +) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake new file mode 100644 index 00000000000..cf16be6126d --- /dev/null +++ b/cmake/QtBuild.cmake @@ -0,0 +1,1080 @@ +include(CMakePackageConfigHelpers) + +# Install locations: +set(INSTALL_BINDIR "bin" CACHE PATH "Executables [PREFIX/bin]") +set(INSTALL_INCLUDEDIR "include" CACHE PATH "Header files [PREFIX/include]") +set(INSTALL_LIBDIR "lib" CACHE PATH "Libraries [PREFIX/lib]") +set(INSTALL_ARCHDATADIR "." CACHE PATH "Arch-dependent data [PREFIX]") +set(INSTALL_PLUGINSDIR "${INSTALL_ARCHDATADIR}/plugins" CACHE PATH + "Plugins [ARCHDATADIR/plugins]") + +set(INSTALL_TARGETS_DEFAULT_ARGS + RUNTIME DESTINATION "${INSTALL_BINDIR}" + LIBRARY DESTINATION "${INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${INSTALL_LIBDIR}" COMPONENT Devel + INCLUDES DESTINATION "${INSTALL_INCLUDEDIR}" +) + +if (WIN32) + set(_default_libexec "${INSTALL_ARCHDATADIR}/bin") +else() + set(_default_libexec "${INSTALL_ARCHDATADIR}/libexec") +endif() + +set(INSTALL_LIBEXECDIR "${_default_libexec}" CACHE PATH + "Helper programs [ARCHDATADIR/bin on Windows, ARCHDATADIR/libexec otherwise]") +set(INSTALL_IMPORTDIR "${INSTALL_ARCHDATADIR}/imports" CACHE PATH + "QML1 imports [ARCHDATADIR/imports]") +set(INSTALL_QMLDIR "${INSTALL_ARCHDATADIR}/qml" CACHE PATH + "QML2 imports [ARCHDATADIR/qml]") +set(INSTALL_DATADIR "." CACHE PATH "Arch-independent data [PREFIX]") +set(INSTALL_DOCDIR "${INSTALL_DATADIR}/doc" CACHE PATH "Documentation [DATADIR/doc]") +set(INSTALL_TRANSLATIONSDIR "${INSTALL_DATADIR}/translations" CACHE PATH + "Translations [DATADIR/translations]") +set(INSTALL_SYSCONFDIR "etc/xdg" CACHE PATH + "Settings used by Qt programs [PREFIX/etc/xdg]") +set(INSTALL_EXAMPLESDIR "examples" CACHE PATH "Examples [PREFIX/examples]") +set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]") + +# Platform define path, etc. +if(WIN32) + set(QT_DEFAULT_PLATFORM_DEFINITIONS UNICODE _UNICODE WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS WIN64 _WIN64) + endif() + if(MSVC) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-msvc) + elseif(CLANG) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-clang) + endif() +elseif(LINUX) + if(GCC) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/linux-g++) + elseif(CLANG) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/linux-clang) + endif() +elseif(APPLE) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/macx-clang) +endif() + +if(NOT DEFINED QT_DEFAULT_PLATFORM_DEFINITIONS) + set(QT_DEFAULT_PLATFORM_DEFINITIONS "") +endif() + +set(QT_PLATFORM_DEFINITIONS ${QT_DEFAULT_PLATFORM_DEFINITIONS} + CACHE STRING "Qt platform specific pre-processor defines") +set(QT_PLATFORM_DEFINITION_DIR ${QT_DEFAULT_PLATFORM_DEFINITION_DIR} + CACHE PATH "Path to directory that contains qplatformdefs.h") +set(QT_NAMESPACE "" CACHE STRING "Qt Namespace") + +# Reset: +set(KNOWN_QT_MODULES "" CACHE INTERNAL "Known Qt modules" FORCE) + + +# For adjusting variables when running tests, we need to know what +# the correct variable is for separating entries in PATH-alike +# variables. +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + set(QT_PATH_SEPARATOR "\\;") +else() + set(QT_PATH_SEPARATOR ":") +endif() + + +# Functions and macros: + +# Print all variables defined in the current scope. +macro(qt_debug_print_variables) + cmake_parse_arguments(__arg "DEDUP" "" "MATCH;IGNORE" ${ARGN}) + message("Known Variables:") + get_cmake_property(__variableNames VARIABLES) + list (SORT __variableNames) + if (__arg_DEDUP) + list(REMOVE_DUPLICATES __variableNames) + endif() + + foreach(__var ${__variableNames}) + set(__ignore OFF) + foreach(__i ${__arg_IGNORE}) + if(__var MATCHES "${__i}") + set(__ignore ON) + break() + endif() + endforeach() + + if (__ignore) + continue() + endif() + + set(__show OFF) + foreach(__i ${__arg_MATCH}) + if(__var MATCHES "${__i}") + set(__show ON) + break() + endif() + endforeach() + + if (__show) + message(" ${__var}=${${__var}}.") + endif() + endforeach() +endmacro() + + +macro(assert) + if (${ARGN}) + else() + message(FATAL_ERROR "ASSERT: ${ARGN}.") + endif() +endmacro() + + +function(qt_ensure_perl) + if(DEFINED HOST_PERL) + return() + endif() + find_program(HOST_PERL "perl" DOC "Perl binary") + if (NOT HOST_PERL) + message(FATAL_ERROR "Perl needs to be available to build Qt.") + endif() +endfunction() + + +# A version of cmake_parse_arguments that makes sure all arguments are processed and errors out +# with a message about ${type} having received unknown arguments. +macro(qt_parse_all_arguments result type flags options multiopts) + cmake_parse_arguments(${result} "${flags}" "${options}" "${multiopts}" ${ARGN}) + if(DEFINED ${result}_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown arguments were passed to ${type} (${${result}_UNPARSED_ARGUMENTS}).") + endif() +endmacro() + + +# Determines the directory where the generated class-style header files for +# the specified module are located and stores the result in the given result +# variable. +function(qt_internal_module_include_dir result module) + set(${result} "${PROJECT_BINARY_DIR}/include/${module}" PARENT_SCOPE) +endfunction() + +function(qt_internal_add_link_flags target to_add) + get_target_property(_flags "${target}" LINK_FLAGS) + if ("${_flags}" STREQUAL "_flags-NOTFOUND") + set(_flags "") + endif() + string(APPEND _flags " ${to_add}") + set_target_properties("${target}" PROPERTIES LINK_FLAGS "${_flags}") +endfunction() + +function(qt_internal_add_linker_version_script target) + qt_parse_all_arguments(_arg "qt_internal_add_linker" "INTERNAL" "" "PRIVATE_HEADERS" ${ARGN}) + + if (TEST_ld_version_script) + if (_arg_INTERNAL) + set(contents "Qt_${PROJECT_VERSION_MAJOR}_PRIVATE_API { *; };") + else() + set(contents "Qt_${PROJECT_VERSION_MAJOR}_PRIVATE_API {\n qt_private_api_tag*;\n") + foreach(ph ${_arg_PRIVATE_HEADERS}) + string(APPEND contents " @FILE:${ph}@\n") + endforeach() + string(APPEND contents "};\n") + set(current "Qt_${PROJECT_VERSION_MAJOR}") + if (QT_NAMESPACE STREQUAL "") + set(tag_symbol "qt_version_tag") + else() + set(tag_symbol "qt_version_tag_${QT_NAMESPACE}") + endif() + string(APPEND contents "${current} { *; };\n") + + foreach(minor_version RANGE ${PROJECT_VERSION_MINOR}) + set(previous "${current}") + set(current "Qt_${PROJECT_VERSION_MAJOR}.${minor_version}") + if (minor_version EQUAL ${PROJECT_VERSION_MINOR}) + string(APPEND contents "${current} { ${tag_symbol}; } ${previous};\n") + else() + string(APPEND contents "${current} {} ${previous};\n") + endif() + endforeach() + + set(infile "${CMAKE_CURRENT_BINARY_DIR}/${target}.version.in") + set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${target}.version") + + file(GENERATE OUTPUT "${infile}" CONTENT "${contents}") + + qt_ensure_perl() + + add_custom_command(TARGET "${target}" PRE_LINK + COMMAND "${HOST_PERL}" "${PROJECT_SOURCE_DIR}/mkspecs/features/data/unix/findclasslist.pl" < "${infile}" > "${outfile}" + BYPRODUCTS "${outfile}" DEPENDS "${infile}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMENT "Generating version linker script" + ) + qt_internal_add_link_flags("${target}" "-Wl,--version-script,${outfile}") + endif() + endif() +endfunction() + +# Generates the necessary rules to run moc on the sources specified after the MOC parameter. +# The resulting moc files are returned in the variable specified by the result parameter. +function(qt_internal_wrap_cpp result) + # get include dirs + qt_get_moc_flags(moc_flags) + qt_parse_all_arguments(_arg "qt_internal_wrap_cpp" "" "TARGET;HEADER_FILE_ONLY" "OPTIONS;DEPENDS;MOC" ${ARGN}) + + set(moc_files ${_arg_MOC}) + set(moc_options ${_arg_OPTIONS}) + set(moc_target ${_arg_TARGET}) + set(moc_depends ${_arg_DEPENDS}) + set(wrapped_files "") + + foreach(it ${moc_files}) + get_filename_component(it ${it} ABSOLUTE) + get_filename_component(moc_file_extension ${it} EXT) + + if(${moc_file_extension} STREQUAL ".h") + set(file_prefix "moc_") + set(file_extension "cpp") + else() + set(file_prefix "") + set(file_extension "moc") + endif() + + qt_make_output_file("${it}" "${file_prefix}" "${file_extension}" outfile) + qt_create_moc_command("${it}" "${outfile}" "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}") + set_source_files_properties(${outfile} PROPERTIES HEADER_FILE_ONLY ${_arg_HEADER_FILE_ONLY}) + list(APPEND wrapped_files "${outfile}") + endforeach() + set("${result}" ${wrapped_files} PARENT_SCOPE) +endfunction() + +function(_qt_module_name name result) + set("${result}" "Qt${name}" PARENT_SCOPE) +endfunction() + + +# This function takes a target as a parameter, followed by a list of sources. +# The sources are scanned for Q_OBJECT/Q_GADGET use as well as the inclusion of +# moc_*.cpp/*.moc. Rules are created to call moc accordingly at build time and +# add the generated sources to the target, if the generated code is not +# directly included otherwise. +function(qt_internal_automoc target) + if ("x${ARGN}" STREQUAL "x") + return() + endif() + + if(NOT DEFINED QT_MOCSCANNER) + get_target_property(mocPath "Qt::moc" LOCATION) + get_filename_component(binDirectory "${mocPath}" DIRECTORY) + set(QT_MOCSCANNER "${binDirectory}/qmocscanner${CMAKE_EXECUTABLE_SUFFIX}") + endif() + + string(REPLACE ";" "\n" sources "${ARGN}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_sources_and_headers.txt" ${sources}) + execute_process(COMMAND "${QT_MOCSCANNER}" + "${CMAKE_CURRENT_BINARY_DIR}/moc_sources_and_headers.txt" + "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" + "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + ) + + file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" moc_files_included) + file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" moc_files_to_build) + + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_sources_and_headers.txt") + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt") + file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt") + + qt_internal_wrap_cpp(included_mocs TARGET "${target}" MOC ${moc_files_included} HEADER_FILE_ONLY ON) + qt_internal_wrap_cpp(moc_and_build_sources TARGET "${target}" MOC ${moc_files_to_build} HEADER_FILE_ONLY OFF) + + target_sources("${target}" PRIVATE ${moc_and_build_sources} ${included_mocs}) + + foreach(generated_source ${included_mocs}) + get_filename_component(directory "${generated_source}" DIRECTORY) + target_include_directories("${target}" PRIVATE "${directory}") + endforeach() +endfunction() + + +# This function takes a target as a parameter, followed by a list of sources. +# Any sources with the .ui extension are passed on to uic and the generated output +# is added to the target sources. +function(qt_internal_autouic target) + if ("x${ARGN}" STREQUAL "x") + return() + endif() + + set(_ui_files "") + + foreach(s ${ARGN}) + get_filename_component(ext "${s}" EXT) + if("${ext}" STREQUAL ".ui") + qt_create_uic_command("${s}" _ui_file) + list(APPEND _ui_files "${_ui_file}") + endif() + endforeach() + target_sources("${target}" PRIVATE "${_ui_files}") +endfunction() + + +# This function attempts to (poorly) parse the given resourceFile (.qrc) and +# determine the dependencies, i.e. which files are intended for inclusion into +# the Qt resource. +function(qt_extract_qrc_dependencies resourceFile _out_depends _rc_depends) + get_filename_component(rc_path ${resourceFile} PATH) + + if(EXISTS "${infile}") + # parse file for dependencies + # all files are absolute paths or relative to the location of the qrc file + file(READ "${infile}" RC_FILE_CONTENTS) + string(REGEX MATCHALL "]*>" "" RC_FILE "${RC_FILE}") + if(NOT IS_ABSOLUTE "${RC_FILE}") + set(RC_FILE "${rc_path}/${RC_FILE}") + endif() + set(RC_DEPENDS ${RC_DEPENDS} "${RC_FILE}") + endforeach() + # Since this cmake function is doing the dependency scanning for these files, + # let's make a configured file and add it as a dependency so cmake is run + # again when dependencies need to be recomputed. + qt_make_output_file("${infile}" "" "qrc.depends" out_depends) + configure_file("${infile}" "${out_depends}" COPYONLY) + else() + # The .qrc file does not exist (yet). Let's add a dependency and hope + # that it will be generated later + set(out_depends) + endif() + + set(${_out_depends} ${out_depends} PARENT_SCOPE) + set(${_rc_depends} ${RC_DEPENDS} PARENT_SCOPE) +endfunction() + + +# This function creates the necessary rule to call rcc on the given +# resource file and stores the name of the to-be generated C++ source +# file (created by rcc) in the outCppFile variable. +function(qt_create_rcc_command resourceFile outCppFile) + get_filename_component(outfilename "${resourceFile}" NAME_WE) + get_filename_component(infile "${resourceFile}" ABSOLUTE) + set(generatedCppFile "${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp") + + qt_extract_qrc_dependencies("${infile}" _out_depends _rc_depends) + set_source_files_properties("${infile}" PROPERTIES SKIP_AUTORCC ON) + + add_custom_command(OUTPUT "${generatedCppFile}" + COMMAND "Qt::rcc" --name "${outfilename}" --output "${generatedCppFile}" "${infile}" + MAIN_DEPENDENCY "${infile}" + DEPENDS "${_rc_depends}" "${_out_depends}" VERBATIM) + set_source_files_properties("${generatedCppFile}" PROPERTIES SKIP_AUTOMOC ON) + set_source_files_properties("${generatedCppFile}" PROPERTIES SKIP_AUTOUIC ON) + set("${outCppFile}" "${generatedCppFile}" PARENT_SCOPE) +endfunction() + + +# This function takes a target as a parameter, followed by a list of sources. +# Any sources ending with the .qrc extension are treated as Qt resources and rules +# to call rcc are generated. The source files rcc generates are added to the target. +function(qt_internal_autorcc target) + if ("x${ARGN}" STREQUAL "x") + return() + endif() + + set(_qrc_cpp_files "") + + foreach(s ${ARGN}) + get_filename_component(ext "${s}" EXT) + if("${ext}" STREQUAL ".qrc") + qt_create_rcc_command("${s}" _qrc_cpp_file) + list(APPEND _qrc_cpp_files "${_qrc_cpp_file}") + endif() + endforeach() + target_sources("${target}" PRIVATE "${_qrc_cpp_files}") +endfunction() + + +# This function takes a target as a parameter, followed by a list of sources. +# The sources are scanned for .ui and .qrc as well as Q_OBJECT/Q_GADGET use +# and rules to call uic/rcc/moc are created. Any generated sources are added +# as private sources to the specified target. +function(qt_internal_process_automatic_sources target) + qt_internal_automoc("${target}" ${ARGN}) + qt_internal_autouic("${target}" ${ARGN}) + qt_internal_autorcc("${target}" ${ARGN}) +endfunction() + + +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES") +set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES") + + +# This function can be used to add sources/libraries/etc. to the specified CMake target +# if the provided CONDITION evaluates to true. +function(extend_target target) + if (NOT TARGET "${target}") + message(FATAL_ERROR "Trying to extend non-existing target \"${target}\".") + endif() + qt_parse_all_arguments(_arg "extend_target" "" "" + "CONDITION;${__default_public_args};${__default_private_args};COMPILE_FLAGS" ${ARGN}) + if ("x${_arg_CONDITION}" STREQUAL x) + set(_arg_CONDITION ON) + endif() + + qt_evaluate_config_expression(result ${_arg_CONDITION}) + if (${result}) + qt_internal_process_automatic_sources("${target}" ${_arg_SOURCES}) + + foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) + if("${dep}" MATCHES "Qt::(.+)(Private?)") + set(depTarget ${CMAKE_MATCH_1}) + + # Fetch features from dependencies and make them available to the + # caller as well as to the local scope for configure.cmake evaluation. + + if("x${CMAKE_MATCH_2}" STREQUAL "xPrivate") + qt_push_features_into_parent_scope(PRIVATE_FEATURES ${depTarget}) + qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) + endif() + qt_push_features_into_parent_scope(PUBLIC_FEATURES ${depTarget}) + qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) + if(TARGET "${dep}") + continue() + endif() + find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) + endif() + endforeach() + + target_sources("${target}" PRIVATE ${_arg_SOURCES}) + if (_arg_COMPILE_FLAGS) + set_source_files_properties(${_arg_SOURCES} PROPERTIES COMPILE_FLAGS "${_arg_COMPILE_FLAGS}") + endif() + target_include_directories("${target}" PUBLIC ${_arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${_arg_INCLUDE_DIRECTORIES}) + target_compile_definitions("${target}" PUBLIC ${_arg_PUBLIC_DEFINES} PRIVATE ${_arg_DEFINES}) + target_link_libraries("${target}" PUBLIC ${_arg_PUBLIC_LIBRARIES} PRIVATE ${_arg_LIBRARIES}) + endif() +endfunction() + + +function(qt_internal_library_deprecation_level result) + if(WIN32) + # On Windows, due to the way DLLs work, we need to export all functions, + # including the inlines + set("${result}" "QT_DISABLE_DEPRECATED_BEFORE=0x040800" PARENT_SCOPE) + else() + # On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API + set("${result}" "QT_DISABLE_DEPRECATED_BEFORE=0x050000" PARENT_SCOPE) + endif() +endfunction() + + +function(qt_read_headers_pri module resultVarPrefix) + qt_internal_module_include_dir(include_dir "${module}") + file(STRINGS "${include_dir}/headers.pri" headers_pri_contents) + foreach(line ${headers_pri_contents}) + if("${line}" MATCHES "SYNCQT.HEADER_FILES = (.*)") + set(public_module_headers "${CMAKE_MATCH_1}") + separate_arguments(public_module_headers UNIX_COMMAND "${public_module_headers}") + elseif("${line}" MATCHES "SYNCQT.PRIVATE_HEADER_FILES = (.*)") + set(private_module_headers "${CMAKE_MATCH_1}") + separate_arguments(private_module_headers UNIX_COMMAND "${private_module_headers}") + elseif("${line}" MATCHES "SYNCQT.GENERATED_HEADER_FILES = (.*)") + set(generated_module_headers "${CMAKE_MATCH_1}") + separate_arguments(generated_module_headers UNIX_COMMAND "${generated_module_headers}") + foreach(generated_header ${generated_module_headers}) + list(APPEND public_module_headers "${include_dir}/${generated_header}") + endforeach() + # Ignore INJECTIONS! + elseif("${line}" MATCHES "SYNCQT.([A-Z_]+)_HEADER_FILES = (.+)") + set(prefix "${CMAKE_MATCH_1}") + string(TOLOWER "${prefix}" prefix) + set(entries "${CMAKE_MATCH_2}") + separate_arguments(entries UNIX_COMMAND "${entries}") + set("${resultVarPrefix}_${prefix}" "${entries}" PARENT_SCOPE) + endif() + endforeach() + set(${resultVarPrefix}_public "${public_module_headers}" PARENT_SCOPE) + set(${resultVarPrefix}_private "${private_module_headers}" PARENT_SCOPE) +endfunction() + + +# This is the main entry function for creating a Qt module, that typically +# consists of a library, public header files, private header files and configurable +# features. +# +# A CMake target with the specified name parameter is created. If the current source +# directory has a configure.cmake file, then that is also processed for feature definition +# and testing. Any features defined as well as any features coming from dependencies to +# this module are imported into the scope of the calling feature. +function(add_qt_module name) + qt_parse_all_arguments(_arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" + "${__default_private_args};${__default_public_args};FEATURE_DEPENDENCIES" ${ARGN}) + + _qt_module_name("${name}" module) + set(versioned_module_name "Qt${PROJECT_VERSION_MAJOR}${name}") + set(target "${name}") + string(TOUPPER "${name}" name_upper) + string(TOLOWER "${name}" name_lower) + + set(known_modules "${KNOWN_QT_MODULES}" "${target}") + set(KNOWN_QT_MODULES ${known_modules} CACHE INTERNAL "Modules that are built." FORCE) + + ### Define Targets: + if(${_arg_STATIC}) + add_library("${target}" STATIC) + elseif(${QT_BUILD_SHARED_LIBS}) + add_library("${target}" SHARED) + else() + add_library("${target}" STATIC) + endif() + add_library("Qt::${target}" ALIAS "${target}") + + # Add _private target to link against the private headers: + set(target_private "${target}Private") + add_library("${target_private}" INTERFACE) + add_library("Qt::${target_private}" ALIAS ${target_private}) + + if(NOT DEFINED _arg_CONFIG_MODULE_NAME) + set(_arg_CONFIG_MODULE_NAME "${name_lower}") + endif() + + # Import global features + if(NOT "${target}" STREQUAL "Core") + qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) + endif() + + # Fetch features from dependencies and make them available to the + # caller as well as to the local scope for configure.cmake evaluation. + foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) + if("${dep}" MATCHES "(Qt::.+)Private") + set(publicDep ${CMAKE_MATCH_1}) + qt_push_features_into_parent_scope(PRIVATE_FEATURES ${publicDep}) + qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) + else() + set(publicDep ${dep}) + endif() + qt_push_features_into_parent_scope(PUBLIC_FEATURES ${publicDep}) + qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) + endforeach() + + if(NOT ${_arg_NO_MODULE_HEADERS}) + qt_ensure_perl() + if(NOT DEFINED QT_SYNCQT) + get_target_property(mocPath "Qt::moc" LOCATION) + get_filename_component(binDirectory "${mocPath}" DIRECTORY) + # We could put this into the cache, but on the other hand there's no real need to + # pollute the app's cache with this. For the first qtbase build, the variable is + # set in global scope. + set(QT_SYNCQT "${binDirectory}/syncqt.pl") + endif() + execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") + endif() + + if(NOT ${_arg_NO_MODULE_HEADERS}) + set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) + else() + set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) + endif() + + set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}") + set_target_properties("${target}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") + set_target_properties("${target}" PROPERTIES OUTPUT_NAME "${versioned_module_name}") + + qt_internal_module_include_dir(include_dir "${module}") + + set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") + if(EXISTS "${configureFile}") + qt_feature_module_begin( + LIBRARY "${module}" + PUBLIC_FILE "qt${_arg_CONFIG_MODULE_NAME}-config.h" + PRIVATE_FILE "qt${_arg_CONFIG_MODULE_NAME}-config_p.h" + PUBLIC_DEPENDENCIES ${_arg_FEATURE_DEPENDENCIES} + PRIVATE_DEPENDENCIES ${_arg_FEATURE_DEPENDENCIES} + ) + include(${configureFile}) + qt_feature_module_end("${target}") + qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES "${target}") + + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${_arg_CONFIG_MODULE_NAME}-config.h") + set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${_arg_CONFIG_MODULE_NAME}-config_p.h") + + if("${target}" STREQUAL "Core") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") + set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") + endif() + endif() + + qt_internal_library_deprecation_level(deprecation_define) + + extend_target("${target}" + SOURCES ${_arg_SOURCES} + PUBLIC_INCLUDE_DIRECTORIES + $ + $ + ${_arg_PUBLIC_INCLUDE_DIRECTORIES} + INCLUDE_DIRECTORIES + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + $ + "${include_dir}/${PROJECT_VERSION}" + "${include_dir}/${PROJECT_VERSION}/${module}" + ${_arg_INCLUDE_DIRECTORIES} + PUBLIC_DEFINES + ${_arg_PUBLIC_DEFINES} + QT_${name_upper}_LIB + DEFINES + ${_arg_DEFINES} + QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS + QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code + QT_USE_QSTRINGBUILDER + QT_DEPRECATED_WARNINGS + QT_BUILDING_QT + QT_BUILD_${name_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore + "${deprecation_define}" + PUBLIC_LIBRARIES + ${_arg_PUBLIC_LIBRARIES} + LIBRARIES + ${_arg_LIBRARIES} + ) + + ### FIXME: Can we replace headers.pri? + qt_internal_module_include_dir(include_dir "${module}") + if(NOT ${_arg_NO_MODULE_HEADERS}) + qt_read_headers_pri("${module}" "module_headers") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") + set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${include_dir}/${module}Depends") + endif() + + if(DEFINED module_headers_private) + qt_internal_add_linker_version_script("${target}" PRIVATE_HEADERS ${module_headers_private}) + else() + qt_internal_add_linker_version_script("${target}") + endif() + + qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${_arg_FEATURE_DEPENDENCIES}) + + install(TARGETS "${target}" "${target_private}" EXPORT "${versioned_module_name}Targets" + LIBRARY DESTINATION ${INSTALL_LIBDIR} + ARCHIVE DESTINATION ${INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} + PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/private + ) + + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${versioned_module_name}") + install(EXPORT "${versioned_module_name}Targets" NAMESPACE Qt:: DESTINATION ${config_install_dir}) + + configure_package_config_file( + "${Qt${PROJECT_VERSION_MAJOR}_DIR}/QtModuleConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}Config.cmake" + INSTALL_DESTINATION "${config_install_dir}" + ) + write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}ConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + set(extra_cmake_files) + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${versioned_module_name}Macros.cmake") + list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${versioned_module_name}Macros.cmake") + endif() + + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}ConfigVersion.cmake" + ${extra_cmake_files} + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + + ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins + # that belong to Qt. + if (GCC) + qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") + endif() + + # When a public module depends on private, also make its private depend on the other's private + set(_qt_libs_private "") + foreach(it ${KNOWN_QT_MODULES}) + list(FIND _arg_LIBRARIES "Qt::${it}Private" _pos) + if(_pos GREATER -1) + list(APPEND _qt_libs_private "Qt::${it}Private") + endif() + endforeach() + + target_link_libraries("${target_private}" INTERFACE "${target}" "${_qt_libs_private}") + + qt_internal_module_include_dir(include_dir "${module}") + target_include_directories("${target_private}" INTERFACE + $ + $ + $ + $ + $ + ) +endfunction() + + +# This is the main entry point for defining Qt plugins. +# A CMake target is created with the given name. The TYPE parameter is needed to place the +# plugin into the correct plugins/ sub-directory. +function(add_qt_plugin name) + # This is a copy paste of add_qt_module with minor changes and some commented out stuff. + # FIXME !!! + set(module "${name}") + string(TOUPPER "${name}" name_upper) + + qt_parse_all_arguments(_arg "add_qt_plugin" "" "TYPE" "${__default_private_args};${__default_public_args}" ${ARGN}) + if (NOT DEFINED _arg_TYPE) + message(FATAL_ERROR "add_qt_plugin called without setting a TYPE.") + endif() + + add_library("${module}") + set_target_properties("${module}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${_arg_TYPE}") + set_target_properties("${module}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") + + # Import global features + qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) + + # Fetch features from dependencies and make them available to the + # caller as well as to the local scope for configure.cmake evaluation. + foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) + if("${dep}" MATCHES "(Qt::.+)Private") + set(publicDep ${CMAKE_MATCH_1}) + qt_push_features_into_parent_scope(PRIVATE_FEATURES ${publicDep}) + qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) + else() + set(publicDep ${dep}) + endif() + qt_push_features_into_parent_scope(PUBLIC_FEATURES ${publicDep}) + qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) + endforeach() + + qt_internal_library_deprecation_level(deprecation_define) + + extend_target("${module}" + SOURCES ${_arg_SOURCES} + INCLUDE_DIRECTORIES + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + ${_arg_INCLUDE_DIRECTORIES} + PUBLIC_INCLUDE_DIRECTORIES ${_arg_PUBLIC_INCLUDE_DIRECTORIES} + LIBRARIES ${_arg_LIBRARIES} + PUBLIC_LIBRARIES ${_arg_PUBLIC_LIBRARIES} + DEFINES + ${_arg_DEFINES} + QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS + QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code + QT_USE_QSTRINGBUILDER + QT_DEPRECATED_WARNINGS + QT_BUILDING_QT + QT_BUILD_${name_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore + "${deprecation_define}" + PUBLIC_DEFINES + QT_${name_upper}_LIB + ${_arg_PUBLIC_DEFINES} + ) + + install(TARGETS "${module}" EXPORT "${module}Targets" + LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${_arg_TYPE} + ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${_arg_TYPE} + ) + install(EXPORT "${module}Targets" NAMESPACE Qt:: DESTINATION ${INSTALL_LIBDIR}/cmake) + + ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins + # that belong to Qt. + if (GCC) + qt_internal_add_link_flags("${module}" "-Wl,--no-undefined") + endif() + + qt_internal_add_linker_version_script(${module}) +endfunction() + + +# This function creates a CMake target for a generic console or GUI binary. +# Please consider to use a more specific version target like the one created +# by add_qt_test or add_qt_tool below. +function(add_qt_executable name) + qt_parse_all_arguments(_arg "add_qt_executable" "GUI" "OUTPUT_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + + if ("x${_arg_OUTPUT_DIRECTORY}" STREQUAL "x") + set(_arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") + endif() + + add_executable("${name}" ${_arg_EXE_FLAGS}) + extend_target("${name}" + SOURCES ${_arg_SOURCES} + INCLUDE_DIRECTORIES + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + ${_arg_INCLUDE_DIRECTORIES} + DEFINES ${_arg_DEFINES} + LIBRARIES ${_arg_LIBRARIES} + ) + set_target_properties("${name}" PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${_arg_OUTPUT_DIRECTORY}" + WIN32_EXECUTABLE "${_arg_GUI}" + MACOSX_BUNDLE "${_arg_GUI}" + ) +endfunction() + + +# This function creates a CMake test target with the specified name for use with CTest. +function(add_qt_test name) + qt_parse_all_arguments(_arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) + set(_path "${CMAKE_CURRENT_BINARY_DIR}") + + add_qt_executable("${name}" + OUTPUT_DIRECTORY "${_path}" + SOURCES "${_arg_SOURCES}" + INCLUDE_DIRECTORIES + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + "${_arg_INCLUDE_DIRECTORIES}" + DEFINES "${_arg_DEFINES}" + LIBRARIES "Qt::Core;Qt::Test;${_arg_LIBRARIES}" + ) + + add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + + set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${_arg_RUN_SERIAL}") + set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${_path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}") + set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${PROJECT_BINARY_DIR}/${INSTALL_PLUGINSDIR}") +endfunction() + + +# This function creates an executable for use as helper program with tests. Some +# tests launch separate programs to test certainly input/output behavior. +function(add_qt_test_helper name) + add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ${ARGN}) +endfunction() + + +# This function is used to define a "Qt tool", such as moc, uic or rcc. +# The BOOTSTRAP option allows building it as standalone program, otherwise +# it will be linked against QtCore. +function(add_qt_tool name) + qt_parse_all_arguments(_arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) + + if (_arg_BOOTSTRAP) + set(corelib Qt::Bootstrap) + else() + set(corelib Qt::Core) + endif() + + add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" + # Do not pass sources here: They may not get processed when BOOTSTRAP is set! + INCLUDE_DIRECTORIES + ${_arg_INCLUDE_DIRECTORIES} + DEFINES ${_arg_DEFINES} + LIBRARIES ${corelib} ${_arg_LIBRARIES} + ) + target_sources("${name}" PRIVATE "${_arg_SOURCES}") + add_executable("Qt::${name}" ALIAS "${name}") + + if (NOT _arg_BOOTSTRAP) + qt_internal_process_automatic_sources("${name}" ${_arg_SOURCES}) + endif() + + install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) +endfunction() + + + +function(qt_create_tracepoints name tracePointsFile) + #### TODO + string(TOLOWER "${name}" name) + + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/qt${name}_tracepoints_p.h" CONTENT + "#include ") +endfunction() + + + +function(add_qt_resource target resourceName) + qt_parse_all_arguments(rcc "add_qt_resource" "" "PREFIX;BASE" "FILES" ${ARGN}) + + set(qrcContents "") + if (${rcc_PREFIX}) + string(APPEND qrcContents " \n") + else() + string(APPEND qrcContents " \n") + endif() + + foreach(file ${rcc_FILES}) + get_property(alias SOURCE ${file} PROPERTY alias) + if (NOT alias) + set(alias "${file}") + endif() + ### FIXME: escape file paths to be XML conform + string(APPEND qrcContents " ${CMAKE_CURRENT_SOURCE_DIR}/${file}\n") + endforeach() + + string(APPEND qrcContents " \n\n") + set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/${resourceName}.qrc") + file(GENERATE OUTPUT "${generatedResourceFile}" CONTENT "${qrcContents}") + + set(generatedSourceCode "${CMAKE_CURRENT_BINARY_DIR}/qrc_${resourceName}.cpp") + add_custom_command(OUTPUT "${generatedSourceCode}" + COMMAND "Qt::rcc" + ARGS --name "${resourceName}" + --output "${generatedSourceCode}" "${generatedResourceFile}" + DEPENDS ${files} + COMMENT "RCC ${resourceName}" + VERBATIM) + target_sources(${target} PRIVATE "${generatedSourceCode}") +endfunction() + +# From Qt5CoreMacros +# Function used to create the names of output files preserving relative dirs +function(qt_make_output_file infile prefix ext result) + string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) + string(LENGTH ${infile} _infileLength) + set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR}) + if(_infileLength GREATER _binlength) + string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile) + if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) + else() + file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) + endif() + else() + file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) + endif() + if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path + set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") + endif() + set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") + string(REPLACE ".." "__" _outfile "${_outfile}") + get_filename_component(outpath "${_outfile}" PATH) + get_filename_component(_outfile "${_outfile}" NAME_WE) + file(MAKE_DIRECTORY "${outpath}") + set(full_outfile "${outpath}/${prefix}${_outfile}.${ext}") + set("${result}" "${full_outfile}" PARENT_SCOPE) +endfunction() + +macro(qt_get_moc_flags _moc_flags) + set(${_moc_flags}) + get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) + + if(CMAKE_INCLUDE_CURRENT_DIR) + list(APPEND _inc_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + endif() + + foreach(_current ${_inc_DIRS}) + if("${_current}" MATCHES "\\.framework/?$") + string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}") + set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}") + else() + set(${_moc_flags} ${${_moc_flags}} "-I${_current}") + endif() + endforeach() + + get_directory_property(_defines COMPILE_DEFINITIONS) + foreach(_current ${_defines}) + set(${_moc_flags} ${${_moc_flags}} "-D${_current}") + endforeach() + + if(WIN32) + set(${_moc_flags} ${${_moc_flags}} -DWIN32) + endif() + if (MSVC) + set(${_moc_flags} ${${_moc_flags}} --compiler-flavor=msvc) + endif() +endmacro() + + +# helper to set up a moc rule +function(qt_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends) + # Pass the parameters in a file. Set the working directory to + # be that containing the parameters file and reference it by + # just the file name. This is necessary because the moc tool on + # MinGW builds does not seem to handle spaces in the path to the + # file given with the @ syntax. + get_filename_component(_moc_outfile_name "${outfile}" NAME) + get_filename_component(_moc_outfile_dir "${outfile}" PATH) + if(_moc_outfile_dir) + set(_moc_working_dir WORKING_DIRECTORY "${_moc_outfile_dir}") + endif() + set (_moc_parameters_file "${outfile}_parameters") + set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") + string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") + + if(moc_target) + set(_moc_parameters_file "${_moc_parameters_file}$<$>:_$>") + set(targetincludes "$") + set(targetdefines "$") + + set(targetincludes "$<$:-I$\n>") + set(targetdefines "$<$:-D$\n>") + + file (GENERATE + OUTPUT "${_moc_parameters_file}" + CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n" + ) + + set(targetincludes) + set(targetdefines) + else() + file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n") + endif() + + set(_moc_extra_parameters_file @${_moc_parameters_file}) + add_custom_command(OUTPUT "${outfile}" + COMMAND "Qt::moc" "${_moc_extra_parameters_file}" + DEPENDS "${infile}" ${moc_depends} + ${_moc_working_dir} + VERBATIM) +endfunction() + + +# helper to set up a uic rule +function(qt_create_uic_command infile _result) + # Pass the parameters in a file. Set the working directory to + # be that containing the parameters file and reference it by + # just the file name. This is necessary because the moc tool on + # MinGW builds does not seem to handle spaces in the path to the + # file given with the @ syntax. + get_filename_component(_uic_basename "${infile}" NAME_WE) + set(outfile "ui_${_uic_basename}.h") + add_custom_command(OUTPUT "${outfile}" + COMMAND "Qt::uic" "${CMAKE_CURRENT_SOURCE_DIR}/${infile}" -o "${CMAKE_CURRENT_BINARY_DIR}/${outfile}" + DEPENDS "${infile}" + COMMENT "Running UIC on ${infile}." + VERBATIM) + set(${_result} "${CMAKE_CURRENT_BINARY_DIR}/${outfile}" PARENT_SCOPE) +endfunction() + + +function(qt_generate_forwarding_headers module) + qt_parse_all_arguments(_arg "qt_generate_forwarding_headers" + "PRIVATE" "SOURCE;DESTINATION" "CLASSES" ${ARGN}) + qt_internal_module_include_dir(include_dir "${module}") + + if (NOT _arg_DESTINATION) + get_filename_component(_arg_DESTINATION "${_arg_SOURCE}" NAME) + endif() + + if (_arg_PRIVATE) + set(main_fwd "${include_dir}/${PROJECT_VERSION}/${module}/private/${_arg_DESTINATION}") + else() + set(main_fwd "${include_dir}/${_arg_DESTINATION}") + endif() + + get_filename_component(main_fwd_dir "${main_fwd}" DIRECTORY) + file(RELATIVE_PATH relpath "${main_fwd_dir}" "${CMAKE_CURRENT_BINARY_DIR}/${_arg_SOURCE}") + set(main_contents "#include \"${relpath}\"") + file(GENERATE OUTPUT "${main_fwd}" CONTENT "${main_contents}") + + foreach(class_fwd ${_arg_CLASSES}) + set(class_fwd_contents "#include \"${fwd_hdr}\"") + message("Generating forwarding header: ${class_fwd} -> ${relpath}.") + file(GENERATE OUTPUT "${include_dir}/${class_fwd}" CONTENT "${class_fwd_contents}") + endforeach() +endfunction() + + +function(add_qt_docs qdocFile) + # TODO +endfunction() diff --git a/cmake/QtCompilerOptimization.cmake b/cmake/QtCompilerOptimization.cmake new file mode 100644 index 00000000000..151d06925b2 --- /dev/null +++ b/cmake/QtCompilerOptimization.cmake @@ -0,0 +1,106 @@ +if (QCC) + set(QT_CFLAGS_SSE2 "-msse2") + set(QT_CFLAGS_SSE3 "-msse3") + set(QT_CFLAGS_SSSE3 "-mssse3") + set(QT_CFLAGS_SSE4_1 "-msse4.1") + set(QT_CFLAGS_SSE4_2 "-msse4.2") + set(QT_CFLAGS_AVX "-mavx") + set(QT_CFLAGS_AVX2 "-mavx2") + set(QT_CFLAGS_AESNI "-maes") + set(QT_CFLAGS_SHANI "-msha") +endif() + +if (MSVC) + if (QT_64BIT) + # SSE2 is mandatory on 64-bit mode, so skip the option. It triggers: + # cl : Command line warning D9002 : ignoring unknown option '-arch:SSE2' + set(QT_CFLAGS_SSE2 "") + else() + set(QT_CFLAGS_SSE2 "-arch:SSE2") + endif() + set(QT_CFLAGS_SSE3 "${QT_CFLAGS_SSE2}") + set(QT_CFLAGS_SSSE3 "${QT_CFLAGS_SSE2}") + set(QT_CFLAGS_SSE4_1 "${QT_CFLAGS_SSE2}") + set(QT_CFLAGS_SSE4_2 "${QT_CFLAGS_SSE2}") + set(QT_CFLAGS_AESNI "${QT_CFLAGS_SSE2}") + set(QT_CFLAGS_SHANI "${QT_CFLAGS_SSE2}") +endif() + +if(GCC OR CLANG) + set(QT_CFLAGS_SSE2 "-msse2") + set(QT_CFLAGS_SSE3 "-msse3") + set(QT_CFLAGS_SSSE3 "-mssse3") + set(QT_CFLAGS_SSE4_1 "-msse4.1") + set(QT_CFLAGS_SSE4_2 "-msse4.2") + set(QT_CFLAGS_F16C "-mf16c") + set(QT_CFLAGS_RDRND "-mrdrnd") + set(QT_CFLAGS_AVX "-mavx") + set(QT_CFLAGS_AVX2 "-mavx2") + set(QT_CFLAGS_AVX512F "-mavx512f") + set(QT_CFLAGS_AVX512ER "-mavx512er") + set(QT_CFLAGS_AVX512CD "-mavx512cd") + set(QT_CFLAGS_AVX512PF "-mavx512pf") + set(QT_CFLAGS_AVX512DQ "-mavx512dq") + set(QT_CFLAGS_AVX512BW "-mavx512bw") + set(QT_CFLAGS_AVX512VL "-mavx512vl") + set(QT_CFLAGS_AVX512IFMA "-mavx512ifma") + set(QT_CFLAGS_AVX512VBMI "-mavx512vbmi") + set(QT_CFLAGS_AESNI "-maes") + set(QT_CFLAGS_SHANI "-msha") + set(QT_CFLAGS_NEON "-mfpu=neon") + set(QT_CFLAGS_MIPS_DSP "-mdsp") + set(QT_CFLAGS_MIPS_DSPR2 "-mdspr2") +endif() + +if (winrt) # FIXME: Correct variable + set(QT_CFLAGS_SSE2 "-arch:SSE2") + set(QT_CFLAGS_SSE3 "-arch:SSE2") + set(QT_CFLAGS_SSSE3 "-arch:SSE2") + set(QT_CFLAGS_SSE4_1 "-arch:SSE2") + set(QT_CFLAGS_SSE4_2 "-arch:SSE2") + set(QT_CFLAGS_AVX "-arch:AVX") + set(QT_CFLAGS_AVX2 "-arch:AVX") + set(QT_CFLAGS_AESNI "-arch:SSE2") + set(QT_CFLAGS_SHANI "-arch:SSE2") +endif() + +if (ICC) + if (MSVC) + set(QT_CFLAGS_SSE2 "-QxSSE2") + set(QT_CFLAGS_SSE3 "-QxSSE3") + set(QT_CFLAGS_SSSE3 "-QxSSSE3") + set(QT_CFLAGS_SSE4_1 "-QxSSE4.1") + set(QT_CFLAGS_SSE4_2 "-QxSSE4.2") + set(QT_CFLAGS_AVX "-QxAVX") + set(QT_CFLAGS_AVX2 "-QxCORE-AVX2") + set(QT_CFLAGS_AVX512F "-QxCOMMON-AVX512") + set(QT_CFLAGS_AVX512CD "-QxCOMMON-AVX512") + set(QT_CFLAGS_AVX512ER "-QxMIC-AVX512") + set(QT_CFLAGS_AVX512PF "-QxMIC-AVX512") + set(QT_CFLAGS_AVX512DQ "-QxCORE-AVX512") + set(QT_CFLAGS_AVX512BW "-QxCORE-AVX512") + set(QT_CFLAGS_AVX512VL "-QxCORE-AVX512") + set(QT_CFLAGS_F16C "${QT_CFLAGS_AVX2}") + set(QT_CFLAGS_AESNI "-QxSSE2") + set(QT_CFLAGS_SHANI "-QxSSE4.2") + else() + set(QT_CFLAGS_SSE2 "-msse2") + set(QT_CFLAGS_SSE3 "-msse3") + set(QT_CFLAGS_SSSE3 "-mssse3") + set(QT_CFLAGS_SSE4_1 "-msse4.1") + set(QT_CFLAGS_SSE4_2 "-msse4.2") + set(QT_CFLAGS_AVX "-march=core-avx") + set(QT_CFLAGS_AVX2 "-march=core-avx2") + set(QT_CFLAGS_AVX512F "-march=broadwell -xCOMMON-AVX512") + set(QT_CFLAGS_AVX512CD "-march=broadwell -xCOMMON-AVX512") + set(QT_CFLAGS_AVX512ER "-march=knl") + set(QT_CFLAGS_AVX512PF "-march=knl") + set(QT_CFLAGS_AVX512DQ "-march=skylake-avx512") + set(QT_CFLAGS_AVX512BW "-march=skylake-avx512") + set(QT_CFLAGS_AVX512VL "-march=skylake-avx512") + set(QT_CFLAGS_AESNI "-maes") + set(QT_CFLAGS_F16C "${QT_CFLAGS_AVX2}") + set(QT_CFLAGS_RDRND "-mrdrnd") + set(QT_CFLAGS_SHANI "-msha") + endif() +endif() diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in new file mode 100644 index 00000000000..ad618b7accb --- /dev/null +++ b/cmake/QtConfig.cmake.in @@ -0,0 +1,43 @@ +@PACKAGE_INIT@ + +# Slightly amended version of ./src/corelib/Qt5Config.cmake.in +if (CMAKE_VERSION VERSION_LESS 3.1.0) + message(FATAL_ERROR "Qt requires at least CMake version 3.1.0") +endif() + +get_filename_component(_qt5_install_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) + +include("${CMAKE_CURRENT_LIST_DIR}/Qt5Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/Qt5ToolsTargets.cmake") + +# if (NOT Qt_FIND_COMPONENTS) +# set(Qt_NOT_FOUND_MESSAGE "The Qt package requires at least one component") +# set(Qt_FOUND False) +# return() +# endif() + +foreach(module ${Qt_FIND_COMPONENTS}) + find_package(Qt${module} + ${_Qt_FIND_PARTS_QUIET} + ${_Qt_FIND_PARTS_REQUIRED} + PATHS ${_qt_install_prefix} NO_DEFAULT_PATH + ) + if (NOT Qt${module}_FOUND) + string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY) + + if (Qt_FIND_REQUIRED_${module}) + set(_Qt_NOTFOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}Failed to find Qt component \"${module}\" config file at \"${_expected_module_location}\"\n") + elseif(NOT Qt_FIND_QUIETLY) + message(WARNING "Failed to find Qt component \"${module}\" config file at \"${_expected_module_location}\"") + endif() + + unset(_expected_module_location) + endif() +endforeach() + +set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) + +if (_Qt_NOTFOUND_MESSAGE) + set(Qt_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}") + set(Qt_FOUND False) +endif() diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake new file mode 100644 index 00000000000..a4d9421935f --- /dev/null +++ b/cmake/QtFeature.cmake @@ -0,0 +1,435 @@ +function(qt_feature_module_begin) + qt_parse_all_arguments(_arg "qt_feature_module_begin" + "" "LIBRARY;PRIVATE_FILE;PUBLIC_FILE" "PUBLIC_DEPENDENCIES;PRIVATE_DEPENDENCIES" ${ARGN}) + + if ("${_arg_LIBRARY}" STREQUAL "") + message(FATAL_ERROR "qt_feature_begin_module needs a LIBRARY name!") + endif() + if ("${_arg_PUBLIC_FILE}" STREQUAL "") + message(FATAL_ERROR "qt_feature_begin_module needs a PUBLIC_FILE name!") + endif() + if ("${_arg_PRIVATE_FILE}" STREQUAL "") + message(FATAL_ERROR "qt_feature_begin_module needs a PRIVATE_FILE name!") + endif() + + set(__QtFeature_library "${_arg_LIBRARY}" PARENT_SCOPE) + set(__QtFeature_private_features "" PARENT_SCOPE) + set(__QtFeature_public_features "" PARENT_SCOPE) + + set(__QtFeature_private_file "${_arg_PRIVATE_FILE}" PARENT_SCOPE) + set(__QtFeature_public_file "${_arg_PUBLIC_FILE}" PARENT_SCOPE) + + set(__QtFeature_private_extra "" PARENT_SCOPE) + set(__QtFeature_public_extra "" PARENT_SCOPE) + + qt_push_features_into_parent_scope(PUBLIC_FEATURES ${_arg_PUBLIC_DEPENDENCIES}) + qt_push_features_into_parent_scope(PRIVATE_FEATURES ${_arg_PRIVATE_DEPENDENCIES}) +endfunction() + +function(qt_feature _feature) + set(QT_FEATURE_DEFINITION_${_feature} ${ARGN} PARENT_SCOPE) + qt_parse_all_arguments(_arg "qt_feature" + "PRIVATE;PUBLIC" + "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${ARGN}) + + if("${_arg_EMIT_IF}" STREQUAL "") + set(_arg_EMIT_IF 1) + endif() + + if (${_arg_EMIT_IF}) + set(QT_FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") + set_property(CACHE QT_FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) + + # Register feature for future use: + if (_arg_PUBLIC) + list(APPEND __QtFeature_public_features "${_feature}") + endif() + if (_arg_PRIVATE) + list(APPEND __QtFeature_private_features "${_feature}") + endif() + endif() + set(__QtFeature_public_features ${__QtFeature_public_features} PARENT_SCOPE) + set(__QtFeature_private_features ${__QtFeature_private_features} PARENT_SCOPE) +endfunction() + +function(qt_evaluate_to_boolean expressionVar) + if(${${expressionVar}}) + set(${expressionVar} ON PARENT_SCOPE) + else() + set(${expressionVar} OFF PARENT_SCOPE) + endif() +endfunction() + +function(qt_evaluate_config_expression resultVar) + set(result "") + set(nestingLevel 0) + set(skipNext OFF) + set(expression "${ARGN}") + list(LENGTH expression length) + + math(EXPR length "${length}-1") + foreach(memberIdx RANGE ${length}) + if(${skipNext}) + set(skipNext OFF) + continue() + endif() + + list(GET expression ${memberIdx} member) + + if("${member}" STREQUAL "(") + if(${nestingLevel} GREATER 0) + list(APPEND result ${member}) + endif() + math(EXPR nestingLevel "${nestingLevel} + 1") + continue() + elseif("${member}" STREQUAL ")") + math(EXPR nestingLevel "${nestingLevel} - 1") + if(nestingLevel LESS 0) + break() + endif() + if(${nestingLevel} EQUAL 0) + qt_evaluate_config_expression(result ${result}) + else() + list(APPEND result ${member}) + endif() + continue() + elseif(${nestingLevel} GREATER 0) + list(APPEND result ${member}) + continue() + elseif("${member}" STREQUAL "NOT") + list(APPEND result ${member}) + continue() + elseif("${member}" STREQUAL "AND") + qt_evaluate_to_boolean(result) + if(NOT ${result}) + break() + endif() + set(result "") + elseif("${member}" STREQUAL "OR") + qt_evaluate_to_boolean(result) + if(${result}) + break() + endif() + set(result "") + elseif("${member}" STREQUAL "STREQUAL" AND memberIdx LESS ${length}) + # Unfortunately the semantics for STREQUAL in if() are broken when the + # RHS is an empty string and the parameters to if are coming through a variable. + # So we expect people two write the empty string with single quotes and then we + # do the comparison manually here. + list(LENGTH result lhsIndex) + math(EXPR lhsIndex "${lhsIndex}-1") + list(GET result ${lhsIndex} lhs) + list(REMOVE_AT result ${lhsIndex}) + set(lhs "${${lhs}}") + + math(EXPR rhsIndex "${memberIdx}+1") + set(skipNext ON) + + list(GET expression ${rhsIndex} rhs) + # We can't pass through an empty string with double quotes through various + # stages of substitution, so instead it is represented using single quotes + # and resolve here. + string(REGEX REPLACE "'(.*)'" "\\1" rhs "${rhs}") + + string(COMPARE EQUAL "${lhs}" "${rhs}" stringCompareResult) + list(APPEND result ${stringCompareResult}) + else() + string(FIND "${member}" "QT_FEATURE_" idx) + if(idx EQUAL 0) + # Remove the QT_FEATURE_ prefix + string(SUBSTRING "${member}" 11 -1 feature) + qt_evaluate_feature(${feature}) + endif() + + list(APPEND result ${member}) + endif() + endforeach() + + if("${result}" STREQUAL "") + set(result ON) + else() + qt_evaluate_to_boolean(result) + endif() + + set(${resultVar} ${result} PARENT_SCOPE) +endfunction() + +function(qt_evaluate_feature _feature) + # If the feature was set explicitly by the user to be on or off, in the cache, then + # there's nothing for us to do. + if(NOT QT_FEATURE_${_feature} STREQUAL UNSET) + return() + endif() + + if(NOT DEFINED QT_FEATURE_DEFINITION_${_feature}) + message(FATAL_ERROR "Attempting to evaluate feature ${_feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing") + endif() + + cmake_parse_arguments(_arg + "PRIVATE;PUBLIC" + "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${QT_FEATURE_DEFINITION_${_feature}}) + + if(DEFINED QT_FEATURE_COMPUTED_VALUE_${_feature}) + set(QT_FEATURE_${_feature} ${QT_FEATURE_COMPUTED_VALUE_${_feature}} PARENT_SCOPE) + return() + endif() + + if("${_arg_ENABLE}" STREQUAL "") + set(_arg_ENABLE OFF) + endif() + + if("${_arg_DISABLE}" STREQUAL "") + set(_arg_DISABLE OFF) + endif() + + if("${_arg_AUTODETECT}" STREQUAL "") + set(_arg_AUTODETECT ON) + endif() + + if("${_arg_CONDITION}" STREQUAL "") + set(_arg_CONDITION ON) + endif() + + if(${_arg_DISABLE}) + set(result OFF) + elseif((${_arg_ENABLE}) OR (${_arg_AUTODETECT})) + qt_evaluate_config_expression(result ${_arg_CONDITION}) + else() + # feature not auto-detected and not explicitly enabled + set(result OFF) + endif() + + set(QT_FEATURE_COMPUTED_VALUE_${_feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") + set(QT_FEATURE_${_feature} "${result}" PARENT_SCOPE) +endfunction() + +function(qt_feature_definition _feature _name) + qt_parse_all_arguments(_arg "qt_feature_definition" "NEGATE" "VALUE" "" ${ARGN}) + + # Generate code: + set(_expected 1) + if (_arg_NEGATE) + set(_expected -1) + endif() + set(_msg "\n#if defined(QT_FEATURE_${_feature}) && QT_FEATURE_${_feature} == ${_expected}\n") + if (_arg_VALUE) + string(APPEND _msg "# define ${_name} ${_arg_VALUE}\n") + else() + string(APPEND _msg "# define ${_name}\n") + endif() + string(APPEND _msg "#endif\n") + + # Store for later use: + list(FIND __QtFeature_public_features "${_feature}" _public_index) + if (_public_index GREATER -1) + string(APPEND __QtFeature_public_extra "${_msg}") + endif() + list(FIND __QtFeature_private_features "${_feature}" _private_index) + if (_private_index GREATER -1) + string(APPEND __QtFeature_private_extra "${_msg}") + endif() + + set(__QtFeature_public_extra ${__QtFeature_public_extra} PARENT_SCOPE) + set(__QtFeature_private_extra ${__QtFeature_private_extra} PARENT_SCOPE) +endfunction() + +function(qt_extra_definition _name _value) + qt_parse_all_arguments(_arg "qt_extra_definition" "PUBLIC;PRIVATE" "" "" ${ARGN}) + + if (_arg_PUBLIC) + string(APPEND __QtFeature_public_extra "\n#define ${_name} ${_value}\n") + elseif(_arg_PRIVATE) + string(APPEND __QtFeature_private_extra "\n#define ${_name} ${_value}\n") + endif() + + set(__QtFeature_public_extra ${__QtFeature_public_extra} PARENT_SCOPE) + set(__QtFeature_private_extra ${__QtFeature_private_extra} PARENT_SCOPE) +endfunction() + +function(_qt_generate_feature_line _line _feature) + set(_line "") + if (QT_FEATURE_${_feature} STREQUAL "ON") + set(_line "#define QT_FEATURE_${_feature} 1\n\n" PARENT_SCOPE) + elseif(QT_FEATURE_${_feature} STREQUAL "OFF") + set(_line "#define QT_FEATURE_${_feature} -1\n\n" PARENT_SCOPE) + elseif(QT_FEATURE_${_feature} STREQUAL "UNSET") + set(_line "#define QT_FEATURE_${_feature} 0\n\n" PARENT_SCOPE) + else() + message(FATAL_ERROR "${_feature} has unexpected value \"${QT_FEATURE_${_feature}}\"!") + endif() +endfunction() + +function(_qt_feature_write_file _file _features _extra) + message("Generating file ${_file}.") + set(_contents "") + foreach(_it ${_features}) + _qt_generate_feature_line(_line "${_it}") + string(APPEND _contents "${_line}") + endforeach() + string(APPEND _contents "${_extra}") + + file(GENERATE OUTPUT "${_file}" CONTENT "${_contents}") +endfunction() + +function(qt_feature_module_end target) + set(all_features ${__QtFeature_public_features} ${__QtFeature_private_features}) + list(REMOVE_DUPLICATES all_features) + + foreach(feature ${all_features}) + unset(QT_FEATURE_COMPUTED_VALUE_${feature} CACHE) + endforeach() + + foreach(feature ${all_features}) + qt_evaluate_feature(${feature}) + + set(QT_FEATURE_${feature} ${QT_FEATURE_${feature}} PARENT_SCOPE) + endforeach() + + set(enabled_public_features "") + set(disabled_public_features "") + set(enabled_private_features "") + set(disabled_private_features "") + + foreach(feature ${__QtFeature_public_features}) + if(QT_FEATURE_${feature}) + list(APPEND enabled_public_features ${feature}) + else() + list(APPEND disabled_public_features ${feature}) + endif() + endforeach() + + foreach(feature ${__QtFeature_private_features}) + if(QT_FEATURE_${feature}) + list(APPEND enabled_private_features ${feature}) + else() + list(APPEND disabled_private_features ${feature}) + endif() + endforeach() + + foreach(feature ${all_features}) + unset(QT_FEATURE_COMPUTED_VALUE_${feature} CACHE) + unset(QT_FEATURE_DEFINITION_${feature} CACHE) + endforeach() + + _qt_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_private_file}" + "${__QtFeature_private_features}" "${__QtFeature_private_extra}" + ) + qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_private_file}" PRIVATE) + + _qt_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_public_file}" + "${__QtFeature_public_features}" "${__QtFeature_public_extra}" + ) + qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_public_file}") + + get_target_property(targetType "${target}" TYPE) + if("${targetType}" STREQUAL "INTERFACE_LIBRARY") + set(propertyPrefix "INTERFACE_") + else() + set(propertyPrefix "") + set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES") + endif() + foreach(visibility public private) + string(TOUPPER "${visibility}" capitalVisibility) + foreach(state enabled disabled) + string(TOUPPER "${state}" capitalState) + + set_property(TARGET "${target}" PROPERTY ${propertyPrefix}QT_${capitalState}_${capitalVisibility}_FEATURES "${${state}_${visibility}_features}") + endforeach() + endforeach() + + unset(__QtFeature_library PARENT_SCOPE) + unset(__QtFeature_private_features PARENT_SCOPE) + unset(__QtFeature_public_features PARENT_SCOPE) + + unset(__QtFeature_private_file PARENT_SCOPE) + unset(__QtFeature_public_file PARENT_SCOPE) + + unset(__QtFeature_private_extra PARENT_SCOPE) + unset(__QtFeature_public_extra PARENT_SCOPE) +endfunction() + +function(qt_config_compile_test name) + cmake_parse_arguments(_arg "" "LABEL" "" ${ARGN}) + + check_cxx_source_compiles("${_arg_UNPARSED_ARGUMENTS}" HAVE_${name}) + set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${_arg_LABEL}") +endfunction() + +function(qt_config_compile_test_x86simd extension label) + string(TOUPPER ${extension} extension_uppercase) + try_compile(TEST_X86SIMD_${extension} "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/x86_simd/main.cpp" + COMPILE_DEFINITIONS -DQT_COMPILER_SUPPORTS_${extension_uppercase} + OUTPUT_VARIABLE foo + ) + set(TEST_subarch_${extension} "${TEST_X86SIMD_${extension}}" CACHE INTERNAL "${label}" ) +endfunction() + +function(qt_pull_features_into_current_scope) + cmake_parse_arguments(__arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "FEATURE_PROPERTY_INFIX" "" ${ARGN}) + foreach(__target IN ITEMS ${__arg_UNPARSED_ARGUMENTS}) + if(NOT TARGET ${__target}) + continue() + endif() + get_target_property(__target_type "${__target}" TYPE) + if("${__target_type}" STREQUAL "INTERFACE_LIBRARY") + set(__property_prefix "INTERFACE_") + else() + set(__property_prefix "") + endif() + foreach(__visibility PUBLIC PRIVATE) + set(__value ON) + foreach(__state ENABLED DISABLED) + if(NOT ${__arg_${__visibility}_FEATURES}) + continue() + endif() + get_target_property(__features "${__target}" ${__property_prefix}QT_${__arg_FEATURE_PROPERTY_INFIX}${__state}_${__visibility}_FEATURES) + if("${__features}" STREQUAL "__features-NOTFOUND") + continue() + endif() + foreach(__feature ${__features}) + set(QT_FEATURE_${__feature} ${__value} PARENT_SCOPE) + endforeach() + set(__value OFF) + endforeach() + endforeach() + endforeach() +endfunction() + +macro(qt_push_features_into_parent_scope) + cmake_parse_arguments(__arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "FEATURE_PROPERTY_INFIX" "" ${ARGN}) + foreach(__target IN ITEMS ${__arg_UNPARSED_ARGUMENTS}) + if(NOT TARGET ${__target}) + continue() + endif() + get_target_property(__target_type "${__target}" TYPE) + if("${__target_type}" STREQUAL "INTERFACE_LIBRARY") + set(__property_prefix "INTERFACE_") + else() + set(__property_prefix "") + endif() + foreach(__visibility PUBLIC PRIVATE) + set(__value ON) + foreach(__state ENABLED DISABLED) + if(NOT ${__arg_${__visibility}_FEATURES}) + continue() + endif() + get_target_property(__features "${__target}" ${__property_prefix}QT_${__arg_FEATURE_PROPERTY_INFIX}${__state}_${__visibility}_FEATURES) + if("${__features}" STREQUAL "__features-NOTFOUND") + continue() + endif() + foreach(__feature ${__features}) + set(QT_FEATURE_${__feature} ${__value} PARENT_SCOPE) + endforeach() + set(__value OFF) + endforeach() + endforeach() + endforeach() +endmacro() + +macro(qt_load_global_features) + if(NOT TARGET Qt::Core) + find_package(Qt${PROJECT_VERSION_MAJOR}Core QUIET) + endif() + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) +endmacro() diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in new file mode 100644 index 00000000000..32f30fed7ee --- /dev/null +++ b/cmake/QtModuleConfig.cmake.in @@ -0,0 +1,9 @@ +@PACKAGE_INIT@ + +find_package(Qt@PROJECT_VERSION_MAJOR@ QUIET) + +include("${CMAKE_CURRENT_LIST_DIR}/@versioned_module_name@Targets.cmake") + +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@versioned_module_name@Macros.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@versioned_module_name@Macros.cmake") +endif() diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake new file mode 100644 index 00000000000..4f3103e304a --- /dev/null +++ b/cmake/QtPlatformSupport.cmake @@ -0,0 +1,41 @@ +function(set01 result) + if (${ARGN}) + set("${result}" 1 PARENT_SCOPE) + else() + set("${result}" 0 PARENT_SCOPE) + endif() +endfunction() + +set01(LINUX CMAKE_SYSTEM_NAME STREQUAL "Linux") +set01(HPUX CMAKE_SYSTEM_NAME STREQUAL "HPUX") +set01(ANDROID CMAKE_SYSTEM_NAME STREQUAL "Android") # FIXME: How to identify this? +set01(NACL CMAKE_SYSTEM_NAME STREQUAL "NaCl") # FIXME: How to identify this? +set01(INTEGRITY CMAKE_SYSTEM_NAME STREQUAL "Integrity") # FIXME: How to identify this? +set01(VXWORKS CMAKE_SYSTEM_NAME STREQUAL "VxWorks") # FIXME: How to identify this? +set01(QNX CMAKE_SYSTEM_NAME STREQUAL "QNX") # FIXME: How to identify this? +set01(OPENBSD CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") # FIXME: How to identify this? +set01(FREEBSD CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FIXME: How to identify this? +set01(NETBSD CMAKE_SYSTEM_NAME STREQUAL "NetBSD") # FIXME: How to identify this? +set01(WASM CMAKE_SYSTEM_NAME STREQUAL "Webassembly") # FIXME: How to identify this? + +set01(BSD APPLE OR OPENBSD OR FREEBSD OR NETBSD) + +set01(WINRT WIN32 AND CMAKE_VS_PLATFORM_TOOSLET STREQUAL "winrt") # FIXME: How to identify this? + +set01(APPLE_OSX APPLE) # FIXME: How to identify this? For now assume that always building for macOS. +set01(APPLE_UIKIT APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "uikit") # FIXME: How to identify this? +set01(APPLE_IOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "ios") # FIXME: How to identify this? +set01(APPLE_TVOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "tvos") # FIXME: How to identify this? +set01(APPLE_WATCHOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "watchos") # FIXME: How to identify this? + +set01(ANDROID_EMBEDDED ANDROID) # FIXME: How to identify this? + +set01(GCC CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +set01(CLANG CMAKE_CXX_COMPILER_ID MATCHES "Clang") +set01(ICC CMAKE_C_COMPILER MATCHES "icc|icl") + +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(QT_64BIT TRUE) +elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + set(QT_32BIT TRUE) +endif() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake new file mode 100644 index 00000000000..5e563d4c915 --- /dev/null +++ b/cmake/QtPostProcess.cmake @@ -0,0 +1,32 @@ +function(qt_internal_write_depends_file target) + set(module Qt${target}) + set(outfile "${PROJECT_BINARY_DIR}/include/${module}/${module}Depends") + message("Generate ${outfile}...") + set(contents "/* This file was generated by cmake with the info from ${module} target. */\n") + string(APPEND contents "#ifdef __cplusplus /* create empty PCH in C mode */\n") + foreach (m ${ARGN}) + string(APPEND contents "# include \n") + endforeach() + string(APPEND contents "#endif\n") + + file(GENERATE OUTPUT ${outfile} CONTENT ${contents}) +endfunction() + +function(qt_internal_create_depends_files) + message("Generating depends files for ${KNOWN_QT_MODULES}...") + foreach (target ${KNOWN_QT_MODULES}) + get_target_property(depends "${target}" LINK_LIBRARIES) + foreach (dep ${depends}) + list(FIND KNOWN_QT_MODULES "${dep}" _pos) + if (_pos GREATER -1) + list(APPEND qtdeps "${dep}") + endif() + endforeach() + get_target_property(hasModuleHeaders "${target}" MODULE_HAS_HEADERS) + if (${hasModuleHeaders}) + qt_internal_write_depends_file("${target}" ${qtdeps}) + endif() + endforeach() +endfunction() + +qt_internal_create_depends_files() diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake new file mode 100644 index 00000000000..11ccc129b40 --- /dev/null +++ b/cmake/QtSetup.cmake @@ -0,0 +1,47 @@ +## Force C++ standard, do not fall back, do not use compiler extensions +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +## Position independent code: +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +# Do not relink dependent libraries when no header has changed: +set(CMAKE_LINK_DEPENDS_NO_SHARED ON) + +# Default to hidden visibility for symbols: +set(CMAKE_C_VISIBILITY_PRESET hidden) +set(CMAKE_CXX_VISIBILITY_PRESET hidden) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) + +## Enable testing: +include(CTest) +enable_testing() + +## Define some constants to check for certain platforms, etc: +include(QtPlatformSupport) + +## add_qt_module and co.: +include(QtBuild) + +## Qt Feature support: +include(QtFeature) + +## Compiler optimization flags: +include(QtCompilerOptimization) + +## Find host tools (if non native): +set(HOST_QT_TOOLS_DIRECTORY "" CACHE PATH "Directory with Qt host tools.") + +if (CMAKE_CROSSCOMPILING AND "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") + message(FATAL_ERROR "You need to set HOST_QT_TOOLS_DIRECTORY for a cross-complile.") +endif() + +## Find syncqt in HOST TOOLS or locally: +if("x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") + set(QT_SYNCQT "${PROJECT_SOURCE_DIR}/bin/syncqt.pl") + install(PROGRAMS "${QT_SYNCQT}" DESTINATION "${INSTALL_BINDIR}") +endif() + +## Enable support for sanitizers: +include(${CMAKE_CURRENT_LIST_DIR}/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake) diff --git a/cmake/README.md b/cmake/README.md new file mode 100644 index 00000000000..6ae8162d80e --- /dev/null +++ b/cmake/README.md @@ -0,0 +1,103 @@ +# Status + +Initial port is on-going. Some modules of QtBase are ported, incl. some of the platform modules. Most are missing still. + +Basic functionality is there (moc, uic, etc.), but documentation, translations, qdbusxml2cpp, etc. are missing. + + +# Intro + +The CMake update offers an opportunity to revisit some topics that came up during the last few years. + +* The Qt build system does not support building host tools during a cross-compilation run. You need to build a Qt for your host machine first and then use the platform tools from that version. The decision to do this was reached independent of cmake: This does save resources on build machines as the host tools will only get built once. + +* 3rd-party dependencies are no longer built as part of Qt. zlib, libpng, etc. from src/3rdparty need +to be supplied from the outside to the build now. You may find apt-get/brew/etc. useful for this. Otherwise you may consider using vcpkg as in the next section. The decision to remove 3rd party dependencies from Qt repositories was reached independent of the decision to use cmake, we just use the opportunity to implement this decision. + +* There is less need for bootstrapping. Only moc and rcc (plus the lesser known tracegen and qfloat16-tables) are linking against the bootstrap Qt library. Everything else can link against the full QtCore. This will include qmake, which is currently missing from a cmake build. This will change: Qmake is supported as a build system for applications *using* Qt going forward and will not go away anytime soon. + +* For the time being we try to keep qmake working so that we do not interfere too much with ongoing development. + + +# Building against VCPKG + +You may use vcpkg to install dependencies needed to build QtBase. + + * ```git clone -b qt https://github.com/tronical/vcpkg``` + * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` + * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to + * Linux: ``x64-linux`` + * Windows: ``qt-x86-windows-static`` + * Build Qt dependencies: ``vcpkg install zlib pcre2 double-conversion harfbuzz`` + * When running cmake in qtbase, pass ``-DCMAKE_PREFIX_PATH=/path/to/your/vcpkg/installed/$VCPKG_DEFAULT_TRIPLET`` or ``-DCMAKE_PREFIX_PATH=/path/to/your/vcpkg/installed/%VCPKG_DEFAULT_TRIPLET%`` on Windows. + + +# Building + +The basic way of building with cmake is as follows: + +``` + cd {build directory} + cmake {path to source directory} + cmake --build . +``` + +``cmake --build`` is just a simple wrapper around the basic build tool that CMake generated a build system for. It works with any supported build backend supported by cmake, but you can also use the backend build tool directly, e.g. by running ``make`` in this case. + +CMake has a ninja backend that works quite well and is noticeably faster than make, so you may want to use that: + +``` + cd {build directory} + cmake -GNinja {path to source directory} + cmake --build . # ... or ninja ;-) +``` + +You can look into the generated ``build.ninja`` file if you're curious and you can also build targets directory such as ``ninja lib/libQt5Core.so``. + +When you're done with the build, you may want to install it, using ``ninja install`` or ``make install``. The installation prefix is chosen when running cmake though: + +``` + cd {build directory} + cmake -GNinja -DCMAKE_INSTALL_PREFIX=/path/where/to/install {path to source directory} + ninja + ninja install +``` + +You can use ``cmake-gui {path to build directory}`` or ``ccmake {path to build directory}`` to configure the values of individual cmake variables or Qt features. After changing a value, you need to choose the *configure* step (usually several times:-/), followed by the *generate* step (to generate makefiles/ninja files). + +# Debugging CMake files + +CMake allows specifying the ``--trace`` and ``--trace-expand`` options, which work like ``qmake -d -d``: As the cmake code is evaluated, the values of parameters and variables is shown. This can be a lot of output, so you may want to redirect it to a file. + +# Porting Help + +We have some python scripts to help with the conversion from qmake to cmake. These scripts can be found in ``utils/cmake``. + +## configurejson2cmake.py + +This script converts all ``configure.json`` in the Qt repository to ``configure.cmake`` files for use with CMake. We want to generate configure.cmake files for the foreseeable future, so if you need to tweak the generated configure.cmake files, please tweak the generation script instead. + +``configurejson2cmake.py`` is run like this: ``util/cmake/configurejson2cmake.py .`` in the top-level source directory of a Qt repository. + + +## pro2cmake.py + +``pro2cmake.py`` generates a skeleton CMakeLists.txt file from a .pro-file. You will need to polish the resulting CMakeLists.txt file, but e.g. the list of files, etc. should be extracted for you. + +``pro2cmake.py`` is run like this: ``/path/to/pro2cmake.py some.pro``. + + +## run_pro2cmake.py + +`` A small helper script to run pro2cmake.py on all .pro-files in a directory. Very useful to e.g. convert all the unit tests for a Qt module over to cmake;-) + +``run_pro2cmake.py`` is run like this: ``/path/to/run_pro2cmake.py some_dir``. + + +## How to convert certain constructs + +| qmake | CMake | +| ------ | ------ | +| ``qtHaveModule(foo)`` | ``if(TARGET Qt::foo)`` | +| ``qtConfig(foo)`` | ``if (QT_FEATURE_foo)`` | + diff --git a/cmake/tests/features/CMakeLists.txt b/cmake/tests/features/CMakeLists.txt new file mode 100644 index 00000000000..0208e3d890e --- /dev/null +++ b/cmake/tests/features/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(FeaturesTest + VERSION 1.0.0 + DESCRIPTION "QtFeature test" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") + +## Qt specific setup common for all modules: +include(QtSetup) + +## Library to hold global features: +add_library(Qt_global_Config INTERFACE) + +qt_feature_module_begin(LIBRARY QtCore + PUBLIC_FILE src/corelib/global/qconfig.h + PRIVATE_FILE src/corelib/global/qconfig_p.h +) +include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") +qt_feature_module_end(Qt_global_Config) + +assert(QT_FEATURE_top_a STREQUAL "ON") +assert(QT_FEATURE_top_b STREQUAL "OFF") +assert(QT_FEATURE_top_enabled STREQUAL "ON") +assert(QT_FEATURE_top_disabled STREQUAL "OFF") +assert(QT_FEATURE_top_disabled_enabled STREQUAL "OFF") +assert(NOT DEFINED QT_FEATURE_top_not_emitted) + +## Enable feature summary at the end of the configure run: +include(FeatureSummary) + +add_subdirectory(src) + +## Delayed actions on some of the Qt targets: +include(QtPostProcess) + +## Print a feature summary: +feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/tests/features/configure.cmake b/cmake/tests/features/configure.cmake new file mode 100644 index 00000000000..ace2b62450e --- /dev/null +++ b/cmake/tests/features/configure.cmake @@ -0,0 +1,35 @@ +#### Features + +# This belongs into gui, but the license check needs it here already. +qt_feature("top_a" PRIVATE + LABEL "top_a" + CONDITION ON +) +qt_feature("top_b" PUBLIC PRIVATE + LABEL "top_b" + AUTODETECT OFF +) +qt_feature_definition("top_a" "top_defa") + +qt_feature("top_enabled" PRIVATE + LABEL "top_enabled" + ENABLE ON +) + +qt_feature("top_disabled" PRIVATE + LABEL "top_enabled" + DISABLE ON +) + +qt_feature("top_disabled_enabled" PRIVATE + LABEL "top_enabled_enabled" + DISABLE ON + ENABLE ON +) + +qt_feature("top_not_emitted" PRIVATE + LABEL "top_not_emitted" + EMIT_IF OFF +) + +qt_extra_definition("top_extra" "PUBLIC_FOO" PUBLIC) diff --git a/cmake/tests/features/src/CMakeLists.txt b/cmake/tests/features/src/CMakeLists.txt new file mode 100644 index 00000000000..1a31dbc8c5f --- /dev/null +++ b/cmake/tests/features/src/CMakeLists.txt @@ -0,0 +1,7 @@ +## Features from parent scope were inherited: +assert(QT_FEATURE_top_a STREQUAL "ON") +assert(QT_FEATURE_top_b STREQUAL "OFF") +assert(QT_FEATURE_top_enabled STREQUAL "ON") +assert(QT_FEATURE_top_disabled STREQUAL "OFF") +assert(QT_FEATURE_top_disabled_enabled STREQUAL "OFF") +assert(NOT DEFINED QT_FEATURE_top_not_emitted) diff --git a/configure.cmake b/configure.cmake new file mode 100644 index 00000000000..0fe41299626 --- /dev/null +++ b/configure.cmake @@ -0,0 +1,421 @@ + + +#### Inputs + + + +#### Libraries + +find_package(ZLIB) +set_package_properties(ZLIB PROPERTIES TYPE OPTIONAL) +find_package(Libudev) +set_package_properties(Libudev PROPERTIES TYPE OPTIONAL) + + +#### Tests + +# reduce_relocations +qt_config_compile_test(reduce_relocations + LABEL "-Bsymbolic-functions support" +"#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64)) +# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129). +#endif + + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ + + /* END TEST: */ + return 0; +} +"# FIXME: qmake: ['TEMPLATE = lib', 'CONFIG += dll bsymbolic_functions', 'isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope")'] +) + +# sse2 +qt_config_compile_test_x86simd(sse2 "SSE2 instructions") + +# sse3 +qt_config_compile_test_x86simd(sse3 "SSE3 instructions") + +# ssse3 +qt_config_compile_test_x86simd(ssse3 "SSSE3 instructions") + +# sse4_1 +qt_config_compile_test_x86simd(sse4_1 "SSE4.1 instructions") + +# sse4_2 +qt_config_compile_test_x86simd(sse4_2 "SSE4.2 instructions") + +# aesni +qt_config_compile_test_x86simd(aesni "AES new instructions") + +# f16c +qt_config_compile_test_x86simd(f16c "F16C instructions") + +# rdrnd +qt_config_compile_test_x86simd(rdrnd "RDRAND instruction") + +# shani +qt_config_compile_test_x86simd(shani "SHA new instructions") + +# avx +qt_config_compile_test_x86simd(avx "AVX instructions") + +# avx2 +qt_config_compile_test_x86simd(avx2 "AVX2 instructions") + +# avx512f +qt_config_compile_test_x86simd(avx512f "AVX512 F instructions") + +# avx512er +qt_config_compile_test_x86simd(avx512er "AVX512 ER instructions") + +# avx512cd +qt_config_compile_test_x86simd(avx512cd "AVX512 CD instructions") + +# avx512pf +qt_config_compile_test_x86simd(avx512pf "AVX512 PF instructions") + +# avx512dq +qt_config_compile_test_x86simd(avx512dq "AVX512 DQ instructions") + +# avx512bw +qt_config_compile_test_x86simd(avx512bw "AVX512 BW instructions") + +# avx512vl +qt_config_compile_test_x86simd(avx512vl "AVX512 VL instructions") + +# avx512ifma +qt_config_compile_test_x86simd(avx512ifma "AVX512 IFMA instructions") + +# avx512vbmi +qt_config_compile_test_x86simd(avx512vbmi "AVX512 VBMI instructions") + +# posix_fallocate +qt_config_compile_test(posix_fallocate + LABEL "POSIX fallocate()" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +(void) posix_fallocate(0, 0, 0); + /* END TEST: */ + return 0; +} +") + +# alloca_stdlib_h +qt_config_compile_test(alloca_stdlib_h + LABEL "alloca() in stdlib.h" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +alloca(1); + /* END TEST: */ + return 0; +} +") + +# alloca_h +qt_config_compile_test(alloca_h + LABEL "alloca() in alloca.h" +" +#include +#ifdef __QNXNTO__ +// extra include needed in QNX7 to define NULL for the alloca() macro +# include +#endif +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +alloca(1); + /* END TEST: */ + return 0; +} +") + +# alloca_malloc_h +qt_config_compile_test(alloca_malloc_h + LABEL "alloca() in malloc.h" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +alloca(1); + /* END TEST: */ + return 0; +} +") + +# stack_protector +qt_config_compile_test(stack_protector + LABEL "stack protection" +"#ifdef __QNXNTO__ +# include +# if _NTO_VERSION < 700 +# error stack-protector not used (by default) before QNX 7.0.0. +# endif +#endif + + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ + + /* END TEST: */ + return 0; +} +"# FIXME: qmake: QMAKE_CXXFLAGS += -fstack-protector-strong +) + + + +#### Features + +# This belongs into gui, but the license check needs it here already. +qt_feature("android_style_assets" PRIVATE + LABEL "Android Style Assets" + CONDITION ANDROID +) +qt_feature("developer_build" PUBLIC PRIVATE + LABEL "Developer build" + AUTODETECT OFF +) +qt_feature_definition("developer_build" "QT_BUILD_INTERNAL") +qt_feature("appstore_compliant" PUBLIC + LABEL "App store compliance" + PURPOSE "Disables code that is not allowed in platform app stores" + AUTODETECT APPLE_UIKIT OR ANDROID OR WINRT +) +qt_feature("simulator_and_device" PUBLIC + LABEL "Build for both simulator and device" + CONDITION APPLE_UIKIT AND INPUT_sdk STREQUAL '' +) +qt_feature("force_asserts" PUBLIC + LABEL "Force assertions" + AUTODETECT OFF +) +qt_feature("framework" PUBLIC + LABEL "Build Apple Frameworks" + CONDITION APPLE AND QT_FEATURE_shared +) +qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD") +qt_feature("largefile" PUBLIC + LABEL "Large file support" + CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT WINRT +) +qt_feature_definition("largefile" "QT_LARGEFILE_SUPPORT" VALUE "64") +qt_feature("reduce_exports" PUBLIC PRIVATE + LABEL "Reduce amount of exported symbols" + CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY +) +qt_feature_definition("reduce_exports" "QT_VISIBILITY_AVAILABLE") +qt_feature("sse2" PUBLIC PRIVATE + LABEL "SSE2" + CONDITION ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) ) AND TEST_subarch_sse2 +) +qt_feature_definition("sse2" "QT_COMPILER_SUPPORTS_SSE2" VALUE "1") +qt_feature("sse3" PUBLIC + LABEL "SSE3" + CONDITION QT_FEATURE_sse2 AND TEST_subarch_sse3 +) +qt_feature_definition("sse3" "QT_COMPILER_SUPPORTS_SSE3" VALUE "1") +qt_feature("ssse3" PUBLIC + LABEL "SSSE3" + CONDITION QT_FEATURE_sse3 AND TEST_subarch_ssse3 +) +qt_feature_definition("ssse3" "QT_COMPILER_SUPPORTS_SSSE3" VALUE "1") +qt_feature("sse4_1" PUBLIC + LABEL "SSE4.1" + CONDITION QT_FEATURE_ssse3 AND TEST_subarch_sse4_1 +) +qt_feature_definition("sse4_1" "QT_COMPILER_SUPPORTS_SSE4_1" VALUE "1") +qt_feature("sse4_2" PUBLIC + LABEL "SSE4.2" + CONDITION QT_FEATURE_sse4_1 AND TEST_subarch_sse4_2 +) +qt_feature_definition("sse4_2" "QT_COMPILER_SUPPORTS_SSE4_2" VALUE "1") +qt_feature("avx" PUBLIC + LABEL "AVX" + CONDITION QT_FEATURE_sse4_2 AND TEST_subarch_avx +) +qt_feature_definition("avx" "QT_COMPILER_SUPPORTS_AVX" VALUE "1") +qt_feature("f16c" PUBLIC + LABEL "F16C" + CONDITION QT_FEATURE_avx AND TEST_subarch_c16c +) +qt_feature_definition("f16c" "QT_COMPILER_SUPPORTS_F16C" VALUE "1") +qt_feature("avx2" PUBLIC PRIVATE + LABEL "AVX2" + CONDITION QT_FEATURE_avx AND TEST_subarch_avx2 +) +qt_feature_definition("avx2" "QT_COMPILER_SUPPORTS_AVX2" VALUE "1") +qt_feature("avx512f" PUBLIC + LABEL "F" + CONDITION QT_FEATURE_avx2 AND TEST_subarch_avx512f +) +qt_feature_definition("avx512f" "QT_COMPILER_SUPPORTS_AVX512F" VALUE "1") +qt_feature("avx512er" PUBLIC + LABEL "ER" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512er +) +qt_feature_definition("avx512er" "QT_COMPILER_SUPPORTS_AVX512ER" VALUE "1") +qt_feature("avx512cd" PUBLIC + LABEL "CD" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512cd +) +qt_feature_definition("avx512cd" "QT_COMPILER_SUPPORTS_AVX512CD" VALUE "1") +qt_feature("avx512pf" PUBLIC + LABEL "PF" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512pf +) +qt_feature_definition("avx512pf" "QT_COMPILER_SUPPORTS_AVX512PF" VALUE "1") +qt_feature("avx512dq" PUBLIC + LABEL "DQ" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512dq +) +qt_feature_definition("avx512dq" "QT_COMPILER_SUPPORTS_AVX512DQ" VALUE "1") +qt_feature("avx512bw" PUBLIC + LABEL "BW" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512bw +) +qt_feature_definition("avx512bw" "QT_COMPILER_SUPPORTS_AVX512BW" VALUE "1") +qt_feature("avx512vl" PUBLIC + LABEL "VL" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512vl +) +qt_feature_definition("avx512vl" "QT_COMPILER_SUPPORTS_AVX512VL" VALUE "1") +qt_feature("avx512ifma" PUBLIC + LABEL "IFMA" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512ifma +) +qt_feature_definition("avx512ifma" "QT_COMPILER_SUPPORTS_AVX512IFMA" VALUE "1") +qt_feature("avx512vbmi" PUBLIC + LABEL "VBMI" + CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512vbmi +) +qt_feature_definition("avx512vbmi" "QT_COMPILER_SUPPORTS_AVX512VBMI" VALUE "1") +qt_feature("aesni" PUBLIC + LABEL "AES" + CONDITION QT_FEATURE_sse2 AND TEST_subarch_aes +) +qt_feature_definition("aesni" "QT_COMPILER_SUPPORTS_AES" VALUE "1") +qt_feature("rdrnd" PUBLIC + LABEL "RDRAND" + CONDITION TEST_subarch_rdseed +) +qt_feature_definition("rdrnd" "QT_COMPILER_SUPPORTS_RDRND" VALUE "1") +qt_feature("shani" PUBLIC + LABEL "SHA" + CONDITION QT_FEATURE_sse2 AND TEST_subarch_sha +) +qt_feature_definition("shani" "QT_COMPILER_SUPPORTS_SHA" VALUE "1") +qt_feature("x86SimdAlways" PUBLIC + LABEL "Intrinsics without -mXXX option" + CONDITION ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) ) AND ON +) +qt_feature_definition("x86SimdAlways" "QT_COMPILER_SUPPORTS_SIMD_ALWAYS" VALUE "1") +qt_feature("mips_dsp" PUBLIC + LABEL "DSP" + CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_subarch_dsp +) +qt_feature_definition("mips_dsp" "QT_COMPILER_SUPPORTS_MIPS_DSP" VALUE "1") +qt_feature("mips_dspr2" PUBLIC + LABEL "DSPr2" + CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_subarch_dspr2 +) +qt_feature_definition("mips_dspr2" "QT_COMPILER_SUPPORTS_MIPS_DSPR2" VALUE "1") +qt_feature("neon" PUBLIC + LABEL "NEON" + CONDITION ( ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 ) ) AND TEST_subarch_neon +) +qt_feature_definition("neon" "QT_COMPILER_SUPPORTS_NEON" VALUE "1") +qt_feature("alloca_h" PRIVATE + LABEL "alloca.h" + CONDITION TEST_alloca_h +) +qt_feature("alloca_malloc_h" PRIVATE + LABEL "alloca() in malloc.h" + CONDITION NOT QT_FEATURE_alloca_h AND TEST_alloca_malloc_h +) +qt_feature("alloca" PRIVATE + LABEL "alloca()" + CONDITION QT_FEATURE_alloca_h OR QT_FEATURE_alloca_malloc_h OR TEST_alloca_stdlib_h +) +qt_feature("thread" PUBLIC + SECTION "Kernel" + LABEL "Thread support" + PURPOSE "Provides QThread and related classes." +) +qt_feature("future" PUBLIC + SECTION "Kernel" + LABEL "QFuture" + PURPOSE "Provides QFuture and related classes." + CONDITION QT_FEATURE_thread +) +qt_feature("concurrent" PUBLIC + SECTION "Kernel" + LABEL "Qt Concurrent" + PURPOSE "Provides a high-level multi-threading API." + CONDITION QT_FEATURE_future +) +qt_feature_definition("concurrent" "QT_NO_CONCURRENT" NEGATE VALUE "1") +qt_feature("dbus" PUBLIC PRIVATE + LABEL "Qt D-Bus" + AUTODETECT NOT APPLE_UIKIT AND NOT ANDROID AND NOT WINRT + CONDITION QT_FEATURE_thread +) +qt_feature_definition("dbus" "QT_NO_DBUS" NEGATE VALUE "1") +qt_feature("dbus_linked" PRIVATE + LABEL "Qt D-Bus directly linked to libdbus" + CONDITION QT_FEATURE_dbus AND libs.dbus OR FIXME + ENABLE INPUT_dbus STREQUAL 'linked' + DISABLE INPUT_dbus STREQUAL 'runtime' +) +qt_feature("gui" PRIVATE + LABEL "Qt Gui" +) +qt_feature("network" PRIVATE + LABEL "Qt Network" + CONDITION QT_FEATURE_thread +) +qt_feature("sql" PRIVATE + LABEL "Qt Sql" + CONDITION QT_FEATURE_thread +) +qt_feature("testlib" PRIVATE + LABEL "Qt Testlib" +) +qt_feature("widgets" PUBLIC PRIVATE + LABEL "Qt Widgets" + AUTODETECT NOT APPLE_TVOS AND NOT APPLE_WATCHOS + CONDITION QT_FEATURE_gui +) +qt_feature_definition("widgets" "QT_NO_WIDGETS" NEGATE) +qt_feature("xml" PRIVATE + LABEL "Qt Xml" +) +qt_feature("libudev" PRIVATE + LABEL "udev" + CONDITION Libudev_FOUND +) + +qt_extra_definition("QT_VERSION_STR" "\"${PROJECT_VERSION}\"" PUBLIC) +qt_extra_definition("QT_VERSION_MAJOR" ${PROJECT_VERSION_MAJOR} PUBLIC) +qt_extra_definition("QT_VERSION_MINOR" ${PROJECT_VERSION_MINOR} PUBLIC) +qt_extra_definition("QT_VERSION_PATCH" ${PROJECT_VERSION_PATCH} PUBLIC) diff --git a/configure.json b/configure.json index 3702c24f63b..5201fd5ce9e 100644 --- a/configure.json +++ b/configure.json @@ -1249,9 +1249,7 @@ { "type": "warning", "condition": "input.debug_and_release == 'yes' && !config.darwin && !config.win32", - "message": "-debug-and-release is only supported on Darwin and Windows platforms. -Qt can be built in release mode with separate debug information, so --debug-and-release is no longer necessary." + "message": "-debug-and-release is only supported on Darwin and Windows platforms. Qt can be built in release mode with separate debug information, so -debug-and-release is no longer necessary." }, { "type": "error", @@ -1274,9 +1272,7 @@ Qt can be built in release mode with separate debug information, so { "type": "note", "condition": "!features.shared", - "message": "Using static linking will disable the use of dynamically -loaded plugins. Make sure to import all needed static plugins, -or compile needed modules into the library." + "message": "Using static linking will disable the use of dynamically loaded plugins. Make sure to import all needed static plugins, or compile needed modules into the library." }, { "type": "note", @@ -1286,8 +1282,7 @@ or compile needed modules into the library." { "type": "note", "condition": "input.qreal == 'double' && arch.arm", - "message": "Qt is using double for qreal on this system. This is binary-incompatible against Qt 5.1. -Configure with '-qreal float' to create a build that is binary-compatible with 5.1." + "message": "Qt is using double for qreal on this system. This is binary-incompatible against Qt 5.1. Configure with '-qreal float' to create a build that is binary-compatible with 5.1." }, { "type": "error", diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 00000000000..4eaab5064f0 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,3 @@ +if(QT_FEATURE_gui) + add_subdirectory(gui) +endif() diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt new file mode 100644 index 00000000000..ac96b7351c4 --- /dev/null +++ b/examples/gui/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(rasterwindow) diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt new file mode 100644 index 00000000000..13caffe5bb1 --- /dev/null +++ b/examples/gui/rasterwindow/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from rasterwindow.pro. + +##################################################################### +## None Binary: +##################################################################### + +set(sources main.cpp + rasterwindow.cpp rasterwindow.h) +add_executable(rasterwindow + ${sources} +) +qt_internal_automoc(rasterwindow ${sources}) +target_include_directories(rasterwindow + PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}" + ) +target_link_libraries(rasterwindow PRIVATE Qt::Core Qt::Test Qt::Gui) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt new file mode 100644 index 00000000000..0582613d82a --- /dev/null +++ b/qmake/CMakeLists.txt @@ -0,0 +1,2 @@ +## FIXME: Actually build something... +install(DIRECTORY mkspecs DESTINATION ${INSTALL_DATADIR}) diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt new file mode 100644 index 00000000000..77c4970f499 --- /dev/null +++ b/src/3rdparty/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(tinycbor) +add_subdirectory(harfbuzz) diff --git a/src/3rdparty/harfbuzz/CMakeLists.txt b/src/3rdparty/harfbuzz/CMakeLists.txt new file mode 100644 index 00000000000..25a3b75d2f0 --- /dev/null +++ b/src/3rdparty/harfbuzz/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(QtHarfBuzz STATIC + src/harfbuzz-shaper-all.cpp + src/harfbuzz-buffer.c + src/harfbuzz-gdef.c + src/harfbuzz-gsub.c + src/harfbuzz-gpos.c + src/harfbuzz-impl.c + src/harfbuzz-open.c + src/harfbuzz-stream.c + ) +target_include_directories(QtHarfBuzz PUBLIC src) diff --git a/src/3rdparty/tinycbor/CMakeLists.txt b/src/3rdparty/tinycbor/CMakeLists.txt new file mode 100644 index 00000000000..3a1a760af9d --- /dev/null +++ b/src/3rdparty/tinycbor/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(tinycbor INTERFACE) +target_include_directories(tinycbor INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/src") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000000..204d7f67972 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,65 @@ +add_subdirectory(3rdparty) + +function(find_or_build_bootstrap_names) + # Move these into their own folder and move this code in the CMakeLists.txt file there! + set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") + + function(find_or_build_bootstrap_tool name) + if (_build_tools) + add_subdirectory(tools/${name}) + else() + message("Searching for ${name}.") + find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH) + if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND") + message(FATAL_ERROR "The name \"${name}\" was not found in the " + "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").") + else() + message("${name} was found at ${_PROG_${name}}.") + add_executable("${name}" IMPORTED GLOBAL) + set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}") + + add_executable("Qt::${name}" ALIAS "${name}") + endif() + endif() + endfunction() + + find_or_build_bootstrap_tool(qmocscanner) + if (_build_tools) + add_subdirectory(tools/bootstrap) # bootstrap library + endif() + find_or_build_bootstrap_tool(moc) + find_or_build_bootstrap_tool(rcc) + find_or_build_bootstrap_tool(qfloat16-tables) + find_or_build_bootstrap_tool(tracegen) + + # $ does not work during configure run, so export into a plain variable: + get_target_property(_mocscanner "Qt::qmocscanner" IMPORTED_LOCATION) + set(QT_MOCSCANNER "${_mocscanner}" CACHE INTERNAL "Qt moc scanner") + + if (_build_tools) + install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "Qt::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") + endif() +endfunction() + +find_or_build_bootstrap_names() + +add_subdirectory(corelib) +add_subdirectory(tools) +add_subdirectory(network) +add_subdirectory(xml) +add_subdirectory(dbus) +if(QT_FEATURE_gui) + add_subdirectory(gui) + + qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::Gui) + if(QT_FEATURE_widgets) + add_subdirectory(widgets) + if(QT_FEATURE_opengl) + add_subdirectory(opengl) + endif() + endif() + add_subdirectory(platformsupport) + add_subdirectory(platformheaders) +endif() +add_subdirectory(testlib) +add_subdirectory(plugins) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt new file mode 100644 index 00000000000..eaa2ab8654c --- /dev/null +++ b/src/corelib/CMakeLists.txt @@ -0,0 +1,781 @@ + +find_package(Threads) +find_package(WrapDoubleConversion REQUIRED) + +find_library(FWAppKit AppKit) +find_library(FWApplicationServices ApplicationServices) +find_library(FWCoreFoundation CoreFoundation) +find_library(FWCoreServices CoreServices) +find_library(FWDiskArbitration DiskArbitration) +find_library(FWFoundation Foundation) +find_library(FWIOKit IOKit) +find_library(FWMobileCoreServices MobileCoreServices) +find_library(FWSecurity Security) +find_library(FWUIKit UIKit) +find_library(FWWatchKit WatchKit) + +## Evaluation helper target: +# FIXME: How does this work? +add_library(Qt_Evaluation INTERFACE) +target_sources(Qt_Evaluation INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/kernel/qtcore_eval.cpp") +target_include_directories(Qt_Evaluation INTERFACE global) + +##################################################################### +## Core Module: +##################################################################### + +add_qt_module(Core + SOURCES + animation/qabstractanimation.cpp animation/qabstractanimation.h animation/qabstractanimation_p.h + animation/qanimationgroup.cpp animation/qanimationgroup.h animation/qanimationgroup_p.h + animation/qparallelanimationgroup.cpp animation/qparallelanimationgroup.h animation/qparallelanimationgroup_p.h + animation/qpauseanimation.cpp animation/qpauseanimation.h + animation/qpropertyanimation.cpp animation/qpropertyanimation.h animation/qpropertyanimation_p.h + animation/qsequentialanimationgroup.cpp animation/qsequentialanimationgroup.h animation/qsequentialanimationgroup_p.h + animation/qvariantanimation.cpp animation/qvariantanimation.h animation/qvariantanimation_p.h + codecs/qisciicodec.cpp codecs/qisciicodec_p.h + codecs/qlatincodec.cpp codecs/qlatincodec_p.h + codecs/qsimplecodec.cpp codecs/qsimplecodec_p.h + codecs/qtextcodec.cpp codecs/qtextcodec.h codecs/qtextcodec_p.h + codecs/qtsciicodec.cpp codecs/qtsciicodec_p.h + codecs/qutfcodec.cpp codecs/qutfcodec_p.h + global/archdetect.cpp + global/qcompilerdetection.h + global/qendian.cpp global/qendian.h global/qendian_p.h + global/qflags.h + global/qfloat16.cpp global/qfloat16.h global/qfloat16_p.h + global/qglobal.cpp global/qglobal.h + global/qglobalstatic.h + global/qhooks.cpp global/qhooks_p.h + global/qisenum.h + global/qlibraryinfo.cpp global/qlibraryinfo.h + global/qlogging.cpp global/qlogging.h + global/qmalloc.cpp + global/qnamespace.h + global/qnumeric.cpp global/qnumeric.h global/qnumeric_p.h + global/qoperatingsystemversion.cpp global/qoperatingsystemversion.h global/qoperatingsystemversion_p.h + global/qprocessordetection.h + global/qrandom.cpp global/qrandom.h global/qrandom_p.h + global/qsysinfo.h + global/qsystemdetection.h + global/qtypeinfo.h + global/qtypetraits.h + global/qversiontagging.cpp global/qversiontagging.h + io/qabstractfileengine.cpp io/qabstractfileengine_p.h + io/qbuffer.cpp io/qbuffer.h + io/qdataurl.cpp io/qdataurl_p.h + io/qdebug.cpp io/qdebug.h io/qdebug_p.h + io/qdir.cpp io/qdir.h io/qdir_p.h + io/qdiriterator.cpp io/qdiriterator.h + io/qfile.cpp io/qfile.h + io/qfiledevice.cpp io/qfiledevice.h io/qfiledevice_p.h + io/qfileinfo.cpp io/qfileinfo.h io/qfileinfo_p.h + io/qfileselector.cpp io/qfileselector.h io/qfileselector_p.h + io/qfilesystemengine.cpp io/qfilesystemengine_p.h + io/qfilesystementry.cpp io/qfilesystementry_p.h + io/qfilesystemiterator_p.h + io/qfilesystemmetadata_p.h + io/qfilesystemwatcher.cpp io/qfilesystemwatcher.h io/qfilesystemwatcher_p.h + io/qfilesystemwatcher_polling.cpp io/qfilesystemwatcher_polling_p.h + io/qfsfileengine.cpp io/qfsfileengine_p.h + io/qfsfileengine_iterator.cpp io/qfsfileengine_iterator_p.h + io/qiodevice.cpp io/qiodevice.h io/qiodevice_p.h + io/qipaddress.cpp io/qipaddress_p.h + io/qlockfile.cpp io/qlockfile.h io/qlockfile_p.h + io/qloggingcategory.cpp io/qloggingcategory.h + io/qloggingregistry.cpp io/qloggingregistry_p.h + io/qnoncontiguousbytedevice.cpp io/qnoncontiguousbytedevice_p.h + io/qresource.cpp io/qresource_p.h + io/qresource_iterator.cpp io/qresource_iterator_p.h + io/qsavefile.cpp io/qsavefile.h + io/qsettings.cpp io/qsettings.h io/qsettings_p.h + io/qstandardpaths.cpp io/qstandardpaths.h + io/qstorageinfo.cpp io/qstorageinfo.h io/qstorageinfo_p.h + io/qtemporarydir.cpp io/qtemporarydir.h + io/qtemporaryfile.cpp io/qtemporaryfile.h io/qtemporaryfile_p.h + io/qtldurl.cpp io/qtldurl_p.h + io/qurl.cpp io/qurl.h io/qurl_p.h + io/qurlidna.cpp + io/qurlquery.cpp io/qurlquery.h + io/qurlrecode.cpp + io/qurltlds_p.h + kernel/qabstracteventdispatcher.cpp kernel/qabstracteventdispatcher.h kernel/qabstracteventdispatcher_p.h + kernel/qabstractnativeeventfilter.cpp kernel/qabstractnativeeventfilter.h + kernel/qbasictimer.cpp kernel/qbasictimer.h + kernel/qcoreapplication.cpp kernel/qcoreapplication.h kernel/qcoreapplication_p.h + kernel/qcorecmdlineargs_p.h + kernel/qcoreevent.cpp kernel/qcoreevent.h + kernel/qcoreglobaldata.cpp kernel/qcoreglobaldata_p.h + kernel/qdeadlinetimer.cpp kernel/qdeadlinetimer.h kernel/qdeadlinetimer_p.h + kernel/qelapsedtimer.cpp kernel/qelapsedtimer.h + kernel/qeventloop.cpp kernel/qeventloop.h + kernel/qfunctions_p.h + kernel/qmath.cpp kernel/qmath.h + kernel/qmetaobject.cpp kernel/qmetaobject.h kernel/qmetaobject_p.h + kernel/qmetaobject_moc_p.h + kernel/qmetaobjectbuilder.cpp kernel/qmetaobjectbuilder_p.h + kernel/qmetatype.cpp kernel/qmetatype.h kernel/qmetatype_p.h + kernel/qmetatypeswitcher_p.h + kernel/qmimedata.cpp kernel/qmimedata.h + kernel/qobject.cpp kernel/qobject.h kernel/qobject_p.h + kernel/qobject_impl.h + kernel/qobjectcleanuphandler.cpp kernel/qobjectcleanuphandler.h + kernel/qobjectdefs.h + kernel/qobjectdefs_impl.h + kernel/qpointer.cpp kernel/qpointer.h + kernel/qsharedmemory.cpp kernel/qsharedmemory.h kernel/qsharedmemory_p.h + kernel/qsignalmapper.cpp kernel/qsignalmapper.h + kernel/qsocketnotifier.cpp kernel/qsocketnotifier.h + kernel/qsystemerror.cpp kernel/qsystemerror_p.h + kernel/qsystemsemaphore.cpp kernel/qsystemsemaphore.h kernel/qsystemsemaphore_p.h + kernel/qtestsupport_core.cpp kernel/qtestsupport_core.h + kernel/qtimer.cpp kernel/qtimer.h + kernel/qtranslator.cpp kernel/qtranslator.h kernel/qtranslator_p.h + kernel/qvariant.cpp kernel/qvariant.h kernel/qvariant_p.h + plugin/qfactoryinterface.cpp plugin/qfactoryinterface.h + plugin/qfactoryloader.cpp plugin/qfactoryloader_p.h + plugin/qplugin.h plugin/qplugin_p.h + plugin/qpluginloader.cpp plugin/qpluginloader.h + plugin/quuid.cpp plugin/quuid.h + serialization/qcborarray.h + serialization/qcborcommon.h + serialization/qcbordiagnostic.cpp + serialization/qcbormap.h + serialization/qcborstream.cpp serialization/qcborstream.h + serialization/qcborvalue.cpp serialization/qcborvalue.h serialization/qcborvalue_p.h + serialization/qdatastream.cpp serialization/qdatastream.h serialization/qdatastream_p.h + serialization/qjson.cpp serialization/qjson_p.h + serialization/qjsonarray.cpp serialization/qjsonarray.h + serialization/qjsoncbor.cpp + serialization/qjsondocument.cpp serialization/qjsondocument.h + serialization/qjsonobject.cpp serialization/qjsonobject.h + serialization/qjsonparser.cpp serialization/qjsonparser_p.h + serialization/qjsonvalue.cpp serialization/qjsonvalue.h + serialization/qjsonwriter.cpp serialization/qjsonwriter_p.h + serialization/qtextstream.cpp serialization/qtextstream.h serialization/qtextstream_p.h + serialization/qxmlstream.cpp serialization/qxmlstream.h serialization/qxmlstream_p.h + serialization/qxmlutils.cpp serialization/qxmlutils_p.h + thread/qmutex.h + thread/qreadwritelock.h + thread/qrunnable.cpp thread/qrunnable.h + thread/qthread.cpp thread/qthread.h + thread/qthreadstorage.h + thread/qwaitcondition.h + tools/qalgorithms.h + tools/qarraydata.cpp tools/qarraydata.h + tools/qarraydataops.h + tools/qarraydatapointer.h + tools/qbitarray.cpp tools/qbitarray.h + tools/qbytearray.cpp tools/qbytearray.h tools/qbytearray_p.h + tools/qbytearraylist.cpp tools/qbytearraylist.h + tools/qbytearraymatcher.cpp tools/qbytearraymatcher.h + tools/qbytedata_p.h + tools/qcache.h + tools/qchar.h + tools/qcollator.cpp tools/qcollator.h tools/qcollator_p.h + tools/qcontainerfwd.h + tools/qcontiguouscache.cpp tools/qcontiguouscache.h + tools/qcryptographichash.cpp tools/qcryptographichash.h + tools/qdatetime.cpp tools/qdatetime.h tools/qdatetime_p.h + tools/qdoublescanprint_p.h + tools/qeasingcurve.cpp tools/qeasingcurve.h + tools/qfreelist.cpp tools/qfreelist_p.h + tools/qharfbuzz.cpp + tools/qhash.cpp tools/qhash.h + tools/qhashfunctions.h + tools/qiterator.h + tools/qline.cpp tools/qline.h + tools/qlinkedlist.cpp tools/qlinkedlist.h + tools/qlist.cpp tools/qlist.h + tools/qlocale.cpp tools/qlocale.h tools/qlocale_p.h + tools/qlocale_data_p.h + tools/qlocale_tools.cpp tools/qlocale_tools_p.h + tools/qmakearray_p.h + tools/qmap.cpp tools/qmap.h + tools/qmargins.cpp tools/qmargins.h + tools/qmessageauthenticationcode.cpp tools/qmessageauthenticationcode.h + tools/qoffsetstringarray_p.h + tools/qpair.h + tools/qpoint.cpp tools/qpoint.h + tools/qqueue.h + tools/qrect.cpp tools/qrect.h + tools/qrefcount.cpp tools/qrefcount.h + tools/qregexp.cpp tools/qregexp.h + tools/qringbuffer.cpp tools/qringbuffer_p.h + tools/qscopedpointer.h tools/qscopedpointer_p.h + tools/qscopedvaluerollback.h + tools/qscopeguard.h + tools/qset.h + tools/qshareddata.cpp tools/qshareddata.h + tools/qsharedpointer.cpp tools/qsharedpointer.h + tools/qsharedpointer_impl.h + tools/qsimd.cpp tools/qsimd_p.h + tools/qsize.cpp tools/qsize.h + tools/qstack.h + tools/qstring.cpp tools/qstring.h + tools/qstringalgorithms.h tools/qstringalgorithms_p.h + tools/qstringbuilder.cpp tools/qstringbuilder.h + tools/qstringiterator_p.h + tools/qstringlist.cpp tools/qstringlist.h + tools/qstringliteral.h + tools/qstringmatcher.h + tools/qstringview.cpp tools/qstringview.h + tools/qtextboundaryfinder.cpp tools/qtextboundaryfinder.h + tools/qtimeline.cpp tools/qtimeline.h + tools/qtools_p.h + tools/qunicodetables_p.h + tools/qunicodetools.cpp tools/qunicodetools_p.h + tools/qvarlengtharray.h + tools/qvector.h + tools/qversionnumber.cpp tools/qversionnumber.h + tools/qvsnprintf.cpp + LIBRARIES + WrapDoubleConversion + tinycbor Threads::Threads ZLIB::ZLIB + QtHarfBuzz + PUBLIC_LIBRARIES Qt::Platform + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH +) + +# As a special feature, the global features are attached to QtCore as +# custom properties. That's symmetric to qconfig.cpp/h being part of +# QtCore and not of a QtGlobal library. + +foreach(visibility PUBLIC PRIVATE) + foreach(state ENABLED DISABLED) + get_target_property(props Qt_global_Config INTERFACE_QT_${state}_${visibility}_FEATURES) + set(propertyName "QT_GLOBAL_${state}_${visibility}_FEATURES") + set_property(TARGET Core PROPERTY ${propertyName} "${props}") + set_property(TARGET Core APPEND PROPERTY EXPORT_PROPERTIES "${propertyName}") + endforeach() +endforeach() + +configure_file(global/qconfig.cpp.in global/qconfig.cpp) + +# FIXME: tools still have a lot of special stuff that is not ported! + +# FIXME: qmake condition: (linux*|hurd*):!cross_compile:!static:!*-armcc* +# FIXME: qmake gets the elf interpreter out of /bin/ls +find_program(HOST_ELF_INTERPRETER NAMES ld-linux-x86-64.so.2 PATHS /lib /lib64 NO_DEFAULT_PATH) +if (LINUX AND NOT CMAKE_CROSSCOMPILING AND HOST_ELF_INTERPRETER_FOUND) + qt_internal_add_link_flags(Core "-Wl,-e,qt_core_boilerplate") + target_compile_definitions(Core PRIVATE ELF_INTERPRETER="${HOST_ELF_INTERPRETER}") +endif() + + +### Platform support: +##################################################################### + +# Windows + +### All Windows: +extend_target(Core CONDITION WIN32 + SOURCES + io/qfilesystemengine_win.cpp + io/qfilesystemwatcher_win.cpp io/qfilesystemwatcher_win_p.h + io/qfsfileengine_win.cpp + io/qlockfile_win.cpp + kernel/qcoreapplication_win.cpp + kernel/qelapsedtimer_win.cpp + kernel/qsharedmemory_win.cpp + kernel/qsystemsemaphore_win.cpp + kernel/qwineventnotifier.cpp + kernel/qwineventnotifier.h + kernel/qwineventnotifier_p.h + plugin/qsystemlibrary.cpp + plugin/qsystemlibrary_p.h + thread/qatomic_msvc.h + thread/qthread_win.cpp + tools/qlocale_win.cpp + global/qoperatingsystemversion_win.cpp + LIBRARIES kernel32 user32 shell32 uuid ole32 advapi32 winmm version ws2_32 +) + +### Classic windows: +extend_target(Core CONDITION WIN32 AND NOT WINRT + SOURCES + io/qsettings_win.cpp + io/qstandardpaths_win.cpp + io/qstorageinfo_win.cpp + io/qwindowspipereader.cpp + io/qwindowspipereader_p.h + io/qwindowspipewriter.cpp + io/qwindowspipewriter_p.h + kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h + LIBRARIES mpr netapi32 userenv +) + +### WinRT +extend_target(Core CONDITION WIN32 AND WINRT + SOURCES + io/qsettings_winrt.cpp + io/qstandardpaths_winrt.cpp + io/qstorageinfo_stub.cpp + kernel/qeventdispatcher_winrt.cpp kernel/qeventdispatcher_winrt_p.h + kernel/qfunctions_fake_env_p.h + kernel/qfunctions_winrt.cpp kernel/qfunctions_winrt.h +) + +### All Apple: +extend_target(Core CONDITION APPLE + SOURCES + io/qsettings_mac.cpp + io/qstandardpaths_mac.mm + io/qstorageinfo_mac.cpp + kernel/qcfsocketnotifier.cpp kernel/qcfsocketnotifier_p.h + kernel/qcoreapplication_mac.cpp + kernel/qcore_foundation.mm + kernel/qcore_mac_objc.mm + kernel/qcore_mac_objc.mm kernel/qcore_mac.cpp kernel/qcore_mac_p.h + kernel/qelapsedtimer_mac.cpp + kernel/qeventdispatcher_cf.mm kernel/qeventdispatcher_cf_p.h + global/qoperatingsystemversion_darwin.mm + LIBRARIES ${FWCoreFoundation} ${FWFoundation} +) + +### Apple desktop machines: +extend_target(Core CONDITION APPLE_OSX + SOURCES + io/qfilesystemwatcher_fsevents.mm io/qfilesystemwatcher_fsevents_p.h + tools/qlocale_mac.mm + LIBRARIES + ${FWCoreServices} ${FWAppKit} ${FWSecurity} + ${FWApplicationServices} ${FWDiskArbitration} ${FWIOKit} +) + +### Apple mobile machines: +extend_target(Core CONDITION APPLE AND NOT APPLE_OSX + LIBRARIES ${FWMobileCoreServices} +) + +extend_target(Core CONDITION APPLE_WATCHOS LIBRARIES ${FWWatchKit}) +extend_target(Core CONDITION APPLE_TVOS LIBRARIES ${FWUIKit}) + +extend_target(Core CONDITION INTEGRITY + SOURCES tools/qlocale_unix.cpp + LIBRARIES posix ivfs socket net shm_client +) + +extend_target(Core CONDITION UNIX + SOURCES + io/qfilesystemengine_unix.cpp + io/qfsfileengine_unix.cpp + io/qlockfile_unix.cpp + thread/qthread_unix.cpp +) + +extend_target(Core CONDITION UNIX AND NOT APPLE + SOURCES + tools/qlocale_unix.cpp +) + +extend_target(Core CONDITION ANDROID + SOURCES + io/qstandardpaths_android.cpp + io/qstorageinfo_unix.cpp + kernel/qjni.cpp kernel/qjni_p.h + kernel/qjnihelpers.cpp kernel/qjnihelpers_p.h + kernel/qjnionload.cpp +) + +extend_target(Core CONDITION HAIKU + SOURCES + io/qstandardpaths_haiku.cpp + io/qstorageinfo_unix.cpp + LIBRARIES be +) + +extend_target(Core CONDITION BSD + SOURCES io/qfilesystemwatcher_kqueue.cpp io/qfilesystemwatcher_kqueue_p.h +) + +extend_target(Core CONDITION VXWORKS + SOURCES kernel/qfunctions_vxworks.cpp kernel/qfunctions_vxworks.h +) + +extend_target(Core CONDITION NACL + SOURCES kernel/qfunctions_nacl.cpp kernel/qfunctions_nacl.h +) + +extend_target(Core CONDITION NOT WIN32 AND NOT APPLE AND NOT ANDROID AND NOT HAIKU + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + +### standardpaths, storageinfo and settings: +if (WIN32) + if (WINRT) + target_sources(Core PRIVATE + io/qsettings_winrt.cpp + io/qstandardpaths_winrt.cpp + io/qstorageinfo_stub.cpp + ) + else() + target_sources(Core PRIVATE + io/qsettings_win.cpp + io/qstandardpaths_win.cpp + io/qstorageinfo_win.cpp + ) + endif() +elseif (UNIX) + if (NOT INTEGRITY AND NOT UIKIT) + target_sources(Core PRIVATE io/forkfd_qt.cpp) + target_include_directories(Core PRIVATE ../3rdparty/forkfd) + endif() + if (NOT NACL AND APPLE) + target_sources(Core PRIVATE io/qsettings_mac.cpp) + endif() + if (APPLE) + target_sources(Core PRIVATE + io/qstandardpaths_mac.mm + io/qstorageinfo_mac.cpp + ) + elseif(ANDROID AND NOT ANDROID_EMBEDDED) + target_sources(Core PRIVATE + io/qstandardpaths_android.cpp + io/qstorageinfo_unix.cpp + ) + elseif(HAIKU) + target_sources(Core PRIVATE + io/qstandardpaths_haiku.cpp + io/qstorageinfo_unix.cpp + ) + else() + target_sources(Core PRIVATE + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp + ) + endif() +endif() + +### kernel stuff: +if (UNIX OR INTEGRITY) + extend_target(Core SOURCES + kernel/qcore_unix.cpp + kernel/qcore_unix_p.h + kernel/qeventdispatcher_unix.cpp + kernel/qeventdispatcher_unix_p.h + kernel/qpoll_p.h + kernel/qtimerinfo_unix.cpp + kernel/qtimerinfo_unix_p.h + ) + if (NOT APPLE OR NACL) + target_sources(Core PRIVATE kernel/qelapsedtimer_unix.cpp) + endif() + + if (ANDROID) + target_sources(Core PRIVATE + kernel/qsharedmemory_android.cpp + kernel/qsystemsemaphore_android.cpp + ) + else() + target_sources(Core PRIVATE + kernel/qsharedmemory_posix.cpp + kernel/qsharedmemory_systemv.cpp + kernel/qsharedmemory_unix.cpp + kernel/qsystemsemaphore_posix.cpp + kernel/qsystemsemaphore_systemv.cpp + kernel/qsystemsemaphore_unix.cpp + ) + endif() + + # FIXME: Implement this! + # This is needed by QMetaType::typeName array implementation + #integrity: QMAKE_CXXFLAGS += --pending_instantiations=128 +elseif(NOT WIN32 AND NOT UNIX AND NOT APPLE) + target_sources(Core PRIVATE kernel/qelapsedtimer_generic.cpp) +endif() + + + +### Feature support: +##################################################################### + +## inotify: +extend_target(Core CONDITION QT_FEATURE_inotify + SOURCES + io/qfilesystemwatcher_inotify.cpp io/qfilesystemwatcher_inotify_p.h +) + +## qqnx_pps: +extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps + SOURCES + kernel/qppsattribute.cpp kernel/qppsattribute_p.h + kernel/qppsattributeprivate_p.h + kernel/qppsobject.cpp kernel/qppsobject_p.h + kernel/qppsobjectprivate_p.h + LIBRARIES pps +) + +## clock_gettime: +extend_target(Core CONDITION UNIX AND QT_FEATURE_clock_gettime + LIBRARIES rt +) + +## glib: +extend_target(Core CONDITION QT_FEATURE_glib + SOURCES + kernel/qeventdispatcher_glib.cpp kernel/qeventdispatcher_glib_p.h + LIBRARIES PkgConfig::GLib +) + +## poll_select: +extend_target(Core CONDITION UNIX AND QT_FEATURE_poll_select + SOURCES kernel/qpoll.cpp +) + +## thread: +extend_target(Core CONDITION QT_FEATURE_thread + SOURCES + thread/qatomic_bootstrap.h + thread/qatomic.cpp thread/qatomic.h + thread/qatomic_cxx11.h + thread/qbasicatomic.h + thread/qfutex_p.h + thread/qgenericatomic.h + thread/qmutex.cpp thread/qmutex_p.h + thread/qmutexpool.cpp thread/qmutexpool_p.h + thread/qorderedmutexlocker_p.h + thread/qreadwritelock.cpp thread/qreadwritelock_p.h + thread/qsemaphore.cpp thread/qsemaphore.h + thread/qthread_p.h + thread/qthreadpool.cpp thread/qthreadpool.h thread/qthreadpool_p.h + thread/qthreadstorage.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread AND WIN32 + SOURCES + thread/qwaitcondition_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread AND NOT WIN32 + SOURCES thread/qwaitcondition_unix.cpp +) + +## future: +extend_target(Core CONDITION QT_FEATURE_future + SOURCES + thread/qexception.cpp thread/qexception.h + thread/qfuture.h + thread/qfutureinterface.cpp thread/qfutureinterface.h thread/qfutureinterface_p.h + thread/qfuturesynchronizer.h + thread/qfuturewatcher.cpp thread/qfuturewatcher.h thread/qfuturewatcher_p.h + thread/qresultstore.cpp thread/qresultstore.h +) + +## ICU: +extend_target(Core CONDITION QT_FEATURE_icu + SOURCES + codecs/qicucodec.cpp + tools/qcollator_icu.cpp + tools/qlocale_icu.cpp + LIBRARIES ICU::i18n ICU::uc ICU::data +) + +extend_target(Core CONDITION NOT QT_FEATURE_icu AND WIN32 + SOURCES tools/qcollator_win.cpp +) + +extend_target(Core CONDITION NOT QT_FEATURE_icu AND APPLE + SOURCES tools/qcollator_macx.cpp +) + +extend_target(Core CONDITION NOT QT_FEATURE_icu AND NOT WIN32 AND NOT APPLE + SOURCES tools/qcollator_posix.cpp +) + +extend_target(Core CONDITION NOT QT_FEATURE_icu + SOURCES + codecs/qbig5codec.cpp codecs/qbig5codec_p.h + codecs/qeucjpcodec.cpp codecs/qeucjpcodec_p.h + codecs/qeuckrcodec.cpp codecs/qeuckrcodec_p.h + codecs/qgb18030codec.cpp codecs/qgb18030codec_p.h + codecs/qjiscodec.cpp codecs/qjiscodec_p.h + codecs/qjpunicode.cpp + codecs/qsjiscodec.cpp codecs/qsjiscodec_p.h +) + +extend_target(Core CONDITION NOT QT_FEATURE_icu AND QT_FEATURE_iconv + SOURCES codecs/qiconvcodec.cpp codecs/qiconvcodec_p.h + LIBRARIES Iconv +) + +extend_target(Core CONDITION NOT QT_FEATURE_icu AND WIN32 + SOURCES codecs/qwindowscodec.cpp codecs/qwindowscodec_p.h +) + +## timezone: +extend_target(Core CONDITION QT_FEATURE_timezone + SOURCES + tools/qtimezone.cpp tools/qtimezone.h + tools/qtimezoneprivate.cpp tools/qtimezoneprivate_p.h + tools/qtimezoneprivate_data_p.h +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 + SOURCES tools/qtimezoneprivate_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND APPLE + SOURCES tools/qtimezoneprivate_mac.mm +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND ANDROID + SOURCES tools/qtimezoneprivate_android.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND NOT APPLE + SOURCES tools/qtimezoneprivate_tz.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND QT_FEATURE_icu AND NOT WIN32 AND NOT ANDROID AND NOT APPLE + SOURCES tools/qtimezoneprivate_icu.cpp +) + +## datetimeparser: +extend_target(Core CONDITION QT_FEATURE_datetimeparser + SOURCES tools/qdatetimeparser.cpp tools/qdatetimeparser_p.h +) + +## regularexpression: +extend_target(Core CONDITION QT_FEATURE_regularexpression + SOURCES tools/qregularexpression.cpp tools/qregularexpression.h + LIBRARIES PCRE2 +) + +## commandlineparser: +extend_target(Core CONDITION QT_FEATURE_commandlineparser + SOURCES + tools/qcommandlineoption.cpp tools/qcommandlineoption.h + tools/qcommandlineparser.cpp tools/qcommandlineparser.h +) + +## processenvironment: +extend_target(Core CONDITION QT_FEATURE_processenvironment + SOURCES io/qprocess.cpp io/qprocess.h io/qprocess_p.h +) + +extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32 AND NOT WINRT + SOURCES io/qprocess_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_processenvironment AND APPLE + SOURCES io/qprocess_darwin.mm +) + +extend_target(Core CONDITION QT_FEATURE_processenvironment AND UNIX + SOURCES io/qprocess_unix.cpp +) + +## filesystemiterator: +extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND WIN32 + SOURCES io/qfilesystemiterator_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND UNIX + SOURCES io/qfilesystemiterator_unix.cpp +) + +## itemmodel: +extend_target(Core CONDITION QT_FEATURE_itemmodel + SOURCES + itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h + itemmodels/qitemselectionmodel.cpp itemmodels/qitemselectionmodel.h itemmodels/qitemselectionmodel_p.h +) + +## proxymodel: +extend_target(Core CONDITION QT_FEATURE_proxymodel + SOURCES itemmodels/qabstractproxymodel.cpp itemmodels/qabstractproxymodel.h itemmodels/qabstractproxymodel_p.h +) + +## identityproxymodel: +extend_target(Core CONDITION QT_FEATURE_identityproxymodel + SOURCES itemmodels/qidentityproxymodel.cpp itemmodels/qidentityproxymodel.h +) + +## identityproxymodel: +extend_target(Core CONDITION QT_FEATURE_sortfilterproxymodel + SOURCES itemmodels/qsortfilterproxymodel.cpp itemmodels/qsortfilterproxymodel.h +) + +## stringlistmodel: +extend_target(Core CONDITION QT_FEATURE_stringlistmodel + SOURCES itemmodels/qstringlistmodel.cpp itemmodels/qstringlistmodel.h +) + +## library: +extend_target(Core CONDITION QT_FEATURE_library + SOURCES + plugin/qelfparser_p.cpp plugin/qelfparser_p.h + plugin/qlibrary.cpp plugin/qlibrary.h plugin/qlibrary_p.h + plugin/qmachparser.cpp plugin/qmachparser_p.h + LIBRARIES ${CMAKE_DL_LIBS} +) + +extend_target(Core CONDITION QT_FEATURE_library AND WIN32 + SOURCES plugin/qlibrary_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_library AND UNIX + SOURCES plugin/qlibrary_unix.cpp +) + +## statemachine: +extend_target(Core CONDITION QT_FEATURE_statemachine + SOURCES + statemachine/qabstractstate.cpp statemachine/qabstractstate.h statemachine/qabstractstate_p.h + statemachine/qabstracttransition.cpp statemachine/qabstracttransition.h statemachine/qabstracttransition_p.h + statemachine/qfinalstate.cpp statemachine/qfinalstate.h statemachine/qfinalstate_p.h + statemachine/qhistorystate.cpp statemachine/qhistorystate.h statemachine/qhistorystate_p.h + statemachine/qsignaleventgenerator_p.h + statemachine/qsignaltransition.cpp statemachine/qsignaltransition.h statemachine/qsignaltransition_p.h + statemachine/qstate.cpp statemachine/qstate.h statemachine/qstate_p.h + statemachine/qstatemachine.cpp statemachine/qstatemachine.h statemachine/qstatemachine_p.h +) + +# qeventtransition: +extend_target(Core CONDITION QT_FEATURE_qeventtransition + SOURCES statemachine/qeventtransition.cpp statemachine/qeventtransition.h statemachine/qeventtransition_p.h +) + +# mimetype: +extend_target(Core CONDITION QT_FEATURE_mimetype + SOURCES + mimetypes/mimetypes.qrc + mimetypes/qmimedatabase.cpp mimetypes/qmimedatabase.h mimetypes/qmimedatabase_p.h + mimetypes/qmimeglobpattern.cpp mimetypes/qmimeglobpattern_p.h + mimetypes/qmimemagicrule.cpp mimetypes/qmimemagicrule_p.h + mimetypes/qmimemagicrulematcher.cpp mimetypes/qmimemagicrulematcher_p.h + mimetypes/qmimeprovider.cpp mimetypes/qmimeprovider_p.h + mimetypes/qmimetype.cpp mimetypes/qmimetype.h mimetypes/qmimetype_p.h + mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h +) + +# Enable Evaluation based on QT_EVAL variable being set from the outside: +extend_target(Core CONDITION QT_EVAL LIBRARIES Qt_Evaluation) + +### Extra stuff: +##################################################################### + + +add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" + COMMAND qfloat16-tables + ARGS "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" + DEPENDS global/qfloat16.h + COMMENT qfloat16-tables + VERBATIM) +target_sources(Core PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp") + +qt_create_tracepoints(Core qtcore.tracepoints) + +# Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library. +if(WIN32) + get_target_property(defines Core COMPILE_DEFINITIONS) + list(REMOVE_ITEM defines QT_NO_CAST_TO_ASCII) + set_target_properties(Core PROPERTIES COMPILE_DEFINITIONS "${defines}") +endif() + +add_qt_docs(./doc/qtcore.qdocconf) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake new file mode 100644 index 00000000000..21886b06aaa --- /dev/null +++ b/src/corelib/configure.cmake @@ -0,0 +1,712 @@ + + +#### Inputs + +# input iconv +set(INPUT_iconv "undefined" CACHE STRING "") +set_property(CACHE INPUT_iconv PROPERTY STRINGS undefined no yes posix sun gnu) + + + +#### Libraries + +find_package(GLib) +set_package_properties(GLib PROPERTIES TYPE OPTIONAL) +find_package(ICU COMPONENTS i18n uc data) +set_package_properties(ICU PROPERTIES TYPE OPTIONAL) +find_package(Libsystemd) +set_package_properties(Libsystemd PROPERTIES TYPE OPTIONAL) +find_package(Atomic) +set_package_properties(Atomic PROPERTIES TYPE OPTIONAL) +find_package(PCRE2) +set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) + + +#### Tests + +# atomicfptr +qt_config_compile_test(atomicfptr + LABEL "working std::atomic for function pointers" +" +#include +typedef void (*fptr)(int); +typedef std::atomic atomicfptr; +void testfunction(int) { } +void test(volatile atomicfptr &a) +{ + fptr v = a.load(std::memory_order_acquire); + while (!a.compare_exchange_strong(v, &testfunction, + std::memory_order_acq_rel, + std::memory_order_acquire)) { + v = a.exchange(&testfunction); + } + a.store(&testfunction, std::memory_order_release); +} +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +atomicfptr fptr(testfunction); +test(fptr); + /* END TEST: */ + return 0; +} +"# FIXME: qmake: CONFIG += c++11 +) + +# clock-monotonic +qt_config_compile_test(clock_monotonic + LABEL "POSIX monotonic clock" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +#if defined(_POSIX_MONOTONIC_CLOCK) && (_POSIX_MONOTONIC_CLOCK-0 >= 0) +timespec ts; +clock_gettime(CLOCK_MONOTONIC, &ts); +#else +# error Feature _POSIX_MONOTONIC_CLOCK not available +#endif + /* END TEST: */ + return 0; +} +") + +# cloexec +qt_config_compile_test(cloexec + LABEL "O_CLOEXEC" +"#define _GNU_SOURCE 1 +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +int pipes[2]; +(void) pipe2(pipes, O_CLOEXEC | O_NONBLOCK); +(void) fcntl(0, F_DUPFD_CLOEXEC, 0); +(void) dup3(0, 3, O_CLOEXEC); +#if defined(__NetBSD__) +(void) paccept(0, 0, 0, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK); +#else +(void) accept4(0, 0, 0, SOCK_CLOEXEC | SOCK_NONBLOCK); +#endif + /* END TEST: */ + return 0; +} +") + +# cxx11_future +qt_config_compile_test(cxx11_future + LABEL "C++11 " +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +std::future f = std::async([]() { return 42; }); +(void)f.get(); + /* END TEST: */ + return 0; +} +"# FIXME: qmake: unix:LIBS += -lpthread +) + +# eventfd +qt_config_compile_test(eventfd + LABEL "eventfd" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +eventfd_t value; +int fd = eventfd(0, EFD_CLOEXEC); +eventfd_read(fd, &value); +eventfd_write(fd, value); + /* END TEST: */ + return 0; +} +") + +# inotify +qt_config_compile_test(inotify + LABEL "inotify" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +inotify_init(); +inotify_add_watch(0, \"foobar\", IN_ACCESS); +inotify_rm_watch(0, 1); + /* END TEST: */ + return 0; +} +") + +# ipc_sysv +qt_config_compile_test(ipc_sysv + LABEL "SysV IPC" +" +#include +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +key_t unix_key = ftok(\"test\", 'Q'); +semctl(semget(unix_key, 1, 0666 | IPC_CREAT | IPC_EXCL), 0, IPC_RMID, 0); +shmget(unix_key, 0, 0666 | IPC_CREAT | IPC_EXCL); +shmctl(0, 0, (struct shmid_ds *)(0)); + /* END TEST: */ + return 0; +} +") + +# ipc_posix +qt_config_compile_test(ipc_posix + LABEL "POSIX IPC" +" +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +sem_close(sem_open(\"test\", O_CREAT | O_EXCL, 0666, 0)); +shm_open(\"test\", O_RDWR | O_CREAT | O_EXCL, 0666); +shm_unlink(\"test\"); + /* END TEST: */ + return 0; +} +"# FIXME: qmake: linux: LIBS += -lpthread -lrt +) + +# linkat +qt_config_compile_test(linkat + LABEL "linkat()" +"#define _ATFILE_SOURCE 1 +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW); + /* END TEST: */ + return 0; +} +") + +# ppoll +qt_config_compile_test(ppoll + LABEL "ppoll()" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +struct pollfd pfd; +struct timespec ts; +sigset_t sig; +ppoll(&pfd, 1, &ts, &sig); + /* END TEST: */ + return 0; +} +") + +# pollts +qt_config_compile_test(pollts + LABEL "pollts()" +" +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +struct pollfd pfd; +struct timespec ts; +sigset_t sig; +pollts(&pfd, 1, &ts, &sig); + /* END TEST: */ + return 0; +} +") + +# poll +qt_config_compile_test(poll + LABEL "poll()" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +struct pollfd pfd; +poll(&pfd, 1, 0); + /* END TEST: */ + return 0; +} +") + +# renameat2 +qt_config_compile_test(renameat2 + LABEL "renameat2()" +"#define _ATFILE_SOURCE 1 +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT); + /* END TEST: */ + return 0; +} +") + +# statx +qt_config_compile_test(statx + LABEL "statx() in libc" +"#define _ATFILE_SOURCE 1 +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +struct statx statxbuf; +unsigned int mask = STATX_BASIC_STATS; +return statx(AT_FDCWD, \"\", AT_STATX_SYNC_AS_STAT, mask, &statxbuf); + /* END TEST: */ + return 0; +} +") + +# syslog +qt_config_compile_test(syslog + LABEL "syslog" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +openlog(\"qt\", 0, LOG_USER); +syslog(LOG_INFO, \"configure\"); +closelog(); + /* END TEST: */ + return 0; +} +") + + + +#### Features + +qt_feature("clock_gettime" PRIVATE + LABEL "clock_gettime()" + CONDITION UNIX AND libs.librt OR FIXME +) +qt_feature("clock_monotonic" PUBLIC + LABEL "POSIX monotonic clock" + CONDITION QT_FEATURE_clock_gettime AND TEST_clock_monotonic +) +qt_feature_definition("clock_monotonic" "QT_NO_CLOCK_MONOTONIC" NEGATE VALUE "1") +qt_feature("cxx11_future" PUBLIC + LABEL "C++11 " + CONDITION TEST_cxx11_future +) +qt_feature("eventfd" PUBLIC + LABEL "eventfd" + CONDITION NOT WASM AND TEST_eventfd +) +qt_feature_definition("eventfd" "QT_NO_EVENTFD" NEGATE VALUE "1") +qt_feature("futimens" PRIVATE + LABEL "futimens()" + CONDITION NOT WIN32 AND TEST_futimens +) +qt_feature("futimes" PRIVATE + LABEL "futimes()" + CONDITION NOT WIN32 AND NOT QT_FEATURE_futimens AND TEST_futimes +) +qt_feature("getauxval" PRIVATE + LABEL "getauxval()" + CONDITION LINUX AND TEST_getauxval +) +qt_feature("getentropy" PRIVATE + LABEL "getentropy()" + CONDITION UNIX AND TEST_getentropy +) +qt_feature("glib" PUBLIC PRIVATE + LABEL "GLib" + AUTODETECT NOT WIN32 + CONDITION GLib_FOUND +) +qt_feature_definition("glib" "QT_NO_GLIB" NEGATE VALUE "1") +qt_feature("iconv" PUBLIC PRIVATE + SECTION "Internationalization" + LABEL "iconv" + PURPOSE "Provides internationalization on Unix." + CONDITION NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( QT_FEATURE_posix_libiconv OR TEST_sun_iconv OR QT_FEATURE_gnu_libiconv ) +) +qt_feature_definition("iconv" "QT_NO_ICONV" NEGATE VALUE "1") +qt_feature("posix_libiconv" PRIVATE + LABEL "POSIX iconv" + CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv + ENABLE INPUT_iconv STREQUAL 'posix' + DISABLE INPUT_iconv STREQUAL 'sun' OR INPUT_iconv STREQUAL 'gnu' OR INPUT_iconv STREQUAL 'no' +) +qt_feature("gnu_libiconv" PRIVATE + LABEL "GNU iconv" + CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND NOT QT_FEATURE_posix_libiconv AND NOT TEST_sun_iconv AND libs.gnu_iconv OR FIXME + ENABLE INPUT_iconv STREQUAL 'gnu' + DISABLE INPUT_iconv STREQUAL 'posix' OR INPUT_iconv STREQUAL 'sun' OR INPUT_iconv STREQUAL 'no' +) +qt_feature("icu" PRIVATE + LABEL "ICU" + AUTODETECT NOT WIN32 + CONDITION ICU_FOUND +) +qt_feature("inotify" PUBLIC PRIVATE + LABEL "inotify" + CONDITION TEST_inotify +) +qt_feature_definition("inotify" "QT_NO_INOTIFY" NEGATE VALUE "1") +qt_feature("ipc_posix" PUBLIC + LABEL "Using POSIX IPC" + AUTODETECT NOT WIN32 + CONDITION NOT TEST_ipc_sysv AND TEST_ipc_posix +) +qt_feature_definition("ipc_posix" "QT_POSIX_IPC") +qt_feature("journald" PRIVATE + LABEL "journald" + AUTODETECT OFF + CONDITION Libsystemd_FOUND +) +# Currently only used by QTemporaryFile; linkat() exists on Android, but hardlink creation fails due to security rules +qt_feature("linkat" PRIVATE + LABEL "linkat()" + AUTODETECT LINUX AND NOT ANDROID + CONDITION TEST_linkat +) +qt_feature("std_atomic64" PUBLIC + LABEL "64 bit atomic operations" + CONDITION Atomic_FOUND +) +qt_feature("mimetype" PUBLIC + SECTION "Utilities" + LABEL "Mimetype handling" + PURPOSE "Provides MIME type handling." + CONDITION QT_FEATURE_textcodec +) +qt_feature_definition("mimetype" "QT_NO_MIMETYPE" NEGATE VALUE "1") +qt_feature("poll_ppoll" PRIVATE + LABEL "Native ppoll()" + CONDITION NOT WASM AND TEST_ppoll + EMIT_IF NOT WIN32 +) +qt_feature("poll_pollts" PRIVATE + LABEL "Native pollts()" + CONDITION NOT QT_FEATURE_poll_ppoll AND TEST_pollts + EMIT_IF NOT WIN32 +) +qt_feature("poll_poll" PRIVATE + LABEL "Native poll()" + CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND TEST_poll + EMIT_IF NOT WIN32 +) +qt_feature("poll_select" PUBLIC PRIVATE + LABEL "Emulated poll()" + CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND NOT QT_FEATURE_poll_poll + EMIT_IF NOT WIN32 +) +qt_feature_definition("poll_select" "QT_NO_NATIVE_POLL") +qt_feature("qqnx_pps" PRIVATE + LABEL "PPS" + CONDITION libs.pps OR FIXME + EMIT_IF QNX +) +qt_feature("renameat2" PRIVATE + LABEL "renameat2()" + CONDITION LINUX AND TEST_renameat2 +) +qt_feature("slog2" PRIVATE + LABEL "slog2" + CONDITION libs.slog2 OR FIXME +) +qt_feature("statx" PRIVATE + LABEL "statx() in libc" + CONDITION LINUX AND TEST_statx +) +qt_feature("syslog" PRIVATE + LABEL "syslog" + AUTODETECT OFF + CONDITION TEST_syslog +) +qt_feature("threadsafe_cloexec" PUBLIC + LABEL "Threadsafe pipe creation" + CONDITION TEST_cloexec +) +qt_feature_definition("threadsafe_cloexec" "QT_THREADSAFE_CLOEXEC" VALUE "1") +qt_feature("properties" PUBLIC + SECTION "Kernel" + LABEL "Properties" + PURPOSE "Supports scripting Qt-based applications." +) +qt_feature_definition("properties" "QT_NO_PROPERTIES" NEGATE VALUE "1") +qt_feature("regularexpression" PUBLIC + SECTION "Kernel" + LABEL "QRegularExpression" + PURPOSE "Provides an API to Perl-compatible regular expressions." +) +qt_feature_definition("regularexpression" "QT_NO_REGULAREXPRESSION" NEGATE VALUE "1") +qt_feature("sharedmemory" PUBLIC + SECTION "Kernel" + LABEL "QSharedMemory" + PURPOSE "Provides access to a shared memory segment." + CONDITION ( ANDROID OR WIN32 OR ( NOT VXWORKS AND ( TEST_ipc_sysv OR TEST_ipc_posix ) ) ) +) +qt_feature_definition("sharedmemory" "QT_NO_SHAREDMEMORY" NEGATE VALUE "1") +qt_feature("systemsemaphore" PUBLIC + SECTION "Kernel" + LABEL "QSystemSemaphore" + PURPOSE "Provides a general counting system semaphore." + CONDITION ( NOT INTEGRITY AND NOT VXWORKS ) AND ( ANDROID OR WIN32 OR TEST_ipc_sysv OR TEST_ipc_posix ) +) +qt_feature_definition("systemsemaphore" "QT_NO_SYSTEMSEMAPHORE" NEGATE VALUE "1") +qt_feature("xmlstream" PUBLIC + SECTION "Kernel" + LABEL "XML Streaming APIs" + PURPOSE "Provides a simple streaming API for XML." +) +qt_feature_definition("xmlstream" "QT_NO_XMLSTREAM" NEGATE VALUE "1") +qt_feature("xmlstreamreader" PUBLIC + SECTION "Kernel" + LABEL "QXmlStreamReader" + PURPOSE "Provides a well-formed XML parser with a simple streaming API." + CONDITION QT_FEATURE_xmlstream +) +qt_feature_definition("xmlstreamreader" "QT_NO_XMLSTREAMREADER" NEGATE VALUE "1") +qt_feature("xmlstreamwriter" PUBLIC + SECTION "Kernel" + LABEL "QXmlStreamWriter" + PURPOSE "Provides a XML writer with a simple streaming API." + CONDITION QT_FEATURE_xmlstream +) +qt_feature_definition("xmlstreamwriter" "QT_NO_XMLSTREAMWRITER" NEGATE VALUE "1") +qt_feature("textdate" PUBLIC + SECTION "Data structures" + LABEL "Text Date" + PURPOSE "Supports month and day names in dates." +) +qt_feature_definition("textdate" "QT_NO_TEXTDATE" NEGATE VALUE "1") +qt_feature("datestring" PUBLIC + SECTION "Data structures" + LABEL "QDate/QTime/QDateTime" + PURPOSE "Provides convertion between dates and strings." + CONDITION QT_FEATURE_textdate +) +qt_feature_definition("datestring" "QT_NO_DATESTRING" NEGATE VALUE "1") +qt_feature("process" PUBLIC + SECTION "File I/O" + LABEL "QProcess" + PURPOSE "Supports external process invocation." + CONDITION QT_FEATURE_processenvironment AND NOT WINRT AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT VXWORKS +) +qt_feature_definition("process" "QT_NO_PROCESS" NEGATE VALUE "1") +qt_feature("processenvironment" PUBLIC + SECTION "File I/O" + LABEL "QProcessEnvironment" + PURPOSE "Provides a higher-level abstraction of environment variables." + CONDITION NOT WINRT AND NOT INTEGRITY +) +qt_feature("temporaryfile" PUBLIC + SECTION "File I/O" + LABEL "QTemporaryFile" + PURPOSE "Provides an I/O device that operates on temporary files." +) +qt_feature_definition("temporaryfile" "QT_NO_TEMPORARYFILE" NEGATE VALUE "1") +qt_feature("library" PUBLIC + SECTION "File I/O" + LABEL "QLibrary" + PURPOSE "Provides a wrapper for dynamically loaded libraries." + CONDITION WIN32 OR HPUX OR ( NOT NACL AND UNIX ) +) +qt_feature_definition("library" "QT_NO_LIBRARY" NEGATE VALUE "1") +qt_feature("settings" PUBLIC + SECTION "File I/O" + LABEL "QSettings" + PURPOSE "Provides persistent application settings." +) +qt_feature_definition("settings" "QT_NO_SETTINGS" NEGATE VALUE "1") +qt_feature("filesystemwatcher" PUBLIC + SECTION "File I/O" + LABEL "QFileSystemWatcher" + PURPOSE "Provides an interface for monitoring files and directories for modifications." + CONDITION NOT WINRT +) +qt_feature_definition("filesystemwatcher" "QT_NO_FILESYSTEMWATCHER" NEGATE VALUE "1") +qt_feature("filesystemiterator" PUBLIC + SECTION "File I/O" + LABEL "QFileSystemIterator" + PURPOSE "Provides fast file system iteration." +) +qt_feature_definition("filesystemiterator" "QT_NO_FILESYSTEMITERATOR" NEGATE VALUE "1") +qt_feature("itemmodel" PUBLIC + SECTION "ItemViews" + LABEL "Qt Item Model" + PURPOSE "Provides the item model for item views" +) +qt_feature_definition("itemmodel" "QT_NO_ITEMMODEL" NEGATE VALUE "1") +qt_feature("proxymodel" PUBLIC + SECTION "ItemViews" + LABEL "QAbstractProxyModel" + PURPOSE "Supports processing of data passed between another model and a view." + CONDITION QT_FEATURE_itemmodel +) +qt_feature_definition("proxymodel" "QT_NO_PROXYMODEL" NEGATE VALUE "1") +qt_feature("sortfilterproxymodel" PUBLIC + SECTION "ItemViews" + LABEL "QSortFilterProxyModel" + PURPOSE "Supports sorting and filtering of data passed between another model and a view." + CONDITION QT_FEATURE_proxymodel +) +qt_feature_definition("sortfilterproxymodel" "QT_NO_SORTFILTERPROXYMODEL" NEGATE VALUE "1") +qt_feature("identityproxymodel" PUBLIC + SECTION "ItemViews" + LABEL "QIdentityProxyModel" + PURPOSE "Supports proxying a source model unmodified." + CONDITION QT_FEATURE_proxymodel +) +qt_feature_definition("identityproxymodel" "QT_NO_IDENTITYPROXYMODEL" NEGATE VALUE "1") +qt_feature("stringlistmodel" PUBLIC + SECTION "ItemViews" + LABEL "QStringListModel" + PURPOSE "Provides a model that supplies strings to views." + CONDITION QT_FEATURE_itemmodel +) +qt_feature_definition("stringlistmodel" "QT_NO_STRINGLISTMODEL" NEGATE VALUE "1") +qt_feature("translation" PUBLIC + SECTION "Internationalization" + LABEL "Translation" + PURPOSE "Supports translations using QObject::tr()." +) +qt_feature_definition("translation" "QT_NO_TRANSLATION" NEGATE VALUE "1") +qt_feature("textcodec" PUBLIC + SECTION "Internationalization" + LABEL "QTextCodec" + PURPOSE "Supports conversions between text encodings." +) +qt_feature_definition("textcodec" "QT_NO_TEXTCODEC" NEGATE VALUE "1") +qt_feature("codecs" PUBLIC + SECTION "Internationalization" + LABEL "Codecs" + PURPOSE "Supports non-unicode text conversions." + CONDITION QT_FEATURE_textcodec +) +qt_feature_definition("codecs" "QT_NO_CODECS" NEGATE VALUE "1") +qt_feature("big_codecs" PUBLIC + SECTION "Internationalization" + LABEL "Big Codecs" + PURPOSE "Supports big codecs, e.g. CJK." + CONDITION QT_FEATURE_textcodec +) +qt_feature_definition("big_codecs" "QT_NO_BIG_CODECS" NEGATE VALUE "1") +qt_feature("animation" PUBLIC + SECTION "Utilities" + LABEL "Animation" + PURPOSE "Provides a framework for animations." + CONDITION QT_FEATURE_properties +) +qt_feature_definition("animation" "QT_NO_ANIMATION" NEGATE VALUE "1") +qt_feature("statemachine" PUBLIC + SECTION "Utilities" + LABEL "State machine" + PURPOSE "Provides hierarchical finite state machines." + CONDITION QT_FEATURE_properties +) +qt_feature_definition("statemachine" "QT_NO_STATEMACHINE" NEGATE VALUE "1") +qt_feature("qeventtransition" PUBLIC + LABEL "QEventTransition class" + CONDITION QT_FEATURE_statemachine +) +qt_feature("gestures" PUBLIC + SECTION "Utilities" + LABEL "Gesture" + PURPOSE "Provides a framework for gestures." +) +qt_feature_definition("gestures" "QT_NO_GESTURES" NEGATE VALUE "1") +qt_feature("sha3_fast" PRIVATE + SECTION "Utilities" + LABEL "Speed optimized SHA3" + PURPOSE "Optimizes SHA3 for speed instead of size." +) +qt_feature("timezone" PUBLIC + SECTION "Utilities" + LABEL "QTimeZone" + PURPOSE "Provides support for time-zone handling." +) +qt_feature("datetimeparser" PRIVATE + SECTION "Utilities" + LABEL "QDateTimeParser" + PURPOSE "Provides support for parsing date-time texts." +) +qt_feature("commandlineparser" PUBLIC + SECTION "Utilities" + LABEL "QCommandlineParser" + PURPOSE "Provides support for command line parsing." +) +qt_feature("lttng" PRIVATE + LABEL "LTTNG" + AUTODETECT OFF + CONDITION LINUX AND libs.lttng-ust OR FIXME + ENABLE INPUT_trace STREQUAL 'lttng' OR ( INPUT_trace STREQUAL 'yes' AND LINUX ) + DISABLE INPUT_trace STREQUAL 'etw' OR INPUT_trace STREQUAL 'no' +) +qt_feature("etw" PRIVATE + LABEL "ETW" + AUTODETECT OFF + CONDITION WIN32 + ENABLE INPUT_trace STREQUAL 'etw' OR ( INPUT_trace STREQUAL 'yes' AND WIN32 ) + DISABLE INPUT_trace STREQUAL 'lttng' OR INPUT_trace STREQUAL 'no' +) +qt_feature("topleveldomain" PUBLIC + SECTION "Utilities" + LABEL "QUrl::topLevelDomain()" + PURPOSE "Provides support for extracting the top level domain from URLs. If enabled, a binary dump of the Public Suffix List (http://www.publicsuffix.org, Mozilla License) is included. The data is then also used in QNetworkCookieJar::validateCookie." +) diff --git a/src/corelib/configure.json b/src/corelib/configure.json index f09ef6c1ddb..a3a4d8359a0 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -622,11 +622,6 @@ "condition": "libs.pps", "output": [ "privateFeature" ] }, - "qeventtransition": { - "label": "QEventTransition class", - "condition": "features.statemachine", - "output": [ "publicFeature" ] - }, "renameat2": { "label": "renameat2()", "condition": "config.linux && tests.renameat2", @@ -847,6 +842,11 @@ "condition": "features.properties", "output": [ "publicFeature", "feature" ] }, + "qeventtransition": { + "label": "QEventTransition class", + "condition": "features.statemachine", + "output": [ "publicFeature" ] + }, "gestures": { "label": "Gesture", "purpose": "Provides a framework for gestures.", @@ -895,10 +895,7 @@ }, "topleveldomain": { "label": "QUrl::topLevelDomain()", - "purpose": "Provides support for extracting the top level domain from URLs. - -If enabled, a binary dump of the Public Suffix List (http://www.publicsuffix.org, -Mozilla License) is included. The data is then also used in QNetworkCookieJar::validateCookie.", + "purpose": "Provides support for extracting the top level domain from URLs. If enabled, a binary dump of the Public Suffix List (http://www.publicsuffix.org, Mozilla License) is included. The data is then also used in QNetworkCookieJar::validateCookie.", "section": "Utilities", "output": [ "publicFeature" ] } @@ -908,10 +905,7 @@ Mozilla License) is included. The data is then also used in QNetworkCookieJar::v { "type": "note", "condition": "features.journald || features.syslog || (config.qnx && features.slog2)", - "message": "journald, syslog or slog2 integration is enabled. -If your users intend to develop applications against this build, -ensure that the IDEs they use either set QT_FORCE_STDERR_LOGGING to 1 -or are able to read the logged output from journald, syslog or slog2." + "message": "journald, syslog or slog2 integration is enabled. If your users intend to develop applications against this build, ensure that the IDEs they use either set QT_FORCE_STDERR_LOGGING to 1 or are able to read the logged output from journald, syslog or slog2." }, { "type": "error", @@ -921,15 +915,12 @@ or are able to read the logged output from journald, syslog or slog2." { "type": "error", "condition": "input.doubleconversion == 'no' && !tests.xlocalescanprint", - "message": "Your C library does not provide sscanf_l or snprintf_l. -You need to use libdouble-conversion for double/string conversion." + "message": "Your C library does not provide sscanf_l or snprintf_l. You need to use libdouble-conversion for double/string conversion." }, { "type": "error", "condition": "!tests.atomicfptr", - "message": "detected a std::atomic implementation that fails for function pointers. -Please apply the patch corresponding to your Standard Library vendor, found in - qtbase/config.tests/atomicfptr" + "message": "detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr" } ], diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in new file mode 100644 index 00000000000..6f589b37711 --- /dev/null +++ b/src/corelib/global/qconfig.cpp.in @@ -0,0 +1,65 @@ +/* Installation date */ +static const char qt_configure_installation [12+11] = "qt_instdate=2012-12-20"; +/* Installation Info */ +static const char qt_configure_prefix_path_str [12+256] = "qt_prfxpath=@CMAKE_INSTALL_PREFIX@"; +#ifdef QT_BUILD_QMAKE +static const char qt_configure_ext_prefix_path_str [12+256] = "qt_epfxpath=@CMAKE_INSTALL_PREFIX@"; +static const char qt_configure_host_prefix_path_str [12+256] = "qt_hpfxpath=@CMAKE_INSTALL_PREFIX@"; +#endif +static const short qt_configure_str_offsets[] = { + 0, + 4, + 12, + 16, + 24, + 28, + 36, + 44, + 48, + 50, + 52, + 65, + 74, +#ifdef QT_BUILD_QMAKE + 80, + 81, + 87, + 91, + 95, + 97, + 107, +#endif +}; +static const char qt_configure_strs[] = + "doc\0" + "include\0" + "lib\0" + "libexec\0" + "bin\0" + "plugins\0" + "imports\0" + "qml\0" + ".\0" + ".\0" + "translations\0" + "examples\0" + "tests\0" +#ifdef QT_BUILD_QMAKE + "\0" + "false\0" + "bin\0" + "lib\0" + ".\0" + "linux-g++\0" + "linux-g++\0" +#endif +; +#define QT_CONFIGURE_SETTINGS_PATH "etc/xdg" +#ifdef QT_BUILD_QMAKE +# define QT_CONFIGURE_SYSROOTIFY_PREFIX false +#endif +#define QT_CONFIGURE_PREFIX_PATH qt_configure_prefix_path_str + 12 +#ifdef QT_BUILD_QMAKE +# define QT_CONFIGURE_EXT_PREFIX_PATH qt_configure_ext_prefix_path_str + 12 +# define QT_CONFIGURE_HOST_PREFIX_PATH qt_configure_host_prefix_path_str + 12 +#endif diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt new file mode 100644 index 00000000000..4150c1274a9 --- /dev/null +++ b/src/dbus/CMakeLists.txt @@ -0,0 +1,58 @@ +# Generated from dbus.pro. + +##################################################################### +## QtDBus Module: +##################################################################### + +add_qt_module(DBus + SOURCES + dbus_minimal_p.h + qdbus_symbols.cpp qdbus_symbols_p.h + qdbusabstractadaptor.cpp qdbusabstractadaptor.h qdbusabstractadaptor_p.h + qdbusabstractinterface.cpp qdbusabstractinterface.h qdbusabstractinterface_p.h + qdbusargument.cpp qdbusargument.h qdbusargument_p.h + qdbusconnection.cpp qdbusconnection.h qdbusconnection_p.h + qdbusconnectioninterface.cpp qdbusconnectioninterface.h + qdbusconnectionmanager_p.h + qdbuscontext.cpp qdbuscontext.h qdbuscontext_p.h + qdbuserror.cpp qdbuserror.h + qdbusextratypes.cpp qdbusextratypes.h + qdbusintegrator.cpp qdbusintegrator_p.h + qdbusinterface.cpp qdbusinterface.h qdbusinterface_p.h + qdbusinternalfilters.cpp + qdbusintrospection.cpp qdbusintrospection_p.h +# FIXME: this file is included in qdbusargument.cpp: qdbusmarshaller.cpp + qdbusmessage.cpp qdbusmessage.h qdbusmessage_p.h + qdbusmetaobject.cpp + qdbusmetatype.cpp qdbusmetatype.h + qdbusmisc.cpp + qdbuspendingcall.cpp qdbuspendingcall.h qdbuspendingcall_p.h + qdbuspendingreply.cpp qdbuspendingreply.h + qdbusreply.cpp qdbusreply.h + qdbusserver.cpp qdbusserver.h + qdbusservicewatcher.cpp qdbusservicewatcher.h + qdbusthreaddebug_p.h + qdbusunixfiledescriptor.cpp qdbusunixfiledescriptor.h + qdbusutil.cpp qdbusutil_p.h + qdbusvirtualobject.cpp qdbusvirtualobject.h + qdbusxmlgenerator.cpp + qdbusxmlparser.cpp qdbusxmlparser_p.h + qtdbusglobal.h qtdbusglobal_p.h + DEFINES + DBUS_API_SUBJECT_TO_CHANGE + QT_NO_FOREACH + LIBRARIES + Qt::Core + Qt::CorePrivate +) + +## Scopes: +##################################################################### + +extend_target(DBus CONDITION QT_FEATURE_dbus_linked + DEFINES QT_LINKED_LIBDBUS LIBRARIES dbus +) + +extend_target(DBus CONDITION WIN32 LIBRARIES ws2_32 advapi32 netapi32 user32) + +add_qt_docs(./doc/qtdbus.qdocconf) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt new file mode 100644 index 00000000000..3af191a18a7 --- /dev/null +++ b/src/gui/CMakeLists.txt @@ -0,0 +1,494 @@ +set(OpenGL_GL_PREFERENCE GLVND) + +find_library(FWCoreGraphics CoreGraphics) + +##################################################################### +## Gui Module: +##################################################################### + +qt_load_global_features() + +if (QT_FEATURE_gui) + if (WINRT) + set(_default_platform "winrt") + elseif(WIN32) + set(_default_platform "windows") + elseif(ANDROID) + set(_default_platform "android") + elseif(APPLE_OSX) + set(_default_platform "cocoa") + elseif(APPLE_TVOS OR APPLE_IOS) + set(_default_platform "ios") + elseif(APPLE_WATCHOS) + set(_default_platform "minimal") + elseif(QNX) + set(_default_platform "qnx") + elseif(INTEGRITY) + set(_default_platform "integrityfb") + elseif(HAIKU) + set(_default_platform "haiku") + elseif(WASM) + set(_default_platform "webassembly") + else() + set(_default_platform "xcb") + endif() + + set(QT_QPA_DEFAULT_PLATFORM "${_default_platform}" CACHE STRING "QPA default platform") +endif() + +add_qt_module(Gui + FEATURE_DEPENDENCIES + Qt::Network + SOURCES + animation/qguivariantanimation.cpp + image/qbitmap.cpp image/qbitmap.h + image/qbmphandler.cpp image/qbmphandler_p.h + image/qicon.cpp image/qicon.h image/qicon_p.h + image/qiconengine.cpp image/qiconengine.h + image/qiconengineplugin.cpp image/qiconengineplugin.h + image/qiconloader.cpp image/qiconloader_p.h + image/qimage.cpp image/qimage.h image/qimage_p.h + image/qimage_conversions.cpp + image/qimageiohandler.cpp image/qimageiohandler.h + image/qimagepixmapcleanuphooks.cpp image/qimagepixmapcleanuphooks_p.h + image/qimagereader.cpp image/qimagereader.h + image/qimagereaderwriterhelpers.cpp image/qimagereaderwriterhelpers_p.h + image/qimagewriter.cpp image/qimagewriter.h + image/qpaintengine_pic.cpp image/qpaintengine_pic_p.h + image/qpicture.cpp image/qpicture.h image/qpicture_p.h + image/qpictureformatplugin.cpp image/qpictureformatplugin.h + image/qpixmap.cpp image/qpixmap.h + image/qpixmap_blitter.cpp image/qpixmap_blitter_p.h + image/qpixmap_raster.cpp image/qpixmap_raster_p.h + image/qpixmapcache.cpp image/qpixmapcache.h image/qpixmapcache_p.h + image/qplatformpixmap.cpp image/qplatformpixmap.h + image/qppmhandler.cpp image/qppmhandler_p.h + image/qxbmhandler.cpp image/qxbmhandler_p.h + image/qxpmhandler.cpp image/qxpmhandler_p.h + kernel/qclipboard.cpp kernel/qclipboard.h + kernel/qcursor.cpp kernel/qcursor.h kernel/qcursor_p.h + kernel/qevent.cpp kernel/qevent.h kernel/qevent_p.h + kernel/qgenericplugin.cpp kernel/qgenericplugin.h + kernel/qgenericpluginfactory.cpp kernel/qgenericpluginfactory.h + kernel/qguiapplication.cpp kernel/qguiapplication.h kernel/qguiapplication_p.h + kernel/qguivariant.cpp + kernel/qhighdpiscaling.cpp kernel/qhighdpiscaling_p.h + kernel/qinputdevicemanager.cpp kernel/qinputdevicemanager_p.h + kernel/qinputdevicemanager_p_p.h + kernel/qinputmethod.cpp kernel/qinputmethod.h kernel/qinputmethod_p.h + kernel/qinternalmimedata.cpp kernel/qinternalmimedata_p.h + kernel/qkeymapper.cpp kernel/qkeymapper_p.h + kernel/qkeysequence.cpp kernel/qkeysequence.h kernel/qkeysequence_p.h + kernel/qoffscreensurface.cpp kernel/qoffscreensurface.h + kernel/qpaintdevicewindow.cpp kernel/qpaintdevicewindow.h kernel/qpaintdevicewindow_p.h + kernel/qpalette.cpp kernel/qpalette.h + kernel/qpixelformat.cpp kernel/qpixelformat.h + kernel/qplatformclipboard.cpp kernel/qplatformclipboard.h + kernel/qplatformcursor.cpp kernel/qplatformcursor.h + kernel/qplatformdialoghelper.cpp kernel/qplatformdialoghelper.h + kernel/qplatformgraphicsbuffer.cpp kernel/qplatformgraphicsbuffer.h + kernel/qplatformgraphicsbufferhelper.cpp kernel/qplatformgraphicsbufferhelper.h + kernel/qplatforminputcontext.cpp kernel/qplatforminputcontext.h kernel/qplatforminputcontext_p.h + kernel/qplatforminputcontextfactory.cpp kernel/qplatforminputcontextfactory_p.h + kernel/qplatforminputcontextplugin.cpp kernel/qplatforminputcontextplugin_p.h + kernel/qplatformintegration.cpp kernel/qplatformintegration.h + kernel/qplatformintegrationfactory.cpp kernel/qplatformintegrationfactory_p.h + kernel/qplatformintegrationplugin.cpp kernel/qplatformintegrationplugin.h + kernel/qplatformmenu.cpp kernel/qplatformmenu.h + kernel/qplatformnativeinterface.cpp kernel/qplatformnativeinterface.h + kernel/qplatformoffscreensurface.cpp kernel/qplatformoffscreensurface.h + kernel/qplatformscreen.cpp kernel/qplatformscreen.h kernel/qplatformscreen_p.h + kernel/qplatformservices.cpp kernel/qplatformservices.h + kernel/qplatformsessionmanager.cpp kernel/qplatformsessionmanager.h + kernel/qplatformsharedgraphicscache.cpp kernel/qplatformsharedgraphicscache.h + kernel/qplatformsurface.cpp kernel/qplatformsurface.h + kernel/qplatformsystemtrayicon.cpp kernel/qplatformsystemtrayicon.h + kernel/qplatformtheme.cpp kernel/qplatformtheme.h kernel/qplatformtheme_p.h + kernel/qplatformthemefactory.cpp kernel/qplatformthemefactory_p.h + kernel/qplatformthemeplugin.cpp kernel/qplatformthemeplugin.h + kernel/qplatformwindow.cpp kernel/qplatformwindow.h kernel/qplatformwindow_p.h + kernel/qrasterwindow.cpp kernel/qrasterwindow.h + kernel/qscreen.cpp kernel/qscreen.h kernel/qscreen_p.h + kernel/qsessionmanager.cpp kernel/qsessionmanager.h kernel/qsessionmanager_p.h + kernel/qshortcutmap.cpp kernel/qshortcutmap_p.h + kernel/qstylehints.cpp kernel/qstylehints.h + kernel/qsurface.cpp kernel/qsurface.h + kernel/qsurfaceformat.cpp kernel/qsurfaceformat.h + kernel/qtestsupport_gui.cpp kernel/qtestsupport_gui.h + kernel/qtguiglobal.h kernel/qtguiglobal_p.h + kernel/qtouchdevice.cpp kernel/qtouchdevice.h kernel/qtouchdevice_p.h + kernel/qwindow.cpp kernel/qwindow.h kernel/qwindow_p.h + kernel/qwindowdefs.h + kernel/qwindowsysteminterface.cpp kernel/qwindowsysteminterface.h kernel/qwindowsysteminterface_p.h + math3d/qgenericmatrix.cpp math3d/qgenericmatrix.h + math3d/qmatrix4x4.cpp math3d/qmatrix4x4.h + math3d/qquaternion.cpp math3d/qquaternion.h + math3d/qvector2d.cpp math3d/qvector2d.h + math3d/qvector3d.cpp math3d/qvector3d.h + math3d/qvector4d.cpp math3d/qvector4d.h + painting/qbackingstore.cpp painting/qbackingstore.h + painting/qbezier.cpp painting/qbezier_p.h + painting/qblendfunctions.cpp painting/qblendfunctions_p.h + painting/qblittable.cpp painting/qblittable_p.h + painting/qbrush.cpp painting/qbrush.h + painting/qcolor.cpp painting/qcolor.h painting/qcolor_p.h + painting/qcolorprofile.cpp painting/qcolorprofile_p.h + painting/qcompositionfunctions.cpp + painting/qcosmeticstroker.cpp painting/qcosmeticstroker_p.h + painting/qdatabuffer_p.h + painting/qdrawhelper.cpp painting/qdrawhelper_p.h + painting/qdrawhelper_x86_p.h + painting/qdrawingprimitive_sse2_p.h + painting/qemulationpaintengine.cpp painting/qemulationpaintengine_p.h + painting/qfixed_p.h + painting/qgrayraster.c painting/qgrayraster_p.h + painting/qimagescale.cpp + painting/qmatrix.cpp painting/qmatrix.h + painting/qmemrotate.cpp painting/qmemrotate_p.h + painting/qoutlinemapper.cpp painting/qoutlinemapper_p.h + painting/qpagedpaintdevice.cpp painting/qpagedpaintdevice.h painting/qpagedpaintdevice_p.h + painting/qpagelayout.cpp painting/qpagelayout.h + painting/qpagesize.cpp painting/qpagesize.h + painting/qpaintdevice.cpp painting/qpaintdevice.h + painting/qpaintengine.cpp painting/qpaintengine.h painting/qpaintengine_p.h + painting/qpaintengine_blitter.cpp painting/qpaintengine_blitter_p.h + painting/qpaintengine_raster.cpp painting/qpaintengine_raster_p.h + painting/qpaintengineex.cpp painting/qpaintengineex_p.h + painting/qpainter.cpp painting/qpainter.h painting/qpainter_p.h + painting/qpainterpath.cpp painting/qpainterpath.h painting/qpainterpath_p.h + painting/qpathclipper.cpp painting/qpathclipper_p.h + painting/qpathsimplifier.cpp painting/qpathsimplifier_p.h + painting/qpdf.cpp painting/qpdf_p.h painting/qpdf.qrc + painting/qpdfwriter.cpp painting/qpdfwriter.h + painting/qpen.cpp painting/qpen.h + painting/qplatformbackingstore.cpp painting/qplatformbackingstore.h + painting/qpolygon.cpp painting/qpolygon.h + painting/qpolygonclipper_p.h + painting/qrasterdefs_p.h + painting/qrasterizer.cpp painting/qrasterizer_p.h + painting/qrbtree_p.h + painting/qregion.cpp painting/qregion.h + painting/qrgb.h + painting/qrgba64.h painting/qrgba64_p.h + painting/qstroker.cpp painting/qstroker_p.h + painting/qtextureglyphcache.cpp painting/qtextureglyphcache_p.h + painting/qtransform.cpp painting/qtransform.h + painting/qtriangulatingstroker.cpp painting/qtriangulatingstroker_p.h + painting/qtriangulator.cpp painting/qtriangulator_p.h + painting/qvectorpath_p.h + text/qabstracttextdocumentlayout.cpp text/qabstracttextdocumentlayout.h text/qabstracttextdocumentlayout_p.h + text/qdistancefield.cpp text/qdistancefield_p.h + text/qfont.cpp text/qfont.h text/qfont_p.h + text/qfontdatabase.cpp text/qfontdatabase.h + text/qfontengine.cpp text/qfontengine_p.h + text/qfontengine_qpf2.cpp + text/qfontengineglyphcache.cpp text/qfontengineglyphcache_p.h + text/qfontinfo.h + text/qfontmetrics.cpp text/qfontmetrics.h + text/qfontsubset.cpp text/qfontsubset_p.h + text/qfragmentmap.cpp text/qfragmentmap_p.h + text/qglyphrun.cpp text/qglyphrun.h text/qglyphrun_p.h + text/qinputcontrol.cpp text/qinputcontrol_p.h + text/qplatformfontdatabase.cpp text/qplatformfontdatabase.h + text/qrawfont.cpp text/qrawfont.h text/qrawfont_p.h + text/qstatictext.cpp text/qstatictext.h text/qstatictext_p.h + text/qsyntaxhighlighter.cpp text/qsyntaxhighlighter.h + text/qtextcursor.cpp text/qtextcursor.h text/qtextcursor_p.h + text/qtextdocument.cpp text/qtextdocument.h text/qtextdocument_p.cpp text/qtextdocument_p.h + text/qtextdocumentfragment.cpp text/qtextdocumentfragment.h text/qtextdocumentfragment_p.h + text/qtextdocumentlayout.cpp text/qtextdocumentlayout_p.h + text/qtextdocumentwriter.cpp text/qtextdocumentwriter.h + text/qtextengine.cpp text/qtextengine_p.h + text/qtextformat.cpp text/qtextformat.h text/qtextformat_p.h + text/qtexthtmlparser.cpp text/qtexthtmlparser_p.h + text/qtextimagehandler.cpp text/qtextimagehandler_p.h + text/qtextlayout.cpp text/qtextlayout.h + text/qtextlist.cpp text/qtextlist.h + text/qtextobject.cpp text/qtextobject.h text/qtextobject_p.h + text/qtextoption.cpp text/qtextoption.h + text/qtexttable.cpp text/qtexttable.h text/qtexttable_p.h + util/qabstractlayoutstyleinfo.cpp util/qabstractlayoutstyleinfo_p.h + util/qdesktopservices.cpp util/qdesktopservices.h + util/qgridlayoutengine.cpp util/qgridlayoutengine_p.h + util/qhexstring_p.h + util/qktxhandler.cpp util/qktxhandler_p.h + util/qlayoutpolicy.cpp util/qlayoutpolicy_p.h + util/qpkmhandler.cpp util/qpkmhandler_p.h + util/qshaderformat.cpp util/qshaderformat_p.h + util/qshadergenerator.cpp util/qshadergenerator_p.h + util/qshadergraph.cpp util/qshadergraph_p.h + util/qshadergraphloader.cpp util/qshadergraphloader_p.h + util/qshaderlanguage.cpp util/qshaderlanguage_p.h + util/qshadernode.cpp util/qshadernode_p.h + util/qshadernodeport.cpp util/qshadernodeport_p.h + util/qshadernodesloader.cpp util/qshadernodesloader_p.h + util/qtexturefiledata.cpp util/qtexturefiledata_p.h + util/qtexturefilehandler_p.h + util/qtexturefilereader.cpp util/qtexturefilereader_p.h + util/qvalidator.cpp util/qvalidator.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + + +## Scopes: +##################################################################### + +extend_target(Gui CONDITION APPLE_OSX LIBRARIES ${FWAppKit}) +extend_target(Gui CONDITION APPLE LIBRARIES ${FWCoreGraphics}) + +extend_target(Gui CONDITION QT_FEATURE_accessibility + SOURCES + accessible/qaccessible.cpp accessible/qaccessible.h + accessible/qaccessiblebridge.cpp accessible/qaccessiblebridge.h + accessible/qaccessiblecache.cpp accessible/qaccessiblecache_p.h + accessible/qaccessibleobject.cpp accessible/qaccessibleobject.h + accessible/qaccessibleplugin.cpp accessible/qaccessibleplugin.h + accessible/qplatformaccessibility.cpp accessible/qplatformaccessibility.h +) + +extend_target(Gui CONDITION QT_FEATURE_accessibility AND APPLE + SOURCES accessible/qaccessiblecache_mac.mm + LIBRARIES ${FWFoundation} +) + +extend_target(Gui CONDITION QT_FEATURE_draganddrop + SOURCES + kernel/qdnd.cpp kernel/qdnd_p.h + kernel/qdrag.cpp kernel/qdrag.h + kernel/qplatformdrag.cpp kernel/qplatformdrag.h + kernel/qshapedpixmapdndwindow.cpp kernel/qshapedpixmapdndwindow_p.h + kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h +) + +extend_target(Gui CONDITION QT_FEATURE_opengl + SOURCES + kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h + kernel/qopenglwindow.cpp kernel/qopenglwindow.h + kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h +) + +extend_target(Gui CONDITION WIN32 SOURCES kernel/qwindowdefs_win.h) + +extend_target(Gui CONDITION QT_FEATURE_movie SOURCES image/qmovie.cpp image/qmovie.h) + +extend_target(Gui CONDITION WIN32 AND NOT WINRT SOURCES image/qpixmap_win.cpp) + +extend_target(Gui CONDITION APPLE SOURCES image/qimage_darwin.mm) + +extend_target(Gui CONDITION QT_FEATURE_png + SOURCES + image/qpnghandler.cpp image/qpnghandler_p.h + LIBRARIES PNG::PNG +) + +extend_target(Gui CONDITION QT_FEATURE_harfbuzz + SOURCES + text/qharfbuzzng.cpp text/qharfbuzzng_p.h + LIBRARIES harfbuzz +) + +extend_target(Gui CONDITION QT_FEATURE_textodfwriter + SOURCES + text/qtextodfwriter.cpp text/qtextodfwriter_p.h + text/qzip.cpp + text/qzipreader_p.h + text/qzipwriter_p.h +) + +extend_target(Gui CONDITION QT_FEATURE_cssparser SOURCES text/qcssparser.cpp text/qcssparser_p.h) + +extend_target(Gui CONDITION QT_FEATURE_standarditemmodel + SOURCES itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h +) + +# This name is fixed in the code:-/ +set_property(SOURCE painting/webgradients.binaryjson PROPERTY alias webgradients.binaryjson) +add_qt_resource(Gui qmake_webgradients PREFIX "/qgradient" + FILES painting/webgradients.binaryjson +) + +extend_target(Gui CONDITION APPLE SOURCES painting/qcoregraphics.mm painting/qcoregraphics_p.h) +extend_target(Gui CONDITION QT_FEATURE_cssparser SOURCES painting/qcssutil.cpp) + +extend_target(Gui CONDITION TEST_architecture STREQUAL arm64 AND NOT APPLE_UIKIT AND NOT WIN32 + DEFINES ENABLE_PIXMAN_DRAWHELPERS +) + +extend_target(Gui CONDITION QT_FEATURE_opengl + SOURCES + opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h + opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h + opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h + opengl/qopenglcustomshaderstage.cpp opengl/qopenglcustomshaderstage_p.h + opengl/qopengldebug.cpp opengl/qopengldebug.h + opengl/qopenglengineshadermanager.cpp opengl/qopenglengineshadermanager_p.h + opengl/qopenglengineshadersource_p.h + opengl/qopenglextensions_p.h + opengl/qopenglextrafunctions.h + opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h + opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h + opengl/qopenglgradientcache.cpp opengl/qopenglgradientcache_p.h + opengl/qopenglpaintdevice.cpp opengl/qopenglpaintdevice.h opengl/qopenglpaintdevice_p.h + opengl/qopenglpaintengine.cpp opengl/qopenglpaintengine_p.h + opengl/qopenglpixeltransferoptions.cpp opengl/qopenglpixeltransferoptions.h + opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h + opengl/qopenglshadercache_p.h + opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h + opengl/qopengltexture.cpp opengl/qopengltexture.h opengl/qopengltexture_p.h + opengl/qopengltextureblitter.cpp opengl/qopengltextureblitter.h + opengl/qopengltexturecache.cpp opengl/qopengltexturecache_p.h + opengl/qopengltextureglyphcache.cpp opengl/qopengltextureglyphcache_p.h + opengl/qopengltexturehelper.cpp opengl/qopengltexturehelper_p.h + opengl/qopengltextureuploader.cpp opengl/qopengltextureuploader_p.h + opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h + opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h + opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h + LIBRARIES + OpenGL::GL +) + +extend_target(Gui CONDITION (QT_FEATURE_opengl) AND (NOT QT_FEATURE_opengles2) + SOURCES + opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h + opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h + opengl/qopenglfunctions_1_2.cpp opengl/qopenglfunctions_1_2.h + opengl/qopenglfunctions_1_3.cpp opengl/qopenglfunctions_1_3.h + opengl/qopenglfunctions_1_4.cpp opengl/qopenglfunctions_1_4.h + opengl/qopenglfunctions_1_5.cpp opengl/qopenglfunctions_1_5.h + opengl/qopenglfunctions_2_0.cpp opengl/qopenglfunctions_2_0.h + opengl/qopenglfunctions_2_1.cpp opengl/qopenglfunctions_2_1.h + opengl/qopenglfunctions_3_0.cpp opengl/qopenglfunctions_3_0.h + opengl/qopenglfunctions_3_1.cpp opengl/qopenglfunctions_3_1.h + opengl/qopenglfunctions_3_2_compatibility.cpp opengl/qopenglfunctions_3_2_compatibility.h + opengl/qopenglfunctions_3_2_core.cpp opengl/qopenglfunctions_3_2_core.h + opengl/qopenglfunctions_3_3_compatibility.cpp opengl/qopenglfunctions_3_3_compatibility.h + opengl/qopenglfunctions_3_3_core.cpp opengl/qopenglfunctions_3_3_core.h + opengl/qopenglfunctions_4_0_compatibility.cpp opengl/qopenglfunctions_4_0_compatibility.h + opengl/qopenglfunctions_4_0_core.cpp opengl/qopenglfunctions_4_0_core.h + opengl/qopenglfunctions_4_1_compatibility.cpp opengl/qopenglfunctions_4_1_compatibility.h + opengl/qopenglfunctions_4_1_core.cpp opengl/qopenglfunctions_4_1_core.h + opengl/qopenglfunctions_4_2_compatibility.cpp opengl/qopenglfunctions_4_2_compatibility.h + opengl/qopenglfunctions_4_2_core.cpp opengl/qopenglfunctions_4_2_core.h + opengl/qopenglfunctions_4_3_compatibility.cpp opengl/qopenglfunctions_4_3_compatibility.h + opengl/qopenglfunctions_4_3_core.cpp opengl/qopenglfunctions_4_3_core.h + opengl/qopenglfunctions_4_4_compatibility.cpp opengl/qopenglfunctions_4_4_compatibility.h + opengl/qopenglfunctions_4_4_core.cpp opengl/qopenglfunctions_4_4_core.h + opengl/qopenglfunctions_4_5_compatibility.cpp opengl/qopenglfunctions_4_5_compatibility.h + opengl/qopenglfunctions_4_5_core.cpp opengl/qopenglfunctions_4_5_core.h + opengl/qopenglqueryhelper_p.h + opengl/qopengltimerquery.cpp opengl/qopengltimerquery.h +) + +extend_target(Gui CONDITION (QT_FEATURE_opengl) AND (QT_FEATURE_opengles2) + SOURCES + opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h +) + +extend_target(Gui CONDITION QT_FEATURE_vulkan + SOURCES + vulkan/qplatformvulkaninstance.cpp vulkan/qplatformvulkaninstance.h + vulkan/qvulkanfunctions.cpp + vulkan/qvulkaninstance.cpp vulkan/qvulkaninstance.h + vulkan/qvulkanwindow.cpp vulkan/qvulkanwindow.h vulkan/qvulkanwindow_p.h +) + +extend_target(Gui CONDITION QT_FEATURE_sse2 + SOURCES painting/qdrawhelper_sse2.cpp + COMPILE_FLAGS ${QT_CFLAGS_SSE2} +) + +extend_target(Gui CONDITION QT_FEATURE_ssse3 + SOURCES + image/qimage_ssse3.cpp + painting/qdrawhelper_ssse3.cpp + COMPILE_FLAGS ${QT_CFLAGS_SSSE3} +) + +extend_target(Gui CONDITION QT_FEATURE_sse4_1 + SOURCES + painting/qdrawhelper_sse4.cpp + painting/qimagescale_sse4.cpp + COMPILE_FLAGS ${QT_CFLAGS_SSE4_1} +) + +extend_target(Gui CONDITION QT_FEATURE_avx2 + SOURCES painting/qdrawhelper_avx2.cpp + COMPILE_FLAGS ${QT_CFLAGS_AVX2} +) + +extend_target(Gui CONDITION QT_FEATURE_neon + SOURCES + image/qimage_neon.cpp + painting/qdrawhelper_neon.cpp painting/qdrawhelper_neon_p.h + painting/qdrawhelper_mips_dspr2_asm.S + painting/qimagescale_neon.cpp painting/qimagescale_neon_asm.S + ../3rdparty/pixman/pixman-arm-neon-asm.S + COMPILE_FLAGS ${QT_CFLAGS_NEON} +) + +extend_target(Gui CONDITION QT_FEATURE_mips_dsp + SOURCES + painting/qdrawhelper_mips_dsp.cpp painting/qdrawhelper_mips_dsp_p.h + painting/qt_mips_asm_dsp_p + painting/qdrawhelper_mips_dsp_asm.S + COMPILE_FLAGS ${QT_FLAGS_MIPS_DSP} +) + +extend_target(Gui CONDITION QT_FEATURE_mips_dspr2 + SOURCES + image/qimage_mips_dspr2.cpp image/qimage_mips_dspr2_asm.S + painting/qdrawhelper_mips_dspr2_asm.S + COMPILE_FLAGS ${QT_FLAGS_MIPS_DSPR2} +) + +qt_create_tracepoints(Gui qtgui.tracepoints) + +if (QT_FEATURE_vulkan) + set(qvkgen_command "${HOST_QVKGEN}") + if (TARGET qvkgen) + set(qvkgen_command qvkgen) + endif() + + set(vulkan_fun "qvulkanfunctions.h") + set(vulkan_fun_p "qvulkanfunctions_p.h") + set(vulkan_fun_p_cpp "qvulkanfunctions_p.cpp") + + add_custom_command( + OUTPUT "${vulkan_fun}" "${vulkan_fun_p}" "${vulkan_fun_p_cpp}" + COMMAND "${qvkgen_command}" + "${CMAKE_CURRENT_SOURCE_DIR}/vulkan/vk.xml" + "${PROJECT_SOURCE_DIR}/header.LGPL" + "${CMAKE_CURRENT_BINARY_DIR}/qvulkanfunctions" + DEPENDS vulkan/vk.xml + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + COMMENT "Generating vulkan data" + ) + + qt_generate_forwarding_headers("QtGui" SOURCE "${vulkan_fun}" + DESTINATION qvulkanfunctions.h + CLASSES QVulkanFunctions QVulkanDeviceFunctions + ) + qt_generate_forwarding_headers("QtGui" SOURCE "${vulkan_fun_p}" + DESTINATION qvulkanfunctions_p.h PRIVATE + ) + + extend_target(Gui CONDITION QT_FEATURE_vulkan + SOURCES "${vulkan_fun}" "${vulkan_fun_p}" "${vulkan_fun_p_cpp}" + LIBRARIES Vulkan::Vulkan + ) +endif() + +# qpa headers are expected to be located right next to QtGui's private +# headers. So a private QtGui header is #include and +# a qpa header is #include , both of them implying +# linkage against Qt::GuiPrivate. +qt_read_headers_pri("QtGui" "module_headers") +install(FILES ${module_headers_qpa} DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) + +add_qt_docs(./doc/qtgui.qdocconf) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake new file mode 100644 index 00000000000..be056b34e3a --- /dev/null +++ b/src/gui/configure.cmake @@ -0,0 +1,946 @@ + + +#### Inputs + +# input freetype +set(INPUT_freetype "undefined" CACHE STRING "") +set_property(CACHE INPUT_freetype PROPERTY STRINGS undefined no qt system) + +# input harfbuzz +set(INPUT_harfbuzz "undefined" CACHE STRING "") +set_property(CACHE INPUT_harfbuzz PROPERTY STRINGS undefined no qt system) + +# input libjpeg +set(INPUT_libjpeg "undefined" CACHE STRING "") +set_property(CACHE INPUT_libjpeg PROPERTY STRINGS undefined no qt system) + +# input libpng +set(INPUT_libpng "undefined" CACHE STRING "") +set_property(CACHE INPUT_libpng PROPERTY STRINGS undefined no qt system) + +# input xcb +set(INPUT_xcb "undefined" CACHE STRING "") +set_property(CACHE INPUT_xcb PROPERTY STRINGS undefined no yes qt system) + +# input xkbcommon +set(INPUT_xkbcommon "undefined" CACHE STRING "") +set_property(CACHE INPUT_xkbcommon PROPERTY STRINGS undefined no qt system) + +# input xkbcommon-x11 +set(INPUT_xkbcommon_x11 "undefined" CACHE STRING "") +set_property(CACHE INPUT_xkbcommon_x11 PROPERTY STRINGS undefined no qt system) + + + +#### Libraries + +find_package(Libdrm) +set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL) +find_package(OpenGL) +set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL) +find_package(Freetype) +set_package_properties(Freetype PROPERTIES TYPE OPTIONAL) +find_package(Fontconfig) +set_package_properties(Fontconfig PROPERTIES TYPE OPTIONAL) +find_package(gbm) +set_package_properties(gbm PROPERTIES TYPE OPTIONAL) +find_package(harfbuzz) +set_package_properties(harfbuzz PROPERTIES TYPE OPTIONAL) +find_package(Libinput) +set_package_properties(Libinput PROPERTIES TYPE OPTIONAL) +find_package(JPEG) +set_package_properties(JPEG PROPERTIES TYPE OPTIONAL) +find_package(PNG) +set_package_properties(PNG PROPERTIES TYPE OPTIONAL) +find_package(Vulkan) +set_package_properties(Vulkan PROPERTIES TYPE OPTIONAL) +find_package(Wayland) +set_package_properties(Wayland PROPERTIES TYPE OPTIONAL) +find_package(X11) +set_package_properties(X11 PROPERTIES TYPE OPTIONAL) +find_package(XCB 1.9) +set_package_properties(XCB PROPERTIES TYPE OPTIONAL) +find_package(X11_XCB) +set_package_properties(X11_XCB PROPERTIES TYPE OPTIONAL) +find_package(XKB 0.4.1) +set_package_properties(XKB PROPERTIES TYPE OPTIONAL) + + +#### Tests + +# angle_d3d11_qdtd +qt_config_compile_test(angle_d3d11_qdtd + LABEL "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd; +(void) qdtd; + /* END TEST: */ + return 0; +} +") + +# directwrite2 +qt_config_compile_test(directwrite2 + LABEL "DirectWrite 2" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +IUnknown *factory = 0; +(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2)); +DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2), + &factory); + /* END TEST: */ + return 0; +} +") + +# drm_atomic +qt_config_compile_test(drm_atomic + LABEL "DRM Atomic API" +"#include +#include +extern \"C\" { +#include +#include +} +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +drmModeAtomicReq *request; + /* END TEST: */ + return 0; +} +") + +# egl-x11 +qt_config_compile_test(egl_x11 + LABEL "EGL on X11" +"// Check if EGL is compatible with X. Some EGL implementations, typically on +// embedded devices, are not intended to be used together with X. EGL support +// has to be disabled in plugins like xcb in this case since the native display, +// window and pixmap types will be different than what an X-based platform +// plugin would expect. +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +Display *dpy = EGL_DEFAULT_DISPLAY; +EGLNativeDisplayType egldpy = XOpenDisplay(\"\"); +dpy = egldpy; +EGLNativeWindowType w = XCreateWindow(dpy, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +XDestroyWindow(dpy, w); +XCloseDisplay(dpy); + /* END TEST: */ + return 0; +} +") + +# egl-brcm +qt_config_compile_test(egl_brcm + LABEL "Broadcom EGL (Raspberry Pi)" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +vc_dispmanx_display_open(0); + /* END TEST: */ + return 0; +} +") + +# egl-egldevice +qt_config_compile_test(egl_egldevice + LABEL "EGLDevice" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +EGLDeviceEXT device = 0; +EGLStreamKHR stream = 0; +EGLOutputLayerEXT layer = 0; +(void) EGL_DRM_CRTC_EXT; + /* END TEST: */ + return 0; +} +") + +# egl-mali +qt_config_compile_test(egl_mali + LABEL "Mali EGL" +" +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +fbdev_window *w = 0; + /* END TEST: */ + return 0; +} +") + +# egl-mali-2 +qt_config_compile_test(egl_mali_2 + LABEL "Mali 2 EGL" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +mali_native_window *w = 0; + /* END TEST: */ + return 0; +} +") + +# egl-viv +qt_config_compile_test(egl_viv + LABEL "i.Mx6 EGL" +" +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +#ifdef __INTEGRITY +fbGetDisplay(); +#else +// Do not rely on fbGetDisplay(), since the signature has changed over time. +// Stick to fbGetDisplayByIndex(). +fbGetDisplayByIndex(0); +#endif + /* END TEST: */ + return 0; +} +"# FIXME: qmake: ['DEFINES += EGL_API_FB=1', '!integrity: DEFINES += LINUX=1'] +) + +# egl-openwfd +qt_config_compile_test(egl_openwfd + LABEL "OpenWFD EGL" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +wfdEnumerateDevices(nullptr, 0, nullptr); + /* END TEST: */ + return 0; +} +") + +# egl-rcar +qt_config_compile_test(egl_rcar + LABEL "RCAR EGL" +" +#include +extern \"C\" { +extern unsigned long PVRGrfxServerInit(void); +} +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +PVRGrfxServerInit(); + /* END TEST: */ + return 0; +} +") + +# evdev +qt_config_compile_test(evdev + LABEL "evdev" +"#if defined(__FreeBSD__) +# include +#else +# include +# include +#endif +enum { + e1 = ABS_PRESSURE, + e2 = ABS_X, + e3 = REL_X, + e4 = SYN_REPORT, +}; + + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +input_event buf[32]; +(void) buf; + /* END TEST: */ + return 0; +} +") + +# integrityfb +qt_config_compile_test(integrityfb + LABEL "INTEGRITY framebuffer" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +FBDriver *driver = 0; + /* END TEST: */ + return 0; +} +") + +# libinput_axis_api +qt_config_compile_test(libinput_axis_api + LABEL "axis API in libinput" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); + /* END TEST: */ + return 0; +} +") + +# linuxfb +qt_config_compile_test(linuxfb + LABEL "LinuxFB" +" +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +fb_fix_screeninfo finfo; +fb_var_screeninfo vinfo; +int fd = 3; +ioctl(fd, FBIOGET_FSCREENINFO, &finfo); +ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); + /* END TEST: */ + return 0; +} +") + +# opengles3 +qt_config_compile_test(opengles3 + LABEL "OpenGL ES 3.0" +"#ifdef __APPLE__ +# include +#else +# define GL_GLEXT_PROTOTYPES +# include +#endif + + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +static GLfloat f[6]; +glGetStringi(GL_EXTENSIONS, 0); +glReadBuffer(GL_COLOR_ATTACHMENT1); +glUniformMatrix2x3fv(0, 0, GL_FALSE, f); +glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); + /* END TEST: */ + return 0; +} +") + +# opengles31 +qt_config_compile_test(opengles31 + LABEL "OpenGL ES 3.1" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +glDispatchCompute(1, 1, 1); +glProgramUniform1i(0, 0, 0); + /* END TEST: */ + return 0; +} +") + +# xlib +qt_config_compile_test(xlib + LABEL "XLib" +" +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +Display *d = XOpenDisplay(NULL); +XCloseDisplay(d); + /* END TEST: */ + return 0; +} +"# FIXME: qmake: CONFIG += x11 +) + + + +#### Features + +qt_feature("accessibility_atspi_bridge" PUBLIC PRIVATE + LABEL "ATSPI Bridge" + CONDITION QT_FEATURE_accessibility AND QT_FEATURE_xcb AND QT_FEATURE_dbus AND libs.atspi OR FIXME +) +qt_feature_definition("accessibility_atspi_bridge" "QT_NO_ACCESSIBILITY_ATSPI_BRIDGE" NEGATE VALUE "1") +qt_feature("angle" PUBLIC + LABEL "ANGLE" + AUTODETECT QT_FEATURE_opengles2 OR QT_FEATURE_opengl_dynamic + CONDITION WIN32 AND tests.directx OR FIXME +) +qt_feature_definition("angle" "QT_OPENGL_ES_2_ANGLE") +qt_feature("angle_d3d11_qdtd" PRIVATE + LABEL "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT" + CONDITION QT_FEATURE_angle AND TEST_angle_d3d11_qdtd +) +qt_feature("combined_angle_lib" PUBLIC + LABEL "Combined ANGLE Library" + AUTODETECT OFF + CONDITION QT_FEATURE_angle +) +qt_feature("directfb" PRIVATE + SECTION "Platform plugins" + LABEL "DirectFB" + AUTODETECT OFF + CONDITION libs.directfb OR FIXME +) +qt_feature("directwrite" PRIVATE + LABEL "DirectWrite" + CONDITION libs.directwrite OR FIXME + EMIT_IF WIN32 +) +qt_feature("directwrite2" PRIVATE + LABEL "DirectWrite 2" + CONDITION QT_FEATURE_directwrite AND TEST_directwrite2 + EMIT_IF WIN32 +) +qt_feature("direct2d" PRIVATE + SECTION "Platform plugins" + LABEL "Direct 2D" + CONDITION WIN32 AND NOT WINRT AND libs.direct2d OR FIXME +) +qt_feature("evdev" PRIVATE + LABEL "evdev" + CONDITION QT_FEATURE_thread AND TEST_evdev +) +qt_feature("freetype" PUBLIC PRIVATE + SECTION "Fonts" + LABEL "FreeType" + PURPOSE "Supports the FreeType 2 font engine (and its supported font formats)." +) +qt_feature_definition("freetype" "QT_NO_FREETYPE" NEGATE VALUE "1") +qt_feature("fontconfig" PUBLIC PRIVATE + LABEL "Fontconfig" + AUTODETECT NOT APPLE + CONDITION NOT WIN32 AND ON AND FONTCONFIG_FOUND +) +qt_feature_definition("fontconfig" "QT_NO_FONTCONFIG" NEGATE VALUE "1") +qt_feature("harfbuzz" PUBLIC PRIVATE + LABEL "HarfBuzz" +) +qt_feature_definition("harfbuzz" "QT_NO_HARFBUZZ" NEGATE VALUE "1") +qt_feature("system_harfbuzz" PRIVATE + LABEL " Using system HarfBuzz" + AUTODETECT NOT APPLE AND NOT WIN32 + CONDITION QT_FEATURE_harfbuzz AND harfbuzz_FOUND + ENABLE INPUT_harfbuzz STREQUAL 'system' + DISABLE INPUT_harfbuzz STREQUAL 'qt' +) +qt_feature("qqnx_imf" PRIVATE + LABEL "IMF" + CONDITION libs.imf OR FIXME + EMIT_IF QNX +) +qt_feature("integrityfb" PRIVATE + SECTION "Platform plugins" + LABEL "INTEGRITY framebuffer" + CONDITION INTEGRITY AND TEST_integrityfb +) +qt_feature("kms" PRIVATE + LABEL "KMS" + CONDITION Libdrm_FOUND +) +qt_feature("drm_atomic" PRIVATE + LABEL "DRM Atomic API" + CONDITION Libdrm_FOUND AND TEST_drm_atomic +) +qt_feature("libinput" PRIVATE + LABEL "libinput" + CONDITION QT_FEATURE_libudev AND Libinput_FOUND +) +qt_feature("integrityhid" PRIVATE + LABEL "INTEGRITY HID" + CONDITION INTEGRITY AND libs.integrityhid OR FIXME +) +qt_feature("libinput_axis_api" PRIVATE + LABEL "axis API in libinput" + CONDITION QT_FEATURE_libinput AND TEST_libinput_axis_api +) +qt_feature("linuxfb" PRIVATE + SECTION "Platform plugins" + LABEL "LinuxFB" + CONDITION TEST_linuxfb AND QT_FEATURE_regularexpression +) +qt_feature("vsp2" PRIVATE + LABEL "VSP2" + AUTODETECT OFF + CONDITION libs.v4l2 OR FIXME +) +qt_feature("vnc" PRIVATE + SECTION "Platform plugins" + LABEL "VNC" + CONDITION ( UNIX AND NOT ANDROID AND NOT APPLE ) AND ( QT_FEATURE_regularexpression AND QT_FEATURE_network ) +) +qt_feature("mirclient" PRIVATE + SECTION "Platform plugins" + LABEL "Mir client" + AUTODETECT OFF + CONDITION libs.mirclient OR FIXME +) +qt_feature("mtdev" PRIVATE + LABEL "mtdev" + CONDITION libs.mtdev OR FIXME +) +qt_feature("opengles2" PUBLIC + LABEL "OpenGL ES 2.0" + CONDITION WIN32 OR ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND libs.opengl_es2 ) OR FIXME + ENABLE INPUT_opengl STREQUAL 'es2' + DISABLE INPUT_opengl STREQUAL 'desktop' OR INPUT_opengl STREQUAL 'dynamic' OR INPUT_opengl STREQUAL 'no' +) +qt_feature_definition("opengles2" "QT_OPENGL_ES") +qt_feature_definition("opengles2" "QT_OPENGL_ES_2") +qt_feature("opengles3" PUBLIC + LABEL "OpenGL ES 3.0" + CONDITION QT_FEATURE_opengles2 AND NOT QT_FEATURE_angle AND TEST_opengles3 AND NOT WASM +) +qt_feature_definition("opengles3" "QT_OPENGL_ES_3") +qt_feature("opengles31" PUBLIC + LABEL "OpenGL ES 3.1" + CONDITION QT_FEATURE_opengles3 AND TEST_opengles31 +) +qt_feature_definition("opengles31" "QT_OPENGL_ES_3_1") +qt_feature("opengles32" PUBLIC + LABEL "OpenGL ES 3.2" + CONDITION QT_FEATURE_opengles31 AND TEST_opengles32 +) +qt_feature_definition("opengles32" "QT_OPENGL_ES_3_2") +qt_feature("opengl_desktop" + LABEL "Desktop OpenGL" + CONDITION ( WIN32 AND NOT WINRT AND NOT QT_FEATURE_opengles2 AND ( MSVC OR OpenGL_OpenGL_FOUND ) ) OR ( NOT APPLE_WATCHOS AND NOT WIN32 AND NOT WASM AND OpenGL_OpenGL_FOUND ) + ENABLE INPUT_opengl STREQUAL 'desktop' + DISABLE INPUT_opengl STREQUAL 'es2' OR INPUT_opengl STREQUAL 'dynamic' OR INPUT_opengl STREQUAL 'no' +) +qt_feature("opengl_dynamic" PUBLIC + LABEL "Dynamic OpenGL" + AUTODETECT OFF + CONDITION WIN32 AND NOT WINRT + ENABLE INPUT_opengl STREQUAL 'dynamic' +) +qt_feature_definition("opengl_dynamic" "QT_OPENGL_DYNAMIC") +qt_feature("opengl" PUBLIC + LABEL "OpenGL" + CONDITION QT_FEATURE_opengl_desktop OR QT_FEATURE_opengl_dynamic OR QT_FEATURE_opengles2 +) +qt_feature_definition("opengl" "QT_NO_OPENGL" NEGATE VALUE "1") +qt_feature("vulkan" PUBLIC + LABEL "Vulkan" + CONDITION Vulkan_FOUND +) +qt_feature("openvg" PUBLIC + LABEL "OpenVG" + CONDITION libs.openvg OR FIXME +) +qt_feature("egl" PUBLIC PRIVATE + LABEL "EGL" + CONDITION ( QT_FEATURE_opengl OR QT_FEATURE_openvg ) AND ( QT_FEATURE_angle OR OpenGL_EGL_FOUND ) +) +qt_feature_definition("egl" "QT_NO_EGL" NEGATE VALUE "1") +qt_feature("egl_x11" PRIVATE + LABEL "EGL on X11" + CONDITION QT_FEATURE_thread AND QT_FEATURE_egl AND TEST_egl_x11 +) +qt_feature("eglfs" PRIVATE + SECTION "Platform plugins" + LABEL "EGLFS" + CONDITION NOT ANDROID AND NOT APPLE AND NOT WIN32 AND QT_FEATURE_egl +) +qt_feature("eglfs_brcm" PRIVATE + LABEL "EGLFS Raspberry Pi" + CONDITION QT_FEATURE_eglfs AND TEST_egl_brcm +) +qt_feature("eglfs_egldevice" PRIVATE + LABEL "EGLFS EGLDevice" + CONDITION QT_FEATURE_eglfs AND TEST_egl_egldevice AND QT_FEATURE_kms +) +qt_feature("eglfs_gbm" PRIVATE + LABEL "EGLFS GBM" + CONDITION QT_FEATURE_eglfs AND gbm_FOUND AND QT_FEATURE_kms +) +qt_feature("eglfs_vsp2" PRIVATE + LABEL "EGLFS VSP2" + CONDITION QT_FEATURE_eglfs AND gbm_FOUND AND QT_FEATURE_kms AND QT_FEATURE_vsp2 +) +qt_feature("eglfs_mali" PRIVATE + LABEL "EGLFS Mali" + CONDITION QT_FEATURE_eglfs AND ( TEST_egl_mali OR TEST_egl_mali_2 ) +) +qt_feature("eglfs_viv" PRIVATE + LABEL "EGLFS i.Mx6" + CONDITION QT_FEATURE_eglfs AND TEST_egl_viv +) +qt_feature("eglfs_rcar" PRIVATE + LABEL "EGLFS RCAR" + CONDITION INTEGRITY AND QT_FEATURE_eglfs AND TEST_egl_rcar +) +qt_feature("eglfs_viv_wl" PRIVATE + LABEL "EGLFS i.Mx6 Wayland" + CONDITION QT_FEATURE_eglfs_viv AND Wayland_FOUND +) +qt_feature("eglfs_openwfd" PRIVATE + LABEL "EGLFS OpenWFD" + CONDITION INTEGRITY AND QT_FEATURE_eglfs AND TEST_egl_openwfd +) +qt_feature("gif" PUBLIC PRIVATE + LABEL "GIF" + CONDITION QT_FEATURE_imageformatplugin +) +qt_feature_definition("gif" "QT_NO_IMAGEFORMAT_GIF" NEGATE) +qt_feature("ico" PUBLIC PRIVATE + LABEL "ICO" + CONDITION QT_FEATURE_imageformatplugin +) +qt_feature_definition("ico" "QT_NO_ICO" NEGATE VALUE "1") +qt_feature("jpeg" PUBLIC PRIVATE + LABEL "JPEG" + CONDITION QT_FEATURE_imageformatplugin + DISABLE INPUT_libjpeg STREQUAL 'no' +) +qt_feature_definition("jpeg" "QT_NO_IMAGEFORMAT_JPEG" NEGATE) +qt_feature("png" PUBLIC PRIVATE + LABEL "PNG" + DISABLE INPUT_libpng STREQUAL 'no' +) +qt_feature_definition("png" "QT_NO_IMAGEFORMAT_PNG" NEGATE) +qt_feature("sessionmanager" PUBLIC + SECTION "Kernel" + LABEL "Session Management" + PURPOSE "Provides an interface to the windowing system's session management." +) +qt_feature_definition("sessionmanager" "QT_NO_SESSIONMANAGER" NEGATE VALUE "1") +qt_feature("tslib" PRIVATE + LABEL "tslib" + CONDITION libs.tslib OR FIXME +) +qt_feature("tuiotouch" PRIVATE + LABEL "TuioTouch" + PURPOSE "Provides the TuioTouch input plugin." + CONDITION QT_FEATURE_network AND QT_FEATURE_udpsocket +) +qt_feature("xcb" PRIVATE + SECTION "Platform plugins" + LABEL "XCB" + AUTODETECT NOT APPLE + CONDITION QT_FEATURE_thread AND XCB_FOUND + ENABLE INPUT_xcb STREQUAL 'system' OR INPUT_xcb STREQUAL 'qt' OR INPUT_xcb STREQUAL 'yes' +) +qt_feature("xcb_glx" PRIVATE + LABEL "XCB GLX" + CONDITION XCB_GLX_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xcb_native_painting" PRIVATE + LABEL "Native painting (experimental)" + CONDITION QT_FEATURE_xcb_xlib AND QT_FEATURE_fontconfig AND XCB_RENDER_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xrender" PRIVATE + LABEL "XRender for native painting" + CONDITION QT_FEATURE_xcb_native_painting + EMIT_IF QT_FEATURE_xcb AND QT_FEATURE_xcb_native_painting +) +qt_feature("xcb_render" PRIVATE + LABEL "XCB render" + CONDITION NOT ON OR XCB_RENDER_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xkb" PRIVATE + LABEL "XCB XKB" + CONDITION NOT ON OR XCB_XKB_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xcb_xlib" PRIVATE + LABEL "XCB Xlib" + CONDITION QT_FEATURE_xlib AND X11_XCB_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xcb_sm" PRIVATE + LABEL "xcb-sm" + CONDITION QT_FEATURE_sessionmanager AND X11_SM_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xcb_xinput" PRIVATE + LABEL "XCB XInput" + CONDITION NOT ON OR XCB_XINPUT_FOUND + EMIT_IF QT_FEATURE_xcb +) +qt_feature("xkbcommon_evdev" PRIVATE + LABEL "xkbcommon-evdev" + CONDITION XKB_FOUND +) +qt_feature("xlib" PRIVATE + LABEL "XLib" + AUTODETECT NOT APPLE OR QT_FEATURE_xcb + CONDITION TEST_xlib +) +qt_feature("texthtmlparser" PUBLIC + SECTION "Kernel" + LABEL "HtmlParser" + PURPOSE "Provides a parser for HTML." +) +qt_feature_definition("texthtmlparser" "QT_NO_TEXTHTMLPARSER" NEGATE VALUE "1") +qt_feature("textodfwriter" PUBLIC + SECTION "Kernel" + LABEL "OdfWriter" + PURPOSE "Provides an ODF writer." + CONDITION QT_FEATURE_xmlstreamwriter +) +qt_feature_definition("textodfwriter" "QT_NO_TEXTODFWRITER" NEGATE VALUE "1") +qt_feature("cssparser" PUBLIC + SECTION "Kernel" + LABEL "CssParser" + PURPOSE "Provides a parser for Cascading Style Sheets." +) +qt_feature_definition("cssparser" "QT_NO_CSSPARSER" NEGATE VALUE "1") +qt_feature("draganddrop" PUBLIC + SECTION "Kernel" + LABEL "Drag and Drop" + PURPOSE "Supports the drag and drop mechansim." + CONDITION QT_FEATURE_imageformat_xpm +) +qt_feature_definition("draganddrop" "QT_NO_DRAGANDDROP" NEGATE VALUE "1") +qt_feature("shortcut" PUBLIC + SECTION "Kernel" + LABEL "QShortcut" + PURPOSE "Provides keyboard accelerators and shortcuts." +) +qt_feature_definition("shortcut" "QT_NO_SHORTCUT" NEGATE VALUE "1") +qt_feature("action" PUBLIC + SECTION "Kernel" + LABEL "QAction" + PURPOSE "Provides widget actions." +) +qt_feature_definition("action" "QT_NO_ACTION" NEGATE VALUE "1") +qt_feature("cursor" PUBLIC + SECTION "Kernel" + LABEL "QCursor" + PURPOSE "Provides mouse cursors." +) +qt_feature_definition("cursor" "QT_NO_CURSOR" NEGATE VALUE "1") +qt_feature("clipboard" PUBLIC + SECTION "Kernel" + LABEL "QClipboard" + PURPOSE "Provides cut and paste operations." + CONDITION NOT INTEGRITY AND NOT QNX +) +qt_feature_definition("clipboard" "QT_NO_CLIPBOARD" NEGATE VALUE "1") +qt_feature("wheelevent" PUBLIC + SECTION "Kernel" + LABEL "QWheelEvent" + PURPOSE "Supports wheel events." +) +qt_feature_definition("wheelevent" "QT_NO_WHEELEVENT" NEGATE VALUE "1") +qt_feature("tabletevent" PUBLIC + SECTION "Kernel" + LABEL "QTabletEvent" + PURPOSE "Supports tablet events." +) +qt_feature_definition("tabletevent" "QT_NO_TABLETEVENT" NEGATE VALUE "1") +qt_feature("im" PUBLIC + SECTION "Kernel" + LABEL "QInputContext" + PURPOSE "Provides complex input methods." + CONDITION QT_FEATURE_library +) +qt_feature_definition("im" "QT_NO_IM" NEGATE VALUE "1") +qt_feature("highdpiscaling" PUBLIC + SECTION "Kernel" + LABEL "High DPI Scaling" + PURPOSE "Provides automatic scaling of DPI-unaware applications on high-DPI displays." +) +qt_feature_definition("highdpiscaling" "QT_NO_HIGHDPISCALING" NEGATE VALUE "1") +qt_feature("validator" PUBLIC + SECTION "Widgets" + LABEL "QValidator" + PURPOSE "Supports validation of input text." +) +qt_feature_definition("validator" "QT_NO_VALIDATOR" NEGATE VALUE "1") +qt_feature("standarditemmodel" PUBLIC + SECTION "ItemViews" + LABEL "QStandardItemModel" + PURPOSE "Provides a generic model for storing custom data." + CONDITION QT_FEATURE_itemmodel +) +qt_feature_definition("standarditemmodel" "QT_NO_STANDARDITEMMODEL" NEGATE VALUE "1") +qt_feature("imageformatplugin" PUBLIC + SECTION "Images" + LABEL "QImageIOPlugin" + PURPOSE "Provides a base for writing a image format plugins." +) +qt_feature_definition("imageformatplugin" "QT_NO_IMAGEFORMATPLUGIN" NEGATE VALUE "1") +qt_feature("movie" PUBLIC + SECTION "Images" + LABEL "QMovie" + PURPOSE "Supports animated images." +) +qt_feature_definition("movie" "QT_NO_MOVIE" NEGATE VALUE "1") +qt_feature("imageformat_bmp" PUBLIC + SECTION "Images" + LABEL "BMP Image Format" + PURPOSE "Supports Microsoft's Bitmap image file format." +) +qt_feature_definition("imageformat_bmp" "QT_NO_IMAGEFORMAT_BMP" NEGATE VALUE "1") +qt_feature("imageformat_ppm" PUBLIC + SECTION "Images" + LABEL "PPM Image Format" + PURPOSE "Supports the Portable Pixmap image file format." +) +qt_feature_definition("imageformat_ppm" "QT_NO_IMAGEFORMAT_PPM" NEGATE VALUE "1") +qt_feature("imageformat_xbm" PUBLIC + SECTION "Images" + LABEL "XBM Image Format" + PURPOSE "Supports the X11 Bitmap image file format." +) +qt_feature_definition("imageformat_xbm" "QT_NO_IMAGEFORMAT_XBM" NEGATE VALUE "1") +qt_feature("imageformat_xpm" PUBLIC + SECTION "Images" + LABEL "XPM Image Format" + PURPOSE "Supports the X11 Pixmap image file format." +) +qt_feature_definition("imageformat_xpm" "QT_NO_IMAGEFORMAT_XPM" NEGATE VALUE "1") +qt_feature("imageformat_png" PUBLIC + SECTION "Images" + LABEL "PNG Image Format" + PURPOSE "Supports the Portable Network Graphics image file format." +) +qt_feature_definition("imageformat_png" "QT_NO_IMAGEFORMAT_PNG" NEGATE VALUE "1") +qt_feature("imageformat_jpeg" PUBLIC + SECTION "Images" + LABEL "JPEG Image Format" + PURPOSE "Supports the Joint Photographic Experts Group image file format." +) +qt_feature_definition("imageformat_jpeg" "QT_NO_IMAGEFORMAT_JPEG" NEGATE VALUE "1") +qt_feature("image_heuristic_mask" PUBLIC + SECTION "Images" + LABEL "QImage::createHeuristicMask()" + PURPOSE "Supports creating a 1-bpp heuristic mask for images." +) +qt_feature_definition("image_heuristic_mask" "QT_NO_IMAGE_HEURISTIC_MASK" NEGATE VALUE "1") +qt_feature("image_text" PUBLIC + SECTION "Images" + LABEL "Image Text" + PURPOSE "Supports image file text strings." +) +qt_feature_definition("image_text" "QT_NO_IMAGE_TEXT" NEGATE VALUE "1") +qt_feature("picture" PUBLIC + SECTION "Painting" + LABEL "QPicture" + PURPOSE "Supports recording and replaying QPainter commands." +) +qt_feature_definition("picture" "QT_NO_PICTURE" NEGATE VALUE "1") +qt_feature("colornames" PUBLIC + SECTION "Painting" + LABEL "Color Names" + PURPOSE "Supports color names such as \"red\", used by QColor and by some HTML documents." +) +qt_feature_definition("colornames" "QT_NO_COLORNAMES" NEGATE VALUE "1") +qt_feature("pdf" PUBLIC + SECTION "Painting" + LABEL "QPdf" + PURPOSE "Provides a PDF backend for QPainter." + CONDITION QT_FEATURE_temporaryfile +) +qt_feature_definition("pdf" "QT_NO_PDF" NEGATE VALUE "1") +qt_feature("desktopservices" PUBLIC + SECTION "Utilities" + LABEL "QDesktopServices" + PURPOSE "Provides methods for accessing common desktop services." +) +qt_feature_definition("desktopservices" "QT_NO_DESKTOPSERVICES" NEGATE VALUE "1") +qt_feature("systemtrayicon" PUBLIC + SECTION "Utilities" + LABEL "QSystemTrayIcon" + PURPOSE "Provides an icon for an application in the system tray." + CONDITION QT_FEATURE_temporaryfile +) +qt_feature_definition("systemtrayicon" "QT_NO_SYSTEMTRAYICON" NEGATE VALUE "1") +qt_feature("accessibility" PUBLIC + SECTION "Utilities" + LABEL "Accessibility" + PURPOSE "Provides accessibility support." + CONDITION QT_FEATURE_properties +) +qt_feature_definition("accessibility" "QT_NO_ACCESSIBILITY" NEGATE VALUE "1") +qt_feature("multiprocess" PRIVATE + SECTION "Utilities" + LABEL "Multi process" + PURPOSE "Provides support for detecting the desktop environment, launching external processes and opening URLs." + CONDITION NOT INTEGRITY +) +qt_feature("whatsthis" PUBLIC + SECTION "Widget Support" + LABEL "QWhatsThis" + PURPOSE "Supports displaying \"What's this\" help." +) +qt_feature_definition("whatsthis" "QT_NO_WHATSTHIS" NEGATE VALUE "1") + +qt_extra_definition("QT_QPA_DEFAULT_PLATFORM" "${QT_QPA_DEFAULT_PLATFORM}" PUBLIC) diff --git a/src/gui/configure.json b/src/gui/configure.json index 4741ed345a4..adc00003224 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1139,8 +1139,7 @@ "label": "Desktop OpenGL", "enable": "input.opengl == 'desktop'", "disable": "input.opengl == 'es2' || input.opengl == 'dynamic' || input.opengl == 'no'", - "condition": "(config.win32 && !config.winrt && !features.opengles2 && (config.msvc || libs.opengl)) - || (!config.watchos && !config.win32 && !config.wasm && libs.opengl)" + "condition": "(config.win32 && !config.winrt && !features.opengles2 && (config.msvc || libs.opengl)) || (!config.watchos && !config.win32 && !config.wasm && libs.opengl)" }, "opengl-dynamic": { "label": "Dynamic OpenGL", @@ -1602,9 +1601,7 @@ { "type": "note", "condition": "features.xcb && config.darwin", - "message": "XCB support on macOS is minimal and untested. Some features will -not work properly or at all (e.g. OpenGL, desktop services or accessibility), -or may depend on your system and XQuartz setup." + "message": "XCB support on macOS is minimal and untested. Some features will not work properly or at all (e.g. OpenGL, desktop services or accessibility), or may depend on your system and XQuartz setup." }, { "type": "note", @@ -1619,17 +1616,12 @@ or may depend on your system and XQuartz setup." { "type": "warning", "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient", - "message": "No QPA platform plugin enabled! This will -produce a Qt that cannot run GUI applications. -The dependencies needed for xcb to build are listed in -src/plugins/platforms/xcb/README" + "message": "No QPA platform plugin enabled! This will produce a Qt that cannot run GUI applications. The dependencies needed for xcb to build are listed in src/plugins/platforms/xcb/README" }, { "type": "warning", "condition": "config.win32 && (features.opengles2 || features.opengl-dynamic) && !features.angle", - "message": "Using OpenGL ES 2.0 on Windows without ANGLE. -The build will most likely fail. -Specify -opengl desktop to use regular OpenGL." + "message": "Using OpenGL ES 2.0 on Windows without ANGLE. The build will most likely fail. Specify -opengl desktop to use regular OpenGL." }, { "type": "warning", @@ -1639,9 +1631,7 @@ Specify -opengl desktop to use regular OpenGL." { "type": "error", "condition": "features.gui && !config.watchos && input.opengl != 'no' && !features.opengl-desktop && !features.opengles2 && !features.opengl-dynamic", - "message": "The OpenGL functionality tests failed! -You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], -QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform." + "message": "The OpenGL functionality tests failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform." }, { "type": "warning", diff --git a/src/gui/painting/qcoregraphics.mm b/src/gui/painting/qcoregraphics.mm index 2249859c43e..d45da147673 100644 --- a/src/gui/painting/qcoregraphics.mm +++ b/src/gui/painting/qcoregraphics.mm @@ -153,7 +153,7 @@ QPixmap qt_mac_toQPixmap(const NSImage *image, const QSizeF &size) return QPixmap(); [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:gc]; - [image drawInRect:iconRect fromRect:iconRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil]; + [image drawInRect:iconRect fromRect:iconRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; [NSGraphicsContext restoreGraphicsState]; return pixmap; } diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt new file mode 100644 index 00000000000..fd684c7eb2f --- /dev/null +++ b/src/network/CMakeLists.txt @@ -0,0 +1,382 @@ +# Generated from network.pro. + +##################################################################### +## QtNetwork Module: +##################################################################### + +add_qt_module(Network + SOURCES + access/qabstractnetworkcache.cpp access/qabstractnetworkcache.h access/qabstractnetworkcache_p.h + access/qhsts.cpp access/qhsts_p.h + access/qhstspolicy.cpp access/qhstspolicy.h + access/qhstsstore.cpp access/qhstsstore_p.h + access/qnetworkaccessauthenticationmanager.cpp access/qnetworkaccessauthenticationmanager_p.h + access/qnetworkaccessbackend.cpp access/qnetworkaccessbackend_p.h + access/qnetworkaccesscache.cpp access/qnetworkaccesscache_p.h + access/qnetworkaccesscachebackend.cpp access/qnetworkaccesscachebackend_p.h + access/qnetworkaccessdebugpipebackend.cpp access/qnetworkaccessdebugpipebackend_p.h + access/qnetworkaccessfilebackend.cpp access/qnetworkaccessfilebackend_p.h + access/qnetworkaccessmanager.cpp access/qnetworkaccessmanager.h access/qnetworkaccessmanager_p.h + access/qnetworkcookie.cpp access/qnetworkcookie.h access/qnetworkcookie_p.h + access/qnetworkcookiejar.cpp access/qnetworkcookiejar.h access/qnetworkcookiejar_p.h + access/qnetworkfile.cpp access/qnetworkfile_p.h + access/qnetworkreply.cpp access/qnetworkreply.h access/qnetworkreply_p.h + access/qnetworkreplydataimpl.cpp access/qnetworkreplydataimpl_p.h + access/qnetworkreplyfileimpl.cpp access/qnetworkreplyfileimpl_p.h + access/qnetworkreplyimpl.cpp access/qnetworkreplyimpl_p.h + access/qnetworkrequest.cpp access/qnetworkrequest.h access/qnetworkrequest_p.h + bearer/qbearerengine.cpp bearer/qbearerengine_p.h + bearer/qbearerplugin.cpp bearer/qbearerplugin_p.h + bearer/qnetworkconfigmanager.cpp bearer/qnetworkconfigmanager.h bearer/qnetworkconfigmanager_p.cpp bearer/qnetworkconfigmanager_p.h + bearer/qnetworkconfiguration.cpp bearer/qnetworkconfiguration.h bearer/qnetworkconfiguration_p.h + bearer/qnetworksession.cpp bearer/qnetworksession.h bearer/qnetworksession_p.h + bearer/qsharednetworksession.cpp bearer/qsharednetworksession_p.h + kernel/qauthenticator.cpp kernel/qauthenticator.h kernel/qauthenticator_p.h + kernel/qhostaddress.cpp kernel/qhostaddress.h kernel/qhostaddress_p.h + kernel/qhostinfo.cpp kernel/qhostinfo.h kernel/qhostinfo_p.h + kernel/qnetworkdatagram.cpp kernel/qnetworkdatagram.h kernel/qnetworkdatagram_p.h + kernel/qnetworkinterface.cpp kernel/qnetworkinterface.h kernel/qnetworkinterface_p.h + kernel/qnetworkinterface_unix_p.h + kernel/qnetworkproxy.cpp kernel/qnetworkproxy.h + kernel/qtnetworkglobal.h kernel/qtnetworkglobal_p.h + socket/qabstractsocket.cpp socket/qabstractsocket.h socket/qabstractsocket_p.h + socket/qabstractsocketengine.cpp socket/qabstractsocketengine_p.h + socket/qtcpserver.cpp socket/qtcpserver.h socket/qtcpserver_p.h + socket/qtcpsocket.cpp socket/qtcpsocket.h socket/qtcpsocket_p.h + socket/qudpsocket.cpp socket/qudpsocket.h + ssl/qasn1element.cpp ssl/qasn1element_p.h + ssl/qpassworddigestor.cpp ssl/qpassworddigestor.h + ssl/qssl.cpp ssl/qssl.h ssl/qssl_p.h + ssl/qsslcertificate.cpp ssl/qsslcertificate.h ssl/qsslcertificate_p.h + ssl/qsslcertificateextension.cpp ssl/qsslcertificateextension.h ssl/qsslcertificateextension_p.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH + INCLUDE_DIRECTORIES + kernel + LIBRARIES + Qt::CorePrivate +) + +## Scopes: +##################################################################### + +find_library(FWCoreFoundation CoreFoundation) +find_library(FWSecurity Security) +find_library(FWCFNetwork CFNetwork) +find_library(FWCoreServices CoreServices) +find_library(FWSystemConfiguration SystemConfiguration) + +# +#extend_target(Network CONDITION MSVC +#) +# +#extend_target(Network CONDITION (MSVC) AND (equals(QT_ARCH, i386)) +#) +# +#extend_target(Network CONDITION QT_FEATURE_bearermanagement +#) + +extend_target(Network CONDITION QT_FEATURE_ftp + SOURCES + access/qftp.cpp access/qftp_p.h + access/qnetworkaccessftpbackend.cpp access/qnetworkaccessftpbackend_p.h +) + +extend_target(Network CONDITION QT_FEATURE_networkdiskcache + SOURCES + access/qnetworkdiskcache.cpp access/qnetworkdiskcache.h access/qnetworkdiskcache_p.h +) + +extend_target(Network CONDITION APPLE_OSX + LIBRARIES + ${FWSecurity} +) + +extend_target(Network CONDITION WASM + SOURCES + access/qnetworkreplywasmimpl.cpp access/qnetworkreplywasmimpl_p.h +) + +extend_target(Network CONDITION QT_FEATURE_http + SOURCES + access/http2/bitstreams.cpp access/http2/bitstreams_p.h + access/http2/hpack.cpp access/http2/hpack_p.h + access/http2/hpacktable.cpp access/http2/hpacktable_p.h + access/http2/http2frames.cpp access/http2/http2frames_p.h + access/http2/http2protocol.cpp access/http2/http2protocol_p.h + access/http2/http2streams.cpp access/http2/http2streams_p.h + access/http2/huffman.cpp access/http2/huffman_p.h + access/qabstractprotocolhandler.cpp access/qabstractprotocolhandler_p.h + access/qhttp2protocolhandler.cpp access/qhttp2protocolhandler_p.h + access/qhttpmultipart.cpp access/qhttpmultipart.h access/qhttpmultipart_p.h + access/qhttpnetworkconnection.cpp access/qhttpnetworkconnection_p.h + access/qhttpnetworkconnectionchannel.cpp access/qhttpnetworkconnectionchannel_p.h + access/qhttpnetworkheader.cpp access/qhttpnetworkheader_p.h + access/qhttpnetworkreply.cpp access/qhttpnetworkreply_p.h + access/qhttpnetworkrequest.cpp access/qhttpnetworkrequest_p.h + access/qhttpprotocolhandler.cpp access/qhttpprotocolhandler_p.h + access/qhttpthreaddelegate.cpp access/qhttpthreaddelegate_p.h + access/qnetworkreplyhttpimpl.cpp access/qnetworkreplyhttpimpl_p.h + LIBRARIES + ZLIB::ZLIB +) + +extend_target(Network CONDITION APPLE_UIKIT + SOURCES + kernel/qnetworkinterface_uikit_p.h +) + +if(APPLE_OSX) + set(proxy_sources kernel/qnetworkproxy_mac.cpp) +elseif(WIN32 AND NOT WINRT) + set(proxy_sources kernel/qnetworkproxy_win.cpp) +elseif(QT_FEATURE_libproxy) + set(proxy_sources kernel/qnetworkproxy_libproxy.cpp) + set(proxy_libs libproxy libdl) +else() + set(proxy_sources kernel/qnetworkproxy_generic.cpp) +endif() + +if(NOT DEFINED proxy_libs) + set(proxy_libs "") +endif() + +extend_target(Network + SOURCES + ${proxy_sources} + LIBRARIES + ${proxy_libs} +) + +extend_target(Network CONDITION (QT_FEATURE_http) AND (QT_FEATURE_ssl) + SOURCES + access/qspdyprotocolhandler.cpp access/qspdyprotocolhandler_p.h +) + +extend_target(Network CONDITION QT_FEATURE_ftp + SOURCES + kernel/qurlinfo.cpp kernel/qurlinfo_p.h +) + +extend_target(Network CONDITION QT_FEATURE_dnslookup + SOURCES + kernel/qdnslookup.cpp kernel/qdnslookup.h kernel/qdnslookup_p.h +) + +extend_target(Network CONDITION UNIX + SOURCES + kernel/qhostinfo_unix.cpp +) +# +#extend_target(Network CONDITION (UNIX) AND (NOT INTEGRITY) +#) + +extend_target(Network CONDITION WIN32 + SOURCES + kernel/qhostinfo_win.cpp +) + +extend_target(Network CONDITION WIN32 AND NOT WINRT + SOURCES + kernel/qnetworkinterface_win.cpp + LIBRARIES + dnsapi + iphlpapi +) + +extend_target(Network CONDITION WIN32 AND NOT WINRT AND QT_FEATURE_dnslookup + SOURCES + kernel/qdnslookup_win.cpp +) + +extend_target(Network CONDITION ((UNIX) AND (NOT INTEGRITY)) AND (QT_FEATURE_dnslookup) + SOURCES + kernel/qdnslookup_unix.cpp +) + +extend_target(Network CONDITION (UNIX) AND (QT_FEATURE_linux_netlink) + SOURCES + kernel/qnetworkinterface_linux.cpp +) + +extend_target(Network CONDITION (UNIX) AND (NOT ((UNIX) AND (QT_FEATURE_linux_netlink))) + SOURCES + kernel/qnetworkinterface_unix.cpp +) +# +#extend_target(Network CONDITION ANDROID +#) + +extend_target(Network CONDITION (ANDROID) AND (QT_FEATURE_dnslookup) + SOURCES + -kernel/qdnslookup_unix.cpp + kernel/qdnslookup_android.cpp +) + +extend_target(Network CONDITION QT_FEATURE_socks5 + SOURCES + socket/qsocks5socketengine.cpp socket/qsocks5socketengine_p.h +) + +extend_target(Network CONDITION QT_FEATURE_http + SOURCES + socket/qhttpsocketengine.cpp socket/qhttpsocketengine_p.h +) + +extend_target(Network CONDITION QT_FEATURE_sctp + SOURCES + socket/qsctpserver.cpp socket/qsctpserver.h socket/qsctpserver_p.h + socket/qsctpsocket.cpp socket/qsctpsocket.h socket/qsctpsocket_p.h +) + +extend_target(Network CONDITION NOT WINRT + SOURCES + socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h +) + +extend_target(Network CONDITION UNIX + SOURCES + socket/qnativesocketengine_unix.cpp + socket/qnet_unix_p.h +) + +### FIXME +# extend_target(Network CONDITION msvc AND equals(QT_ARCH, i386): +# QMAKE_LFLAGS += /BASE:0x64000000 +# ) + +extend_target(Network CONDITION WIN32 + SOURCES +) + +extend_target(Network CONDITION (WIN32) AND (NOT WINRT) + SOURCES + socket/qnativesocketengine_win.cpp +) + +extend_target(Network CONDITION WIN32 + LIBRARIES + ws2_32 +) + +extend_target(Network CONDITION (WIN32) AND (NOT WINRT) + LIBRARIES + advapi32 +) + +extend_target(Network CONDITION WINRT + SOURCES + socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h +) + +extend_target(Network CONDITION NOT QT_FEATURE_openssl + SOURCES + ssl/qsslcertificate_qt.cpp +) + +extend_target(Network CONDITION QT_FEATURE_ssl + SOURCES + ssl/qsslcipher.cpp ssl/qsslcipher.h ssl/qsslcipher_p.h + ssl/qsslconfiguration.cpp ssl/qsslconfiguration.h ssl/qsslconfiguration_p.h + ssl/qssldiffiehellmanparameters.cpp ssl/qssldiffiehellmanparameters.h ssl/qssldiffiehellmanparameters_p.h + ssl/qsslellipticcurve.cpp ssl/qsslellipticcurve.h + ssl/qsslerror.cpp ssl/qsslerror.h + ssl/qsslkey.h ssl/qsslkey_p.cpp ssl/qsslkey_p.h + ssl/qsslpresharedkeyauthenticator.cpp ssl/qsslpresharedkeyauthenticator.h ssl/qsslpresharedkeyauthenticator_p.h + ssl/qsslsocket.cpp ssl/qsslsocket.h ssl/qsslsocket_p.h +) + +extend_target(Network CONDITION (QT_FEATURE_ssl) AND (WINRT) + SOURCES + ssl/qsslcertificate_winrt.cpp + ssl/qssldiffiehellmanparameters_dummy.cpp + ssl/qsslellipticcurve_dummy.cpp + ssl/qsslkey_qt.cpp + ssl/qsslkey_winrt.cpp + ssl/qsslsocket_winrt.cpp ssl/qsslsocket_winrt_p.h +) + +extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_securetransport) + SOURCES + ssl/qssldiffiehellmanparameters_dummy.cpp + ssl/qsslellipticcurve_dummy.cpp + ssl/qsslkey_mac.cpp + ssl/qsslkey_qt.cpp + ssl/qsslsocket_mac.cpp ssl/qsslsocket_mac_p.h + ssl/qsslsocket_mac_shared.cpp +) + +extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_dtls) + SOURCES + ssl/qdtls.cpp ssl/qdtls.h ssl/qdtls_p.h +) + +extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_openssl) + SOURCES + ssl/qsslcertificate_openssl.cpp + ssl/qsslcontext_openssl.cpp ssl/qsslcontext_openssl_p.h + ssl/qssldiffiehellmanparameters_openssl.cpp + ssl/qsslellipticcurve_openssl.cpp + ssl/qsslkey_openssl.cpp + ssl/qsslsocket_openssl.cpp ssl/qsslsocket_openssl_p.h + ssl/qsslsocket_openssl_symbols.cpp ssl/qsslsocket_openssl_symbols_p.h +) + +extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_dtls) + SOURCES + ssl/qdtls_openssl.cpp ssl/qdtls_openssl_p.h +) + +extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_opensslv11) + SOURCES + ssl/qsslcontext_openssl11.cpp + ssl/qsslsocket_openssl11.cpp + ssl/qsslsocket_openssl11_symbols_p.h +) + +extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (NOT QT_FEATURE_opensslv11) + SOURCES + ssl/qsslcontext_opensslpre11.cpp + ssl/qsslsocket_opensslpre11.cpp + ssl/qsslsocket_opensslpre11_symbols_p.h +) + +extend_target(Network CONDITION (APPLE_OSX) AND (NOT APPLE_UIKIT) + LIBRARIES + ${FWCoreServices} + ${FWSystemConfiguration} +) + +extend_target(Network CONDITION APPLE_OSX + LIBRARIES + ${FWCoreFoundation} +) + +extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (APPLE) + SOURCES + ssl/qsslsocket_mac_shared.cpp +) +# +#extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (ANDROID) +#) + +extend_target(Network CONDITION (((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (ANDROID)) AND (NOT ANDROID_EMBEDDED) + SOURCES + ssl/qsslsocket_openssl_android.cpp +) +# +#extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_openssl_linked) +#) +# +#extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (NOT (((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_openssl_linked))) +#) + +extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (WIN32) + SOURCES + ssl/qwindowscarootfetcher.cpp ssl/qwindowscarootfetcher_p.h + LIBRARIES + crypt32 +) + +add_qt_docs(./doc/qtnetwork.qdocconf) diff --git a/src/network/configure.cmake b/src/network/configure.cmake new file mode 100644 index 00000000000..dd7f487fc55 --- /dev/null +++ b/src/network/configure.cmake @@ -0,0 +1,265 @@ + + +#### Inputs + + + +#### Libraries + +find_package(libproxy) +set_package_properties(libproxy PROPERTIES TYPE OPTIONAL) +find_package(OpenSSL) +set_package_properties(OpenSSL PROPERTIES TYPE OPTIONAL) + + +#### Tests + +# getifaddrs +qt_config_compile_test(getifaddrs + LABEL "getifaddrs()" +" +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +ifaddrs *list; +getifaddrs(&list); +freeifaddrs(list); + /* END TEST: */ + return 0; +} +") + +# ipv6ifname +qt_config_compile_test(ipv6ifname + LABEL "IPv6 ifname" +" +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +char buf[IFNAMSIZ]; +if_nametoindex(\"eth0\"); +if_indextoname(1, buf); +if_freenameindex(if_nameindex()); + /* END TEST: */ + return 0; +} +") + +# linux-netlink +qt_config_compile_test(linux_netlink + LABEL "Linux AF_NETLINK sockets" +" +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +struct rtattr rta = { }; +struct ifinfomsg ifi = {}; +struct ifaddrmsg ifa = {}; +struct ifa_cacheinfo ci; +ci.ifa_prefered = ci.ifa_valid = 0; +(void)RTM_NEWLINK; (void)RTM_NEWADDR; +(void)IFLA_ADDRESS; (void)IFLA_IFNAME; +(void)IFA_ADDRESS; (void)IFA_LABEL; (void)IFA_CACHEINFO; +(void)(IFA_F_SECONDARY | IFA_F_DEPRECATED | IFA_F_PERMANENT | IFA_F_MANAGETEMPADDR); + /* END TEST: */ + return 0; +} +") + +# sctp +qt_config_compile_test(sctp + LABEL "SCTP support" +" +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ +sctp_initmsg sctpInitMsg; +socklen_t sctpInitMsgSize = sizeof(sctpInitMsg); +(void) socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP); +(void) getsockopt(-1, SOL_SCTP, SCTP_INITMSG, &sctpInitMsg, &sctpInitMsgSize); + /* END TEST: */ + return 0; +} +") + +# dtls +qt_config_compile_test(dtls + LABEL "DTLS support in OpenSSL" +" +#include +#if defined(OPENSSL_NO_DTLS) || !defined(DTLS1_2_VERSION) +# error OpenSSL without DTLS support +#endif +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ + + /* END TEST: */ + return 0; +} +") + + + +#### Features + +qt_feature("corewlan" PUBLIC PRIVATE + LABEL "CoreWLan" + CONDITION libs.corewlan OR FIXME + EMIT_IF APPLE +) +qt_feature_definition("corewlan" "QT_NO_COREWLAN" NEGATE VALUE "1") +qt_feature("getifaddrs" PUBLIC + LABEL "getifaddrs()" + CONDITION TEST_getifaddrs +) +qt_feature_definition("getifaddrs" "QT_NO_GETIFADDRS" NEGATE VALUE "1") +qt_feature("ipv6ifname" PUBLIC + LABEL "IPv6 ifname" + CONDITION TEST_ipv6ifname +) +qt_feature_definition("ipv6ifname" "QT_NO_IPV6IFNAME" NEGATE VALUE "1") +qt_feature("libproxy" PRIVATE + LABEL "libproxy" + AUTODETECT OFF + CONDITION libproxy_FOUND +) +qt_feature("linux_netlink" PRIVATE + LABEL "Linux AF_NETLINK" + CONDITION LINUX AND TEST_linux_netlink +) +qt_feature("openssl" PUBLIC PRIVATE + LABEL "OpenSSL" + AUTODETECT NOT WINRT AND NOT WASM + CONDITION NOT QT_FEATURE_securetransport AND ( QT_FEATURE_openssl_linked OR OPENSSL_INCLUDE_DIR ) + ENABLE INPUT_openssl STREQUAL 'yes' OR INPUT_openssl STREQUAL 'linked' OR INPUT_openssl STREQUAL 'runtime' + DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_ssl STREQUAL 'no' +) +qt_feature_definition("openssl" "QT_NO_OPENSSL" NEGATE) +qt_feature("openssl_linked" PUBLIC PRIVATE + LABEL " Qt directly linked to OpenSSL" + CONDITION NOT QT_FEATURE_securetransport AND libs.openssl OR FIXME + ENABLE INPUT_openssl STREQUAL 'linked' + DISABLE ( NOT INPUT_openssl STREQUAL 'linked' ) +) +qt_feature_definition("openssl_linked" "QT_LINKED_OPENSSL") +qt_feature("securetransport" PUBLIC PRIVATE + LABEL "SecureTransport" + CONDITION APPLE AND ( INPUT_openssl STREQUAL '' OR INPUT_openssl STREQUAL 'no' ) + DISABLE INPUT_securetransport STREQUAL 'no' OR INPUT_ssl STREQUAL 'no' +) +qt_feature_definition("securetransport" "QT_SECURETRANSPORT") +qt_feature("ssl" PUBLIC + LABEL "SSL" + CONDITION WINRT OR QT_FEATURE_securetransport OR QT_FEATURE_openssl +) +qt_feature_definition("ssl" "QT_NO_SSL" NEGATE VALUE "1") +qt_feature("dtls" PUBLIC + SECTION "Networking" + LABEL "DTLS" + PURPOSE "Provides a DTLS implementation" + CONDITION QT_FEATURE_openssl AND TEST_dtls +) +qt_feature("opensslv11" PUBLIC + LABEL "OpenSSL 1.1" + CONDITION QT_FEATURE_openssl AND ( OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.0" ) +) +qt_feature("sctp" PUBLIC + LABEL "SCTP" + AUTODETECT OFF + CONDITION TEST_sctp +) +qt_feature_definition("sctp" "QT_NO_SCTP" NEGATE VALUE "1") +qt_feature("system_proxies" PRIVATE + LABEL "Use system proxies" +) +qt_feature("ftp" PUBLIC + SECTION "Networking" + LABEL "FTP" + PURPOSE "Provides support for the File Transfer Protocol in QNetworkAccessManager." + CONDITION QT_FEATURE_textdate +) +qt_feature_definition("ftp" "QT_NO_FTP" NEGATE VALUE "1") +qt_feature("http" PUBLIC + SECTION "Networking" + LABEL "HTTP" + PURPOSE "Provides support for the Hypertext Transfer Protocol in QNetworkAccessManager." + CONDITION QT_FEATURE_thread +) +qt_feature_definition("http" "QT_NO_HTTP" NEGATE VALUE "1") +qt_feature("udpsocket" PUBLIC + SECTION "Networking" + LABEL "QUdpSocket" + PURPOSE "Provides access to UDP sockets." +) +qt_feature_definition("udpsocket" "QT_NO_UDPSOCKET" NEGATE VALUE "1") +qt_feature("networkproxy" PUBLIC + SECTION "Networking" + LABEL "QNetworkProxy" + PURPOSE "Provides network proxy support." +) +qt_feature_definition("networkproxy" "QT_NO_NETWORKPROXY" NEGATE VALUE "1") +qt_feature("socks5" PUBLIC + SECTION "Networking" + LABEL "SOCKS5" + PURPOSE "Provides SOCKS5 support in QNetworkProxy." + CONDITION QT_FEATURE_networkproxy +) +qt_feature_definition("socks5" "QT_NO_SOCKS5" NEGATE VALUE "1") +qt_feature("networkinterface" PUBLIC + SECTION "Networking" + LABEL "QNetworkInterface" + PURPOSE "Supports enumerating a host's IP addresses and network interfaces." + CONDITION NOT WASM +) +qt_feature_definition("networkinterface" "QT_NO_NETWORKINTERFACE" NEGATE VALUE "1") +qt_feature("networkdiskcache" PUBLIC + SECTION "Networking" + LABEL "QNetworkDiskCache" + PURPOSE "Provides a disk cache for network resources." + CONDITION QT_FEATURE_temporaryfile +) +qt_feature_definition("networkdiskcache" "QT_NO_NETWORKDISKCACHE" NEGATE VALUE "1") +qt_feature("bearermanagement" PUBLIC + SECTION "Networking" + LABEL "Bearer management" + PURPOSE "Provides bearer management for the network stack." + CONDITION QT_FEATURE_thread AND QT_FEATURE_library AND QT_FEATURE_networkinterface AND QT_FEATURE_properties +) +qt_feature_definition("bearermanagement" "QT_NO_BEARERMANAGEMENT" NEGATE VALUE "1") +qt_feature("localserver" PUBLIC + SECTION "Networking" + LABEL "QLocalServer" + PURPOSE "Provides a local socket based server." + CONDITION QT_FEATURE_temporaryfile +) +qt_feature_definition("localserver" "QT_NO_LOCALSERVER" NEGATE VALUE "1") +qt_feature("dnslookup" PUBLIC + SECTION "Networking" + LABEL "QDnsLookup" + PURPOSE "Provides API for DNS lookups." +) diff --git a/src/network/configure.json b/src/network/configure.json index 327131ba11f..9acc4cd7a62 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -324,25 +324,13 @@ "report": [ { "type": "note", - "condition": "features.openssl-linked && libs.openssl.source != 0 - && input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''", - "message": "When linking against OpenSSL, you can override the default -library names through OPENSSL_LIBS. -For example: - OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked" + "condition": "features.openssl-linked && libs.openssl.source != 0 && input.openssl.prefix == '' && input.openssl.libs == '' && input.openssl.libs.debug == ''", + "message": "When linking against OpenSSL, you can override the default library names through OPENSSL_LIBS. For example: OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked" }, { "type": "warning", "condition": "features.libproxy && input.qt_namespace == ''", - "message": "Some of libproxy's plugins may use incompatible Qt versions. - - Some platforms and distributions ship libproxy with plugins, such - as config_kde4.so, that are linked against old versions of Qt; and - libproxy loads these plugins automatically when initialized. If Qt - is not in a namespace, that loading causes a crash. Even if the - systems on which you build and test have no such plugins, your - users' systems may have them. We therefore recommend that you - combine -libproxy with -qtnamespace when configuring Qt." + "message": "Some of libproxy's plugins may use incompatible Qt versions. Some platforms and distributions ship libproxy with plugins, such as config_kde4.so, that are linked against old versions of Qt; and libproxy loads these plugins automatically when initialized. If Qt is not in a namespace, that loading causes a crash. Even if the systems on which you build and test have no such plugins, your users' systems may have them. We therefore recommend that you combine -libproxy with -qtnamespace when configuring Qt." } ], diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt new file mode 100644 index 00000000000..f67fea4d160 --- /dev/null +++ b/src/opengl/CMakeLists.txt @@ -0,0 +1,58 @@ +# Generated from opengl.pro. + +##################################################################### +## QtOpenGL Module: +##################################################################### + +add_qt_module(OpenGL + SOURCES + gl2paintengineex/qgl2pexvertexarray.cpp gl2paintengineex/qgl2pexvertexarray_p.h + gl2paintengineex/qglcustomshaderstage.cpp gl2paintengineex/qglcustomshaderstage_p.h + gl2paintengineex/qglengineshadermanager.cpp gl2paintengineex/qglengineshadermanager_p.h + gl2paintengineex/qglengineshadersource_p.h + gl2paintengineex/qglgradientcache.cpp gl2paintengineex/qglgradientcache_p.h + gl2paintengineex/qglshadercache_p.h + gl2paintengineex/qpaintengineex_opengl2.cpp gl2paintengineex/qpaintengineex_opengl2_p.h + gl2paintengineex/qtextureglyphcache_gl.cpp gl2paintengineex/qtextureglyphcache_gl_p.h + qgl.cpp qgl.h qgl_p.h + qglbuffer.cpp qglbuffer.h + qglcolormap.cpp qglcolormap.h + qglframebufferobject.cpp qglframebufferobject.h qglframebufferobject_p.h + qglfunctions.cpp qglfunctions.h + qglpaintdevice.cpp qglpaintdevice_p.h + qglpixelbuffer.cpp qglpixelbuffer.h qglpixelbuffer_p.h + qglshaderprogram.cpp qglshaderprogram.h + qtopenglglobal.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate +) + +## Scopes: +##################################################################### +# +#extend_target(OpenGL CONDITION MSVC +#) +# +#extend_target(OpenGL CONDITION (MSVC) AND (equals(QT_ARCH, i386)) +#) +# +#extend_target(OpenGL CONDITION solaris-cc* +#) +# +#extend_target(OpenGL CONDITION QT_FEATURE_opengl +#) +# +#extend_target(OpenGL CONDITION QT_FEATURE_opengles2 +#) + +extend_target(OpenGL CONDITION QT_FEATURE_graphicseffect + SOURCES + qgraphicsshadereffect.cpp qgraphicsshadereffect_p.h +) + +add_qt_docs(./doc/qtopengl.qdocconf) diff --git a/src/platformheaders/CMakeLists.txt b/src/platformheaders/CMakeLists.txt new file mode 100644 index 00000000000..493cb9f17a8 --- /dev/null +++ b/src/platformheaders/CMakeLists.txt @@ -0,0 +1,7 @@ +# FIXME Add the rest of the stuff + +add_qt_module(PlatformHeaders SOURCES fake.cpp) + +extend_target(PlatformHeaders CONDITION APPLE SOURCES cocoafunctions/qcocoawindowfunctions.h) + +add_qt_docs(./doc/qtplatformheaders.qdocconf) diff --git a/src/platformheaders/fake.cpp b/src/platformheaders/fake.cpp new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt new file mode 100644 index 00000000000..158cecbec02 --- /dev/null +++ b/src/platformsupport/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from platformsupport.pro. + +qt_pull_features_into_current_scope(PRIVATE_FEATURES Qt::Gui) +add_subdirectory(themes) +add_subdirectory(edid) +add_subdirectory(eventdispatchers) + +if(QT_FEATURE_freetype OR APPLE OR WIN32) + add_subdirectory(fontdatabases) +endif() + +if((UNIX AND (NOT uikit)) OR QT_FEATURE_xcb) + add_subdirectory(services) +endif() + +if(QT_FEATURE_accessibility) + add_subdirectory(accessibility) +endif() + +if(APPLE) + add_subdirectory(clipboard) + add_subdirectory(graphics) +endif() diff --git a/src/platformsupport/accessibility/CMakeLists.txt b/src/platformsupport/accessibility/CMakeLists.txt new file mode 100644 index 00000000000..453e2d1ab8d --- /dev/null +++ b/src/platformsupport/accessibility/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from accessibility.pro. + +##################################################################### +## QtAccessibilitySupport Module: +##################################################################### + +add_qt_module(AccessibilitySupport + STATIC + SOURCES + qaccessiblebridgeutils.cpp qaccessiblebridgeutils_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/src/platformsupport/clipboard/CMakeLists.txt b/src/platformsupport/clipboard/CMakeLists.txt new file mode 100644 index 00000000000..5c960c14771 --- /dev/null +++ b/src/platformsupport/clipboard/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from clipboard.pro. + +##################################################################### +## QtClipboardSupport Module: +##################################################################### + +find_library(FWAppKit AppKit) +find_library(FWImageIO ImageIO) +find_library(FWCoreFoundation CoreFoundation) + +add_qt_module(ClipboardSupport + STATIC + SOURCES + qmacmime.mm qmacmime_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::Gui +) + +## Scopes: +##################################################################### + +extend_target(ClipboardSupport CONDITION APPLE + LIBRARIES ${FWAppKit} ${FWImageIO} ${FWCoreFoundation} +) diff --git a/src/platformsupport/edid/CMakeLists.txt b/src/platformsupport/edid/CMakeLists.txt new file mode 100644 index 00000000000..c5f55624c8d --- /dev/null +++ b/src/platformsupport/edid/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from edid.pro. + +##################################################################### +## QtEdidSupport Module: +##################################################################### + +add_qt_module(EdidSupport + STATIC + SOURCES + qedidparser.cpp qedidparser_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate +) diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt new file mode 100644 index 00000000000..54a4287ccc4 --- /dev/null +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from eventdispatchers.pro. + +find_package(GLib) +set_package_properties(GLib PROPERTIES TYPE OPTIONAL) + +##################################################################### +## QtEventDispatcherSupport Module: +##################################################################### + +add_qt_module(EventDispatcherSupport + STATIC + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) + +## Scopes: +##################################################################### + +extend_target(EventDispatcherSupport CONDITION UNIX + SOURCES + qgenericunixeventdispatcher.cpp qgenericunixeventdispatcher_p.h + qunixeventdispatcher.cpp + qunixeventdispatcher_qpa_p.h +) + +extend_target(EventDispatcherSupport CONDITION NOT UNIX + SOURCES + qwindowsguieventdispatcher.cpp qwindowsguieventdispatcher_p.h +) + +extend_target(EventDispatcherSupport CONDITION QT_FEATURE_glib + SOURCES + qeventdispatcher_glib.cpp qeventdispatcher_glib_p.h + LIBRARIES + PkgConfig::GLib +) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt new file mode 100644 index 00000000000..ca54c419153 --- /dev/null +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -0,0 +1,106 @@ +# Generated from fontdatabases.pro. + +##################################################################### +## QtFontDatabaseSupport Module: +##################################################################### + +find_package(Freetype) +find_library(FWCoreGraphics CoreGraphics) +find_library(FWCoreFoundation CoreFoundation) +find_library(FWCoreText CoreText) +find_library(FWFoundation Foundation) +find_library(FWAppKit AppKit) + +add_qt_module(FontDatabaseSupport + STATIC + SOURCES fake.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) + +extend_target(FontDatabaseSupport CONDITION APPLE + SOURCES + mac/qcoretextfontdatabase.mm mac/qcoretextfontdatabase_p.h + mac/qfontengine_coretext.mm mac/qfontengine_coretext_p.h + LIBRARIES + ${FWCoreFoundation} + ${FWCoreGraphics} + ${FWCoreText} + ${FWFoundation} + ${FWAppKit} +) + +extend_target(FontDatabaseSupport CONDITION APPLE AND QT_FEATURE_freetype + SOURCES + freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h + LIBRARIES + Freetype::Freetype +) + +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype + SOURCES + freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h + freetype/qfreetypefontdatabase.cpp freetype/qfreetypefontdatabase_p.h + LIBRARIES + Freetype::Freetype +) + +extend_target(FontDatabaseSupport CONDITION UNIX + SOURCES + genericunix/qgenericunixfontdatabase_p.h +) + +extend_target(FontDatabaseSupport CONDITION UNIX AND QT_FEATURE_fontconfig + SOURCES + fontconfig/qfontconfigdatabase.cpp fontconfig/qfontconfigdatabase_p.h + fontconfig/qfontenginemultifontconfig.cpp fontconfig/qfontenginemultifontconfig_p.h + LIBRARIES + fontconfig +) + +#extend_target(FontDatabaseSupport CONDITION WIN32 +#) + +#extend_target(FontDatabaseSupport CONDITION (WIN32) AND (NOT WINRT) +# SOURCES +# qwindowsfontdatabase.cpp qwindowsfontdatabase_p.h +# qwindowsfontengine.cpp qwindowsfontengine_p.h +# qwindowsnativeimage.cpp qwindowsnativeimage_p.h +# LIBRARIES +# Qt::GuiPrivate +#) + +#extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (QT_FEATURE_freetype) +# SOURCES +# qwindowsfontdatabase_ft.cpp qwindowsfontdatabase_ft_p.h +#) + +#extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (QT_FEATURE_directwrite) +# SOURCES +# qwindowsfontenginedirectwrite.cpp qwindowsfontenginedirectwrite_p.h +#) + +#extend_target(FontDatabaseSupport CONDITION (((WIN32) AND (NOT WINRT)) AND (QT_FEATURE_directwrite)) AND (QT_FEATURE_directwrite2) +# DEFINES +# QT_USE_DIRECTWRITE2 +#) + +#extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (NOT QT_FEATURE_directwrite) +# DEFINES +# QT_NO_DIRECTWRITE +#) +## +##extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (mingw) +##) + +#extend_target(FontDatabaseSupport CONDITION WINRT +# SOURCES +# qwinrtfontdatabase.cpp qwinrtfontdatabase_p.h +# DEFINES +# __WRL_NO_DEFAULT_LIB__ +# LIBRARIES +# Qt::GuiPrivate +#) diff --git a/src/platformsupport/fontdatabases/fake.cpp b/src/platformsupport/fontdatabases/fake.cpp new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/platformsupport/graphics/CMakeLists.txt b/src/platformsupport/graphics/CMakeLists.txt new file mode 100644 index 00000000000..2846fc024bb --- /dev/null +++ b/src/platformsupport/graphics/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from graphics.pro. + +##################################################################### +## QtGraphicsSupport Module: +##################################################################### + +add_qt_module(GraphicsSupport + SOURCES + qrasterbackingstore.cpp qrasterbackingstore_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/src/platformsupport/services/CMakeLists.txt b/src/platformsupport/services/CMakeLists.txt new file mode 100644 index 00000000000..afa5bc166de --- /dev/null +++ b/src/platformsupport/services/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from services.pro. + +##################################################################### +## QtServiceSupport Module: +##################################################################### + +add_qt_module(ServiceSupport + STATIC + SOURCES + genericunix/qgenericunixservices.cpp genericunix/qgenericunixservices_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) + +## Scopes: +##################################################################### + +extend_target(ServiceSupport CONDITION QT_FEATURE_dbus + LIBRARIES + Qt::DBus +) diff --git a/src/platformsupport/themes/CMakeLists.txt b/src/platformsupport/themes/CMakeLists.txt new file mode 100644 index 00000000000..db9f84a5b76 --- /dev/null +++ b/src/platformsupport/themes/CMakeLists.txt @@ -0,0 +1,55 @@ +# Generated from themes.pro. + +##################################################################### +## QtThemeSupport Module: +##################################################################### + +add_qt_module(ThemeSupport + STATIC + SOURCES + qabstractfileiconengine.cpp qabstractfileiconengine_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) + +## Scopes: +##################################################################### +# +#extend_target(ThemeSupport CONDITION if(unix +#) + +extend_target(ThemeSupport CONDITION (UNIX AND (NOT APPLE_UIKIT)) OR QT_FEATURE_xcb + SOURCES + genericunix/qgenericunixthemes.cpp genericunix/qgenericunixthemes_p.h +) + +extend_target(ThemeSupport CONDITION ((UNIX AND (NOT APPLE_UIKIT)) OR QT_FEATURE_xcb) AND QT_FEATURE_dbus + SOURCES + genericunix/dbusmenu/qdbusmenuadaptor.cpp genericunix/dbusmenu/qdbusmenuadaptor.cpp genericunix/dbusmenu/qdbusmenuadaptor_p.h genericunix/dbusmenu/qdbusmenuadaptor_p.h + genericunix/dbusmenu/qdbusmenubar.cpp genericunix/dbusmenu/qdbusmenubar.cpp genericunix/dbusmenu/qdbusmenubar_p.h genericunix/dbusmenu/qdbusmenubar_p.h + genericunix/dbusmenu/qdbusmenuconnection.cpp genericunix/dbusmenu/qdbusmenuconnection.cpp genericunix/dbusmenu/qdbusmenuconnection_p.h genericunix/dbusmenu/qdbusmenuconnection_p.h + genericunix/dbusmenu/qdbusmenuregistrarproxy.cpp genericunix/dbusmenu/qdbusmenuregistrarproxy.cpp genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h + genericunix/dbusmenu/qdbusmenutypes.cpp genericunix/dbusmenu/qdbusmenutypes.cpp genericunix/dbusmenu/qdbusmenutypes_p.h genericunix/dbusmenu/qdbusmenutypes_p.h + genericunix/dbusmenu/qdbusplatformmenu.cpp genericunix/dbusmenu/qdbusplatformmenu.cpp genericunix/dbusmenu/qdbusplatformmenu_p.h genericunix/dbusmenu/qdbusplatformmenu_p.h + INCLUDE_DIRECTORIES + genericunix/dbusmenu/ + genericunix/dbusmenu/ + LIBRARIES + Qt::DBus +) + +extend_target(ThemeSupport CONDITION ((UNIX AND (NOT APPLE_UIKIT)) OR QT_FEATURE_xcb) AND QT_FEATURE_dbus AND QT_FEATURE_systemtrayicon + SOURCES + genericunix/dbustray/qdbustrayicon.cpp genericunix/dbustray/qdbustrayicon.cpp genericunix/dbustray/qdbustrayicon_p.h genericunix/dbustray/qdbustrayicon_p.h + genericunix/dbustray/qdbustraytypes.cpp genericunix/dbustray/qdbustraytypes.cpp genericunix/dbustray/qdbustraytypes_p.h genericunix/dbustray/qdbustraytypes_p.h + genericunix/dbustray/qstatusnotifieritemadaptor.cpp genericunix/dbustray/qstatusnotifieritemadaptor.cpp genericunix/dbustray/qstatusnotifieritemadaptor_p.h genericunix/dbustray/qstatusnotifieritemadaptor_p.h + genericunix/dbustray/qxdgnotificationproxy.cpp genericunix/dbustray/qxdgnotificationproxy.cpp genericunix/dbustray/qxdgnotificationproxy_p.h genericunix/dbustray/qxdgnotificationproxy_p.h + INCLUDE_DIRECTORIES + genericunix/dbustray/ + genericunix/dbustray/ + LIBRARIES + Qt::DBus +) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt new file mode 100644 index 00000000000..ff9afb9c89b --- /dev/null +++ b/src/plugins/CMakeLists.txt @@ -0,0 +1,3 @@ +if(QT_FEATURE_gui) + add_subdirectory(platforms) +endif() diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt new file mode 100644 index 00000000000..f0ac297d17b --- /dev/null +++ b/src/plugins/platforms/CMakeLists.txt @@ -0,0 +1,10 @@ +qt_pull_features_into_current_scope(PRIVATE_FEATURES Qt::Gui) + +if(QT_FEATURE_xcb) + add_subdirectory(xcb) +endif() + +if(APPLE) + add_subdirectory(cocoa) +endif(APPLE) + diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt new file mode 100644 index 00000000000..66cc2bcd892 --- /dev/null +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -0,0 +1,115 @@ +find_package(OpenGL) +find_library(FWAppkit AppKit) +find_library(FWCoreServices CoreServices) +find_library(FWCarbon Carbon) +find_library(FWIOKit IOKit) +find_library(FWQuartzCore QuartzCore) +find_library(FWCoreVideo CoreVideo) +find_library(FWMetal Metal) +find_library(FWcups cups) + +add_qt_plugin(qcocoa + TYPE platforms + SOURCES + main.mm + messages.cpp messages.h + qcocoaaccessibility.h qcocoaaccessibility.mm + qcocoaaccessibilityelement.h qcocoaaccessibilityelement.mm + qcocoaapplication.h qcocoaapplication.mm + qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm + qcocoabackingstore.h qcocoabackingstore.mm + qcocoaclipboard.h qcocoaclipboard.mm + qcocoacursor.h qcocoacursor.mm + qcocoadrag.h qcocoadrag.mm + qcocoaeventdispatcher.h qcocoaeventdispatcher.mm + qcocoahelpers.h qcocoahelpers.mm + qcocoainputcontext.h qcocoainputcontext.mm + qcocoaintegration.h qcocoaintegration.mm + qcocoaintrospection.h qcocoaintrospection.mm + qcocoakeymapper.h qcocoakeymapper.mm + qcocoamenu.h qcocoamenu.mm + qcocoamenubar.h qcocoamenubar.mm + qcocoamenuitem.h qcocoamenuitem.mm + qcocoamenuloader.h qcocoamenuloader.mm + qcocoamimetypes.h qcocoamimetypes.mm + qcocoanativeinterface.h qcocoanativeinterface.mm + qcocoansmenu.h qcocoansmenu.mm + qcocoascreen.h qcocoascreen.mm + qcocoaservices.h qcocoaservices.mm + qcocoasystemsettings.h qcocoasystemsettings.mm + qcocoasystemtrayicon.h qcocoasystemtrayicon.mm + qcocoatheme.h qcocoatheme.mm + qcocoawindow.h qcocoawindow.mm + qmacclipboard.h qmacclipboard.mm + qmultitouch_mac.mm qmultitouch_mac_p.h + qnsview.h qnsview.mm + qnswindow.h qnswindow.mm + qnswindowdelegate.h qnswindowdelegate.mm + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::AccessibilitySupportPrivate + Qt::ClipboardSupportPrivate + Qt::ThemeSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::GraphicsSupportPrivate + Qt::PlatformHeaders + ${FWAppKit} + ${FWCoreServices} + ${FWCarbon} + ${FWIOKit} + ${FWQuartzCore} + ${FWCoreVideo} + ${FWMetal} + ${FWcups} +) + +add_qt_resource(qcocoa qcocoaresources PREFIX "/qt-project.org/mac/cursors" + FILES images/spincursor.png images/waitcursor.png images/sizeallcursor.png +) + +extend_target(qcocoa CONDITION QT_FEATURE_opengl + SOURCES + qcocoaglcontext.h qcocoaglcontext.mm + LIBRARIES + OpenGL::GL +) + +extend_target(qcocoa CONDITION QT_FEATURE_vulkan + SOURCES + qcocoavulkaninstance.h qcocoavulkaninstance.mm +) + +extend_target(qcocoa CONDITION QT_FEATURE_vulkan + LIBRARIES + vulkan_support_private +) + +extend_target(qcocoa CONDITION QT_FEATURE_widgets + SOURCES + qcocoaprintdevice.h qcocoaprintdevice.mm + qcocoaprintersupport.h qcocoaprintersupport.mm + qpaintengine_mac.mm qpaintengine_mac_p.h + qprintengine_mac.mm qprintengine_mac_p.h + LIBRARIES + Qt::WidgetsPrivate + Qt::PrintSupportPrivate +) + +extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_colordialog) + SOURCES + qcocoacolordialoghelper.h qcocoacolordialoghelper.mm +) + +extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_filedialog) + SOURCES + qcocoafiledialoghelper.h qcocoafiledialoghelper.mm +) + +extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_fontdialog) + SOURCES + qcocoafontdialoghelper.h qcocoafontdialoghelper.mm +) + +#extend_target(qcocoa CONDITION NOT equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN) +#) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt new file mode 100644 index 00000000000..90c924b4b1a --- /dev/null +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -0,0 +1,172 @@ +# Generated from xcb_qpa_lib.pro. + +##################################################################### +## QtXcbQpa Module: +##################################################################### +find_package(X11_XCB) +find_package(X11) +find_package(XCB) +find_package(XKB) +find_package(PkgConfig) + +pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) + +add_qt_module(XcbQpa + NO_MODULE_HEADERS + SOURCES + gl_integrations/qxcbglintegration.cpp gl_integrations/qxcbglintegration.h + gl_integrations/qxcbglintegrationfactory.cpp gl_integrations/qxcbglintegrationfactory.h + gl_integrations/qxcbglintegrationplugin.h + gl_integrations/qxcbnativeinterfacehandler.cpp gl_integrations/qxcbnativeinterfacehandler.h + qxcbbackingstore.cpp qxcbbackingstore.h + qxcbclipboard.cpp qxcbclipboard.h + qxcbconnection.cpp qxcbconnection.h + qxcbcursor.cpp qxcbcursor.h + qxcbimage.cpp qxcbimage.h + qxcbintegration.cpp qxcbintegration.h + qxcbkeyboard.cpp qxcbkeyboard.h + qxcbmime.cpp qxcbmime.h + qxcbnativeinterface.cpp qxcbnativeinterface.h + qxcbobject.h + qxcbscreen.cpp qxcbscreen.h + qxcbsystemtraytracker.cpp qxcbsystemtraytracker.h + qxcbwindow.cpp qxcbwindow.h + qxcbwmsupport.cpp qxcbwmsupport.h + qxcbxkbcommon.h + qxcbxsettings.cpp qxcbxsettings.h + DEFINES + QT_NO_FOREACH + QT_BUILD_XCB_PLUGIN + INCLUDE_DIRECTORIES + gl_integrations/ + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::ServiceSupportPrivate + Qt::ThemeSupportPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::EdidSupportPrivate + X11::XCB + XCB::XCB + XCB::SHAPE + XCB::ICCCM + XCB::RANDR + XCB::XKB + XCB::SYNC + XCB::XFIXES + XCB::XINERAMA + XCB::SHM + XCB::IMAGE + XCB::RENDER + XCB::RENDERUTIL + XCB::KEYSYMS + XKB::XKB + PkgConfig::XKB_COMMON_X11 +) + +## Scopes: +##################################################################### + +extend_target(XcbQpa CONDITION TARGET Qt::linuxaccessibility_support_private + LIBRARIES + linuxaccessibility_supportPrivate +) + +extend_target(XcbQpa CONDITION QT_FEATURE_vulkan + LIBRARIES + vulkan_supportPrivate +) + +extend_target(XcbQpa CONDITION QT_FEATURE_draganddrop + SOURCES + qxcbdrag.cpp qxcbdrag.h +) +# +#extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xlib +#) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xinput + SOURCES + qxcbconnection_xi2.cpp +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_sm + SOURCES + qxcbsessionmanager.cpp qxcbsessionmanager.h + LIBRARIES + ${X11_SM_LIB} ${X11_ICE_LIB} +) + +extend_target(XcbQpa CONDITION QT_FEATURE_vulkan + SOURCES + qxcbvulkaninstance.cpp qxcbvulkaninstance.h + qxcbvulkanwindow.cpp qxcbvulkanwindow.h +) +# +#extend_target(XcbQpa CONDITION NOT QT_FEATURE_system_xcb +#) +# +#extend_target(XcbQpa CONDITION NOT NOT QT_FEATURE_system_xcb +#) +# +#extend_target(XcbQpa CONDITION (NOT NOT QT_FEATURE_system_xcb) AND (QT_FEATURE_xkb) +#) +# +#extend_target(XcbQpa CONDITION (NOT NOT QT_FEATURE_system_xcb) AND (QT_FEATURE_xcb_render) +#) +# +#extend_target(XcbQpa CONDITION (NOT NOT QT_FEATURE_system_xcb) AND (QT_FEATURE_xcb_xinput) +#) +# +#extend_target(XcbQpa CONDITION NOT QT_FEATURE_xkbcommon_system +#) + +extend_target(XcbQpa CONDITION (NOT QT_FEATURE_xkbcommon_system) AND (QT_FEATURE_xkb) + INCLUDE_DIRECTORIES + ../../../3rdparty/xkbcommon/src/x11 +) + +extend_target(XcbQpa CONDITION (NOT QT_FEATURE_xkbcommon_system) AND (NOT QT_FEATURE_xkb) + INCLUDE_DIRECTORIES + ../../../3rdparty/xkbcommon + ../../../3rdparty/xkbcommon/xkbcommon + ../../../3rdparty/xkbcommon/src + ../../../3rdparty/xkbcommon/src/xkbcomp +) +# +#extend_target(XcbQpa CONDITION NOT NOT QT_FEATURE_xkbcommon_system +#) +# +#extend_target(XcbQpa CONDITION QT_FEATURE_dlopen +#) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting + SOURCES + nativepainting/qbackingstore_x11.cpp nativepainting/qbackingstore_x11_p.h + nativepainting/qcolormap_x11.cpp nativepainting/qcolormap_x11_p.h + nativepainting/qpaintengine_x11.cpp nativepainting/qpaintengine_x11_p.h + nativepainting/qpixmap_x11.cpp nativepainting/qpixmap_x11_p.h + nativepainting/qt_x11_p.h + nativepainting/qtessellator.cpp nativepainting/qtessellator_p.h + nativepainting/qxcbnativepainting.cpp nativepainting/qxcbnativepainting.h + INCLUDE_DIRECTORIES + nativepainting/ +) +# +#extend_target(XcbQpa CONDITION (QT_FEATURE_xcb_native_painting) AND (QT_FEATURE_xrender) +#) + +extend_target(XcbQpa CONDITION (QT_FEATURE_xcb_native_painting) AND (QT_FEATURE_fontconfig) + LIBRARIES + freetype +) + +add_qt_plugin(qxcb + TYPE platforms + SOURCES + qxcbmain.cpp + LIBRARIES + Qt::XcbQpa + Qt::GuiPrivate +) diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json index 4802d3b04df..417d8949786 100644 --- a/src/plugins/sqldrivers/configure.json +++ b/src/plugins/sqldrivers/configure.json @@ -221,9 +221,7 @@ { "type": "warning", "condition": "config.win32 && !config.msvc && features.sql-oci", - "message": "Qt does not support compiling the Oracle database driver with -MinGW, due to lack of such support from Oracle. Consider disabling the -Oracle driver, as the current build will most likely fail." + "message": "Qt does not support compiling the Oracle database driver with MinGW, due to lack of such support from Oracle. Consider disabling the Oracle driver, as the current build will most likely fail." } ], diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt new file mode 100644 index 00000000000..3650fd0e37b --- /dev/null +++ b/src/testlib/CMakeLists.txt @@ -0,0 +1,89 @@ +##################################################################### +## Test Module: +##################################################################### + +add_qt_module(Test + # Typically the Qt module name results in qt${module}-config.h, but + # testlib is an exception where QtTest uses qttestlib-config.h. + CONFIG_MODULE_NAME "testlib" + SOURCES + qabstracttestlogger.cpp + qasciikey.cpp + qbenchmark.cpp qbenchmark.h qbenchmark_p.h + qbenchmarkevent.cpp qbenchmarkevent_p.h + qbenchmarkmeasurement.cpp qbenchmarkmeasurement_p.h + qbenchmarkmetric.cpp qbenchmarkmetric.h qbenchmarkmetric_p.h + qbenchmarkperfevents.cpp qbenchmarkperfevents_p.h + qbenchmarktimemeasurers_p.h + qbenchmarkvalgrind.cpp qbenchmarkvalgrind_p.h + qcsvbenchmarklogger.cpp + qplaintestlogger.cpp + qsignaldumper.cpp + qsignalspy.h + qtaptestlogger.cpp qtaptestlogger_p.h + qteamcitylogger.cpp + qtest.h + qtest_gui.h + qtest_network.h + qtest_widgets.h + qtestaccessible.h + qtestassert.h + qtestblacklist.cpp qtestblacklist_p.h + qtestcase.cpp qtestcase.h + qtestdata.cpp qtestdata.h + qtestelement.cpp + qtestelementattribute.cpp + qtestevent.h + qtesteventloop.h + qtesthelpers_p.h + qtestkeyboard.h + qtestlog.cpp + qtestmouse.cpp qtestmouse.h + qtestresult.cpp + qtestspontaneevent.h + qtestsystem.h + qtesttable.cpp + qtesttouch.h + qtestxunitstreamer.cpp + qttestglobal.h + qxmltestlogger.cpp + qxunittestlogger.cpp + LIBRARIES + CorePrivate + PUBLIC_LIBRARIES + Core + DEFINES + QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + QT_NO_DATASTREAM +) + +# Typically the module name is also the define symbol, but testlib works +# differently and uses QT_BUILD_TESTLIB_LIB, derived from the name testlib.pro. +set_target_properties(Test PROPERTIES DEFINE_SYMBOL QT_BUILD_TESTLIB_LIB) + +### Platform support: +##################################################################### +extend_target(Test CONDITION APPLE + SOURCES + qappletestlogger.cpp qappletestlogger_p.h + LIBRARIES ${FWSecurity} + + # FIXME: Skip XCTEST support, disabled in qmake build system +) + +extend_target(Test CONDITION APPLE_OSX + SOURCES qtestutil_macos.mm qtestutil_macos_p.h + LIBRARIES ${FWFoundation} ${FWApplicationServices} ${FWIOKit} +) + + +### Feature support: +##################################################################### + +## itemmodeltester: +extend_target(Test CONDITION QT_FEATURE_itemmodeltester + SOURCES qabstractitemmodeltester.cpp qabstractitemmodeltester.h +) + +add_qt_docs(./doc/qttestlib.qdocconf) diff --git a/src/testlib/configure.cmake b/src/testlib/configure.cmake new file mode 100644 index 00000000000..2509e11330f --- /dev/null +++ b/src/testlib/configure.cmake @@ -0,0 +1,21 @@ + + +#### Inputs + + + +#### Libraries + + + +#### Tests + + + +#### Features + +qt_feature("itemmodeltester" PUBLIC + LABEL "Tester for item models" + PURPOSE "Provides a utility to test item models." + CONDITION QT_FEATURE_itemmodel +) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt new file mode 100644 index 00000000000..6c8866b3711 --- /dev/null +++ b/src/tools/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(uic) +add_subdirectory(qvkgen) diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt new file mode 100644 index 00000000000..e85f7e9e16b --- /dev/null +++ b/src/tools/bootstrap/CMakeLists.txt @@ -0,0 +1,151 @@ + +if(WIN32) + set(os_sources + ../../corelib/global/qoperatingsystemversion_win.cpp + ../../corelib/io/qfilesystemengine_win.cpp + ../../corelib/io/qfilesystemiterator_win.cpp + ../../corelib/io/qfsfileengine_win.cpp + ../../corelib/kernel/qcoreapplication_win.cpp + ../../corelib/plugin/qsystemlibrary.cpp + ../../corelib/io/qstandardpaths_win.cpp + ) + set(os_libs user32 ole32 advapi32 shell32 netapi32) +else() + set(os_sources + ../../corelib/kernel/qcore_unix.cpp + ../../corelib/io/qfilesystemengine_unix.cpp + ../../corelib/io/qfilesystemiterator_unix.cpp + ../../corelib/io/qfsfileengine_unix.cpp + ) + + if(APPLE) + list(APPEND os_sources + ../../corelib/global/qoperatingsystemversion_darwin.mm + ../../corelib/io/qstandardpaths_mac.mm + ../../corelib/kernel/qcoreapplication_mac.cpp + ../../corelib/kernel/qcore_mac.cpp + ../../corelib/kernel/qcore_mac_objc.mm + ../../corelib/kernel/qcore_foundation.mm + ../../corelib/io/qurl.cpp + ) + else() + list(APPEND os_sources ../../corelib/io/qstandardpaths_unix.cpp) + endif() + set(os_libs "") +endif() + +add_library(QtBootstrap STATIC + ../../corelib/codecs/qlatincodec.cpp + ../../corelib/codecs/qtextcodec.cpp + ../../corelib/codecs/qutfcodec.cpp + ../../corelib/global/qendian.cpp + ../../corelib/global/qglobal.cpp + ../../corelib/global/qlogging.cpp + ../../corelib/global/qmalloc.cpp + ../../corelib/global/qnumeric.cpp + ../../corelib/global/qoperatingsystemversion.cpp + ../../corelib/global/qrandom.cpp + ../../corelib/io/qabstractfileengine.cpp + ../../corelib/io/qbuffer.cpp + ../../corelib/io/qdebug.cpp + ../../corelib/io/qdir.cpp + ../../corelib/io/qdiriterator.cpp + ../../corelib/io/qfile.cpp + ../../corelib/io/qfileinfo.cpp + ../../corelib/io/qfilesystementry.cpp + ../../corelib/io/qfilesystemengine.cpp + ../../corelib/io/qfsfileengine.cpp + ../../corelib/io/qfsfileengine_iterator.cpp + ../../corelib/io/qiodevice.cpp + ../../corelib/io/qfiledevice.cpp + ../../corelib/io/qresource.cpp + ../../corelib/io/qtemporarydir.cpp + ../../corelib/io/qtemporaryfile.cpp + ../../corelib/io/qsavefile.cpp + ../../corelib/io/qstandardpaths.cpp + ../../corelib/io/qloggingcategory.cpp + ../../corelib/io/qloggingregistry.cpp + ../../corelib/kernel/qcoreapplication.cpp + ../../corelib/kernel/qcoreglobaldata.cpp + ../../corelib/kernel/qmetatype.cpp + ../../corelib/kernel/qvariant.cpp + ../../corelib/kernel/qsystemerror.cpp + ../../corelib/plugin/quuid.cpp + ../../corelib/serialization/qdatastream.cpp + ../../corelib/serialization/qjson.cpp + ../../corelib/serialization/qjsondocument.cpp + ../../corelib/serialization/qjsonobject.cpp + ../../corelib/serialization/qjsonarray.cpp + ../../corelib/serialization/qjsonvalue.cpp + ../../corelib/serialization/qjsonparser.cpp + ../../corelib/serialization/qjsonwriter.cpp + ../../corelib/serialization/qtextstream.cpp + ../../corelib/serialization/qxmlutils.cpp + ../../corelib/serialization/qxmlstream.cpp + ../../corelib/tools/qbitarray.cpp + ../../corelib/tools/qbytearray.cpp + ../../corelib/tools/qarraydata.cpp + ../../corelib/tools/qbytearraymatcher.cpp + ../../corelib/tools/qcommandlineparser.cpp + ../../corelib/tools/qcommandlineoption.cpp + ../../corelib/tools/qcryptographichash.cpp + ../../corelib/tools/qdatetime.cpp + ../../corelib/tools/qhash.cpp + ../../corelib/tools/qlist.cpp + ../../corelib/tools/qlinkedlist.cpp + ../../corelib/tools/qlocale.cpp + ../../corelib/tools/qlocale_tools.cpp + ../../corelib/tools/qmap.cpp + ../../corelib/tools/qregexp.cpp + ../../corelib/tools/qringbuffer.cpp + ../../corelib/tools/qpoint.cpp + ../../corelib/tools/qrect.cpp + ../../corelib/tools/qsize.cpp + ../../corelib/tools/qline.cpp + ../../corelib/tools/qstring.cpp + ../../corelib/tools/qstringbuilder.cpp + ../../corelib/tools/qstring_compat.cpp + ../../corelib/tools/qstringlist.cpp + ../../corelib/tools/qversionnumber.cpp + ../../corelib/tools/qvsnprintf.cpp + ../../xml/dom/qdom.cpp + ../../xml/sax/qxml.cpp + ${os_sources} +) + +add_library(Qt::Bootstrap ALIAS QtBootstrap) + +qt_ensure_perl() +foreach(module QtCore QtXml) + execute_process(COMMAND "${HOST_PERL}" -w "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" -quiet -minimal -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") + target_include_directories(QtBootstrap PUBLIC + "${PROJECT_BINARY_DIR}/include/${module}" + "${PROJECT_BINARY_DIR}/include/${module}/${PROJECT_VERSION}" + "${PROJECT_BINARY_DIR}/include/${module}/${PROJECT_VERSION}/${module}") +endforeach() + +target_compile_definitions(QtBootstrap PUBLIC + QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} + QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} + QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} + QT_VERSION_STR="${PROJECT_VERSION}" + QT_BOOTSTRAPPED + QT_NO_CAST_ASCII + QT_NO_FOREACH + QT_NO_CAST_FROM_ASCII +) +target_link_libraries(QtBootstrap PUBLIC Qt::Platform ${os_libs}) +target_include_directories(QtBootstrap PUBLIC "${PROJECT_BINARY_DIR}/include") +target_link_libraries(QtBootstrap PRIVATE ZLIB::ZLIB) + +### fixme: Expose as some cmake equivalent of a reusable qmake mkspecs/features/gc_binaries.prf. +if(APPLE) + target_link_libraries(QtBootstrap INTERFACE "-Wl,-dead_strip") +endif() + +if (APPLE) + find_library(FWFoundation Foundation) + find_library(FWCoreServices CoreServices) + target_link_libraries(QtBootstrap INTERFACE ${FWFoundation}) + target_link_libraries(QtBootstrap PRIVATE ${FWCoreServices}) +endif() diff --git a/src/tools/moc/CMakeLists.txt b/src/tools/moc/CMakeLists.txt new file mode 100644 index 00000000000..b16ed026a4c --- /dev/null +++ b/src/tools/moc/CMakeLists.txt @@ -0,0 +1,10 @@ +add_qt_tool(moc BOOTSTRAP + LIBRARIES tinycbor + SOURCES + moc.cpp + preprocessor.cpp + generator.cpp + parser.cpp + token.cpp + main.cpp +) diff --git a/src/tools/qfloat16-tables/CMakeLists.txt b/src/tools/qfloat16-tables/CMakeLists.txt new file mode 100644 index 00000000000..60d62829760 --- /dev/null +++ b/src/tools/qfloat16-tables/CMakeLists.txt @@ -0,0 +1,2 @@ +add_qt_tool(qfloat16-tables BOOTSTRAP SOURCES gen_qfloat16_tables.cpp) + diff --git a/src/tools/qmocscanner/CMakeLists.txt b/src/tools/qmocscanner/CMakeLists.txt new file mode 100644 index 00000000000..fd0190dc6e0 --- /dev/null +++ b/src/tools/qmocscanner/CMakeLists.txt @@ -0,0 +1,10 @@ +set(_mocscanner "${PROJECT_BINARY_DIR}/${INSTALL_BINDIR}/qmocscanner${CMAKE_EXECUTABLE_SUFFIX}") +try_compile(mocscanner_built "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" COPY_FILE "${_mocscanner}") + +add_executable(qmocscanner IMPORTED GLOBAL) +set_target_properties(qmocscanner PROPERTIES IMPORTED_LOCATION "${_mocscanner}") + +install(PROGRAMS "${_mocscanner}" DESTINATION "${INSTALL_BINDIR}") +add_executable("Qt::qmocscanner" ALIAS "qmocscanner") + +# FIXME: This should get exported to ToolsTargets! diff --git a/src/tools/qmocscanner/main.cpp b/src/tools/qmocscanner/main.cpp new file mode 100644 index 00000000000..3509820c619 --- /dev/null +++ b/src/tools/qmocscanner/main.cpp @@ -0,0 +1,623 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmocscanner application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct ScanResult +{ + std::string fileName; + bool foundMocRelevantMacro = false; + std::vector includedMocFiles; +}; + +struct Option +{ + static int debug_level; +}; +int Option::debug_level = 0; + +static void debug_msg(int level, const char *fmt, ...) +{ + if (level < 3) + return; + va_list ap; + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); +} + +#define qmake_endOfLine(c) (c == '\r' || c == '\n') + +static int skipEscapedLineEnds(const char *buffer, int buffer_len, int offset, int *lines) +{ + // Join physical lines to make logical lines, as in the C preprocessor + while (offset + 1 < buffer_len + && buffer[offset] == '\\' + && qmake_endOfLine(buffer[offset + 1])) { + offset += 2; + ++*lines; + if (offset < buffer_len + && buffer[offset - 1] == '\r' + && buffer[offset] == '\n') // CRLF + offset++; + } + return offset; +} + +static bool matchWhileUnsplitting(const char *buffer, int buffer_len, int start, + const char *needle, int needle_len, + int *matchlen, int *lines) +{ + int x = start; + for (int n = 0; n < needle_len; + n++, x = skipEscapedLineEnds(buffer, buffer_len, x + 1, lines)) { + if (x >= buffer_len || buffer[x] != needle[n]) + return false; + } + // That also skipped any remaining BSNLs immediately after the match. + + // Tell caller how long the match was: + *matchlen = x - start; + + return true; +} + +/* Advance from an opening quote at buffer[offset] to the matching close quote. */ +static int scanPastString(char *buffer, int buffer_len, int offset, int *lines) +{ + // http://en.cppreference.com/w/cpp/language/string_literal + // It might be a C++11 raw string. + bool israw = false; + if (buffer[offset] == '"' && offset > 0) { + int explore = offset - 1; + bool prefix = false; // One of L, U, u or u8 may appear before R + bool saw8 = false; // Partial scan of u8 + while (explore >= 0) { + // Cope with backslash-newline interruptions of the prefix: + if (explore > 0 + && qmake_endOfLine(buffer[explore]) + && buffer[explore - 1] == '\\') { + explore -= 2; + } else if (explore > 1 + && buffer[explore] == '\n' + && buffer[explore - 1] == '\r' + && buffer[explore - 2] == '\\') { + explore -= 3; + // Remaining cases can only decrement explore by one at a time: + } else if (saw8 && buffer[explore] == 'u') { + explore--; + saw8 = false; + prefix = true; + } else if (saw8 || prefix) { + break; + } else if (explore > 1 && buffer[explore] == '8') { + explore--; + saw8 = true; + } else if (buffer[explore] == 'L' + || buffer[explore] == 'U' + || buffer[explore] == 'u') { + explore--; + prefix = true; + } else if (buffer[explore] == 'R') { + if (israw) + break; + explore--; + israw = true; + } else { + break; + } + } + // Check the R (with possible prefix) isn't just part of an identifier: + if (israw && explore >= 0 + && (isalnum(buffer[explore]) || buffer[explore] == '_')) { + israw = false; + } + } + + if (israw) { +#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), lines) + + offset = SKIP_BSNL(offset + 1); + const char *const delim = buffer + offset; + int clean = offset; + while (offset < buffer_len && buffer[offset] != '(') { + if (clean < offset) + buffer[clean++] = buffer[offset]; + else + clean++; + + offset = SKIP_BSNL(offset + 1); + } + /* + Not checking correctness (trust real compiler to do that): + - no controls, spaces, '(', ')', '\\' or (presumably) '"' in delim; + - at most 16 bytes in delim + + Raw strings are surely defined after phase 2, when BSNLs are resolved; + so the delimiter's exclusion of '\\' and space (including newlines) + applies too late to save us the need to cope with BSNLs in it. + */ + + const int delimlen = buffer + clean - delim; + int matchlen = delimlen, extralines = 0; + while ((offset = SKIP_BSNL(offset + 1)) < buffer_len + && (buffer[offset] != ')' + || (delimlen > 0 && + !matchWhileUnsplitting(buffer, buffer_len, + offset + 1, delim, delimlen, + &matchlen, &extralines)) + || buffer[offset + 1 + matchlen] != '"')) { + // skip, but keep track of lines + if (qmake_endOfLine(buffer[offset])) + ++*lines; + extralines = 0; + } + *lines += extralines; // from the match + // buffer[offset] is ')' + offset += 1 + matchlen; // 1 for ')', then delim + // buffer[offset] is '"' + +#undef SKIP_BSNL + } else { // Traditional string or char literal: + const char term = buffer[offset]; + while (++offset < buffer_len && buffer[offset] != term) { + if (buffer[offset] == '\\') + ++offset; + else if (qmake_endOfLine(buffer[offset])) + ++*lines; + } + } + + return offset; +} + +static std::vector findIncludes(const char *fileName, char *buffer, int buffer_len) +{ + std::vector includes; + int line_count = 1; + enum { + /* + States of C preprocessing (for TYPE_C only), after backslash-newline + elimination and skipping comments and spaces (i.e. in ANSI X3.159-1989 + section 2.1.1.2's phase 4). We're about to study buffer[x] to decide + on which transition to do. + */ + AtStart, // start of logical line; a # may start a preprocessor directive + HadHash, // saw a # at start, looking for preprocessor keyword + WantName, // saw #include or #import, waiting for name + InCode // after directive, parsing non-#include directive or in actual code + } cpp_state = AtStart; + + int x = 0; + if (buffer_len >= 3) { + const unsigned char *p = (unsigned char *)buffer; + // skip UTF-8 BOM, if present + if (p[0] == 0xEF && p[1] == 0xBB && p[2] == 0xBF) + x += 3; + } + for (; x < buffer_len; ++x) { + bool try_local = true; + char *inc = nullptr; + // We've studied all buffer[i] for i < x + for (; x < buffer_len; ++x) { + // How to handle backslash-newline (BSNL) pairs: +#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count) + + // Seek code or directive, skipping comments and space: + for (; (x = SKIP_BSNL(x)) < buffer_len; ++x) { + if (buffer[x] == ' ' || buffer[x] == '\t') { + // keep going + } else if (buffer[x] == '/') { + int extralines = 0; + int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines); + if (y >= buffer_len) { + x = y; + break; + } else if (buffer[y] == '/') { // C++-style comment + line_count += extralines; + x = SKIP_BSNL(y + 1); + while (x < buffer_len && !qmake_endOfLine(buffer[x])) + x = SKIP_BSNL(x + 1); // skip + + cpp_state = AtStart; + ++line_count; + } else if (buffer[y] == '*') { // C-style comment + line_count += extralines; + x = y; + while ((x = SKIP_BSNL(++x)) < buffer_len) { + if (buffer[x] == '*') { + extralines = 0; + y = skipEscapedLineEnds(buffer, buffer_len, + x + 1, &extralines); + if (y < buffer_len && buffer[y] == '/') { + line_count += extralines; + x = y; // for loop shall step past this + break; + } + } else if (qmake_endOfLine(buffer[x])) { + ++line_count; + } + } + } else { + // buffer[x] is the division operator + break; + } + } else if (qmake_endOfLine(buffer[x])) { + ++line_count; + cpp_state = AtStart; + } else { + /* Drop out of phases 1, 2, 3, into phase 4 */ + break; + } + } + // Phase 4 study of buffer[x]: + + if (x >= buffer_len) + break; + + switch (cpp_state) { + case HadHash: + { + // Read keyword; buffer[x] starts first preprocessing token after # + const char *const keyword = buffer + x; + int clean = x; + while (x < buffer_len && buffer[x] >= 'a' && buffer[x] <= 'z') { + // skip over keyword, consolidating it if it contains BSNLs + // (see WantName's similar code consolidating inc, below) + if (clean < x) + buffer[clean++] = buffer[x]; + else + clean++; + + x = SKIP_BSNL(x + 1); + } + const int keyword_len = buffer + clean - keyword; + x--; // Still need to study buffer[x] next time round for loop. + + cpp_state = + ((keyword_len == 7 && !strncmp(keyword, "include", 7)) // C & Obj-C + || (keyword_len == 6 && !strncmp(keyword, "import", 6))) // Obj-C + ? WantName : InCode; + break; + } + + case WantName: + { + char term = buffer[x]; + if (term == '<') { + try_local = false; + term = '>'; + } else if (term != '"') { + /* + Possibly malformed, but this may be something like: + #include IDENTIFIER + which does work, if #define IDENTIFIER "filename" is + in effect. This is beyond this noddy preprocessor's + powers of tracking. So give up and resume searching + for a directive. We haven't made sense of buffer[x], + so back up to ensure we do study it (now as code) next + time round the loop. + */ + x--; + cpp_state = InCode; + continue; + } + + x = SKIP_BSNL(x + 1); + inc = buffer + x; + int clean = x; // offset if we need to clear \-newlines + for (; x < buffer_len && buffer[x] != term; x = SKIP_BSNL(x + 1)) { + if (qmake_endOfLine(buffer[x])) { // malformed + cpp_state = AtStart; + ++line_count; + break; + } + + /* + If we do skip any BSNLs, we need to consolidate the + surviving text by copying to lower indices. For that + to be possible, we also have to keep 'clean' advanced + in step with x even when we've yet to see any BSNLs. + */ + if (clean < x) + buffer[clean++] = buffer[x]; + else + clean++; + } + if (cpp_state == WantName) + buffer[clean] = '\0'; + else // i.e. malformed + inc = nullptr; + + cpp_state = InCode; // hereafter + break; + } + + case AtStart: + // Preprocessor directive? + if (buffer[x] == '#') { + cpp_state = HadHash; + break; + } + cpp_state = InCode; + // ... and fall through to handle buffer[x] as such. + case InCode: + // matching quotes (string literals and character literals) + if (buffer[x] == '\'' || buffer[x] == '"') { + x = scanPastString(buffer, buffer_len, x, &line_count); + // for loop's ++x shall step over the closing quote. + } + // else: buffer[x] is just some code; move on. + break; + } + + if (inc) // We were in WantName and found a name. + break; +#undef SKIP_BSNL + } + if (x >= buffer_len) + break; + + if (inc) { + includes.push_back(inc); + } + } + return includes; +} + +static bool isCWordChar(char c) { + return c == '_' + || (c >= 'a' && c <= 'z') + || (c >= 'A' && c <= 'Z') + || (c >= '0' && c <= '9'); +} + +static bool scanBufferForMocRelevantMacros(const char *fileName, char *buffer, int buffer_len) +{ + int line_count = 1; + bool ignore[3] = { false, false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE + /* qmake ignore Q_GADGET */ + /* qmake ignore Q_OBJECT */ + /* qmake ignore Q_NAMESPACE */ + for (int x = 0; x < buffer_len; x++) { +#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count) + x = SKIP_BSNL(x); + if (buffer[x] == '/') { + int extralines = 0; + int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines); + if (buffer_len > y) { + // If comment, advance to the character that ends it: + if (buffer[y] == '/') { // C++-style comment + line_count += extralines; + x = y; + do { + x = SKIP_BSNL(x + 1); + } while (x < buffer_len && !qmake_endOfLine(buffer[x])); + + } else if (buffer[y] == '*') { // C-style comment + line_count += extralines; + x = SKIP_BSNL(y + 1); + for (; x < buffer_len; x = SKIP_BSNL(x + 1)) { + if (buffer[x] == 't' || buffer[x] == 'q') { // ignore + if (buffer_len >= (x + 20) && + !strncmp(buffer + x + 1, "make ignore Q_OBJECT", 20)) { + debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_OBJECT\"", + fileName, line_count); + x += 20; + ignore[0] = true; + } else if (buffer_len >= (x + 20) && + !strncmp(buffer + x + 1, "make ignore Q_GADGET", 20)) { + debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_GADGET\"", + fileName, line_count); + x += 20; + ignore[1] = true; + } else if (buffer_len >= (x + 23) && + !strncmp(buffer + x + 1, "make ignore Q_NAMESPACE", 23)) { + debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_NAMESPACE\"", + fileName, line_count); + x += 23; + ignore[2] = true; + } + } else if (buffer[x] == '*') { + extralines = 0; + y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines); + if (buffer_len > y && buffer[y] == '/') { + line_count += extralines; + x = y; + break; + } + } else if (Option::debug_level && qmake_endOfLine(buffer[x])) { + ++line_count; + } + } + } + // else: don't update x, buffer[x] is just the division operator. + } + } else if (buffer[x] == '\'' || buffer[x] == '"') { + x = scanPastString(buffer, buffer_len, x, &line_count); + // Leaves us on closing quote; for loop's x++ steps us past it. + } + + if (x < buffer_len && Option::debug_level && qmake_endOfLine(buffer[x])) + ++line_count; + if (buffer_len > x + 8 && !isCWordChar(buffer[x])) { + int morelines = 0; + int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &morelines); + if (buffer[y] == 'Q') { + static const char interesting[][12] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE"}; + for (int interest = 0; interest < 3; ++interest) { + if (ignore[interest]) + continue; + + int matchlen = 0, extralines = 0; + size_t needle_len = strlen(interesting[interest]); + assert(needle_len <= INT_MAX); + if (matchWhileUnsplitting(buffer, buffer_len, y, + interesting[interest], + static_cast(needle_len), + &matchlen, &extralines) + && y + matchlen < buffer_len + && !isCWordChar(buffer[y + matchlen])) { + if (Option::debug_level) { + buffer[y + matchlen] = '\0'; + debug_msg(2, "Mocgen: %s:%d Found MOC symbol %s", + fileName, + line_count + morelines, buffer + y); + } + return true; + } + } + } + } +#undef SKIP_BSNL + } + return false; +} + +static bool startsWith(const std::string &str, const char *needle) +{ + return str.find(needle) == 0; +} + +static bool endsWith(const std::string &str, const char *needle) +{ + return str.rfind(needle) == str.size() - strlen(needle); +} + +static std::string fileNameFromPath(const std::string &path) +{ + int separatorIndex = path.rfind("/"); + if (separatorIndex == -1) + return path; + return path.substr(separatorIndex + 1); +} + +static ScanResult scanFile(const std::string &fileName) +{ + ScanResult result; + result.fileName = fileName; + + std::ifstream file(fileName, std::ios::binary); + if (!file.is_open()) + return result; + + file.seekg(0, std::ios_base::end); + auto size = file.tellg(); + if (size == 0) + return result; + file.seekg(0, std::ios_base::beg); + + std::vector buffer; + buffer.resize(size); + char *bufferPtr = &(*buffer.begin()); + file.read(bufferPtr, size); + + file.close(); + + result.foundMocRelevantMacro = scanBufferForMocRelevantMacros(fileName.c_str(), bufferPtr, size); + + for (const auto &include: findIncludes(fileName.c_str(), bufferPtr, size)) { + if (startsWith(include, "moc_") && endsWith(include, ".cpp")) { + std::string mocHeader = include.substr(strlen("moc_"), + include.size() - strlen("moc_") - strlen(".cpp")); + mocHeader.append(".h"); + result.includedMocFiles.push_back(mocHeader); + } else if (endsWith(include, ".moc")) { + std::string mocHeader = include.substr(0, include.size() - strlen(".moc")); + mocHeader.append(".cpp"); + result.includedMocFiles.push_back(mocHeader); + } + } + + return result; +} + +static void writeSetToFile(const char *fileName, const std::set &content) +{ + std::ofstream file(fileName, std::ios::binary); + for (const auto &entry: content) { + const std::string &fileName = entry; + file << fileName << std::endl; + } +} + +int main(int argc, char **argv) +{ + if (argc != 4) { + fprintf(stderr, "usage: %s \n", argv[0]); + return EXIT_FAILURE; + } + + std::vector sourcesAndHeaders; + { + std::ifstream file(argv[1]); + if (!file.is_open()) { + std::cerr << "failed to open input file " << argv[1] << std::endl; + return EXIT_FAILURE; + } + for (std::string line; std::getline(file, line);) + sourcesAndHeaders.push_back(line); + } + + std::unordered_set mocCandidates; + std::unordered_set mocFilesInIncludeStatements; + + for (const auto &sourceOrHeader: sourcesAndHeaders) { + auto result = scanFile(sourceOrHeader); + if (result.foundMocRelevantMacro) + mocCandidates.insert(result.fileName); + for (const auto &header: result.includedMocFiles) + mocFilesInIncludeStatements.insert(header); + } + + std::set mocFilesToInclude; + std::set mocFilesToBuild; + + for (const auto &candidate: mocCandidates) { + std::string fileName = fileNameFromPath(candidate); + if (mocFilesInIncludeStatements.find(fileName) != mocFilesInIncludeStatements.end()) + mocFilesToInclude.insert(candidate); + else + mocFilesToBuild.insert(candidate); + } + + writeSetToFile(argv[2], mocFilesToInclude); + writeSetToFile(argv[3], mocFilesToBuild); + + return EXIT_SUCCESS; +} diff --git a/src/tools/qvkgen/CMakeLists.txt b/src/tools/qvkgen/CMakeLists.txt new file mode 100644 index 00000000000..2e9ab3458bf --- /dev/null +++ b/src/tools/qvkgen/CMakeLists.txt @@ -0,0 +1,5 @@ +##################################################################### +## qvkgen Tool: +##################################################################### + +add_qt_tool(qvkgen SOURCES qvkgen.cpp) diff --git a/src/tools/rcc/CMakeLists.txt b/src/tools/rcc/CMakeLists.txt new file mode 100644 index 00000000000..4a882e78608 --- /dev/null +++ b/src/tools/rcc/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_tool(rcc BOOTSTRAP SOURCES rcc.cpp main.cpp) diff --git a/src/tools/tracegen/CMakeLists.txt b/src/tools/tracegen/CMakeLists.txt new file mode 100644 index 00000000000..85ae0ffef70 --- /dev/null +++ b/src/tools/tracegen/CMakeLists.txt @@ -0,0 +1,10 @@ +add_qt_tool(tracegen BOOTSTRAP + SOURCES + etw.cpp + helpers.cpp + lttng.cpp + panic.cpp + provider.cpp + qtheaders.cpp + tracegen.cpp +) diff --git a/src/tools/uic/CMakeLists.txt b/src/tools/uic/CMakeLists.txt new file mode 100644 index 00000000000..0c40af3540f --- /dev/null +++ b/src/tools/uic/CMakeLists.txt @@ -0,0 +1,16 @@ +add_qt_tool(uic + SOURCES + cpp/cppwritedeclaration.cpp + cpp/cppwriteincludes.cpp + cpp/cppwriteinitialization.cpp + customwidgetsinfo.cpp + databaseinfo.cpp + driver.cpp + main.cpp + treewalker.cpp + ui4.cpp + uic.cpp + validator.cpp + INCLUDE_DIRECTORIES cpp + DEFINES QT_UIC QT_UIC_CPP_GENERATOR +) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt new file mode 100644 index 00000000000..22f6ec4d349 --- /dev/null +++ b/src/widgets/CMakeLists.txt @@ -0,0 +1,612 @@ +# Generated from widgets.pro. + +##################################################################### +## QtWidgets Module: +##################################################################### + +add_qt_module(Widgets + SOURCES + itemviews/qfileiconprovider.cpp itemviews/qfileiconprovider.h itemviews/qfileiconprovider_p.h + kernel/qaction.cpp kernel/qaction.h kernel/qaction_p.h + kernel/qactiongroup.cpp kernel/qactiongroup.h + kernel/qapplication.cpp kernel/qapplication.h kernel/qapplication_p.h + kernel/qboxlayout.cpp kernel/qboxlayout.h + kernel/qdesktopwidget.cpp kernel/qdesktopwidget.h kernel/qdesktopwidget_p.h + kernel/qgesture.cpp kernel/qgesture.h kernel/qgesture_p.h + kernel/qgesturemanager.cpp kernel/qgesturemanager_p.h + kernel/qgesturerecognizer.cpp kernel/qgesturerecognizer.h + kernel/qgridlayout.cpp kernel/qgridlayout.h + kernel/qlayout.cpp kernel/qlayout.h kernel/qlayout_p.h + kernel/qlayoutengine.cpp kernel/qlayoutengine_p.h + kernel/qlayoutitem.cpp kernel/qlayoutitem.h + kernel/qshortcut.cpp kernel/qshortcut.h + kernel/qsizepolicy.cpp kernel/qsizepolicy.h + kernel/qstackedlayout.cpp kernel/qstackedlayout.h + kernel/qstandardgestures.cpp kernel/qstandardgestures_p.h + kernel/qtestsupport_widgets.cpp kernel/qtestsupport_widgets.h + kernel/qtooltip.cpp kernel/qtooltip.h + kernel/qtwidgetsglobal.h kernel/qtwidgetsglobal_p.h + kernel/qwidget.cpp kernel/qwidget.h kernel/qwidget_p.h + kernel/qwidgetaction.cpp kernel/qwidgetaction.h kernel/qwidgetaction_p.h + kernel/qwidgetbackingstore.cpp kernel/qwidgetbackingstore_p.h + kernel/qwidgetsvariant.cpp + kernel/qwidgetwindow.cpp kernel/qwidgetwindow_p.h + kernel/qwindowcontainer.cpp kernel/qwindowcontainer_p.h + styles/qcommonstyle.cpp styles/qcommonstyle.h styles/qcommonstyle_p.h + styles/qcommonstylepixmaps_p.h + styles/qdrawutil.cpp styles/qdrawutil.h + styles/qpixmapstyle.cpp styles/qpixmapstyle_p.h + styles/qpixmapstyle_p_p.h + styles/qproxystyle.cpp styles/qproxystyle.h styles/qproxystyle_p.h + styles/qstyle.cpp styles/qstyle.h styles/qstyle.qrc + styles/qstyleanimation.cpp styles/qstyleanimation_p.h + styles/qstylefactory.cpp styles/qstylefactory.h + styles/qstylehelper.cpp styles/qstylehelper_p.h + styles/qstyleoption.cpp styles/qstyleoption.h + styles/qstylepainter.cpp styles/qstylepainter.h + styles/qstyleplugin.cpp styles/qstyleplugin.h + styles/qstylesheetstyle.cpp styles/qstylesheetstyle_p.h + styles/qstylesheetstyle_default.cpp + util/qcolormap.cpp util/qcolormap.h + util/qsystemtrayicon.cpp util/qsystemtrayicon.h util/qsystemtrayicon_p.h + widgets/qabstractscrollarea.cpp widgets/qabstractscrollarea.h widgets/qabstractscrollarea_p.h + widgets/qfocusframe.cpp widgets/qfocusframe.h + widgets/qframe.cpp widgets/qframe.h widgets/qframe_p.h + widgets/qwidgetanimator.cpp widgets/qwidgetanimator_p.h + DEFINES + QT_NO_USING_NAMESPACE + INCLUDE_DIRECTORIES + dialogs/ + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui +) + +## Scopes: +##################################################################### +# +#extend_target(Widgets CONDITION MSVC +#) +# +#extend_target(Widgets CONDITION (MSVC) AND (equals(QT_ARCH, i386)) +#) +# +#extend_target(Widgets CONDITION APPLE_OSX +#) + +extend_target(Widgets CONDITION (APPLE_OSX) AND (macos) + LIBRARIES + ${FWAppKit} + z +) + +extend_target(Widgets CONDITION ((APPLE_OSX) AND (macos)) AND (*-mwerks) + INCLUDE_DIRECTORIES + compat +) + +extend_target(Widgets CONDITION WIN32 + INCLUDE_DIRECTORIES + ../3rdparty/wintab +) + +extend_target(Widgets CONDITION (WIN32) AND (NOT WINRT) + LIBRARIES + shell32 + uxtheme + dwmapi +) + +extend_target(Widgets CONDITION QT_FEATURE_graphicseffect + SOURCES + effects/qgraphicseffect.cpp effects/qgraphicseffect.h effects/qgraphicseffect_p.h + effects/qpixmapfilter.cpp effects/qpixmapfilter_p.h +) +# +#extend_target(Widgets CONDITION contains(DEFINES,QT_EVAL) +#) +# +#extend_target(Widgets CONDITION testcocoon +#) + +extend_target(Widgets CONDITION macx + SOURCES + kernel/qmacgesturerecognizer.cpp kernel/qmacgesturerecognizer_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_opengl + SOURCES + kernel/qopenglwidget.cpp kernel/qopenglwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_formlayout + SOURCES + kernel/qformlayout.cpp kernel/qformlayout.h +) + +extend_target(Widgets CONDITION QT_FEATURE_whatsthis + SOURCES + kernel/qwhatsthis.cpp kernel/qwhatsthis.h +) + +extend_target(Widgets CONDITION QT_FEATURE_style_windows + SOURCES + styles/qwindowsstyle.cpp styles/qwindowsstyle_p.h + styles/qwindowsstyle_p_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_style_fusion + SOURCES + styles/qfusionstyle.cpp styles/qfusionstyle_p.h + styles/qfusionstyle_p_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_abstractbutton + SOURCES + widgets/qabstractbutton.cpp widgets/qabstractbutton.h widgets/qabstractbutton_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_abstractslider + SOURCES + widgets/qabstractslider.cpp widgets/qabstractslider.h widgets/qabstractslider_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_buttongroup + SOURCES + widgets/qbuttongroup.cpp widgets/qbuttongroup.h widgets/qbuttongroup_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_calendarwidget + SOURCES + widgets/qcalendarwidget.cpp widgets/qcalendarwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_checkbox + SOURCES + widgets/qcheckbox.cpp widgets/qcheckbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_combobox + SOURCES + widgets/qcombobox.cpp widgets/qcombobox.h widgets/qcombobox_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_commandlinkbutton + SOURCES + widgets/qcommandlinkbutton.cpp widgets/qcommandlinkbutton.h +) + +extend_target(Widgets CONDITION QT_FEATURE_datetimeedit + SOURCES + widgets/qdatetimeedit.cpp widgets/qdatetimeedit.h widgets/qdatetimeedit_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dial + SOURCES + widgets/qdial.cpp widgets/qdial.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dockwidget + SOURCES + widgets/qdockarealayout.cpp widgets/qdockarealayout_p.h + widgets/qdockwidget.cpp widgets/qdockwidget.h widgets/qdockwidget_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_effects + SOURCES + widgets/qeffects.cpp widgets/qeffects_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_fontcombobox + SOURCES + widgets/qfontcombobox.cpp widgets/qfontcombobox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_groupbox + SOURCES + widgets/qgroupbox.cpp widgets/qgroupbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_keysequenceedit + SOURCES + widgets/qkeysequenceedit.cpp widgets/qkeysequenceedit.h widgets/qkeysequenceedit_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_label + SOURCES + widgets/qlabel.cpp widgets/qlabel.h widgets/qlabel_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_lcdnumber + SOURCES + widgets/qlcdnumber.cpp widgets/qlcdnumber.h +) + +extend_target(Widgets CONDITION QT_FEATURE_lineedit + SOURCES + widgets/qlineedit.cpp widgets/qlineedit.h widgets/qlineedit_p.cpp widgets/qlineedit_p.h + widgets/qwidgetlinecontrol.cpp widgets/qwidgetlinecontrol_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_mainwindow + SOURCES + widgets/qmainwindow.cpp widgets/qmainwindow.h + widgets/qmainwindowlayout.cpp widgets/qmainwindowlayout_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_mdiarea + SOURCES + widgets/qmdiarea.cpp widgets/qmdiarea.h widgets/qmdiarea_p.h + widgets/qmdisubwindow.cpp widgets/qmdisubwindow.h widgets/qmdisubwindow_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_menu + SOURCES + widgets/qmenu.cpp widgets/qmenu.h widgets/qmenu_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_menubar + SOURCES + widgets/qmenubar.cpp widgets/qmenubar.h widgets/qmenubar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_progressbar + SOURCES + widgets/qprogressbar.cpp widgets/qprogressbar.h +) + +extend_target(Widgets CONDITION QT_FEATURE_pushbutton + SOURCES + widgets/qpushbutton.cpp widgets/qpushbutton.h widgets/qpushbutton_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_radiobutton + SOURCES + widgets/qradiobutton.cpp widgets/qradiobutton.h +) + +extend_target(Widgets CONDITION QT_FEATURE_resizehandler + SOURCES + widgets/qwidgetresizehandler.cpp widgets/qwidgetresizehandler_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dialogbuttonbox + SOURCES + widgets/qdialogbuttonbox.cpp widgets/qdialogbuttonbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_rubberband + SOURCES + widgets/qrubberband.cpp widgets/qrubberband.h +) + +extend_target(Widgets CONDITION QT_FEATURE_scrollarea + SOURCES + widgets/qscrollarea.cpp widgets/qscrollarea.h widgets/qscrollarea_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_scrollbar + SOURCES + widgets/qscrollbar.cpp widgets/qscrollbar.h widgets/qscrollbar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_sizegrip + SOURCES + widgets/qsizegrip.cpp widgets/qsizegrip.h +) + +extend_target(Widgets CONDITION QT_FEATURE_slider + SOURCES + widgets/qslider.cpp widgets/qslider.h +) + +extend_target(Widgets CONDITION QT_FEATURE_spinbox + SOURCES + widgets/qabstractspinbox.cpp widgets/qabstractspinbox.h widgets/qabstractspinbox_p.h + widgets/qspinbox.cpp widgets/qspinbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_splashscreen + SOURCES + widgets/qsplashscreen.cpp widgets/qsplashscreen.h +) + +extend_target(Widgets CONDITION QT_FEATURE_splitter + SOURCES + widgets/qsplitter.cpp widgets/qsplitter.h widgets/qsplitter_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_stackedwidget + SOURCES + widgets/qstackedwidget.cpp widgets/qstackedwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_statusbar + SOURCES + widgets/qstatusbar.cpp widgets/qstatusbar.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tabbar + SOURCES + widgets/qtabbar.cpp widgets/qtabbar.h widgets/qtabbar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_textedit + SOURCES + widgets/qplaintextedit.cpp widgets/qplaintextedit.h widgets/qplaintextedit_p.h + widgets/qtextedit.cpp widgets/qtextedit.h widgets/qtextedit_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_textbrowser + SOURCES + widgets/qtextbrowser.cpp widgets/qtextbrowser.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tabwidget + SOURCES + widgets/qtabwidget.cpp widgets/qtabwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_toolbar + SOURCES + widgets/qtoolbar.cpp widgets/qtoolbar.h widgets/qtoolbar_p.h + widgets/qtoolbararealayout.cpp widgets/qtoolbararealayout_p.h + widgets/qtoolbarlayout.cpp widgets/qtoolbarlayout_p.h + widgets/qtoolbarseparator.cpp widgets/qtoolbarseparator_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_toolbox + SOURCES + widgets/qtoolbox.cpp widgets/qtoolbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_toolbutton + SOURCES + widgets/qtoolbarextension.cpp widgets/qtoolbarextension_p.h + widgets/qtoolbutton.cpp widgets/qtoolbutton.h +) + +extend_target(Widgets CONDITION QT_FEATURE_widgettextcontrol + SOURCES + widgets/qwidgettextcontrol.cpp widgets/qwidgettextcontrol_p.h + widgets/qwidgettextcontrol_p_p.h +) + +extend_target(Widgets CONDITION macx + SOURCES + widgets/qmaccocoaviewcontainer_mac.h widgets/qmaccocoaviewcontainer_mac.mm + widgets/qmacnativewidget_mac.h widgets/qmacnativewidget_mac.mm +) + +extend_target(Widgets CONDITION (macx) AND (QT_FEATURE_menu OR QT_FEATURE_menubar) + SOURCES + widgets/qmenu_mac.mm +) + +extend_target(Widgets CONDITION QT_FEATURE_colordialog + SOURCES + dialogs/qcolordialog.cpp dialogs/qcolordialog.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dialog + SOURCES + dialogs/qdialog.cpp dialogs/qdialog.h dialogs/qdialog_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_errormessage + SOURCES + dialogs/qerrormessage.cpp dialogs/qerrormessage.h +) + +extend_target(Widgets CONDITION QT_FEATURE_filedialog + SOURCES + dialogs/qfiledialog.cpp dialogs/qfiledialog.h dialogs/qfiledialog.ui dialogs/qfiledialog_p.h + dialogs/qsidebar.cpp dialogs/qsidebar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_filesystemmodel + SOURCES + dialogs/qfileinfogatherer.cpp dialogs/qfileinfogatherer_p.h + dialogs/qfilesystemmodel.cpp dialogs/qfilesystemmodel.h dialogs/qfilesystemmodel_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_fontdialog + SOURCES + dialogs/qfontdialog.cpp dialogs/qfontdialog.h dialogs/qfontdialog_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_fscompleter + SOURCES + dialogs/qfscompleter_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_inputdialog + SOURCES + dialogs/qinputdialog.cpp dialogs/qinputdialog.h +) + +extend_target(Widgets CONDITION QT_FEATURE_messagebox + SOURCES + dialogs/qmessagebox.cpp dialogs/qmessagebox.h dialogs/qmessagebox.qrc +) + +extend_target(Widgets CONDITION QT_FEATURE_progressdialog + SOURCES + dialogs/qprogressdialog.cpp dialogs/qprogressdialog.h +) + +extend_target(Widgets CONDITION QT_FEATURE_wizard + SOURCES + dialogs/qwizard.cpp dialogs/qwizard.h +) + +extend_target(Widgets CONDITION (QT_FEATURE_wizard) AND (WIN32) + SOURCES + dialogs/qwizard_win.cpp dialogs/qwizard_win_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_accessibility + SOURCES + accessible/complexwidgets.cpp accessible/complexwidgets_p.h + accessible/qaccessiblemenu.cpp accessible/qaccessiblemenu_p.h + accessible/qaccessiblewidget.cpp accessible/qaccessiblewidget.h + accessible/qaccessiblewidgetfactory.cpp accessible/qaccessiblewidgetfactory_p.h + accessible/qaccessiblewidgets.cpp accessible/qaccessiblewidgets_p.h + accessible/rangecontrols.cpp accessible/rangecontrols_p.h + accessible/simplewidgets.cpp accessible/simplewidgets_p.h +) + +extend_target(Widgets CONDITION (QT_FEATURE_accessibility) AND (QT_FEATURE_itemviews) + SOURCES + accessible/itemviews.cpp accessible/itemviews_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_itemviews + SOURCES + itemviews/qabstractitemdelegate.cpp itemviews/qabstractitemdelegate.h itemviews/qabstractitemdelegate_p.h + itemviews/qabstractitemview.cpp itemviews/qabstractitemview.h itemviews/qabstractitemview_p.h + itemviews/qbsptree.cpp itemviews/qbsptree_p.h + itemviews/qheaderview.cpp itemviews/qheaderview.h itemviews/qheaderview_p.h + itemviews/qitemdelegate.cpp itemviews/qitemdelegate.h + itemviews/qitemeditorfactory.cpp itemviews/qitemeditorfactory.h itemviews/qitemeditorfactory_p.h + itemviews/qstyleditemdelegate.cpp itemviews/qstyleditemdelegate.h + itemviews/qwidgetitemdata_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_columnview + SOURCES + itemviews/qcolumnview.cpp itemviews/qcolumnview.h itemviews/qcolumnview_p.h + itemviews/qcolumnviewgrip.cpp itemviews/qcolumnviewgrip_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_datawidgetmapper + SOURCES + itemviews/qdatawidgetmapper.cpp itemviews/qdatawidgetmapper.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dirmodel + SOURCES + itemviews/qdirmodel.cpp itemviews/qdirmodel.h +) + +extend_target(Widgets CONDITION QT_FEATURE_listview + SOURCES + itemviews/qlistview.cpp itemviews/qlistview.h itemviews/qlistview_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_listwidget + SOURCES + itemviews/qlistwidget.cpp itemviews/qlistwidget.h itemviews/qlistwidget_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tableview + SOURCES + itemviews/qtableview.cpp itemviews/qtableview.h itemviews/qtableview_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tablewidget + SOURCES + itemviews/qtablewidget.cpp itemviews/qtablewidget.h itemviews/qtablewidget_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_treeview + SOURCES + itemviews/qtreeview.cpp itemviews/qtreeview.h itemviews/qtreeview_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_treewidget + SOURCES + itemviews/qtreewidget.cpp itemviews/qtreewidget.h itemviews/qtreewidget_p.h + itemviews/qtreewidgetitemiterator.cpp itemviews/qtreewidgetitemiterator.h +) + +extend_target(Widgets CONDITION QT_FEATURE_graphicsview + SOURCES + graphicsview/qgraph_p.h + graphicsview/qgraphicsanchorlayout.cpp graphicsview/qgraphicsanchorlayout.h graphicsview/qgraphicsanchorlayout_p.cpp graphicsview/qgraphicsanchorlayout_p.h + graphicsview/qgraphicsgridlayout.cpp graphicsview/qgraphicsgridlayout.h + graphicsview/qgraphicsgridlayoutengine.cpp graphicsview/qgraphicsgridlayoutengine_p.h + graphicsview/qgraphicsitem.cpp graphicsview/qgraphicsitem.h graphicsview/qgraphicsitem_p.h + graphicsview/qgraphicsitemanimation.cpp graphicsview/qgraphicsitemanimation.h + graphicsview/qgraphicslayout.cpp graphicsview/qgraphicslayout.h graphicsview/qgraphicslayout_p.cpp graphicsview/qgraphicslayout_p.h + graphicsview/qgraphicslayoutitem.cpp graphicsview/qgraphicslayoutitem.h graphicsview/qgraphicslayoutitem_p.h + graphicsview/qgraphicslayoutstyleinfo.cpp graphicsview/qgraphicslayoutstyleinfo_p.h + graphicsview/qgraphicslinearlayout.cpp graphicsview/qgraphicslinearlayout.h + graphicsview/qgraphicsproxywidget.cpp graphicsview/qgraphicsproxywidget.h graphicsview/qgraphicsproxywidget_p.h + graphicsview/qgraphicsscene.cpp graphicsview/qgraphicsscene.h graphicsview/qgraphicsscene_p.h + graphicsview/qgraphicsscene_bsp.cpp graphicsview/qgraphicsscene_bsp_p.h + graphicsview/qgraphicsscenebsptreeindex.cpp graphicsview/qgraphicsscenebsptreeindex_p.h + graphicsview/qgraphicssceneevent.cpp graphicsview/qgraphicssceneevent.h + graphicsview/qgraphicssceneindex.cpp graphicsview/qgraphicssceneindex_p.h + graphicsview/qgraphicsscenelinearindex.cpp graphicsview/qgraphicsscenelinearindex_p.h + graphicsview/qgraphicstransform.cpp graphicsview/qgraphicstransform.h graphicsview/qgraphicstransform_p.h + graphicsview/qgraphicsview.cpp graphicsview/qgraphicsview.h graphicsview/qgraphicsview_p.h + graphicsview/qgraphicswidget.cpp graphicsview/qgraphicswidget.h graphicsview/qgraphicswidget_p.cpp graphicsview/qgraphicswidget_p.h + graphicsview/qsimplex_p.cpp graphicsview/qsimplex_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_completer + SOURCES + util/qcompleter.cpp util/qcompleter.h util/qcompleter_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_scroller + SOURCES + util/qflickgesture.cpp util/qflickgesture_p.h + util/qscroller.cpp util/qscroller.h util/qscroller_p.h + util/qscrollerproperties.cpp util/qscrollerproperties.h util/qscrollerproperties_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_undocommand + SOURCES + util/qundostack.cpp util/qundostack.h util/qundostack_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_undogroup + SOURCES + util/qundogroup.cpp util/qundogroup.h +) + +extend_target(Widgets CONDITION QT_FEATURE_undoview + SOURCES + util/qundoview.cpp util/qundoview.h +) + +extend_target(Widgets CONDITION QT_FEATURE_xcb + SOURCES + util/qsystemtrayicon_x11.cpp +) + +extend_target(Widgets CONDITION NOT QT_FEATURE_xcb + SOURCES + util/qsystemtrayicon_qpa.cpp +) + +extend_target(Widgets CONDITION APPLE_OSX + SOURCES + util/qscroller_mac.mm +) + +extend_target(Widgets CONDITION QT_FEATURE_statemachine + SOURCES + statemachine/qguistatemachine.cpp +) + +extend_target(Widgets CONDITION QT_FEATURE_qeventtransition + SOURCES + statemachine/qbasickeyeventtransition.cpp statemachine/qbasickeyeventtransition_p.h + statemachine/qbasicmouseeventtransition.cpp statemachine/qbasicmouseeventtransition_p.h + statemachine/qkeyeventtransition.cpp statemachine/qkeyeventtransition.h + statemachine/qmouseeventtransition.cpp statemachine/qmouseeventtransition.h +) + +# Enable Evaluation based on QT_EVAL variable being set from the outside: +extend_target(Widgets CONDITION QT_EVAL LIBRARIES Qt_Evaluation) + + +qt_create_tracepoints(Widgets ./qtwidgets.tracepoints) + +add_qt_docs(./doc/qtwidgets.qdocconf) diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake new file mode 100644 index 00000000000..3fae04b0d21 --- /dev/null +++ b/src/widgets/configure.cmake @@ -0,0 +1,567 @@ + + +#### Inputs + + + +#### Libraries + + + +#### Tests + + + +#### Features + +qt_feature("gtk3" PRIVATE + LABEL "GTK+" + AUTODETECT NOT APPLE + CONDITION QT_FEATURE_glib AND libs.gtk3 OR FIXME +) +qt_feature("style_fusion" PRIVATE + LABEL "Fusion" +) +qt_feature("style_mac" PRIVATE + LABEL "macOS" + CONDITION APPLE_OSX +) +qt_feature("style_windows" PRIVATE + LABEL "Windows" +) +qt_feature("style_windowsvista" PRIVATE + LABEL "WindowsVista" + CONDITION QT_FEATURE_style_windows AND WIN32 AND NOT WINRT AND tests.uxtheme OR FIXME +) +qt_feature("style_android" PRIVATE + LABEL "Android" + AUTODETECT ANDROID +) +qt_feature("style_stylesheet" PUBLIC + SECTION "Styles" + LABEL "QStyleSheetStyle" + PURPOSE "Provides a widget style which is configurable via CSS." + CONDITION QT_FEATURE_style_windows AND QT_FEATURE_properties AND QT_FEATURE_cssparser +) +qt_feature_definition("style_stylesheet" "QT_NO_STYLE_STYLESHEET" NEGATE VALUE "1") +qt_feature("effects" PRIVATE + SECTION "Kernel" + LABEL "Effects" + PURPOSE "Provides special widget effects (e.g. fading and scrolling)." +) +qt_feature("filesystemmodel" PUBLIC + SECTION "File I/O" + LABEL "QFileSystemModel" + PURPOSE "Provides a data model for the local filesystem." + CONDITION QT_FEATURE_itemmodel AND QT_FEATURE_thread +) +qt_feature_definition("filesystemmodel" "QT_NO_FILESYSTEMMODEL" NEGATE VALUE "1") +qt_feature("itemviews" PUBLIC + SECTION "ItemViews" + LABEL "The Model/View Framework" + PURPOSE "Provides the model/view architecture managing the relationship between data and the way it is presented to the user." + CONDITION QT_FEATURE_itemmodel AND QT_FEATURE_scrollarea +) +qt_feature_definition("itemviews" "QT_NO_ITEMVIEWS" NEGATE VALUE "1") +qt_feature("treewidget" PUBLIC + SECTION "Widgets" + LABEL "QTreeWidget" + PURPOSE "Provides views using tree models." + CONDITION QT_FEATURE_treeview +) +qt_feature_definition("treewidget" "QT_NO_TREEWIDGET" NEGATE VALUE "1") +qt_feature("listwidget" PUBLIC + SECTION "Widgets" + LABEL "QListWidget" + PURPOSE "Provides item-based list widgets." + CONDITION QT_FEATURE_listview +) +qt_feature_definition("listwidget" "QT_NO_LISTWIDGET" NEGATE VALUE "1") +qt_feature("tablewidget" PUBLIC + SECTION "Widgets" + LABEL "QTableWidget" + PURPOSE "Provides item-based table views." + CONDITION QT_FEATURE_tableview +) +qt_feature_definition("tablewidget" "QT_NO_TABLEWIDGET" NEGATE VALUE "1") +qt_feature("abstractbutton" PUBLIC + SECTION "Widgets" + LABEL "QAbstractButton" + PURPOSE "Abstract base class of button widgets, providing functionality common to buttons." +) +qt_feature("commandlinkbutton" PUBLIC + SECTION "Widgets" + LABEL "QCommandLinkButton" + PURPOSE "Provides a Vista style command link button." + CONDITION QT_FEATURE_pushbutton +) +qt_feature("datetimeedit" PUBLIC + SECTION "Widgets" + LABEL "QDateTimeEdit" + PURPOSE "Supports editing dates and times." + CONDITION QT_FEATURE_calendarwidget AND QT_FEATURE_datestring AND QT_FEATURE_textdate AND QT_FEATURE_datetimeparser +) +qt_feature_definition("datetimeedit" "QT_NO_DATETIMEEDIT" NEGATE VALUE "1") +qt_feature("stackedwidget" PUBLIC + SECTION "Widgets" + LABEL "QStackedWidget" + PURPOSE "Provides stacked widgets." +) +qt_feature_definition("stackedwidget" "QT_NO_STACKEDWIDGET" NEGATE VALUE "1") +qt_feature("textbrowser" PUBLIC + SECTION "Widgets" + LABEL "QTextBrowser" + PURPOSE "Supports HTML document browsing." + CONDITION QT_FEATURE_textedit +) +qt_feature_definition("textbrowser" "QT_NO_TEXTBROWSER" NEGATE VALUE "1") +qt_feature("splashscreen" PUBLIC + SECTION "Widgets" + LABEL "QSplashScreen" + PURPOSE "Supports splash screens that can be shown during application startup." +) +qt_feature_definition("splashscreen" "QT_NO_SPLASHSCREEN" NEGATE VALUE "1") +qt_feature("splitter" PUBLIC + SECTION "Widgets" + LABEL "QSplitter" + PURPOSE "Provides user controlled splitter widgets." +) +qt_feature_definition("splitter" "QT_NO_SPLITTER" NEGATE VALUE "1") +qt_feature("widgettextcontrol" PRIVATE + SECTION "Widgets" + LABEL "QWidgetTextControl" + PURPOSE "Provides text control functionality to other widgets." +) +qt_feature("label" PUBLIC + SECTION "Widgets" + LABEL "QLabel" + PURPOSE "Provides a text or image display." + CONDITION QT_FEATURE_widgettextcontrol +) +qt_feature("formlayout" PUBLIC + SECTION "Widgets" + LABEL "QFormLayout" + PURPOSE "Manages forms of input widgets and their associated labels." + CONDITION QT_FEATURE_label +) +qt_feature("lcdnumber" PUBLIC + SECTION "Widgets" + LABEL "QLCDNumber" + PURPOSE "Provides LCD-like digits." +) +qt_feature_definition("lcdnumber" "QT_NO_LCDNUMBER" NEGATE VALUE "1") +qt_feature("menu" PUBLIC + SECTION "Widgets" + LABEL "QMenu" + PURPOSE "Provides popup-menus." + CONDITION QT_FEATURE_action AND QT_FEATURE_pushbutton +) +qt_feature_definition("menu" "QT_NO_MENU" NEGATE VALUE "1") +qt_feature("lineedit" PUBLIC + SECTION "Widgets" + LABEL "QLineEdit" + PURPOSE "Provides single-line edits." + CONDITION QT_FEATURE_widgettextcontrol +) +qt_feature_definition("lineedit" "QT_NO_LINEEDIT" NEGATE VALUE "1") +qt_feature("radiobutton" PUBLIC + SECTION "Widgets" + LABEL "QRadioButton" + PURPOSE "Provides a radio button with a text label." + CONDITION QT_FEATURE_abstractbutton +) +qt_feature("spinbox" PUBLIC + SECTION "Widgets" + LABEL "QSpinBox" + PURPOSE "Provides spin boxes handling integers and discrete sets of values." + CONDITION QT_FEATURE_lineedit AND QT_FEATURE_validator +) +qt_feature_definition("spinbox" "QT_NO_SPINBOX" NEGATE VALUE "1") +qt_feature("tabbar" PUBLIC + SECTION "Widgets" + LABEL "QTabBar" + PURPOSE "Provides tab bars, e.g., for use in tabbed dialogs." + CONDITION QT_FEATURE_toolbutton +) +qt_feature_definition("tabbar" "QT_NO_TABBAR" NEGATE VALUE "1") +qt_feature("tabwidget" PUBLIC + SECTION "Widgets" + LABEL "QTabWidget" + PURPOSE "Supports stacking tabbed widgets." + CONDITION QT_FEATURE_tabbar AND QT_FEATURE_stackedwidget +) +qt_feature_definition("tabwidget" "QT_NO_TABWIDGET" NEGATE VALUE "1") +qt_feature("combobox" PUBLIC + SECTION "Widgets" + LABEL "QComboBox" + PURPOSE "Provides drop-down boxes presenting a list of options to the user." + CONDITION QT_FEATURE_lineedit AND QT_FEATURE_standarditemmodel AND QT_FEATURE_listview +) +qt_feature_definition("combobox" "QT_NO_COMBOBOX" NEGATE VALUE "1") +qt_feature("fontcombobox" PUBLIC + SECTION "Widgets" + LABEL "QFontComboBox" + PURPOSE "Provides a combobox that lets the user select a font family." + CONDITION QT_FEATURE_combobox AND QT_FEATURE_stringlistmodel +) +qt_feature_definition("fontcombobox" "QT_NO_FONTCOMBOBOX" NEGATE VALUE "1") +qt_feature("checkbox" PUBLIC + SECTION "Widgets" + LABEL "QCheckBox(" + PURPOSE "Provides a checkbox with a text label." + CONDITION QT_FEATURE_abstractbutton +) +qt_feature("pushbutton" PUBLIC + SECTION "Widgets" + LABEL "QPushButton" + PURPOSE "Provides a command button." + CONDITION QT_FEATURE_abstractbutton AND QT_FEATURE_action +) +qt_feature("toolbutton" PUBLIC + SECTION "Widgets" + LABEL "QToolButton" + PURPOSE "Provides quick-access buttons to commands and options." + CONDITION QT_FEATURE_abstractbutton AND QT_FEATURE_action +) +qt_feature_definition("toolbutton" "QT_NO_TOOLBUTTON" NEGATE VALUE "1") +qt_feature("toolbar" PUBLIC + SECTION "Widgets" + LABEL "QToolBar" + PURPOSE "Provides movable panels containing a set of controls." + CONDITION QT_FEATURE_mainwindow +) +qt_feature_definition("toolbar" "QT_NO_TOOLBAR" NEGATE VALUE "1") +qt_feature("toolbox" PUBLIC + SECTION "Widgets" + LABEL "QToolBox" + PURPOSE "Provides columns of tabbed widget items." + CONDITION QT_FEATURE_toolbutton AND QT_FEATURE_scrollarea +) +qt_feature_definition("toolbox" "QT_NO_TOOLBOX" NEGATE VALUE "1") +qt_feature("groupbox" PUBLIC + SECTION "Widgets" + LABEL "QGroupBox" + PURPOSE "Provides widget grouping boxes with frames." +) +qt_feature_definition("groupbox" "QT_NO_GROUPBOX" NEGATE VALUE "1") +qt_feature("buttongroup" PUBLIC + SECTION "Widgets" + LABEL "QButtonGroup" + PURPOSE "Supports organizing groups of button widgets." + CONDITION QT_FEATURE_abstractbutton AND QT_FEATURE_groupbox +) +qt_feature_definition("buttongroup" "QT_NO_BUTTONGROUP" NEGATE VALUE "1") +qt_feature("mainwindow" PUBLIC + SECTION "Widgets" + LABEL "QMainWindow" + PURPOSE "Provides main application windows." + CONDITION QT_FEATURE_menu AND QT_FEATURE_resizehandler AND QT_FEATURE_toolbutton +) +qt_feature_definition("mainwindow" "QT_NO_MAINWINDOW" NEGATE VALUE "1") +qt_feature("dockwidget" PUBLIC + SECTION "Widgets" + LABEL "QDockwidget" + PURPOSE "Supports docking widgets inside a QMainWindow or floated as a top-level window on the desktop." + CONDITION QT_FEATURE_mainwindow +) +qt_feature_definition("dockwidget" "QT_NO_DOCKWIDGET" NEGATE VALUE "1") +qt_feature("mdiarea" PUBLIC + SECTION "Widgets" + LABEL "QMdiArea" + PURPOSE "Provides an area in which MDI windows are displayed." + CONDITION QT_FEATURE_scrollarea +) +qt_feature_definition("mdiarea" "QT_NO_MDIAREA" NEGATE VALUE "1") +qt_feature("resizehandler" PUBLIC + SECTION "Widgets" + LABEL "QWidgetResizeHandler" + PURPOSE "Provides an internal resize handler for dock widgets." +) +qt_feature_definition("resizehandler" "QT_NO_RESIZEHANDLER" NEGATE VALUE "1") +qt_feature("statusbar" PUBLIC + SECTION "Widgets" + LABEL "QStatusBar" + PURPOSE "Supports presentation of status information." +) +qt_feature_definition("statusbar" "QT_NO_STATUSBAR" NEGATE VALUE "1") +qt_feature("menubar" PUBLIC + SECTION "Widgets" + LABEL "QMenuBar" + PURPOSE "Provides pull-down menu items." + CONDITION QT_FEATURE_menu AND QT_FEATURE_toolbutton +) +qt_feature_definition("menubar" "QT_NO_MENUBAR" NEGATE VALUE "1") +qt_feature("contextmenu" PUBLIC + SECTION "Widgets" + LABEL "Context menus" + PURPOSE "Adds pop-up menus on right mouse click to numerous widgets." + CONDITION QT_FEATURE_menu +) +qt_feature_definition("contextmenu" "QT_NO_CONTEXTMENU" NEGATE VALUE "1") +qt_feature("progressbar" PUBLIC + SECTION "Widgets" + LABEL "QProgressBar" + PURPOSE "Supports presentation of operation progress." +) +qt_feature_definition("progressbar" "QT_NO_PROGRESSBAR" NEGATE VALUE "1") +qt_feature("abstractslider" PUBLIC + SECTION "Widgets" + LABEL "QAbstractSlider" + PURPOSE "Common super class for widgets like QScrollBar, QSlider and QDial." +) +qt_feature("slider" PUBLIC + SECTION "Widgets" + LABEL "QSlider" + PURPOSE "Provides sliders controlling a bounded value." + CONDITION QT_FEATURE_abstractslider +) +qt_feature_definition("slider" "QT_NO_SLIDER" NEGATE VALUE "1") +qt_feature("scrollbar" PUBLIC + SECTION "Widgets" + LABEL "QScrollBar" + PURPOSE "Provides scrollbars allowing the user access parts of a document that is larger than the widget used to display it." + CONDITION QT_FEATURE_slider +) +qt_feature_definition("scrollbar" "QT_NO_SCROLLBAR" NEGATE VALUE "1") +qt_feature("dial" PUBLIC + SECTION "Widgets" + LABEL "QDial" + PURPOSE "Provides a rounded range control, e.g., like a speedometer." + CONDITION QT_FEATURE_slider +) +qt_feature_definition("dial" "QT_NO_DIAL" NEGATE VALUE "1") +qt_feature("scrollarea" PUBLIC + SECTION "Widgets" + LABEL "QScrollArea" + PURPOSE "Supports scrolling views onto widgets." + CONDITION QT_FEATURE_scrollbar +) +qt_feature_definition("scrollarea" "QT_NO_SCROLLAREA" NEGATE VALUE "1") +qt_feature("scroller" PUBLIC + SECTION "Widgets" + LABEL "QScroller" + PURPOSE "Enables kinetic scrolling for any scrolling widget or graphics item." +) +qt_feature("graphicsview" PUBLIC + SECTION "Widgets" + LABEL "QGraphicsView" + PURPOSE "Provides a canvas/sprite framework." + CONDITION QT_FEATURE_scrollarea AND QT_FEATURE_widgettextcontrol +) +qt_feature_definition("graphicsview" "QT_NO_GRAPHICSVIEW" NEGATE VALUE "1") +qt_feature("graphicseffect" PUBLIC + SECTION "Widgets" + LABEL "QGraphicsEffect" + PURPOSE "Provides various graphics effects." + CONDITION QT_FEATURE_graphicsview +) +qt_feature_definition("graphicseffect" "QT_NO_GRAPHICSEFFECT" NEGATE VALUE "1") +qt_feature("textedit" PUBLIC + SECTION "Widgets" + LABEL "QTextEdit" + PURPOSE "Supports rich text editing." + CONDITION QT_FEATURE_scrollarea AND QT_FEATURE_properties AND QT_FEATURE_widgettextcontrol +) +qt_feature_definition("textedit" "QT_NO_TEXTEDIT" NEGATE VALUE "1") +qt_feature("syntaxhighlighter" PUBLIC + SECTION "Widgets" + LABEL "QSyntaxHighlighter" + PURPOSE "Supports custom syntax highlighting." + CONDITION QT_FEATURE_textedit +) +qt_feature_definition("syntaxhighlighter" "QT_NO_SYNTAXHIGHLIGHTER" NEGATE VALUE "1") +qt_feature("rubberband" PUBLIC + SECTION "Widgets" + LABEL "QRubberBand" + PURPOSE "Supports using rubberbands to indicate selections and boundaries." +) +qt_feature_definition("rubberband" "QT_NO_RUBBERBAND" NEGATE VALUE "1") +qt_feature("tooltip" PUBLIC + SECTION "Widgets" + LABEL "QToolTip" + PURPOSE "Supports presentation of tooltips." + CONDITION QT_FEATURE_label +) +qt_feature_definition("tooltip" "QT_NO_TOOLTIP" NEGATE VALUE "1") +qt_feature("statustip" PUBLIC + SECTION "Widgets" + LABEL "Status Tip" + PURPOSE "Supports status tip functionality and events." +) +qt_feature_definition("statustip" "QT_NO_STATUSTIP" NEGATE VALUE "1") +qt_feature("sizegrip" PUBLIC + SECTION "Widgets" + LABEL "QSizeGrip" + PURPOSE "Provides corner-grips for resizing top-level windows." +) +qt_feature_definition("sizegrip" "QT_NO_SIZEGRIP" NEGATE VALUE "1") +qt_feature("calendarwidget" PUBLIC + SECTION "Widgets" + LABEL "QCalendarWidget" + PURPOSE "Provides a monthly based calendar widget allowing the user to select a date." + CONDITION ( QT_FEATURE_label ) AND ( QT_FEATURE_menu ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_spinbox ) AND ( QT_FEATURE_tableview ) AND ( QT_FEATURE_textdate ) AND ( QT_FEATURE_toolbutton ) +) +qt_feature_definition("calendarwidget" "QT_NO_CALENDARWIDGET" NEGATE VALUE "1") +qt_feature("keysequenceedit" PUBLIC + SECTION "Widgets" + LABEL "QKeySequenceEdit" + PURPOSE "Provides a widget for editing QKeySequences." + CONDITION QT_FEATURE_lineedit AND QT_FEATURE_shortcut +) +qt_feature_definition("keysequenceedit" "QT_NO_KEYSEQUENCEEDIT" NEGATE VALUE "1") +qt_feature("dialog" PUBLIC + SECTION "Dialogs" + LABEL "QDialog" + PURPOSE "Base class of dialog windows." +) +qt_feature("dialogbuttonbox" PUBLIC + SECTION "Dialogs" + LABEL "QDialogButtonBox" + PURPOSE "Presents buttons in a layout that is appropriate for the current widget style." + CONDITION QT_FEATURE_dialog AND QT_FEATURE_pushbutton +) +qt_feature("messagebox" PUBLIC + SECTION "Dialogs" + LABEL "QMessageBox" + PURPOSE "Provides message boxes displaying informative messages and simple questions." + CONDITION ( QT_FEATURE_checkbox ) AND ( QT_FEATURE_dialog ) AND ( QT_FEATURE_dialogbuttonbox ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_pushbutton ) +) +qt_feature_definition("messagebox" "QT_NO_MESSAGEBOX" NEGATE VALUE "1") +qt_feature("colordialog" PUBLIC + SECTION "Dialogs" + LABEL "QColorDialog" + PURPOSE "Provides a dialog widget for specifying colors." + CONDITION ( QT_FEATURE_dialog ) AND ( QT_FEATURE_dialogbuttonbox ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_spinbox ) +) +qt_feature_definition("colordialog" "QT_NO_COLORDIALOG" NEGATE VALUE "1") +qt_feature("filedialog" PUBLIC + SECTION "Dialogs" + LABEL "QFileDialog" + PURPOSE "Provides a dialog widget for selecting files or directories." + CONDITION ( QT_FEATURE_buttongroup ) AND ( QT_FEATURE_combobox ) AND ( QT_FEATURE_dialog ) AND ( QT_FEATURE_dialogbuttonbox ) AND ( QT_FEATURE_dirmodel ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_proxymodel ) AND ( QT_FEATURE_splitter ) AND ( QT_FEATURE_stackedwidget ) AND ( QT_FEATURE_treeview ) AND ( QT_FEATURE_toolbutton ) +) +qt_feature_definition("filedialog" "QT_NO_FILEDIALOG" NEGATE VALUE "1") +qt_feature("fontdialog" PUBLIC + SECTION "Dialogs" + LABEL "QFontDialog" + PURPOSE "Provides a dialog widget for selecting fonts." + CONDITION ( QT_FEATURE_checkbox ) AND ( QT_FEATURE_combobox ) AND ( QT_FEATURE_dialog ) AND ( QT_FEATURE_dialogbuttonbox ) AND ( QT_FEATURE_groupbox ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_stringlistmodel ) AND ( QT_FEATURE_validator ) +) +qt_feature_definition("fontdialog" "QT_NO_FONTDIALOG" NEGATE VALUE "1") +qt_feature("progressdialog" PUBLIC + SECTION "Dialogs" + LABEL "QProgressDialog" + PURPOSE "Provides feedback on the progress of a slow operation." + CONDITION ( QT_FEATURE_dialog ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_progressbar ) +) +qt_feature_definition("progressdialog" "QT_NO_PROGRESSDIALOG" NEGATE VALUE "1") +qt_feature("inputdialog" PUBLIC + SECTION "Dialogs" + LABEL "QInputDialog" + PURPOSE "Provides a simple convenience dialog to get a single value from the user." + CONDITION ( QT_FEATURE_combobox ) AND ( QT_FEATURE_dialog ) AND ( QT_FEATURE_dialogbuttonbox ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_spinbox ) AND ( QT_FEATURE_stackedwidget ) AND ( QT_FEATURE_textedit ) +) +qt_feature_definition("inputdialog" "QT_NO_INPUTDIALOG" NEGATE VALUE "1") +qt_feature("errormessage" PUBLIC + SECTION "Dialogs" + LABEL "QErrorMessage" + PURPOSE "Provides an error message display dialog." + CONDITION ( QT_FEATURE_checkbox ) AND ( QT_FEATURE_dialog ) AND ( QT_FEATURE_textedit ) AND ( QT_FEATURE_label ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_textedit ) +) +qt_feature_definition("errormessage" "QT_NO_ERRORMESSAGE" NEGATE VALUE "1") +qt_feature("wizard" PUBLIC + SECTION "Dialogs" + LABEL "QWizard" + PURPOSE "Provides a framework for multi-page click-through dialogs." + CONDITION ( QT_FEATURE_dialog ) AND ( QT_FEATURE_pushbutton ) AND ( QT_FEATURE_properties ) AND ( QT_FEATURE_label ) +) +qt_feature_definition("wizard" "QT_NO_WIZARD" NEGATE VALUE "1") +qt_feature("dirmodel" PUBLIC + SECTION "ItemViews" + LABEL "QDirModel" + PURPOSE "Provides a data model for the local filesystem." + CONDITION QT_FEATURE_itemviews AND QT_FEATURE_filesystemmodel +) +qt_feature_definition("dirmodel" "QT_NO_DIRMODEL" NEGATE VALUE "1") +qt_feature("listview" PUBLIC + SECTION "ItemViews" + LABEL "QListView" + PURPOSE "Provides a list or icon view onto a model." + CONDITION QT_FEATURE_itemviews +) +qt_feature_definition("listview" "QT_NO_LISTVIEW" NEGATE VALUE "1") +qt_feature("tableview" PUBLIC + SECTION "ItemViews" + LABEL "QTableView" + PURPOSE "Provides a default model/view implementation of a table view." + CONDITION QT_FEATURE_itemviews +) +qt_feature_definition("tableview" "QT_NO_TABLEVIEW" NEGATE VALUE "1") +qt_feature("treeview" PUBLIC + SECTION "ItemViews" + LABEL "QTreeView" + PURPOSE "Provides a default model/view implementation of a tree view." + CONDITION QT_FEATURE_itemviews +) +qt_feature_definition("treeview" "QT_NO_TREEVIEW" NEGATE VALUE "1") +qt_feature("datawidgetmapper" PUBLIC + SECTION "ItemViews" + LABEL "QDataWidgetMapper" + PURPOSE "Provides mapping between a section of a data model to widgets." + CONDITION QT_FEATURE_itemviews AND QT_FEATURE_properties +) +qt_feature_definition("datawidgetmapper" "QT_NO_DATAWIDGETMAPPER" NEGATE VALUE "1") +qt_feature("columnview" PUBLIC + SECTION "ItemViews" + LABEL "QColumnView" + PURPOSE "Provides a model/view implementation of a column view." + CONDITION QT_FEATURE_listview +) +qt_feature_definition("columnview" "QT_NO_COLUMNVIEW" NEGATE VALUE "1") +qt_feature("paint_debug" PUBLIC + SECTION "Painting" + LABEL "Painting Debug Utilities" + PURPOSE "Enabled debugging painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT." +) +qt_feature_definition("paint_debug" "QT_NO_PAINT_DEBUG" NEGATE VALUE "1") +qt_feature("completer" PUBLIC + SECTION "Utilities" + LABEL "QCompleter" + PURPOSE "Provides completions based on an item model." + CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_itemviews +) +qt_feature_definition("completer" "QT_NO_COMPLETER" NEGATE VALUE "1") +qt_feature("fscompleter" PUBLIC + SECTION "Utilities" + LABEL "QFSCompleter" + PURPOSE "Provides file name completion in QFileDialog." + CONDITION QT_FEATURE_filesystemmodel AND QT_FEATURE_completer +) +qt_feature_definition("fscompleter" "QT_NO_FSCOMPLETER" NEGATE VALUE "1") +qt_feature("undocommand" PUBLIC + SECTION "Utilities" + LABEL "QUndoCommand" + PURPOSE "Applies (redo or) undo of a single change in a document." +) +qt_feature_definition("undocommand" "QT_NO_UNDOCOMMAND" NEGATE VALUE "1") +qt_feature("undostack" PUBLIC + SECTION "Utilities" + LABEL "QUndoStack" + PURPOSE "Provides the ability to (redo or) undo a list of changes in a document." + CONDITION QT_FEATURE_undocommand +) +qt_feature_definition("undostack" "QT_NO_UNDOSTACK" NEGATE VALUE "1") +qt_feature("undogroup" PUBLIC + SECTION "Utilities" + LABEL "QUndoGroup" + PURPOSE "Provides the ability to cluster QUndoCommands." + CONDITION QT_FEATURE_undostack +) +qt_feature_definition("undogroup" "QT_NO_UNDOGROUP" NEGATE VALUE "1") +qt_feature("undoview" PUBLIC + SECTION "Utilities" + LABEL "QUndoView" + PURPOSE "Provides a widget which shows the contents of an undo stack." + CONDITION QT_FEATURE_undostack AND QT_FEATURE_listview +) +qt_feature_definition("undoview" "QT_NO_UNDOVIEW" NEGATE VALUE "1") diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt new file mode 100644 index 00000000000..ae045ae76e1 --- /dev/null +++ b/src/xml/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from xml.pro. + +##################################################################### +## QtXml Module: +##################################################################### + +add_qt_module(Xml + SOURCES + dom/qdom.cpp dom/qdom.h + qtxmlglobal.h + sax/qxml.cpp sax/qxml.h sax/qxml_p.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + +## Scopes: +##################################################################### + +### FIXME +# extend_target(Xml CONDITION (MSVC) AND (TEST_architecture_arch STREQUAL i386)) +# SOURCES +# ### FIXME: QMAKE_LFLAGS += /BASE:0x61000000 +# ) + +add_qt_docs(./doc/qtxml.qdocconf) diff --git a/src/xml/configure.cmake b/src/xml/configure.cmake new file mode 100644 index 00000000000..25a7de5aa20 --- /dev/null +++ b/src/xml/configure.cmake @@ -0,0 +1,22 @@ + + +#### Inputs + + + +#### Libraries + + + +#### Tests + + + +#### Features + +qt_feature("dom" PUBLIC + SECTION "File I/O" + LABEL "DOM" + PURPOSE "Supports the Document Object Model." +) +qt_feature_definition("dom" "QT_NO_DOM" NEGATE VALUE "1") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 00000000000..0653827192a --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(auto) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt new file mode 100644 index 00000000000..5ee23c0023e --- /dev/null +++ b/tests/auto/CMakeLists.txt @@ -0,0 +1,55 @@ +# Generated from auto.pro. + +if (NOT APPLE_UIKIT) + add_subdirectory("corelib") +endif() +if (QT_FEATURE_dbus) + set(run_dbus_tests ON) + if(NOT CMAKE_CROSSCOMPILING AND TARGET Qt::DBus) + execute_process(COMMAND dbus-send --session --type=signal / local.AutotestCheck.Hello + RESULT_VARIABLE dbus_session_test + OUTPUT_QUIET ERROR_QUIET) + if(NOT "${dbus_session_test}" STREQUAL "0") + set(run_dbus_tests OFF) + if(QT_FEATURE_dbus_linked) + message(SEND_ERROR "QtDBus is enabled but session bus is not available for testing. Please check the installation.") + else() + message(WARNING "QtDBus is enabled with runtime support, but session bus is not available. Skipping QtDBus tests.") + endif() + endif() + endif() + if(run_dbus_tests) + add_subdirectory("dbus") + endif() +endif() +if (NOT APPLE_UIKIT AND QT_FEATURE_gui) + add_subdirectory("gui") +endif() +if (QT_FEATURE_network AND NOT WINRT) +# add_subdirectory("network") +endif() +if (TARGET Qt::OpenGL AND NOT WINRT) + add_subdirectory("opengl") +endif() +if (QT_FEATURE_sql) +# add_subdirectory("sql") +endif() +add_subdirectory("testlib") +if (NOT CMAKE_CROSSCOMPILE AND QT_FEATURE_process) +# add_subdirectory("tools") +endif() +if (QT_FEATURE_xml) +# add_subdirectory("xml") +endif() +if (QT_FEATURE_concurrent) +# add_subdirectory("concurrent") +endif() +# add_subdirectory("other") +if (QT_FEATURE_widgets) + add_subdirectory("widgets") +endif() +if (QT_FEATURE_printsupport) +# add_subdirectory("printsupport") +endif() +# add_subdirectory("cmake") ## FIXME: Does this still make sense in this form? +# add_subdirectory("installed_cmake") ## FIXME: Does this still make sense in this form? diff --git a/tests/auto/corelib/CMakeLists.txt b/tests/auto/corelib/CMakeLists.txt new file mode 100644 index 00000000000..1625488909a --- /dev/null +++ b/tests/auto/corelib/CMakeLists.txt @@ -0,0 +1,12 @@ +add_subdirectory(animation) +add_subdirectory(codecs) +add_subdirectory(global) +add_subdirectory(io) +add_subdirectory(itemmodels) +add_subdirectory(kernel) +add_subdirectory(mimetypes) +add_subdirectory(serialization) +add_subdirectory(statemachine) +add_subdirectory(thread) +add_subdirectory(tools) + diff --git a/tests/auto/corelib/animation/CMakeLists.txt b/tests/auto/corelib/animation/CMakeLists.txt new file mode 100644 index 00000000000..ed238bb4f7e --- /dev/null +++ b/tests/auto/corelib/animation/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(qabstractanimation) +add_subdirectory(qanimationgroup) +add_subdirectory(qparallelanimationgroup) +add_subdirectory(qpauseanimation) +add_subdirectory(qsequentialanimationgroup) +add_subdirectory(qvariantanimation) diff --git a/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt b/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt new file mode 100644 index 00000000000..5a9bb29f18f --- /dev/null +++ b/tests/auto/corelib/animation/qabstractanimation/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qabstractanimation SOURCES tst_qabstractanimation.cpp) diff --git a/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt new file mode 100644 index 00000000000..82f50b8f75c --- /dev/null +++ b/tests/auto/corelib/animation/qanimationgroup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qanimationgroup SOURCES tst_qanimationgroup.cpp) diff --git a/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt new file mode 100644 index 00000000000..798e49b0c0a --- /dev/null +++ b/tests/auto/corelib/animation/qparallelanimationgroup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qparallelanimationgroup SOURCES tst_qparallelanimationgroup.cpp) diff --git a/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt b/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt new file mode 100644 index 00000000000..a960722b870 --- /dev/null +++ b/tests/auto/corelib/animation/qpauseanimation/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpauseanimation SOURCES tst_qpauseanimation.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt b/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt new file mode 100644 index 00000000000..da5d3cfe6a7 --- /dev/null +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsequentialanimationgroup SOURCES tst_qsequentialanimationgroup.cpp) diff --git a/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt b/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt new file mode 100644 index 00000000000..de548e07ff1 --- /dev/null +++ b/tests/auto/corelib/animation/qvariantanimation/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qvariantanimation SOURCES tst_qvariantanimation.cpp) diff --git a/tests/auto/corelib/codecs/CMakeLists.txt b/tests/auto/corelib/codecs/CMakeLists.txt new file mode 100644 index 00000000000..272b19f5f87 --- /dev/null +++ b/tests/auto/corelib/codecs/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(qtextcodec) +add_subdirectory(utf8) + diff --git a/tests/auto/corelib/codecs/qtextcodec/CMakeLists.txt b/tests/auto/corelib/codecs/qtextcodec/CMakeLists.txt new file mode 100644 index 00000000000..09b46eaa1d8 --- /dev/null +++ b/tests/auto/corelib/codecs/qtextcodec/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test(tst_qtextcodec SOURCES tst_qtextcodec.cpp) + +if(UNIX) + add_subdirectory(echo) +endif() diff --git a/tests/auto/corelib/codecs/qtextcodec/echo/CMakeLists.txt b/tests/auto/corelib/codecs/qtextcodec/echo/CMakeLists.txt new file mode 100644 index 00000000000..bfc7d39b5e2 --- /dev/null +++ b/tests/auto/corelib/codecs/qtextcodec/echo/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test_helper(echo_helper SOURCES main.cpp LIBRARIES Qt::Core) diff --git a/tests/auto/corelib/codecs/utf8/CMakeLists.txt b/tests/auto/corelib/codecs/utf8/CMakeLists.txt new file mode 100644 index 00000000000..69825823f41 --- /dev/null +++ b/tests/auto/corelib/codecs/utf8/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_utf8 SOURCES tst_utf8.cpp utf8data.cpp) diff --git a/tests/auto/corelib/global/CMakeLists.txt b/tests/auto/corelib/global/CMakeLists.txt new file mode 100644 index 00000000000..58e083d6655 --- /dev/null +++ b/tests/auto/corelib/global/CMakeLists.txt @@ -0,0 +1,12 @@ +add_subdirectory(q_func_info) +add_subdirectory(qflags) +add_subdirectory(qfloat16) +add_subdirectory(qgetputenv) +add_subdirectory(qglobalstatic) +add_subdirectory(qhooks) +add_subdirectory(qlogging) +add_subdirectory(qnumeric) +add_subdirectory(qrand) +add_subdirectory(qrandomgenerator) +add_subdirectory(qtendian) + diff --git a/tests/auto/corelib/global/q_func_info/CMakeLists.txt b/tests/auto/corelib/global/q_func_info/CMakeLists.txt new file mode 100644 index 00000000000..a8384a17a78 --- /dev/null +++ b/tests/auto/corelib/global/q_func_info/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_q_func_info SOURCES tst_q_func_info.cpp) diff --git a/tests/auto/corelib/global/qflags/CMakeLists.txt b/tests/auto/corelib/global/qflags/CMakeLists.txt new file mode 100644 index 00000000000..c464dd0aab9 --- /dev/null +++ b/tests/auto/corelib/global/qflags/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qflags SOURCES tst_qflags.cpp) diff --git a/tests/auto/corelib/global/qfloat16/CMakeLists.txt b/tests/auto/corelib/global/qfloat16/CMakeLists.txt new file mode 100644 index 00000000000..272215216d0 --- /dev/null +++ b/tests/auto/corelib/global/qfloat16/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qfloat16 SOURCES tst_qfloat16.cpp) diff --git a/tests/auto/corelib/global/qgetputenv/CMakeLists.txt b/tests/auto/corelib/global/qgetputenv/CMakeLists.txt new file mode 100644 index 00000000000..390263691b0 --- /dev/null +++ b/tests/auto/corelib/global/qgetputenv/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qgetputenv SOURCES tst_qgetputenv.cpp) diff --git a/tests/auto/corelib/global/qglobal/CMakeLists.txt b/tests/auto/corelib/global/qglobal/CMakeLists.txt new file mode 100644 index 00000000000..129a35157a2 --- /dev/null +++ b/tests/auto/corelib/global/qglobal/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qglobal SOURCES tst_qglobal.cpp qglobal.c) diff --git a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt new file mode 100644 index 00000000000..3aa4511d6f2 --- /dev/null +++ b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test(tst_qglobalstatic + SOURCES + tst_qglobalstatic.cpp + DEFINES + SRCDIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\" + LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/global/qhooks/CMakeLists.txt b/tests/auto/corelib/global/qhooks/CMakeLists.txt new file mode 100644 index 00000000000..24122530609 --- /dev/null +++ b/tests/auto/corelib/global/qhooks/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qhooks SOURCES tst_qhooks.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/global/qlogging/CMakeLists.txt b/tests/auto/corelib/global/qlogging/CMakeLists.txt new file mode 100644 index 00000000000..05b5bdb63b3 --- /dev/null +++ b/tests/auto/corelib/global/qlogging/CMakeLists.txt @@ -0,0 +1,10 @@ +if(NOT WINRT) + add_qt_test_helper(qlogging_helper SOURCES app/main.cpp DEFINES QT_MESSAGELOGCONTEXT LIBRARIES Qt::Core) +endif() + +add_qt_test(tst_qlogging SOURCES tst_qlogging.cpp + DEFINES + QT_MESSAGELOGCONTEXT + QT_DISABLE_DEPRECATED_BEFORE=0 + HELPER_BINARY="qlogging_helper" +) diff --git a/tests/auto/corelib/global/qnumeric/CMakeLists.txt b/tests/auto/corelib/global/qnumeric/CMakeLists.txt new file mode 100644 index 00000000000..ebd05c14895 --- /dev/null +++ b/tests/auto/corelib/global/qnumeric/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qnumeric SOURCES tst_qnumeric.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/global/qrand/CMakeLists.txt b/tests/auto/corelib/global/qrand/CMakeLists.txt new file mode 100644 index 00000000000..4fccf1b0daf --- /dev/null +++ b/tests/auto/corelib/global/qrand/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qrand SOURCES tst_qrand.cpp) diff --git a/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt b/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt new file mode 100644 index 00000000000..e742537bf8f --- /dev/null +++ b/tests/auto/corelib/global/qrandomgenerator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qrandomgenerator SOURCES tst_qrandomgenerator.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/global/qtendian/CMakeLists.txt b/tests/auto/corelib/global/qtendian/CMakeLists.txt new file mode 100644 index 00000000000..91b5c131623 --- /dev/null +++ b/tests/auto/corelib/global/qtendian/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qtendian SOURCES tst_qtendian.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt new file mode 100644 index 00000000000..3cebec6d9da --- /dev/null +++ b/tests/auto/corelib/io/CMakeLists.txt @@ -0,0 +1,12 @@ +add_subdirectory(largefile) +add_subdirectory(qbuffer) +add_subdirectory(qdataurl) +add_subdirectory(qfilesystementry) +add_subdirectory(qfilesystemwatcher) +add_subdirectory(qipaddress) +# add_subdirectory(qloggingcategory) +add_subdirectory(qnodebug) +add_subdirectory(qprocessenvironment) +add_subdirectory(qstorageinfo) +add_subdirectory(qurlquery) + diff --git a/tests/auto/corelib/io/largefile/CMakeLists.txt b/tests/auto/corelib/io/largefile/CMakeLists.txt new file mode 100644 index 00000000000..d85cfd73b46 --- /dev/null +++ b/tests/auto/corelib/io/largefile/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_largefile SOURCES + tst_largefile.cpp + ../../../../shared/emulationdetector.h + INCLUDE_DIRECTORIES + ../../../../shared/ +) diff --git a/tests/auto/corelib/io/qbuffer/CMakeLists.txt b/tests/auto/corelib/io/qbuffer/CMakeLists.txt new file mode 100644 index 00000000000..3ed97382175 --- /dev/null +++ b/tests/auto/corelib/io/qbuffer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qbuffer SOURCES tst_qbuffer.cpp) diff --git a/tests/auto/corelib/io/qdataurl/CMakeLists.txt b/tests/auto/corelib/io/qdataurl/CMakeLists.txt new file mode 100644 index 00000000000..d24b18dfc92 --- /dev/null +++ b/tests/auto/corelib/io/qdataurl/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qdataurl SOURCES tst_qdataurl.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt b/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt new file mode 100644 index 00000000000..58c859dc2ef --- /dev/null +++ b/tests/auto/corelib/io/qfilesystementry/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test(tst_qfilesystementry SOURCES + tst_qfilesystementry.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystementry.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystementry_p.h + LIBRARIES + Qt::CorePrivate +) diff --git a/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt b/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt new file mode 100644 index 00000000000..978f87acab4 --- /dev/null +++ b/tests/auto/corelib/io/qfilesystemwatcher/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qfilesystemwatcher SOURCES tst_qfilesystemwatcher.cpp) diff --git a/tests/auto/corelib/io/qipaddress/CMakeLists.txt b/tests/auto/corelib/io/qipaddress/CMakeLists.txt new file mode 100644 index 00000000000..c60bae1c217 --- /dev/null +++ b/tests/auto/corelib/io/qipaddress/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qipaddress SOURCES tst_qipaddress.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt b/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt new file mode 100644 index 00000000000..00b807eebaf --- /dev/null +++ b/tests/auto/corelib/io/qloggingcategory/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qloggingcategory SOURCES tst_qloggingcategory.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/io/qnodebug/CMakeLists.txt b/tests/auto/corelib/io/qnodebug/CMakeLists.txt new file mode 100644 index 00000000000..15e46596f49 --- /dev/null +++ b/tests/auto/corelib/io/qnodebug/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qnodebug SOURCES tst_qnodebug.cpp) diff --git a/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt b/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt new file mode 100644 index 00000000000..68c6a9936f6 --- /dev/null +++ b/tests/auto/corelib/io/qprocessenvironment/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qprocessenvironment SOURCES tst_qprocessenvironment.cpp) diff --git a/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt b/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt new file mode 100644 index 00000000000..16e4415bc5d --- /dev/null +++ b/tests/auto/corelib/io/qstorageinfo/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstorageinfo SOURCES tst_qstorageinfo.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/io/qurlquery/CMakeLists.txt b/tests/auto/corelib/io/qurlquery/CMakeLists.txt new file mode 100644 index 00000000000..88fd621720a --- /dev/null +++ b/tests/auto/corelib/io/qurlquery/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qurlquery SOURCES tst_qurlquery.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/itemmodels/CMakeLists.txt b/tests/auto/corelib/itemmodels/CMakeLists.txt new file mode 100644 index 00000000000..3f47845905e --- /dev/null +++ b/tests/auto/corelib/itemmodels/CMakeLists.txt @@ -0,0 +1,4 @@ +# add_subdirectory(qabstractproxymodel) +# add_subdirectory(qitemselectionmodel) +add_subdirectory(qstringlistmodel) + diff --git a/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt new file mode 100644 index 00000000000..7f2e10cf65e --- /dev/null +++ b/tests/auto/corelib/itemmodels/qabstractproxymodel/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qabstractproxymodel SOURCES tst_qabstractproxymodel.cpp) diff --git a/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt new file mode 100644 index 00000000000..03c2ddede18 --- /dev/null +++ b/tests/auto/corelib/itemmodels/qitemselectionmodel/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qitemselectionmodel SOURCES tst_qitemselectionmodel.cpp) diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt b/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt new file mode 100644 index 00000000000..1cec8344236 --- /dev/null +++ b/tests/auto/corelib/itemmodels/qstringlistmodel/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qt_test(tst_qstringlistmodel SOURCES + qmodellistener.h + tst_qstringlistmodel.cpp +) diff --git a/tests/auto/corelib/kernel/CMakeLists.txt b/tests/auto/corelib/kernel/CMakeLists.txt new file mode 100644 index 00000000000..208cd89ca73 --- /dev/null +++ b/tests/auto/corelib/kernel/CMakeLists.txt @@ -0,0 +1,13 @@ +add_subdirectory(qdeadlinetimer) +add_subdirectory(qelapsedtimer) +add_subdirectory(qeventdispatcher) +add_subdirectory(qmath) +add_subdirectory(qmetaenum) +add_subdirectory(qmetamethod) +add_subdirectory(qmetaobject) +add_subdirectory(qmetaobjectbuilder) +add_subdirectory(qmetaproperty) +# add_subdirectory(qmimedata) +add_subdirectory(qsignalmapper) +# add_subdirectory(qwineventnotifier) + diff --git a/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt b/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt new file mode 100644 index 00000000000..0bf39130c2c --- /dev/null +++ b/tests/auto/corelib/kernel/qdeadlinetimer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qdeadlinetimer SOURCES tst_qdeadlinetimer.cpp) diff --git a/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt b/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt new file mode 100644 index 00000000000..7a937730ab7 --- /dev/null +++ b/tests/auto/corelib/kernel/qelapsedtimer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qelapsedtimer SOURCES tst_qelapsedtimer.cpp) diff --git a/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt b/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt new file mode 100644 index 00000000000..832bbd4079c --- /dev/null +++ b/tests/auto/corelib/kernel/qeventdispatcher/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qeventdispatcher SOURCES tst_qeventdispatcher.cpp) diff --git a/tests/auto/corelib/kernel/qmath/CMakeLists.txt b/tests/auto/corelib/kernel/qmath/CMakeLists.txt new file mode 100644 index 00000000000..3edebc07762 --- /dev/null +++ b/tests/auto/corelib/kernel/qmath/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmath SOURCES tst_qmath.cpp) diff --git a/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt b/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt new file mode 100644 index 00000000000..2db56b9f3c2 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetaenum/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmetaenum SOURCES tst_qmetaenum.cpp) diff --git a/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt b/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt new file mode 100644 index 00000000000..ca41b0d676a --- /dev/null +++ b/tests/auto/corelib/kernel/qmetamethod/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmetamethod SOURCES tst_qmetamethod.cpp) diff --git a/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt b/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt new file mode 100644 index 00000000000..61b64ef36d2 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetaobject/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmetaobject SOURCES tst_qmetaobject.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/kernel/qmetaobjectbuilder/CMakeLists.txt b/tests/auto/corelib/kernel/qmetaobjectbuilder/CMakeLists.txt new file mode 100644 index 00000000000..bc86eb1e1ef --- /dev/null +++ b/tests/auto/corelib/kernel/qmetaobjectbuilder/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmetaobjectbuilder SOURCES tst_qmetaobjectbuilder.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/kernel/qmetaproperty/CMakeLists.txt b/tests/auto/corelib/kernel/qmetaproperty/CMakeLists.txt new file mode 100644 index 00000000000..46635feb3a6 --- /dev/null +++ b/tests/auto/corelib/kernel/qmetaproperty/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmetaproperty SOURCES tst_qmetaproperty.cpp) diff --git a/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt b/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt new file mode 100644 index 00000000000..78d0a69d681 --- /dev/null +++ b/tests/auto/corelib/kernel/qmimedata/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmimedata SOURCES tst_qmimedata.cpp) diff --git a/tests/auto/corelib/kernel/qsignalmapper/CMakeLists.txt b/tests/auto/corelib/kernel/qsignalmapper/CMakeLists.txt new file mode 100644 index 00000000000..1a6416fabb2 --- /dev/null +++ b/tests/auto/corelib/kernel/qsignalmapper/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsignalmapper SOURCES tst_qsignalmapper.cpp) diff --git a/tests/auto/corelib/kernel/qwineventnotifier/CMakeLists.txt b/tests/auto/corelib/kernel/qwineventnotifier/CMakeLists.txt new file mode 100644 index 00000000000..db888dcda0c --- /dev/null +++ b/tests/auto/corelib/kernel/qwineventnotifier/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qwineventnotifier SOURCES tst_qwineventnotifier.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/mimetypes/CMakeLists.txt b/tests/auto/corelib/mimetypes/CMakeLists.txt new file mode 100644 index 00000000000..1e59aa33293 --- /dev/null +++ b/tests/auto/corelib/mimetypes/CMakeLists.txt @@ -0,0 +1,2 @@ +# add_subdirectory(qmimetype) + diff --git a/tests/auto/corelib/mimetypes/qmimetype/CMakeLists.txt b/tests/auto/corelib/mimetypes/qmimetype/CMakeLists.txt new file mode 100644 index 00000000000..9b70d0971a5 --- /dev/null +++ b/tests/auto/corelib/mimetypes/qmimetype/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmimetype SOURCES tst_qmimetype.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/serialization/CMakeLists.txt b/tests/auto/corelib/serialization/CMakeLists.txt new file mode 100644 index 00000000000..e856ccae90a --- /dev/null +++ b/tests/auto/corelib/serialization/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(qcborvalue_json) +add_subdirectory(qcborstreamreader) +add_subdirectory(qcborstreamwriter) +add_subdirectory(qcborvalue) + diff --git a/tests/auto/corelib/serialization/qcborstreamreader/CMakeLists.txt b/tests/auto/corelib/serialization/qcborstreamreader/CMakeLists.txt new file mode 100644 index 00000000000..2db29547a42 --- /dev/null +++ b/tests/auto/corelib/serialization/qcborstreamreader/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qcborstreamreader SOURCES + tst_qcborstreamreader.cpp + INCLUDE_DIRECTORIES + ../../../../../src/3rdparty/tinycbor/src + ../../../../../src/3rdparty/tinycbor/tests/parser +) diff --git a/tests/auto/corelib/serialization/qcborstreamwriter/CMakeLists.txt b/tests/auto/corelib/serialization/qcborstreamwriter/CMakeLists.txt new file mode 100644 index 00000000000..483a335cd33 --- /dev/null +++ b/tests/auto/corelib/serialization/qcborstreamwriter/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test(tst_qcborstreamwriter SOURCES + tst_qcborstreamwriter.cpp + INCLUDE_DIRECTORIES + ../../../../../src/3rdparty/tinycbor/tests/encoder +) diff --git a/tests/auto/corelib/serialization/qcborvalue/CMakeLists.txt b/tests/auto/corelib/serialization/qcborvalue/CMakeLists.txt new file mode 100644 index 00000000000..f1630798e97 --- /dev/null +++ b/tests/auto/corelib/serialization/qcborvalue/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qcborvalue SOURCES + tst_qcborvalue.cpp + INCLUDE_DIRECTORIES + ../../../../../src/3rdparty/tinycbor/src + ../../../../../src/3rdparty/tinycbor/tests/parser +) diff --git a/tests/auto/corelib/serialization/qcborvalue_json/CMakeLists.txt b/tests/auto/corelib/serialization/qcborvalue_json/CMakeLists.txt new file mode 100644 index 00000000000..651e0c68afb --- /dev/null +++ b/tests/auto/corelib/serialization/qcborvalue_json/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qcborvalue_json SOURCES tst_qcborvalue_json.cpp) diff --git a/tests/auto/corelib/statemachine/CMakeLists.txt b/tests/auto/corelib/statemachine/CMakeLists.txt new file mode 100644 index 00000000000..52c956cd033 --- /dev/null +++ b/tests/auto/corelib/statemachine/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(qstate) + diff --git a/tests/auto/corelib/statemachine/qstate/CMakeLists.txt b/tests/auto/corelib/statemachine/qstate/CMakeLists.txt new file mode 100644 index 00000000000..28aa801be94 --- /dev/null +++ b/tests/auto/corelib/statemachine/qstate/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstate SOURCES tst_qstate.cpp) diff --git a/tests/auto/corelib/thread/CMakeLists.txt b/tests/auto/corelib/thread/CMakeLists.txt new file mode 100644 index 00000000000..357ae844f6a --- /dev/null +++ b/tests/auto/corelib/thread/CMakeLists.txt @@ -0,0 +1,13 @@ +add_subdirectory(qatomicint) +add_subdirectory(qatomicpointer) +add_subdirectory(qfuture) +add_subdirectory(qfuturesynchronizer) +add_subdirectory(qmutexlocker) +add_subdirectory(qreadlocker) +add_subdirectory(qreadwritelock) +add_subdirectory(qresultstore) +add_subdirectory(qsemaphore) +add_subdirectory(qthreadpool) +add_subdirectory(qwaitcondition) +add_subdirectory(qwritelocker) + diff --git a/tests/auto/corelib/thread/qatomicint/CMakeLists.txt b/tests/auto/corelib/thread/qatomicint/CMakeLists.txt new file mode 100644 index 00000000000..e94c228820d --- /dev/null +++ b/tests/auto/corelib/thread/qatomicint/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qatomicint SOURCES tst_qatomicint.cpp) diff --git a/tests/auto/corelib/thread/qatomicpointer/CMakeLists.txt b/tests/auto/corelib/thread/qatomicpointer/CMakeLists.txt new file mode 100644 index 00000000000..3a74e4dc1f3 --- /dev/null +++ b/tests/auto/corelib/thread/qatomicpointer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qatomicpointer SOURCES tst_qatomicpointer.cpp) diff --git a/tests/auto/corelib/thread/qfuture/CMakeLists.txt b/tests/auto/corelib/thread/qfuture/CMakeLists.txt new file mode 100644 index 00000000000..d37f134c46b --- /dev/null +++ b/tests/auto/corelib/thread/qfuture/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qfuture SOURCES tst_qfuture.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/thread/qfuturesynchronizer/CMakeLists.txt b/tests/auto/corelib/thread/qfuturesynchronizer/CMakeLists.txt new file mode 100644 index 00000000000..3745db0a756 --- /dev/null +++ b/tests/auto/corelib/thread/qfuturesynchronizer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qfuturesynchronizer SOURCES tst_qfuturesynchronizer.cpp) diff --git a/tests/auto/corelib/thread/qmutexlocker/CMakeLists.txt b/tests/auto/corelib/thread/qmutexlocker/CMakeLists.txt new file mode 100644 index 00000000000..de6be505eae --- /dev/null +++ b/tests/auto/corelib/thread/qmutexlocker/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmutexlocker SOURCES tst_qmutexlocker.cpp) diff --git a/tests/auto/corelib/thread/qreadlocker/CMakeLists.txt b/tests/auto/corelib/thread/qreadlocker/CMakeLists.txt new file mode 100644 index 00000000000..b7b7c4add74 --- /dev/null +++ b/tests/auto/corelib/thread/qreadlocker/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qreadlocker SOURCES tst_qreadlocker.cpp) diff --git a/tests/auto/corelib/thread/qreadwritelock/CMakeLists.txt b/tests/auto/corelib/thread/qreadwritelock/CMakeLists.txt new file mode 100644 index 00000000000..2a8ac429091 --- /dev/null +++ b/tests/auto/corelib/thread/qreadwritelock/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qreadwritelock SOURCES tst_qreadwritelock.cpp) diff --git a/tests/auto/corelib/thread/qresultstore/CMakeLists.txt b/tests/auto/corelib/thread/qresultstore/CMakeLists.txt new file mode 100644 index 00000000000..52fefb84bb5 --- /dev/null +++ b/tests/auto/corelib/thread/qresultstore/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qresultstore SOURCES tst_qresultstore.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/thread/qsemaphore/CMakeLists.txt b/tests/auto/corelib/thread/qsemaphore/CMakeLists.txt new file mode 100644 index 00000000000..7bc1183bd2a --- /dev/null +++ b/tests/auto/corelib/thread/qsemaphore/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsemaphore SOURCES tst_qsemaphore.cpp) diff --git a/tests/auto/corelib/thread/qthreadpool/CMakeLists.txt b/tests/auto/corelib/thread/qthreadpool/CMakeLists.txt new file mode 100644 index 00000000000..385bfcdea4d --- /dev/null +++ b/tests/auto/corelib/thread/qthreadpool/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qthreadpool SOURCES tst_qthreadpool.cpp) diff --git a/tests/auto/corelib/thread/qwaitcondition/CMakeLists.txt b/tests/auto/corelib/thread/qwaitcondition/CMakeLists.txt new file mode 100644 index 00000000000..ab81379e03e --- /dev/null +++ b/tests/auto/corelib/thread/qwaitcondition/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qwaitcondition SOURCES tst_qwaitcondition.cpp) diff --git a/tests/auto/corelib/thread/qwritelocker/CMakeLists.txt b/tests/auto/corelib/thread/qwritelocker/CMakeLists.txt new file mode 100644 index 00000000000..4635a34b6e4 --- /dev/null +++ b/tests/auto/corelib/thread/qwritelocker/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qwritelocker SOURCES tst_qwritelocker.cpp) diff --git a/tests/auto/corelib/tools/CMakeLists.txt b/tests/auto/corelib/tools/CMakeLists.txt new file mode 100644 index 00000000000..befa8e900d5 --- /dev/null +++ b/tests/auto/corelib/tools/CMakeLists.txt @@ -0,0 +1,47 @@ +add_subdirectory(qalgorithms) +add_subdirectory(qarraydata) +add_subdirectory(qbitarray) +add_subdirectory(qbytearraylist) +add_subdirectory(qbytedatabuffer) +add_subdirectory(qcache) +add_subdirectory(qcommandlineparser) +add_subdirectory(qcontiguouscache) +add_subdirectory(qdate) +add_subdirectory(qeasingcurve) +add_subdirectory(qexplicitlyshareddatapointer) +add_subdirectory(qhash) +add_subdirectory(qhashfunctions) +add_subdirectory(qlinkedlist) +add_subdirectory(qlist) +add_subdirectory(qmakearray) +add_subdirectory(qmap) +add_subdirectory(qmargins) +add_subdirectory(qmessageauthenticationcode) +add_subdirectory(qpair) +add_subdirectory(qpoint) +add_subdirectory(qpointf) +add_subdirectory(qqueue) +add_subdirectory(qrect) +add_subdirectory(qregexp) +add_subdirectory(qregularexpression) +add_subdirectory(qringbuffer) +add_subdirectory(qscopedpointer) +add_subdirectory(qscopedvaluerollback) +add_subdirectory(qscopeguard) +add_subdirectory(qset) +add_subdirectory(qsize) +add_subdirectory(qsizef) +add_subdirectory(qstl) +add_subdirectory(qstring_no_cast_from_bytearray) +add_subdirectory(qstringbuilder/qstringbuilder1) +add_subdirectory(qstringbuilder/qstringbuilder2) +add_subdirectory(qstringbuilder/qstringbuilder3) +add_subdirectory(qstringbuilder/qstringbuilder4) +add_subdirectory(qstringiterator) +add_subdirectory(qstringlist) +add_subdirectory(qstringmatcher) +add_subdirectory(qstringref) +add_subdirectory(qtime) +add_subdirectory(qtimeline) +add_subdirectory(qvarlengtharray) + diff --git a/tests/auto/corelib/tools/qalgorithms/CMakeLists.txt b/tests/auto/corelib/tools/qalgorithms/CMakeLists.txt new file mode 100644 index 00000000000..66c205b605e --- /dev/null +++ b/tests/auto/corelib/tools/qalgorithms/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qalgorithms SOURCES tst_qalgorithms.cpp) diff --git a/tests/auto/corelib/tools/qarraydata/CMakeLists.txt b/tests/auto/corelib/tools/qarraydata/CMakeLists.txt new file mode 100644 index 00000000000..573f13af55c --- /dev/null +++ b/tests/auto/corelib/tools/qarraydata/CMakeLists.txt @@ -0,0 +1,4 @@ +add_qt_test(tst_qarraydata SOURCES + tst_qarraydata.cpp + simplevector.h +) diff --git a/tests/auto/corelib/tools/qbitarray/CMakeLists.txt b/tests/auto/corelib/tools/qbitarray/CMakeLists.txt new file mode 100644 index 00000000000..684fa58694e --- /dev/null +++ b/tests/auto/corelib/tools/qbitarray/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qbitarray SOURCES tst_qbitarray.cpp) diff --git a/tests/auto/corelib/tools/qbytearraylist/CMakeLists.txt b/tests/auto/corelib/tools/qbytearraylist/CMakeLists.txt new file mode 100644 index 00000000000..f7b8314dbdc --- /dev/null +++ b/tests/auto/corelib/tools/qbytearraylist/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qbytearraylist SOURCES tst_qbytearraylist.cpp) diff --git a/tests/auto/corelib/tools/qbytedatabuffer/CMakeLists.txt b/tests/auto/corelib/tools/qbytedatabuffer/CMakeLists.txt new file mode 100644 index 00000000000..c02ee4c2847 --- /dev/null +++ b/tests/auto/corelib/tools/qbytedatabuffer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qbytedatabuffer SOURCES tst_qbytedatabuffer.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/tools/qcache/CMakeLists.txt b/tests/auto/corelib/tools/qcache/CMakeLists.txt new file mode 100644 index 00000000000..816614bebff --- /dev/null +++ b/tests/auto/corelib/tools/qcache/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qcache SOURCES tst_qcache.cpp) diff --git a/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt b/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt new file mode 100644 index 00000000000..33d254a0340 --- /dev/null +++ b/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qcommandlineparser SOURCES tst_qcommandlineparser.cpp) diff --git a/tests/auto/corelib/tools/qcontiguouscache/CMakeLists.txt b/tests/auto/corelib/tools/qcontiguouscache/CMakeLists.txt new file mode 100644 index 00000000000..3f7dc63c5b9 --- /dev/null +++ b/tests/auto/corelib/tools/qcontiguouscache/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qcontiguouscache SOURCES tst_qcontiguouscache.cpp) diff --git a/tests/auto/corelib/tools/qdate/CMakeLists.txt b/tests/auto/corelib/tools/qdate/CMakeLists.txt new file mode 100644 index 00000000000..e967a03edf5 --- /dev/null +++ b/tests/auto/corelib/tools/qdate/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qdate SOURCES tst_qdate.cpp) diff --git a/tests/auto/corelib/tools/qeasingcurve/CMakeLists.txt b/tests/auto/corelib/tools/qeasingcurve/CMakeLists.txt new file mode 100644 index 00000000000..42bfd081af9 --- /dev/null +++ b/tests/auto/corelib/tools/qeasingcurve/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qeasingcurve SOURCES tst_qeasingcurve.cpp) diff --git a/tests/auto/corelib/tools/qexplicitlyshareddatapointer/CMakeLists.txt b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/CMakeLists.txt new file mode 100644 index 00000000000..5da0db0398d --- /dev/null +++ b/tests/auto/corelib/tools/qexplicitlyshareddatapointer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qexplicitlyshareddatapointer SOURCES tst_qexplicitlyshareddatapointer.cpp) diff --git a/tests/auto/corelib/tools/qhash/CMakeLists.txt b/tests/auto/corelib/tools/qhash/CMakeLists.txt new file mode 100644 index 00000000000..1e0026e5bae --- /dev/null +++ b/tests/auto/corelib/tools/qhash/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qhash SOURCES tst_qhash.cpp) diff --git a/tests/auto/corelib/tools/qhashfunctions/CMakeLists.txt b/tests/auto/corelib/tools/qhashfunctions/CMakeLists.txt new file mode 100644 index 00000000000..2a9b50e70e6 --- /dev/null +++ b/tests/auto/corelib/tools/qhashfunctions/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qhashfunctions SOURCES tst_qhashfunctions.cpp) diff --git a/tests/auto/corelib/tools/qlinkedlist/CMakeLists.txt b/tests/auto/corelib/tools/qlinkedlist/CMakeLists.txt new file mode 100644 index 00000000000..aad00ab21ed --- /dev/null +++ b/tests/auto/corelib/tools/qlinkedlist/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qlinkedlist SOURCES tst_qlinkedlist.cpp) diff --git a/tests/auto/corelib/tools/qlist/CMakeLists.txt b/tests/auto/corelib/tools/qlist/CMakeLists.txt new file mode 100644 index 00000000000..ca5195b12ec --- /dev/null +++ b/tests/auto/corelib/tools/qlist/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qlist SOURCES tst_qlist.cpp) diff --git a/tests/auto/corelib/tools/qmakearray/CMakeLists.txt b/tests/auto/corelib/tools/qmakearray/CMakeLists.txt new file mode 100644 index 00000000000..f63961fe146 --- /dev/null +++ b/tests/auto/corelib/tools/qmakearray/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmakearray SOURCES tst_qmakearray.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/tools/qmap/CMakeLists.txt b/tests/auto/corelib/tools/qmap/CMakeLists.txt new file mode 100644 index 00000000000..a53b522bd84 --- /dev/null +++ b/tests/auto/corelib/tools/qmap/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmap SOURCES tst_qmap.cpp) diff --git a/tests/auto/corelib/tools/qmargins/CMakeLists.txt b/tests/auto/corelib/tools/qmargins/CMakeLists.txt new file mode 100644 index 00000000000..7bfb2d01f24 --- /dev/null +++ b/tests/auto/corelib/tools/qmargins/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmargins SOURCES tst_qmargins.cpp) diff --git a/tests/auto/corelib/tools/qmessageauthenticationcode/CMakeLists.txt b/tests/auto/corelib/tools/qmessageauthenticationcode/CMakeLists.txt new file mode 100644 index 00000000000..1c851386079 --- /dev/null +++ b/tests/auto/corelib/tools/qmessageauthenticationcode/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmessageauthenticationcode SOURCES tst_qmessageauthenticationcode.cpp) diff --git a/tests/auto/corelib/tools/qpair/CMakeLists.txt b/tests/auto/corelib/tools/qpair/CMakeLists.txt new file mode 100644 index 00000000000..e8a0c8e855f --- /dev/null +++ b/tests/auto/corelib/tools/qpair/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpair SOURCES tst_qpair.cpp) diff --git a/tests/auto/corelib/tools/qpoint/CMakeLists.txt b/tests/auto/corelib/tools/qpoint/CMakeLists.txt new file mode 100644 index 00000000000..869ddab1c7b --- /dev/null +++ b/tests/auto/corelib/tools/qpoint/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpoint SOURCES tst_qpoint.cpp) diff --git a/tests/auto/corelib/tools/qpointf/CMakeLists.txt b/tests/auto/corelib/tools/qpointf/CMakeLists.txt new file mode 100644 index 00000000000..d0cfc0c8edb --- /dev/null +++ b/tests/auto/corelib/tools/qpointf/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpointf SOURCES tst_qpointf.cpp) diff --git a/tests/auto/corelib/tools/qqueue/CMakeLists.txt b/tests/auto/corelib/tools/qqueue/CMakeLists.txt new file mode 100644 index 00000000000..4e8a711fd9c --- /dev/null +++ b/tests/auto/corelib/tools/qqueue/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qqueue SOURCES tst_qqueue.cpp) diff --git a/tests/auto/corelib/tools/qrect/CMakeLists.txt b/tests/auto/corelib/tools/qrect/CMakeLists.txt new file mode 100644 index 00000000000..3ffa3d1d34a --- /dev/null +++ b/tests/auto/corelib/tools/qrect/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qrect SOURCES tst_qrect.cpp) diff --git a/tests/auto/corelib/tools/qregexp/CMakeLists.txt b/tests/auto/corelib/tools/qregexp/CMakeLists.txt new file mode 100644 index 00000000000..1a376449776 --- /dev/null +++ b/tests/auto/corelib/tools/qregexp/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qregexp SOURCES tst_qregexp.cpp) diff --git a/tests/auto/corelib/tools/qregularexpression/CMakeLists.txt b/tests/auto/corelib/tools/qregularexpression/CMakeLists.txt new file mode 100644 index 00000000000..ff0cb8d9626 --- /dev/null +++ b/tests/auto/corelib/tools/qregularexpression/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qregularexpression SOURCES tst_qregularexpression.cpp) diff --git a/tests/auto/corelib/tools/qringbuffer/CMakeLists.txt b/tests/auto/corelib/tools/qringbuffer/CMakeLists.txt new file mode 100644 index 00000000000..ccb9a1b7b4a --- /dev/null +++ b/tests/auto/corelib/tools/qringbuffer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qringbuffer SOURCES tst_qringbuffer.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/tools/qscopedpointer/CMakeLists.txt b/tests/auto/corelib/tools/qscopedpointer/CMakeLists.txt new file mode 100644 index 00000000000..24cc66b34a3 --- /dev/null +++ b/tests/auto/corelib/tools/qscopedpointer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qscopedpointer SOURCES tst_qscopedpointer.cpp) diff --git a/tests/auto/corelib/tools/qscopedvaluerollback/CMakeLists.txt b/tests/auto/corelib/tools/qscopedvaluerollback/CMakeLists.txt new file mode 100644 index 00000000000..e772f67fb47 --- /dev/null +++ b/tests/auto/corelib/tools/qscopedvaluerollback/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qscopedvaluerollback SOURCES tst_qscopedvaluerollback.cpp) diff --git a/tests/auto/corelib/tools/qscopeguard/CMakeLists.txt b/tests/auto/corelib/tools/qscopeguard/CMakeLists.txt new file mode 100644 index 00000000000..dae2fd49ff3 --- /dev/null +++ b/tests/auto/corelib/tools/qscopeguard/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qscopeguard SOURCES tst_qscopeguard.cpp) diff --git a/tests/auto/corelib/tools/qset/CMakeLists.txt b/tests/auto/corelib/tools/qset/CMakeLists.txt new file mode 100644 index 00000000000..e602ff4293e --- /dev/null +++ b/tests/auto/corelib/tools/qset/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qset SOURCES tst_qset.cpp) diff --git a/tests/auto/corelib/tools/qsize/CMakeLists.txt b/tests/auto/corelib/tools/qsize/CMakeLists.txt new file mode 100644 index 00000000000..595b5f4af88 --- /dev/null +++ b/tests/auto/corelib/tools/qsize/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsize SOURCES tst_qsize.cpp) diff --git a/tests/auto/corelib/tools/qsizef/CMakeLists.txt b/tests/auto/corelib/tools/qsizef/CMakeLists.txt new file mode 100644 index 00000000000..05aa4ba8a7f --- /dev/null +++ b/tests/auto/corelib/tools/qsizef/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsizef SOURCES tst_qsizef.cpp) diff --git a/tests/auto/corelib/tools/qstl/CMakeLists.txt b/tests/auto/corelib/tools/qstl/CMakeLists.txt new file mode 100644 index 00000000000..37a9529e8f7 --- /dev/null +++ b/tests/auto/corelib/tools/qstl/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstl SOURCES tst_qstl.cpp) diff --git a/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/CMakeLists.txt b/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/CMakeLists.txt new file mode 100644 index 00000000000..46a9e9ff794 --- /dev/null +++ b/tests/auto/corelib/tools/qstring_no_cast_from_bytearray/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstring_no_cast_from_bytearray SOURCES tst_qstring_no_cast_from_bytearray.cpp) diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/CMakeLists.txt b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/CMakeLists.txt new file mode 100644 index 00000000000..2fad1ee7ed3 --- /dev/null +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringbuilder1 SOURCES tst_qstringbuilder1.cpp) diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/CMakeLists.txt b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/CMakeLists.txt new file mode 100644 index 00000000000..93231a22e17 --- /dev/null +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder2/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringbuilder2 SOURCES tst_qstringbuilder2.cpp) diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/CMakeLists.txt b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/CMakeLists.txt new file mode 100644 index 00000000000..4669fc93b44 --- /dev/null +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder3/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringbuilder3 SOURCES tst_qstringbuilder3.cpp) diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/CMakeLists.txt b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/CMakeLists.txt new file mode 100644 index 00000000000..d6e7be6c117 --- /dev/null +++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder4/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringbuilder4 SOURCES tst_qstringbuilder4.cpp) diff --git a/tests/auto/corelib/tools/qstringiterator/CMakeLists.txt b/tests/auto/corelib/tools/qstringiterator/CMakeLists.txt new file mode 100644 index 00000000000..572ada1f4cc --- /dev/null +++ b/tests/auto/corelib/tools/qstringiterator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringiterator SOURCES tst_qstringiterator.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/corelib/tools/qstringlist/CMakeLists.txt b/tests/auto/corelib/tools/qstringlist/CMakeLists.txt new file mode 100644 index 00000000000..af361fbbccb --- /dev/null +++ b/tests/auto/corelib/tools/qstringlist/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringlist SOURCES tst_qstringlist.cpp) diff --git a/tests/auto/corelib/tools/qstringmatcher/CMakeLists.txt b/tests/auto/corelib/tools/qstringmatcher/CMakeLists.txt new file mode 100644 index 00000000000..1bf0a6e15f7 --- /dev/null +++ b/tests/auto/corelib/tools/qstringmatcher/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringmatcher SOURCES tst_qstringmatcher.cpp) diff --git a/tests/auto/corelib/tools/qstringref/CMakeLists.txt b/tests/auto/corelib/tools/qstringref/CMakeLists.txt new file mode 100644 index 00000000000..d4daf1a4370 --- /dev/null +++ b/tests/auto/corelib/tools/qstringref/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstringref SOURCES tst_qstringref.cpp) diff --git a/tests/auto/corelib/tools/qtime/CMakeLists.txt b/tests/auto/corelib/tools/qtime/CMakeLists.txt new file mode 100644 index 00000000000..0b8b4c81f37 --- /dev/null +++ b/tests/auto/corelib/tools/qtime/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qtime SOURCES tst_qtime.cpp) diff --git a/tests/auto/corelib/tools/qtimeline/CMakeLists.txt b/tests/auto/corelib/tools/qtimeline/CMakeLists.txt new file mode 100644 index 00000000000..b23f07e9b5e --- /dev/null +++ b/tests/auto/corelib/tools/qtimeline/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qtimeline SOURCES tst_qtimeline.cpp) diff --git a/tests/auto/corelib/tools/qvarlengtharray/CMakeLists.txt b/tests/auto/corelib/tools/qvarlengtharray/CMakeLists.txt new file mode 100644 index 00000000000..a1bea13f9eb --- /dev/null +++ b/tests/auto/corelib/tools/qvarlengtharray/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qvarlengtharray SOURCES tst_qvarlengtharray.cpp) diff --git a/tests/auto/dbus/CMakeLists.txt b/tests/auto/dbus/CMakeLists.txt new file mode 100644 index 00000000000..6371c52ceb8 --- /dev/null +++ b/tests/auto/dbus/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from dbus.pro. + +add_subdirectory(qdbusconnection_delayed) +add_subdirectory(qdbusconnection) +add_subdirectory(qdbusconnection_no_app) +add_subdirectory(qdbusconnection_no_bus) +add_subdirectory(qdbusconnection_no_libdbus) +add_subdirectory(qdbusconnection_spyhook) +add_subdirectory(qdbuscontext) +add_subdirectory(qdbuslocalcalls) +add_subdirectory(qdbusmetaobject) +add_subdirectory(qdbusmetatype) +add_subdirectory(qdbuspendingcall) +add_subdirectory(qdbuspendingreply) +add_subdirectory(qdbusreply) +add_subdirectory(qdbusservicewatcher) +add_subdirectory(qdbustype) +add_subdirectory(qdbusthreading) + +if(QT_FEATURE_process) + # missing add_qt_binary: add_subdirectory("qdbusabstractadaptor") + # missing add_qt_binary: add_subdirectory("qdbusabstractinterface") + # missing add_qt_binary: add_subdirectory("qdbusinterface") + + if(QT_FEATURE_private_tests) + add_subdirectory(qdbusmarshall) + endif() +endif() + +### FIXME +# if(QT_FEATURE_xml) +# add_subdirectory(qdbusxmlparser) +# endif() diff --git a/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt new file mode 100644 index 00000000000..9a8132d1150 --- /dev/null +++ b/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qdbusabstractadaptor.pro. + +add_subdirectory(qmyserver) +add_subdirectory(qdbusabstractadaptor) diff --git a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt new file mode 100644 index 00000000000..953eeb4fa45 --- /dev/null +++ b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qdbusabstractadaptor.pro. + +##################################################################### +## ../tst_qdbusabstractadaptor Test: +##################################################################### + +add_qt_test(../tst_qdbusabstractadaptor + SOURCES + ../myobject.h + ../tst_qdbusabstractadaptor.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt new file mode 100644 index 00000000000..627b29ff422 --- /dev/null +++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qmyserver.pro. + +##################################################################### +## qmyserver Binary: +##################################################################### + +add_qt_executable(qmyserver + SOURCES + ../myobject.h + qmyserver.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt new file mode 100644 index 00000000000..111012aba91 --- /dev/null +++ b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qdbusabstractinterface.pro. + +add_subdirectory(qpinger) +add_subdirectory(qdbusabstractinterface) diff --git a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt new file mode 100644 index 00000000000..5bbd2ebbaad --- /dev/null +++ b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qdbusabstractinterface.pro. + +##################################################################### +## ../tst_qdbusabstractinterface Test: +##################################################################### + +add_qt_test(../tst_qdbusabstractinterface + SOURCES + ../interface.cpp ../interface.h + ../tst_qdbusabstractinterface.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt new file mode 100644 index 00000000000..91427dacabf --- /dev/null +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qpinger.pro. + +##################################################################### +## qpinger Binary: +##################################################################### + +add_qt_executable(qpinger + SOURCES + ../interface.cpp ../interface.h + qpinger.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusconnection/CMakeLists.txt b/tests/auto/dbus/qdbusconnection/CMakeLists.txt new file mode 100644 index 00000000000..e2886d9185d --- /dev/null +++ b/tests/auto/dbus/qdbusconnection/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusconnection.pro. + +##################################################################### +## tst_qdbusconnection Test: +##################################################################### + +add_qt_test(tst_qdbusconnection + SOURCES + tst_qdbusconnection.cpp tst_qdbusconnection.h + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusconnection_delayed/CMakeLists.txt b/tests/auto/dbus/qdbusconnection_delayed/CMakeLists.txt new file mode 100644 index 00000000000..8463fea971a --- /dev/null +++ b/tests/auto/dbus/qdbusconnection_delayed/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qdbusconnection_delayed.pro. + +##################################################################### +## tst_qdbusconnection_delayed Test: +##################################################################### + +add_qt_test(tst_qdbusconnection_delayed + SOURCES + tst_qdbusconnection_delayed.cpp + DEFINES + SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusconnection_no_app/CMakeLists.txt b/tests/auto/dbus/qdbusconnection_no_app/CMakeLists.txt new file mode 100644 index 00000000000..07223682cf5 --- /dev/null +++ b/tests/auto/dbus/qdbusconnection_no_app/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from qdbusconnection_no_app.pro. + +##################################################################### +## tst_qdbusconnection_no_app Test: +##################################################################### + +add_qt_test(tst_qdbusconnection_no_app + SOURCES + ../qdbusconnection/tst_qdbusconnection.h + tst_qdbusconnection_no_app.cpp + DEFINES + SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" + tst_QDBusConnection=tst_QDBusConnection_NoApplication + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusconnection_no_bus/CMakeLists.txt b/tests/auto/dbus/qdbusconnection_no_bus/CMakeLists.txt new file mode 100644 index 00000000000..8cd1e2a3d33 --- /dev/null +++ b/tests/auto/dbus/qdbusconnection_no_bus/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusconnection_no_bus.pro. + +##################################################################### +## tst_qdbusconnection_no_bus Test: +##################################################################### + +add_qt_test(tst_qdbusconnection_no_bus + SOURCES + tst_qdbusconnection_no_bus.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusconnection_no_libdbus/CMakeLists.txt b/tests/auto/dbus/qdbusconnection_no_libdbus/CMakeLists.txt new file mode 100644 index 00000000000..08a5c3cad57 --- /dev/null +++ b/tests/auto/dbus/qdbusconnection_no_libdbus/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qdbusconnection_no_libdbus.pro. + +##################################################################### +## tst_qdbusconnection_no_libdbus Test: +##################################################################### + +add_qt_test(tst_qdbusconnection_no_libdbus + SOURCES + ../qdbusconnection_no_bus/tst_qdbusconnection_no_bus.cpp + DEFINES + SIMULATE_LOAD_FAIL + tst_QDBusConnectionNoBus=tst_QDBusConnectionNoLibDBus1 + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusconnection_no_libdbus/tst_qdbusconnection_no_libdbus.cpp b/tests/auto/dbus/qdbusconnection_no_libdbus/tst_qdbusconnection_no_libdbus.cpp new file mode 100644 index 00000000000..e93b8aa6091 --- /dev/null +++ b/tests/auto/dbus/qdbusconnection_no_libdbus/tst_qdbusconnection_no_libdbus.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include + +#include +#include + +#include + +/* This test uses an appless main, to ensure that no D-Bus stuff is implicitly done + It also sets the magic "QT_SIMULATE_DBUS_LIBFAIL" env variable, that is only available + in developer builds. That env variable simulates a D-Bus library load fail. + + In no case should the QDBus module crash because D-Bus libs couldn't be loaded */ + +class tst_QDBusConnectionNoBus : public QObject +{ + Q_OBJECT + +public: + tst_QDBusConnectionNoBus() + { + qputenv("DBUS_SESSION_BUS_ADDRESS", "unix:abstract=/tmp/does_not_exist"); +#ifdef SIMULATE_LOAD_FAIL + qputenv("QT_SIMULATE_DBUS_LIBFAIL", "1"); +#endif + } + +private slots: + void connectToBus(); +}; + + +void tst_QDBusConnectionNoBus::connectToBus() +{ + int argc = 0; + QCoreApplication app(argc, 0); + + QDBusConnection con = QDBusConnection::sessionBus(); + + QVERIFY(!con.isConnected()); // if we didn't crash here, the test passed :) +} + +QTEST_APPLESS_MAIN(tst_QDBusConnectionNoBus) + +#include "tst_qdbusconnection_no_libdbus.moc" + diff --git a/tests/auto/dbus/qdbusconnection_spyhook/CMakeLists.txt b/tests/auto/dbus/qdbusconnection_spyhook/CMakeLists.txt new file mode 100644 index 00000000000..e7c6cf0ea25 --- /dev/null +++ b/tests/auto/dbus/qdbusconnection_spyhook/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from qdbusconnection_spyhook.pro. + +##################################################################### +## tst_qdbusconnection_spyhook Test: +##################################################################### + +add_qt_test(tst_qdbusconnection_spyhook + SOURCES + ../qdbusconnection/tst_qdbusconnection.h + tst_qdbusconnection_spyhook.cpp + DEFINES + SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" + tst_QDBusConnection=tst_QDBusConnection_SpyHook + LIBRARIES + Qt::DBus + RUN_SERIAL +) diff --git a/tests/auto/dbus/qdbuscontext/CMakeLists.txt b/tests/auto/dbus/qdbuscontext/CMakeLists.txt new file mode 100644 index 00000000000..e5ecc293e58 --- /dev/null +++ b/tests/auto/dbus/qdbuscontext/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbuscontext.pro. + +##################################################################### +## tst_qdbuscontext Test: +##################################################################### + +add_qt_test(tst_qdbuscontext + SOURCES + tst_qdbuscontext.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusinterface/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/CMakeLists.txt new file mode 100644 index 00000000000..ae79490a833 --- /dev/null +++ b/tests/auto/dbus/qdbusinterface/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qdbusinterface.pro. + +add_subdirectory(qmyserver) +add_subdirectory(qdbusinterface) diff --git a/tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt new file mode 100644 index 00000000000..624ec00bd11 --- /dev/null +++ b/tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from qdbusinterface.pro. + +##################################################################### +## ../tst_qdbusinterface Test: +##################################################################### + +add_qt_test(../tst_qdbusinterface + SOURCES + ../myobject.h + ../tst_qdbusinterface.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBus + Qt::DBusPrivate +) + +## Scopes: +##################################################################### + +extend_target(../tst_qdbusinterface CONDITION QT_FEATURE_dbus_linked + DEFINES + QT_LINKED_LIBDBUS +) + +extend_target(../tst_qdbusinterface CONDITION NOT QT_FEATURE_dbus_linked + SOURCES + ../../../../../src/dbus/qdbus_symbols.cpp +) diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt new file mode 100644 index 00000000000..627b29ff422 --- /dev/null +++ b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qmyserver.pro. + +##################################################################### +## qmyserver Binary: +##################################################################### + +add_qt_executable(qmyserver + SOURCES + ../myobject.h + qmyserver.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbuslocalcalls/CMakeLists.txt b/tests/auto/dbus/qdbuslocalcalls/CMakeLists.txt new file mode 100644 index 00000000000..fee5d383728 --- /dev/null +++ b/tests/auto/dbus/qdbuslocalcalls/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbuslocalcalls.pro. + +##################################################################### +## tst_qdbuslocalcalls Test: +##################################################################### + +add_qt_test(tst_qdbuslocalcalls + SOURCES + tst_qdbuslocalcalls.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusmarshall/CMakeLists.txt b/tests/auto/dbus/qdbusmarshall/CMakeLists.txt new file mode 100644 index 00000000000..aabeae0f4a5 --- /dev/null +++ b/tests/auto/dbus/qdbusmarshall/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qdbusmarshall.pro. + +add_subdirectory(qpong) +add_subdirectory(qdbusmarshall) diff --git a/tests/auto/dbus/qdbusmarshall/qdbusmarshall/CMakeLists.txt b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/CMakeLists.txt new file mode 100644 index 00000000000..bfa7cf0b2f3 --- /dev/null +++ b/tests/auto/dbus/qdbusmarshall/qdbusmarshall/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from qdbusmarshall.pro. + +##################################################################### +## ../tst_qdbusmarshall Test: +##################################################################### + +add_qt_test(../tst_qdbusmarshall + SOURCES + ../tst_qdbusmarshall.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBusPrivate +) + +## Scopes: +##################################################################### + +extend_target(../tst_qdbusmarshall CONDITION QT_FEATURE_dbus_linked + DEFINES + QT_LINKED_LIBDBUS +) + +extend_target(../tst_qdbusmarshall CONDITION NOT QT_FEATURE_dbus_linked + SOURCES + ../../../../../src/dbus/qdbus_symbols.cpp +) diff --git a/tests/auto/dbus/qdbusmarshall/qpong/CMakeLists.txt b/tests/auto/dbus/qdbusmarshall/qpong/CMakeLists.txt new file mode 100644 index 00000000000..358bb235ed3 --- /dev/null +++ b/tests/auto/dbus/qdbusmarshall/qpong/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qpong.pro. + +##################################################################### +## qpong Binary: +##################################################################### + +add_qt_executable(qpong + SOURCES + qpong.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusmetaobject/CMakeLists.txt b/tests/auto/dbus/qdbusmetaobject/CMakeLists.txt new file mode 100644 index 00000000000..661339c4fe3 --- /dev/null +++ b/tests/auto/dbus/qdbusmetaobject/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusmetaobject.pro. + +##################################################################### +## tst_qdbusmetaobject Test: +##################################################################### + +add_qt_test(tst_qdbusmetaobject + SOURCES + tst_qdbusmetaobject.cpp + LIBRARIES + Qt::DBusPrivate +) diff --git a/tests/auto/dbus/qdbusmetatype/CMakeLists.txt b/tests/auto/dbus/qdbusmetatype/CMakeLists.txt new file mode 100644 index 00000000000..cde3362ed85 --- /dev/null +++ b/tests/auto/dbus/qdbusmetatype/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusmetatype.pro. + +##################################################################### +## tst_qdbusmetatype Test: +##################################################################### + +add_qt_test(tst_qdbusmetatype + SOURCES + tst_qdbusmetatype.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbuspendingcall/CMakeLists.txt b/tests/auto/dbus/qdbuspendingcall/CMakeLists.txt new file mode 100644 index 00000000000..86f981221ad --- /dev/null +++ b/tests/auto/dbus/qdbuspendingcall/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbuspendingcall.pro. + +##################################################################### +## tst_qdbuspendingcall Test: +##################################################################### + +add_qt_test(tst_qdbuspendingcall + SOURCES + tst_qdbuspendingcall.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbuspendingreply/CMakeLists.txt b/tests/auto/dbus/qdbuspendingreply/CMakeLists.txt new file mode 100644 index 00000000000..82224c20d60 --- /dev/null +++ b/tests/auto/dbus/qdbuspendingreply/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbuspendingreply.pro. + +##################################################################### +## tst_qdbuspendingreply Test: +##################################################################### + +add_qt_test(tst_qdbuspendingreply + SOURCES + tst_qdbuspendingreply.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusreply/CMakeLists.txt b/tests/auto/dbus/qdbusreply/CMakeLists.txt new file mode 100644 index 00000000000..283be755f64 --- /dev/null +++ b/tests/auto/dbus/qdbusreply/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusreply.pro. + +##################################################################### +## tst_qdbusreply Test: +##################################################################### + +add_qt_test(tst_qdbusreply + SOURCES + tst_qdbusreply.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusservicewatcher/CMakeLists.txt b/tests/auto/dbus/qdbusservicewatcher/CMakeLists.txt new file mode 100644 index 00000000000..fe1c3c7911d --- /dev/null +++ b/tests/auto/dbus/qdbusservicewatcher/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusservicewatcher.pro. + +##################################################################### +## tst_qdbusservicewatcher Test: +##################################################################### + +add_qt_test(tst_qdbusservicewatcher + SOURCES + tst_qdbusservicewatcher.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusthreading/CMakeLists.txt b/tests/auto/dbus/qdbusthreading/CMakeLists.txt new file mode 100644 index 00000000000..7cab309dbfe --- /dev/null +++ b/tests/auto/dbus/qdbusthreading/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qdbusthreading.pro. + +##################################################################### +## tst_qdbusthreading Test: +##################################################################### + +add_qt_test(tst_qdbusthreading + SOURCES + tst_qdbusthreading.cpp + LIBRARIES + Qt::DBus +) diff --git a/tests/auto/dbus/qdbustype/CMakeLists.txt b/tests/auto/dbus/qdbustype/CMakeLists.txt new file mode 100644 index 00000000000..c76f44ba02d --- /dev/null +++ b/tests/auto/dbus/qdbustype/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from qdbustype.pro. + +##################################################################### +## tst_qdbustype Test: +##################################################################### + +add_qt_test(tst_qdbustype + SOURCES + tst_qdbustype.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBusPrivate +) + +## Scopes: +##################################################################### + +extend_target(tst_qdbustype CONDITION QT_FEATURE_dbus_linked + DEFINES + QT_LINKED_LIBDBUS +) + +extend_target(tst_qdbustype CONDITION NOT QT_FEATURE_dbus_linked + SOURCES + ../../../../src/dbus/qdbus_symbols.cpp +) diff --git a/tests/auto/dbus/qdbusxmlparser/CMakeLists.txt b/tests/auto/dbus/qdbusxmlparser/CMakeLists.txt new file mode 100644 index 00000000000..ab35fba0486 --- /dev/null +++ b/tests/auto/dbus/qdbusxmlparser/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qdbusxmlparser.pro. + +##################################################################### +## tst_qdbusxmlparser Test: +##################################################################### + +add_qt_test(tst_qdbusxmlparser + SOURCES + tst_qdbusxmlparser.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBusPrivate + Qt::Xml +) diff --git a/tests/auto/gui/CMakeLists.txt b/tests/auto/gui/CMakeLists.txt new file mode 100644 index 00000000000..8be8abea635 --- /dev/null +++ b/tests/auto/gui/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from gui.pro. + +add_subdirectory("kernel") + +if(NOT APPLE_UIKIT) + add_subdirectory("image") + add_subdirectory("math3d") + add_subdirectory("painting") + if (QT_FEATURE_opengl AND NOT WINRT) + # missing CMakeLists.txt: add_subdirectory("qopenglconfig") + # missing CMakeLists.txt: add_subdirectory("qopengl") + endif() + # if (QT_FEATURE_vulkan) + # add_subdirectory("qvulkan") + # endif() + # add_subdirectory("text") + add_subdirectory("util") + add_subdirectory("itemmodels") +endif() diff --git a/tests/auto/gui/image/CMakeLists.txt b/tests/auto/gui/image/CMakeLists.txt new file mode 100644 index 00000000000..ea56c0474a6 --- /dev/null +++ b/tests/auto/gui/image/CMakeLists.txt @@ -0,0 +1,15 @@ +if (QT_FEATURE_network) +# add_subdirectory("qimagereader") +endif() +# add_subdirectory("qicoimageformat") +# add_subdirectory("qpixmap") +if (QT_FEATURE_private_tests) +# add_subdirectory("qpixmapcache") +endif() +# add_subdirectory("qimage") +add_subdirectory("qimageiohandler") +# add_subdirectory("qimagewriter") +# add_subdirectory("qmovie") +add_subdirectory("qpicture") +# add_subdirectory("qicon") +# add_subdirectory("qiconhighdpi") diff --git a/tests/auto/gui/image/qimageiohandler/CMakeLists.txt b/tests/auto/gui/image/qimageiohandler/CMakeLists.txt new file mode 100644 index 00000000000..fbefeb26d88 --- /dev/null +++ b/tests/auto/gui/image/qimageiohandler/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qimageiohandler SOURCES tst_qimageiohandler.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/image/qpicture/CMakeLists.txt b/tests/auto/gui/image/qpicture/CMakeLists.txt new file mode 100644 index 00000000000..c3db4ffb25e --- /dev/null +++ b/tests/auto/gui/image/qpicture/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpicture SOURCES tst_qpicture.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/itemmodels/CMakeLists.txt b/tests/auto/gui/itemmodels/CMakeLists.txt new file mode 100644 index 00000000000..196168b1b21 --- /dev/null +++ b/tests/auto/gui/itemmodels/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory("qstandarditem") +if (QT_FEATURE_widgets) +# add_subdirectory("qstandarditemmodel") +endif() diff --git a/tests/auto/gui/itemmodels/qstandarditem/CMakeLists.txt b/tests/auto/gui/itemmodels/qstandarditem/CMakeLists.txt new file mode 100644 index 00000000000..cfbf843cacc --- /dev/null +++ b/tests/auto/gui/itemmodels/qstandarditem/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qstandarditem SOURCES tst_qstandarditem.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/kernel/CMakeLists.txt b/tests/auto/gui/kernel/CMakeLists.txt new file mode 100644 index 00000000000..f48625d5395 --- /dev/null +++ b/tests/auto/gui/kernel/CMakeLists.txt @@ -0,0 +1,38 @@ +# add_subdirectory("qbackingstore") +if (NOT ANDROID AND NOT APPLE_UIKIT) +# add_subdirectory("qclipboard") +endif() +add_subdirectory("qcursor") +# add_subdirectory("qdrag") +add_subdirectory("qevent") +add_subdirectory("qfileopenevent") +#add_subdirectory("qguieventdispatcher") +if (QT_FEATURE_network) +# add_subdirectory("qguieventloop") +endif() +# add_subdirectory("qguimetatype") +# add_subdirectory("qguitimer") +add_subdirectory("qguivariant") +# add_subdirectory("qinputmethod") +# add_subdirectory("qkeyevent") +# add_subdirectory("qkeysequence") +add_subdirectory("qmouseevent") +if (QT_FEATURE_widgets) +# add_subdirectory("qmouseevent_modal") + add_subdirectory("qpalette") +endif() +# add_subdirectory("qscreen") +# add_subdirectory("qsurfaceformat") +# add_subdirectory("qtouchevent") +# add_subdirectory("qwindow") +# add_subdirectory("qguiapplication") +# add_subdirectory("qpixelformat") +if (QT_FEATURE_opengl) +# add_subdirectory("qopenglwindow") +endif() +# add_subdirectory("qrasterwindow") + +if(WIN32 AND NOT WINRT AND QT_FEATURE_network) +# add_subdirectory("noqteventloop") +endif() + diff --git a/tests/auto/gui/kernel/qcursor/CMakeLists.txt b/tests/auto/gui/kernel/qcursor/CMakeLists.txt new file mode 100644 index 00000000000..431aa9f3746 --- /dev/null +++ b/tests/auto/gui/kernel/qcursor/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qcursor SOURCES tst_qcursor.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/kernel/qevent/CMakeLists.txt b/tests/auto/gui/kernel/qevent/CMakeLists.txt new file mode 100644 index 00000000000..7fa08d26092 --- /dev/null +++ b/tests/auto/gui/kernel/qevent/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qevent SOURCES tst_qevent.cpp) diff --git a/tests/auto/gui/kernel/qfileopenevent/CMakeLists.txt b/tests/auto/gui/kernel/qfileopenevent/CMakeLists.txt new file mode 100644 index 00000000000..c5bafe3ebed --- /dev/null +++ b/tests/auto/gui/kernel/qfileopenevent/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory("test") +add_subdirectory("qfileopeneventexternal") diff --git a/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/CMakeLists.txt b/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/CMakeLists.txt new file mode 100644 index 00000000000..fddc9399f59 --- /dev/null +++ b/tests/auto/gui/kernel/qfileopenevent/qfileopeneventexternal/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(qfileopeneventexternal SOURCES qfileopeneventexternal.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/kernel/qfileopenevent/test/CMakeLists.txt b/tests/auto/gui/kernel/qfileopenevent/test/CMakeLists.txt new file mode 100644 index 00000000000..122d4497706 --- /dev/null +++ b/tests/auto/gui/kernel/qfileopenevent/test/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qfileopenevent SOURCES tst_qfileopenevent.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/kernel/qguivariant/CMakeLists.txt b/tests/auto/gui/kernel/qguivariant/CMakeLists.txt new file mode 100644 index 00000000000..41b0aacf854 --- /dev/null +++ b/tests/auto/gui/kernel/qguivariant/CMakeLists.txt @@ -0,0 +1,2 @@ +# add_subdirectory("test") +add_subdirectory("no_application") diff --git a/tests/auto/gui/kernel/qguivariant/no_application/CMakeLists.txt b/tests/auto/gui/kernel/qguivariant/no_application/CMakeLists.txt new file mode 100644 index 00000000000..b8acedbe453 --- /dev/null +++ b/tests/auto/gui/kernel/qguivariant/no_application/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(no_application SOURCES main.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/kernel/qmouseevent/CMakeLists.txt b/tests/auto/gui/kernel/qmouseevent/CMakeLists.txt new file mode 100644 index 00000000000..a478d9c0274 --- /dev/null +++ b/tests/auto/gui/kernel/qmouseevent/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qmouseevent SOURCES tst_qmouseevent.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/kernel/qpalette/CMakeLists.txt b/tests/auto/gui/kernel/qpalette/CMakeLists.txt new file mode 100644 index 00000000000..d7573bbc70e --- /dev/null +++ b/tests/auto/gui/kernel/qpalette/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpalette SOURCES tst_qpalette.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/math3d/CMakeLists.txt b/tests/auto/gui/math3d/CMakeLists.txt new file mode 100644 index 00000000000..91e59874b78 --- /dev/null +++ b/tests/auto/gui/math3d/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory("qquaternion") +add_subdirectory("qvectornd") +add_subdirectory("qmatrixnxn") diff --git a/tests/auto/gui/math3d/qmatrixnxn/CMakeLists.txt b/tests/auto/gui/math3d/qmatrixnxn/CMakeLists.txt new file mode 100644 index 00000000000..f1758bf4731 --- /dev/null +++ b/tests/auto/gui/math3d/qmatrixnxn/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test(tst_qmatrixnxn + SOURCES tst_qmatrixnxn.cpp + DEFINES QT_DISABLE_DEPRECATED_BEFORE=0 + LIBRARIES Qt::Gui +) diff --git a/tests/auto/gui/math3d/qquaternion/CMakeLists.txt b/tests/auto/gui/math3d/qquaternion/CMakeLists.txt new file mode 100644 index 00000000000..dd534225355 --- /dev/null +++ b/tests/auto/gui/math3d/qquaternion/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qquaternion SOURCES tst_qquaternion.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/math3d/qvectornd/CMakeLists.txt b/tests/auto/gui/math3d/qvectornd/CMakeLists.txt new file mode 100644 index 00000000000..7a4321740fa --- /dev/null +++ b/tests/auto/gui/math3d/qvectornd/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qvectornd SOURCES tst_qvectornd.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/painting/CMakeLists.txt b/tests/auto/gui/painting/CMakeLists.txt new file mode 100644 index 00000000000..fc62e50c1e4 --- /dev/null +++ b/tests/auto/gui/painting/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from painting.pro. + +add_subdirectory("qpainterpath") +add_subdirectory("qpainterpathstroker") +# add_subdirectory("qcolor") +# add_subdirectory("qbrush") +# add_subdirectory("qregion") +# add_subdirectory("qpagelayout") +add_subdirectory("qpagesize") +# add_subdirectory("qpainter") +if (QT_FEATURE_private_tests) + add_subdirectory("qpathclipper") +endif() +# add_subdirectory("qpdfwriter") +add_subdirectory("qpen") +add_subdirectory("qpaintengine") +# add_subdirectory("qtransform") +# add_subdirectory("qwmatrix") +# add_subdirectory("qpolygon") diff --git a/tests/auto/gui/painting/qpagesize/CMakeLists.txt b/tests/auto/gui/painting/qpagesize/CMakeLists.txt new file mode 100644 index 00000000000..73e7dcfd6b0 --- /dev/null +++ b/tests/auto/gui/painting/qpagesize/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpagesize SOURCES tst_qpagesize.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/painting/qpaintengine/CMakeLists.txt b/tests/auto/gui/painting/qpaintengine/CMakeLists.txt new file mode 100644 index 00000000000..d361a5707b4 --- /dev/null +++ b/tests/auto/gui/painting/qpaintengine/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpaintengine SOURCES tst_qpaintengine.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/painting/qpainterpath/CMakeLists.txt b/tests/auto/gui/painting/qpainterpath/CMakeLists.txt new file mode 100644 index 00000000000..3e4880ae63b --- /dev/null +++ b/tests/auto/gui/painting/qpainterpath/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpainterpath SOURCES tst_qpainterpath.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/painting/qpainterpathstroker/CMakeLists.txt b/tests/auto/gui/painting/qpainterpathstroker/CMakeLists.txt new file mode 100644 index 00000000000..15279ca69f4 --- /dev/null +++ b/tests/auto/gui/painting/qpainterpathstroker/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpainterpathstroker SOURCES tst_qpainterpathstroker.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/painting/qpen/CMakeLists.txt b/tests/auto/gui/painting/qpen/CMakeLists.txt new file mode 100644 index 00000000000..99668679ff6 --- /dev/null +++ b/tests/auto/gui/painting/qpen/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qpen SOURCES tst_qpen.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/util/CMakeLists.txt b/tests/auto/gui/util/CMakeLists.txt new file mode 100644 index 00000000000..c7dec5460df --- /dev/null +++ b/tests/auto/gui/util/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from util.pro. + +# add_subdirectory("qdesktopservices") +add_subdirectory("qdoublevalidator") +add_subdirectory("qintvalidator") +add_subdirectory("qregexpvalidator") +add_subdirectory("qregularexpressionvalidator") +# add_subdirectory("qshadergenerator") +# add_subdirectory("qshadergraph") +# add_subdirectory("qshadergraphloader") +# add_subdirectory("qshadernodes") +# add_subdirectory("qshadernodesloader") +# add_subdirectory("qtexturefilereader") diff --git a/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt b/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt new file mode 100644 index 00000000000..5d6bf2ceeac --- /dev/null +++ b/tests/auto/gui/util/qdoublevalidator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qdoublevalidator SOURCES tst_qdoublevalidator.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/util/qintvalidator/CMakeLists.txt b/tests/auto/gui/util/qintvalidator/CMakeLists.txt new file mode 100644 index 00000000000..54bb16e248f --- /dev/null +++ b/tests/auto/gui/util/qintvalidator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qintvalidator SOURCES tst_qintvalidator.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/util/qregexpvalidator/CMakeLists.txt b/tests/auto/gui/util/qregexpvalidator/CMakeLists.txt new file mode 100644 index 00000000000..1447d702ec3 --- /dev/null +++ b/tests/auto/gui/util/qregexpvalidator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qregexpvalidator SOURCES tst_qregexpvalidator.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt b/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt new file mode 100644 index 00000000000..8d57b0fa08c --- /dev/null +++ b/tests/auto/gui/util/qregularexpressionvalidator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qregularexpressionvalidator SOURCES tst_qregularexpressionvalidator.cpp LIBRARIES Qt::Gui) diff --git a/tests/auto/opengl/CMakeLists.txt b/tests/auto/opengl/CMakeLists.txt new file mode 100644 index 00000000000..54238c1fa60 --- /dev/null +++ b/tests/auto/opengl/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from opengl.pro. + +add_subdirectory(qgl) +add_subdirectory(qglbuffer) +add_subdirectory(qglfunctions) +add_subdirectory(qglthreads) diff --git a/tests/auto/opengl/qgl/CMakeLists.txt b/tests/auto/opengl/qgl/CMakeLists.txt new file mode 100644 index 00000000000..77c0afca75b --- /dev/null +++ b/tests/auto/opengl/qgl/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qgl" SOURCES qgl.qrc tst_qgl.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::OpenGLPrivate + Qt::GuiPrivate + Qt::CorePrivate +) diff --git a/tests/auto/opengl/qglbuffer/CMakeLists.txt b/tests/auto/opengl/qglbuffer/CMakeLists.txt new file mode 100644 index 00000000000..96296846b4a --- /dev/null +++ b/tests/auto/opengl/qglbuffer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qglbuffer" SOURCES tst_qglbuffer.cpp LIBRARIES Qt::OpenGL Qt::Widgets) diff --git a/tests/auto/opengl/qglfunctions/CMakeLists.txt b/tests/auto/opengl/qglfunctions/CMakeLists.txt new file mode 100644 index 00000000000..21a0766ac25 --- /dev/null +++ b/tests/auto/opengl/qglfunctions/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qglfunctions" SOURCES tst_qglfunctions.cpp LIBRARIES Qt::OpenGL Qt::Widgets) diff --git a/tests/auto/opengl/qglthreads/CMakeLists.txt b/tests/auto/opengl/qglthreads/CMakeLists.txt new file mode 100644 index 00000000000..0564fe3e6f3 --- /dev/null +++ b/tests/auto/opengl/qglthreads/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qglthreads" SOURCES tst_qglthreads.cpp tst_qglthreads.h + LIBRARIES + Qt::OpenGL + Qt::Widgets + Qt::GuiPrivate + Qt::CorePrivate +) diff --git a/tests/auto/other/qtokenautomaton/CMakeLists.txt b/tests/auto/other/qtokenautomaton/CMakeLists.txt new file mode 100644 index 00000000000..394dc614f1e --- /dev/null +++ b/tests/auto/other/qtokenautomaton/CMakeLists.txt @@ -0,0 +1,15 @@ +add_qt_test(tst_qtokenautomaton SOURCES + tst_qtokenautomaton.cpp + tokenizers/basic/basic.cpp + tokenizers/basicNamespace/basicNamespace.cpp + tokenizers/boilerplate/boilerplate.cpp + tokenizers/noNamespace/noNamespace.cpp + tokenizers/noToString/noToString.cpp + tokenizers/withNamespace/withNamespace.cpp + tokenizers/basic/basic.h + tokenizers/basicNamespace/basicNamespace.h + tokenizers/boilerplate/boilerplate.h + tokenizers/noNamespace/noNamespace.h + tokenizers/noToString/noToString.h + tokenizers/withNamespace/withNamespace.h +) diff --git a/tests/auto/other/toolsupport/CMakeLists.txt b/tests/auto/other/toolsupport/CMakeLists.txt new file mode 100644 index 00000000000..637a00bffcb --- /dev/null +++ b/tests/auto/other/toolsupport/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_toolsupport SOURCES tst_toolsupport.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/testlib/CMakeLists.txt b/tests/auto/testlib/CMakeLists.txt new file mode 100644 index 00000000000..ff2e0d6d8c2 --- /dev/null +++ b/tests/auto/testlib/CMakeLists.txt @@ -0,0 +1,4 @@ +## add_subdirectory(qabstractitemmodeltester) # FIXME: Needs GUI +add_subdirectory(qsignalspy) +add_subdirectory(selftests) + diff --git a/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt b/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt new file mode 100644 index 00000000000..f99b57a1fda --- /dev/null +++ b/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test(tst_qabstractitemmodeltester SOURCES + tst_qabstractitemmodeltester.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../../other/qabstractitemmodelutils/dynamictreemodel.cpp + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR}/../../other/qabstractitemmodelutils + INCLUDED_MOC + tst_qabstractitemmodeltester.cpp +) diff --git a/tests/auto/testlib/qsignalspy/CMakeLists.txt b/tests/auto/testlib/qsignalspy/CMakeLists.txt new file mode 100644 index 00000000000..ffdaa28de4e --- /dev/null +++ b/tests/auto/testlib/qsignalspy/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsignalspy SOURCES tst_qsignalspy.cpp) diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt new file mode 100644 index 00000000000..ff5aa8f3116 --- /dev/null +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -0,0 +1,42 @@ +# add_subdirectory(alive) # FIXME: Needs widgets +add_subdirectory(assert) +add_subdirectory(badxml) +add_subdirectory(benchlibcallgrind) +add_subdirectory(benchlibcounting) +add_subdirectory(benchlibeventcounter) +add_subdirectory(benchliboptions) +add_subdirectory(benchlibwalltime) +add_subdirectory(commandlinedata) +add_subdirectory(counting) +add_subdirectory(crashes) +add_subdirectory(datatable) +add_subdirectory(datetime) +add_subdirectory(deleteLater) +add_subdirectory(deleteLater_noApp) +add_subdirectory(differentexec) +add_subdirectory(expectfail) +add_subdirectory(failcleanup) +add_subdirectory(failinit) +add_subdirectory(failinitdata) +add_subdirectory(fetchbogus) +add_subdirectory(float) +add_subdirectory(globaldata) +add_subdirectory(longstring) +add_subdirectory(maxwarnings) +add_subdirectory(multiexec) +add_subdirectory(pairdiagnostics) +add_subdirectory(printdatatags) +add_subdirectory(printdatatagswithglobaltags) +add_subdirectory(qexecstringlist) +add_subdirectory(singleskip) +add_subdirectory(skip) +add_subdirectory(skipcleanup) +add_subdirectory(skipinit) +add_subdirectory(skipinitdata) +add_subdirectory(sleep) +add_subdirectory(strcmp) +add_subdirectory(subtest) +add_subdirectory(tuplediagnostics) +add_subdirectory(warnings) +add_subdirectory(xunit) + diff --git a/tests/auto/testlib/selftests/alive/CMakeLists.txt b/tests/auto/testlib/selftests/alive/CMakeLists.txt new file mode 100644 index 00000000000..3523c5b11e1 --- /dev/null +++ b/tests/auto/testlib/selftests/alive/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(alive SOURCES tst_alive.cpp) diff --git a/tests/auto/testlib/selftests/assert/CMakeLists.txt b/tests/auto/testlib/selftests/assert/CMakeLists.txt new file mode 100644 index 00000000000..f9882750380 --- /dev/null +++ b/tests/auto/testlib/selftests/assert/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(assert SOURCES tst_assert.cpp) diff --git a/tests/auto/testlib/selftests/badxml/CMakeLists.txt b/tests/auto/testlib/selftests/badxml/CMakeLists.txt new file mode 100644 index 00000000000..9a709a2d7d0 --- /dev/null +++ b/tests/auto/testlib/selftests/badxml/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(badxml SOURCES tst_badxml.cpp LIBRARIES Qt::CorePrivate) diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt new file mode 100644 index 00000000000..f247623e6c4 --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(benchlibcallgrind SOURCES tst_benchlibcallgrind.cpp) diff --git a/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt new file mode 100644 index 00000000000..e8df2820d6f --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(benchlibcounting SOURCES tst_benchlibcounting.cpp) diff --git a/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt new file mode 100644 index 00000000000..b98c46c870e --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(benchlibeventcounter SOURCES tst_benchlibeventcounter.cpp) diff --git a/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt b/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt new file mode 100644 index 00000000000..c7e57e60809 --- /dev/null +++ b/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(benchliboptions SOURCES tst_benchliboptions.cpp) diff --git a/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt new file mode 100644 index 00000000000..d774fb95c08 --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(benchlibwalltime SOURCES tst_benchlibwalltime.cpp) diff --git a/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt b/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt new file mode 100644 index 00000000000..a9d4fee477e --- /dev/null +++ b/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(commandlinedata SOURCES tst_commandlinedata.cpp) diff --git a/tests/auto/testlib/selftests/counting/CMakeLists.txt b/tests/auto/testlib/selftests/counting/CMakeLists.txt new file mode 100644 index 00000000000..bde163f6633 --- /dev/null +++ b/tests/auto/testlib/selftests/counting/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(counting SOURCES tst_counting.cpp) diff --git a/tests/auto/testlib/selftests/crashes/CMakeLists.txt b/tests/auto/testlib/selftests/crashes/CMakeLists.txt new file mode 100644 index 00000000000..046e0e0fcc1 --- /dev/null +++ b/tests/auto/testlib/selftests/crashes/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(crashes SOURCES tst_crashes.cpp) diff --git a/tests/auto/testlib/selftests/datatable/CMakeLists.txt b/tests/auto/testlib/selftests/datatable/CMakeLists.txt new file mode 100644 index 00000000000..a6f5bd10a76 --- /dev/null +++ b/tests/auto/testlib/selftests/datatable/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(datatable SOURCES tst_datatable.cpp) diff --git a/tests/auto/testlib/selftests/datetime/CMakeLists.txt b/tests/auto/testlib/selftests/datetime/CMakeLists.txt new file mode 100644 index 00000000000..989f9b242cc --- /dev/null +++ b/tests/auto/testlib/selftests/datetime/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(datetime SOURCES tst_datetime.cpp) diff --git a/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt b/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt new file mode 100644 index 00000000000..e07f87a1111 --- /dev/null +++ b/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_deleteLater SOURCES tst_deleteLater.cpp) diff --git a/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt b/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt new file mode 100644 index 00000000000..cd2818e2f7f --- /dev/null +++ b/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_deleteLater_noApp SOURCES tst_deleteLater_noApp.cpp) diff --git a/tests/auto/testlib/selftests/differentexec/CMakeLists.txt b/tests/auto/testlib/selftests/differentexec/CMakeLists.txt new file mode 100644 index 00000000000..9dd4fb2e891 --- /dev/null +++ b/tests/auto/testlib/selftests/differentexec/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(differentexec SOURCES tst_differentexec.cpp) diff --git a/tests/auto/testlib/selftests/expectfail/CMakeLists.txt b/tests/auto/testlib/selftests/expectfail/CMakeLists.txt new file mode 100644 index 00000000000..72dd051b7cf --- /dev/null +++ b/tests/auto/testlib/selftests/expectfail/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(expectfail SOURCES tst_expectfail.cpp) diff --git a/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt b/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt new file mode 100644 index 00000000000..d6dae7593fa --- /dev/null +++ b/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(failcleanup SOURCES tst_failcleanup.cpp) diff --git a/tests/auto/testlib/selftests/failinit/CMakeLists.txt b/tests/auto/testlib/selftests/failinit/CMakeLists.txt new file mode 100644 index 00000000000..11c0cacf7f0 --- /dev/null +++ b/tests/auto/testlib/selftests/failinit/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(failinit SOURCES tst_failinit.cpp) diff --git a/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt b/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt new file mode 100644 index 00000000000..ac7f01423ef --- /dev/null +++ b/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(failinitdata SOURCES tst_failinitdata.cpp) diff --git a/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt b/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt new file mode 100644 index 00000000000..854f63ec203 --- /dev/null +++ b/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(fetchbogus SOURCES tst_fetchbogus.cpp) diff --git a/tests/auto/testlib/selftests/float/CMakeLists.txt b/tests/auto/testlib/selftests/float/CMakeLists.txt new file mode 100644 index 00000000000..6068aa3a1e7 --- /dev/null +++ b/tests/auto/testlib/selftests/float/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(float SOURCES tst_float.cpp) diff --git a/tests/auto/testlib/selftests/globaldata/CMakeLists.txt b/tests/auto/testlib/selftests/globaldata/CMakeLists.txt new file mode 100644 index 00000000000..2722788c8e1 --- /dev/null +++ b/tests/auto/testlib/selftests/globaldata/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(globaldata SOURCES tst_globaldata.cpp) diff --git a/tests/auto/testlib/selftests/longstring/CMakeLists.txt b/tests/auto/testlib/selftests/longstring/CMakeLists.txt new file mode 100644 index 00000000000..56912b6cd10 --- /dev/null +++ b/tests/auto/testlib/selftests/longstring/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(longstring SOURCES tst_longstring.cpp) diff --git a/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt b/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt new file mode 100644 index 00000000000..c9077b32b0f --- /dev/null +++ b/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(maxwarnings SOURCES maxwarnings.cpp) diff --git a/tests/auto/testlib/selftests/multiexec/CMakeLists.txt b/tests/auto/testlib/selftests/multiexec/CMakeLists.txt new file mode 100644 index 00000000000..bee72b2b178 --- /dev/null +++ b/tests/auto/testlib/selftests/multiexec/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(multiexec SOURCES tst_multiexec.cpp) diff --git a/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt b/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt new file mode 100644 index 00000000000..677be5403a0 --- /dev/null +++ b/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(pairdiagnostics SOURCES tst_pairdiagnostics.cpp) diff --git a/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt b/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt new file mode 100644 index 00000000000..778dcc184f8 --- /dev/null +++ b/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(printdatatags SOURCES tst_printdatatags.cpp) diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt b/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt new file mode 100644 index 00000000000..0942ed15d41 --- /dev/null +++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(printdatatagswithglobaltags SOURCES tst_printdatatagswithglobaltags.cpp) diff --git a/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt b/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt new file mode 100644 index 00000000000..6429b5f5319 --- /dev/null +++ b/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(qexecstringlist SOURCES tst_qexecstringlist.cpp) diff --git a/tests/auto/testlib/selftests/singleskip/CMakeLists.txt b/tests/auto/testlib/selftests/singleskip/CMakeLists.txt new file mode 100644 index 00000000000..041b06aabb5 --- /dev/null +++ b/tests/auto/testlib/selftests/singleskip/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(singleskip SOURCES tst_singleskip.cpp) diff --git a/tests/auto/testlib/selftests/skip/CMakeLists.txt b/tests/auto/testlib/selftests/skip/CMakeLists.txt new file mode 100644 index 00000000000..974020cdbc0 --- /dev/null +++ b/tests/auto/testlib/selftests/skip/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(skip SOURCES tst_skip.cpp) diff --git a/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt b/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt new file mode 100644 index 00000000000..bf8c6e7adeb --- /dev/null +++ b/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(skipcleanup SOURCES tst_skipcleanup.cpp) diff --git a/tests/auto/testlib/selftests/skipinit/CMakeLists.txt b/tests/auto/testlib/selftests/skipinit/CMakeLists.txt new file mode 100644 index 00000000000..a9eb542e1c4 --- /dev/null +++ b/tests/auto/testlib/selftests/skipinit/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(skipinit SOURCES tst_skipinit.cpp) diff --git a/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt b/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt new file mode 100644 index 00000000000..cc38fed14fa --- /dev/null +++ b/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(skipinitdata SOURCES tst_skipinitdata.cpp) diff --git a/tests/auto/testlib/selftests/sleep/CMakeLists.txt b/tests/auto/testlib/selftests/sleep/CMakeLists.txt new file mode 100644 index 00000000000..49c5e97ac20 --- /dev/null +++ b/tests/auto/testlib/selftests/sleep/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(sleep SOURCES tst_sleep.cpp) diff --git a/tests/auto/testlib/selftests/strcmp/CMakeLists.txt b/tests/auto/testlib/selftests/strcmp/CMakeLists.txt new file mode 100644 index 00000000000..cb50518af22 --- /dev/null +++ b/tests/auto/testlib/selftests/strcmp/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(strcmp SOURCES tst_strcmp.cpp) diff --git a/tests/auto/testlib/selftests/subtest/CMakeLists.txt b/tests/auto/testlib/selftests/subtest/CMakeLists.txt new file mode 100644 index 00000000000..434fd88563f --- /dev/null +++ b/tests/auto/testlib/selftests/subtest/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(subtest SOURCES tst_subtest.cpp) diff --git a/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt b/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt new file mode 100644 index 00000000000..1dfe64c642a --- /dev/null +++ b/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tuplediagnostics SOURCES tst_tuplediagnostics.cpp) diff --git a/tests/auto/testlib/selftests/warnings/CMakeLists.txt b/tests/auto/testlib/selftests/warnings/CMakeLists.txt new file mode 100644 index 00000000000..35f53f2822d --- /dev/null +++ b/tests/auto/testlib/selftests/warnings/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(warnings SOURCES tst_warnings.cpp) diff --git a/tests/auto/testlib/selftests/xunit/CMakeLists.txt b/tests/auto/testlib/selftests/xunit/CMakeLists.txt new file mode 100644 index 00000000000..8c151ab1acc --- /dev/null +++ b/tests/auto/testlib/selftests/xunit/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(xunit SOURCES tst_xunit.cpp) diff --git a/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt b/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt new file mode 100644 index 00000000000..c6dbbcdc3ad --- /dev/null +++ b/tests/auto/tools/qdbusxml2cpp/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qdbusxml2cpp SOURCES tst_qdbusxml2cpp.cpp) diff --git a/tests/auto/tools/uic/CMakeLists.txt b/tests/auto/tools/uic/CMakeLists.txt new file mode 100644 index 00000000000..22d43d98683 --- /dev/null +++ b/tests/auto/tools/uic/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_uic SOURCES tst_uic.cpp) diff --git a/tests/auto/widgets/CMakeLists.txt b/tests/auto/widgets/CMakeLists.txt new file mode 100644 index 00000000000..5870f28db0d --- /dev/null +++ b/tests/auto/widgets/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from widgets.pro. + +add_subdirectory(dialogs) +add_subdirectory(effects) +add_subdirectory(graphicsview) +add_subdirectory(itemviews) +add_subdirectory(kernel) +add_subdirectory(styles) +add_subdirectory(util) +add_subdirectory(widgets) diff --git a/tests/auto/widgets/dialogs/CMakeLists.txt b/tests/auto/widgets/dialogs/CMakeLists.txt new file mode 100644 index 00000000000..508093e7ad6 --- /dev/null +++ b/tests/auto/widgets/dialogs/CMakeLists.txt @@ -0,0 +1,19 @@ +add_subdirectory(qcolordialog) +add_subdirectory(qdialog) +add_subdirectory(qerrormessage) +if (NOT WINRT) + add_subdirectory(qfiledialog) + add_subdirectory(qfiledialog2) + add_subdirectory(qmessagebox) +endif() +if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR NOT WIN32) + add_subdirectory(qfilesystemmodel) +endif() +add_subdirectory(qfontdialog) +add_subdirectory(qinputdialog) +add_subdirectory(qprogressdialog) +if (QT_FEATURE_private_tests) + add_subdirectory(qsidebar) +endif() +add_subdirectory(qwizard) + diff --git a/tests/auto/widgets/dialogs/qcolordialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qcolordialog/CMakeLists.txt new file mode 100644 index 00000000000..c025189fd54 --- /dev/null +++ b/tests/auto/widgets/dialogs/qcolordialog/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qcolordialog" SOURCES tst_qcolordialog.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/dialogs/qdialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qdialog/CMakeLists.txt new file mode 100644 index 00000000000..1164e9ed6a3 --- /dev/null +++ b/tests/auto/widgets/dialogs/qdialog/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test("tst_qdialog" + SOURCES + tst_qdialog.cpp + LIBRARIES + Qt::Widgets + Qt::GuiPrivate + Qt::CorePrivate +) diff --git a/tests/auto/widgets/dialogs/qerrormessage/CMakeLists.txt b/tests/auto/widgets/dialogs/qerrormessage/CMakeLists.txt new file mode 100644 index 00000000000..f1b03de367e --- /dev/null +++ b/tests/auto/widgets/dialogs/qerrormessage/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qerrormessage" SOURCES tst_qerrormessage.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt new file mode 100644 index 00000000000..7c22f8fa7b8 --- /dev/null +++ b/tests/auto/widgets/dialogs/qfiledialog/CMakeLists.txt @@ -0,0 +1,9 @@ +add_qt_test("tst_qfiledialog" + SOURCES tst_qfiledialog.cpp + DEFINES SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) + diff --git a/tests/auto/widgets/dialogs/qfiledialog2/CMakeLists.txt b/tests/auto/widgets/dialogs/qfiledialog2/CMakeLists.txt new file mode 100644 index 00000000000..7bf7b09de17 --- /dev/null +++ b/tests/auto/widgets/dialogs/qfiledialog2/CMakeLists.txt @@ -0,0 +1,10 @@ +add_qt_test("tst_qfiledialog2" + SOURCES + tst_qfiledialog2.cpp + DEFINES + SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/CMakeLists.txt b/tests/auto/widgets/dialogs/qfilesystemmodel/CMakeLists.txt new file mode 100644 index 00000000000..bf615c6805a --- /dev/null +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test("tst_qfilesystemmodel" SOURCES tst_qfilesystemmodel.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate +) diff --git a/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt new file mode 100644 index 00000000000..099fee7a51c --- /dev/null +++ b/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt @@ -0,0 +1,9 @@ +add_qt_test("tst_qfontdialog" + SOURCES + testfonts.qrc + tst_qfontdialog.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/dialogs/qinputdialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qinputdialog/CMakeLists.txt new file mode 100644 index 00000000000..4abe5542918 --- /dev/null +++ b/tests/auto/widgets/dialogs/qinputdialog/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qinputdialog" SOURCES tst_qinputdialog.cpp LIBRARIES Qt::WidgetsPrivate) diff --git a/tests/auto/widgets/dialogs/qmessagebox/CMakeLists.txt b/tests/auto/widgets/dialogs/qmessagebox/CMakeLists.txt new file mode 100644 index 00000000000..785a1a01846 --- /dev/null +++ b/tests/auto/widgets/dialogs/qmessagebox/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qmessagebox" SOURCES tst_qmessagebox.cpp + LIBRARIES + Qt::GuiPrivate + Qt::CorePrivate + Qt::Widgets +) diff --git a/tests/auto/widgets/dialogs/qprogressdialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qprogressdialog/CMakeLists.txt new file mode 100644 index 00000000000..894f2ab37e1 --- /dev/null +++ b/tests/auto/widgets/dialogs/qprogressdialog/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qprogressdialog" SOURCES tst_qprogressdialog.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/dialogs/qsidebar/CMakeLists.txt b/tests/auto/widgets/dialogs/qsidebar/CMakeLists.txt new file mode 100644 index 00000000000..6f92dc58fc6 --- /dev/null +++ b/tests/auto/widgets/dialogs/qsidebar/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test("tst_qsidebar" SOURCES tst_qsidebar.cpp + LIBRARIES + Qt::CorePrivate + Qt::WidgetsPrivate +) diff --git a/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt b/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt new file mode 100644 index 00000000000..3d88e2cb694 --- /dev/null +++ b/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test("tst_qwizard" + SOURCES + qwizard.qrc + tst_qwizard.cpp + tst_qwizard_2.cpp + LIBRARIES + Qt::Widgets +) diff --git a/tests/auto/widgets/effects/CMakeLists.txt b/tests/auto/widgets/effects/CMakeLists.txt new file mode 100644 index 00000000000..2e2045e33e1 --- /dev/null +++ b/tests/auto/widgets/effects/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(qgraphicseffect) +add_subdirectory(qpixmapfilter) diff --git a/tests/auto/widgets/effects/qgraphicseffect/CMakeLists.txt b/tests/auto/widgets/effects/qgraphicseffect/CMakeLists.txt new file mode 100644 index 00000000000..e3388bba730 --- /dev/null +++ b/tests/auto/widgets/effects/qgraphicseffect/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicseffect" SOURCES tst_qgraphicseffect.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/effects/qpixmapfilter/CMakeLists.txt b/tests/auto/widgets/effects/qpixmapfilter/CMakeLists.txt new file mode 100644 index 00000000000..5d7df75bac2 --- /dev/null +++ b/tests/auto/widgets/effects/qpixmapfilter/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test("tst_qpixmapfilter" SOURCES tst_qpixmapfilter.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/graphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/CMakeLists.txt new file mode 100644 index 00000000000..8007ac18a05 --- /dev/null +++ b/tests/auto/widgets/graphicsview/CMakeLists.txt @@ -0,0 +1,25 @@ +if (QT_FEATURE_private_tests) + add_subdirectory(qgraphicsanchorlayout) + add_subdirectory(qgraphicsanchorlayout1) + add_subdirectory(qgraphicsitem) + add_subdirectory(qgraphicsscene) + add_subdirectory(qgraphicssceneindex) +endif() +add_subdirectory(qgraphicseffectsource) +add_subdirectory(qgraphicsgridlayout) +add_subdirectory(qgraphicsitemanimation) +add_subdirectory(qgraphicslayout) +add_subdirectory(qgraphicslayoutitem) +add_subdirectory(qgraphicslinearlayout) +add_subdirectory(qgraphicsobject) +add_subdirectory(qgraphicspixmapitem) +add_subdirectory(qgraphicspolygonitem) +add_subdirectory(qgraphicstransform) +if (NOT WINRT) + add_subdirectory(qgraphicsview) +endif() + +if(FALSE) # FIXME: How to test for fusion style?! + add_subdirectory(qgraphicsproxywidget) + add_subdirectory(qgraphicswidget) +endif() diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt new file mode 100644 index 00000000000..6e97335a9af --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicsanchorlayout" SOURCES tst_qgraphicsanchorlayout.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt new file mode 100644 index 00000000000..ef52c03bc88 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsanchorlayout1/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicsanchorlayout1" SOURCES tst_qgraphicsanchorlayout1.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt new file mode 100644 index 00000000000..51add34605d --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicseffectsource/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicseffectsource" SOURCES tst_qgraphicseffectsource.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt new file mode 100644 index 00000000000..ecb90ea557e --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicsgridlayout" SOURCES tst_qgraphicsgridlayout.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt new file mode 100644 index 00000000000..e5446407ab0 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/CMakeLists.txt @@ -0,0 +1,11 @@ +add_qt_test("tst_qgraphicsitem" SOURCES tst_qgraphicsitem.cpp + DEFINES + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::WidgetsPrivate + Qt::TestPrivate + Qt::CorePrivate + Qt::GuiPrivate +) + +extend_target("tst_qgraphicsitem" CONDITION WIN32 AND NOT WINRT LIBRARIES -luser32) diff --git a/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt new file mode 100644 index 00000000000..7fe81cb6ea4 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsitemanimation/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicsitemanimation" SOURCES tst_qgraphicsitemanimation.cpp + DEFINES + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::Widgets +) diff --git a/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt new file mode 100644 index 00000000000..65ae39ae8f8 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicslayout/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicslayout" SOURCES tst_qgraphicslayout.cpp + DEFINES + QT_USE_USING_NAMESPACE + LIBRARIES + Qt::Widgets +) diff --git a/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt new file mode 100644 index 00000000000..8f1e57ea47d --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicslayoutitem/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicslayoutitem" SOURCES tst_qgraphicslayoutitem.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt new file mode 100644 index 00000000000..b4d4b6630a3 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicslinearlayout/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicslinearlayout" SOURCES tst_qgraphicslinearlayout.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt new file mode 100644 index 00000000000..8d5d7ddfe40 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsobject/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicsobject" SOURCES tst_qgraphicsobject.cpp LIBRARIES Qt::Widgets Qt::CorePrivate) diff --git a/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt new file mode 100644 index 00000000000..d6c87306da3 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicspixmapitem/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicspixmapitem" SOURCES tst_qgraphicspixmapitem.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt new file mode 100644 index 00000000000..df9f5c71fe7 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicspolygonitem/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicspolygonitem" SOURCES tst_qgraphicspolygonitem.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt new file mode 100644 index 00000000000..0dd32c50dd5 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/CMakeLists.txt @@ -0,0 +1,10 @@ +add_qt_test("tst_qgraphicsproxywidget" + SOURCES + tst_qgraphicsproxywidget.cpp + DEFINES + QTEST_QPA_MOUSE_HANDLING + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt new file mode 100644 index 00000000000..e3c0ed8559c --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsscene/CMakeLists.txt @@ -0,0 +1,15 @@ +add_qt_test("tst_qgraphicsscene" + SOURCES + images.qrc + testdata.qrc + tst_qgraphicsscene.cpp + DEFINES + SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) + +extend_target("tst_qgraphicsscene" CONDITION WIN32 AND NOT WINRT LIBRARIES -luser32) diff --git a/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt new file mode 100644 index 00000000000..127e4d1d2f8 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicssceneindex/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicssceneindex" SOURCES tst_qgraphicssceneindex.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt new file mode 100644 index 00000000000..638432f39e7 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicstransform/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgraphicstransform" SOURCES tst_qgraphicstransform.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt new file mode 100644 index 00000000000..9541044cfd4 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicsview/CMakeLists.txt @@ -0,0 +1,12 @@ +add_qt_test("tst_qgraphicsview" + SOURCES + tst_qgraphicsview.cpp tst_qgraphicsview.h + tst_qgraphicsview_2.cpp + DEFINES + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt b/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt new file mode 100644 index 00000000000..dd84df47588 --- /dev/null +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgraphicswidget" SOURCES tst_qgraphicswidget.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/itemviews/CMakeLists.txt b/tests/auto/widgets/itemviews/CMakeLists.txt new file mode 100644 index 00000000000..a1bbf052e84 --- /dev/null +++ b/tests/auto/widgets/itemviews/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from itemviews.pro. + +add_subdirectory(qabstractitemview) +add_subdirectory(qdatawidgetmapper) +add_subdirectory(qdirmodel) +add_subdirectory(qfileiconprovider) +# add_subdirectory(qheaderview) ## FIXME: Fails to build! +add_subdirectory(qitemdelegate) +add_subdirectory(qitemeditorfactory) +add_subdirectory(qitemview) +add_subdirectory(qlistview) +add_subdirectory(qtableview) +add_subdirectory(qtablewidget) +add_subdirectory(qtreeview) +add_subdirectory(qtreewidget) +add_subdirectory(qtreewidgetitemiterator) + +if(QT_FEATURE_private_tests) + add_subdirectory(qcolumnview) + add_subdirectory(qlistwidget) +endif() diff --git a/tests/auto/widgets/itemviews/qabstractitemview/CMakeLists.txt b/tests/auto/widgets/itemviews/qabstractitemview/CMakeLists.txt new file mode 100644 index 00000000000..dbabcecf8ac --- /dev/null +++ b/tests/auto/widgets/itemviews/qabstractitemview/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test("tst_qabstractitemview" SOURCES tst_qabstractitemview.cpp + LIBRARIES + Qt::Widgets + Qt::TestPrivate +) diff --git a/tests/auto/widgets/itemviews/qcolumnview/CMakeLists.txt b/tests/auto/widgets/itemviews/qcolumnview/CMakeLists.txt new file mode 100644 index 00000000000..07ae31be613 --- /dev/null +++ b/tests/auto/widgets/itemviews/qcolumnview/CMakeLists.txt @@ -0,0 +1,11 @@ +add_qt_test("tst_qcolumnview" + SOURCES + ../../../../shared/fakedirmodel.h + tst_qcolumnview.cpp + LIBRARIES + Qt::Widgets + Qt::WidgetsPrivate + Qt::GuiPrivate + Qt::CorePrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/itemviews/qdatawidgetmapper/CMakeLists.txt b/tests/auto/widgets/itemviews/qdatawidgetmapper/CMakeLists.txt new file mode 100644 index 00000000000..ef7d9cf63ee --- /dev/null +++ b/tests/auto/widgets/itemviews/qdatawidgetmapper/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qdatawidgetmapper" SOURCES tst_qdatawidgetmapper.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/itemviews/qdirmodel/CMakeLists.txt b/tests/auto/widgets/itemviews/qdirmodel/CMakeLists.txt new file mode 100644 index 00000000000..29ffde1801b --- /dev/null +++ b/tests/auto/widgets/itemviews/qdirmodel/CMakeLists.txt @@ -0,0 +1,19 @@ +add_qt_test("tst_qdirmodel" + SOURCES + ../../../../shared/emulationdetector.h + tst_qdirmodel.cpp + INCLUDE_DIRECTORIES + ../../../../shared/ + LIBRARIES + Qt::Widgets +) + +extend_target("tst_qdirmodel" CONDITION ANDROID DEFINES SRCDIR="./") + +extend_target("tst_qdirmodel" CONDITION NOT ANDROID + DEFINES SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" +) + +extend_target("tst_qdirmodel" CONDITION ANDROID AND NOT ANDROID_EMBEDDED + SOURCES testdata.qrc +) diff --git a/tests/auto/widgets/itemviews/qfileiconprovider/CMakeLists.txt b/tests/auto/widgets/itemviews/qfileiconprovider/CMakeLists.txt new file mode 100644 index 00000000000..c1aa9a8d3f6 --- /dev/null +++ b/tests/auto/widgets/itemviews/qfileiconprovider/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qfileiconprovider" SOURCES tst_qfileiconprovider.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/itemviews/qheaderview/CMakeLists.txt b/tests/auto/widgets/itemviews/qheaderview/CMakeLists.txt new file mode 100644 index 00000000000..512179bccaf --- /dev/null +++ b/tests/auto/widgets/itemviews/qheaderview/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qheaderview" SOURCES tst_qheaderview.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/itemviews/qitemdelegate/CMakeLists.txt b/tests/auto/widgets/itemviews/qitemdelegate/CMakeLists.txt new file mode 100644 index 00000000000..70cc1a7540a --- /dev/null +++ b/tests/auto/widgets/itemviews/qitemdelegate/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test("tst_qitemdelegate" SOURCES tst_qitemdelegate.cpp LIBRARIES Qt::WidgetsPrivate) + +extend_target("tst_qitemdelegate" CONDITION WIN32 AND NOT WINRT LIBRARIES -luser32) diff --git a/tests/auto/widgets/itemviews/qitemeditorfactory/CMakeLists.txt b/tests/auto/widgets/itemviews/qitemeditorfactory/CMakeLists.txt new file mode 100644 index 00000000000..7100fb802f9 --- /dev/null +++ b/tests/auto/widgets/itemviews/qitemeditorfactory/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qitemeditorfactory" SOURCES tst_qitemeditorfactory.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/itemviews/qitemview/CMakeLists.txt b/tests/auto/widgets/itemviews/qitemview/CMakeLists.txt new file mode 100644 index 00000000000..9b298d97f37 --- /dev/null +++ b/tests/auto/widgets/itemviews/qitemview/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qitemview" SOURCES tst_qitemview.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/itemviews/qlistview/CMakeLists.txt b/tests/auto/widgets/itemviews/qlistview/CMakeLists.txt new file mode 100644 index 00000000000..56812234c83 --- /dev/null +++ b/tests/auto/widgets/itemviews/qlistview/CMakeLists.txt @@ -0,0 +1,13 @@ +add_qt_test("tst_qlistview" + SOURCES + tst_qlistview.cpp + LIBRARIES + Qt::GuiPrivate + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::TestPrivate +) + +extend_target("tst_qlistview" CONDITION WIN32 AND NOT WINRT + LIBRARIES -luser32 +) diff --git a/tests/auto/widgets/itemviews/qlistwidget/CMakeLists.txt b/tests/auto/widgets/itemviews/qlistwidget/CMakeLists.txt new file mode 100644 index 00000000000..5b16aa61a61 --- /dev/null +++ b/tests/auto/widgets/itemviews/qlistwidget/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test("tst_qlistwidget" + SOURCES + tst_qlistwidget.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/itemviews/qtableview/CMakeLists.txt b/tests/auto/widgets/itemviews/qtableview/CMakeLists.txt new file mode 100644 index 00000000000..655d91d3000 --- /dev/null +++ b/tests/auto/widgets/itemviews/qtableview/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qtableview" SOURCES tst_qtableview.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/itemviews/qtablewidget/CMakeLists.txt b/tests/auto/widgets/itemviews/qtablewidget/CMakeLists.txt new file mode 100644 index 00000000000..f8bcef068ee --- /dev/null +++ b/tests/auto/widgets/itemviews/qtablewidget/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtablewidget" SOURCES tst_qtablewidget.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/itemviews/qtreeview/CMakeLists.txt b/tests/auto/widgets/itemviews/qtreeview/CMakeLists.txt new file mode 100644 index 00000000000..582b45ef785 --- /dev/null +++ b/tests/auto/widgets/itemviews/qtreeview/CMakeLists.txt @@ -0,0 +1,11 @@ +add_qt_test("tst_qtreeview" + SOURCES + ../../../../shared/fakedirmodel.h + tst_qtreeview.cpp + LIBRARIES + Qt::Widgets + Qt::WidgetsPrivate + Qt::GuiPrivate + Qt::CorePrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/itemviews/qtreewidget/CMakeLists.txt b/tests/auto/widgets/itemviews/qtreewidget/CMakeLists.txt new file mode 100644 index 00000000000..6d180e21671 --- /dev/null +++ b/tests/auto/widgets/itemviews/qtreewidget/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtreewidget" SOURCES tst_qtreewidget.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/itemviews/qtreewidgetitemiterator/CMakeLists.txt b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/CMakeLists.txt new file mode 100644 index 00000000000..c29cb76bc8e --- /dev/null +++ b/tests/auto/widgets/itemviews/qtreewidgetitemiterator/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtreewidgetitemiterator" SOURCES tst_qtreewidgetitemiterator.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/CMakeLists.txt b/tests/auto/widgets/kernel/CMakeLists.txt new file mode 100644 index 00000000000..046f12e014d --- /dev/null +++ b/tests/auto/widgets/kernel/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from kernel.pro. + +add_subdirectory(qaction) +add_subdirectory(qactiongroup) +# add_subdirectory(qapplication) # FIXME: Enable this! +add_subdirectory(qboxlayout) +add_subdirectory(qdesktopwidget) +add_subdirectory(qformlayout) +add_subdirectory(qgridlayout) +add_subdirectory(qlayout) +add_subdirectory(qstackedlayout) +add_subdirectory(qtooltip) +add_subdirectory(qwidget) +add_subdirectory(qwidget_window) +add_subdirectory(qwidgetaction) +add_subdirectory(qwidgetmetatype) +add_subdirectory(qwidgetsvariant) +add_subdirectory(qwindowcontainer) +add_subdirectory(qshortcut) +add_subdirectory(qsizepolicy) +if(OFF) + add_subdirectory(qsound) +endif() + +if(NOT APPLE) + add_subdirectory(qgesturerecognizer) +endif() diff --git a/tests/auto/widgets/kernel/kernel.pro b/tests/auto/widgets/kernel/kernel.pro index 73fd9345025..0382264eb88 100644 --- a/tests/auto/widgets/kernel/kernel.pro +++ b/tests/auto/widgets/kernel/kernel.pro @@ -20,7 +20,7 @@ SUBDIRS=\ qshortcut \ qsizepolicy -darwin:SUBDIRS -= \ # Uses native recognizers +darwin:SUBDIRS -= \ qgesturerecognizer \ SUBDIRS -= qsound diff --git a/tests/auto/widgets/kernel/qaction/CMakeLists.txt b/tests/auto/widgets/kernel/qaction/CMakeLists.txt new file mode 100644 index 00000000000..8bea25a189e --- /dev/null +++ b/tests/auto/widgets/kernel/qaction/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qaction" SOURCES tst_qaction.cpp + LIBRARIES + Qt::GuiPrivate + Qt::CorePrivate + Qt::Widgets +) diff --git a/tests/auto/widgets/kernel/qactiongroup/CMakeLists.txt b/tests/auto/widgets/kernel/qactiongroup/CMakeLists.txt new file mode 100644 index 00000000000..404e1bab601 --- /dev/null +++ b/tests/auto/widgets/kernel/qactiongroup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qactiongroup" SOURCES tst_qactiongroup.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/qboxlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qboxlayout/CMakeLists.txt new file mode 100644 index 00000000000..0fb220514b9 --- /dev/null +++ b/tests/auto/widgets/kernel/qboxlayout/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qboxlayout" SOURCES tst_qboxlayout.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) diff --git a/tests/auto/widgets/kernel/qdesktopwidget/CMakeLists.txt b/tests/auto/widgets/kernel/qdesktopwidget/CMakeLists.txt new file mode 100644 index 00000000000..6cfea9d4f44 --- /dev/null +++ b/tests/auto/widgets/kernel/qdesktopwidget/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qdesktopwidget" SOURCES tst_qdesktopwidget.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/qformlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qformlayout/CMakeLists.txt new file mode 100644 index 00000000000..c5ef0946f99 --- /dev/null +++ b/tests/auto/widgets/kernel/qformlayout/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qformlayout" SOURCES tst_qformlayout.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) diff --git a/tests/auto/widgets/kernel/qgesturerecognizer/CMakeLists.txt b/tests/auto/widgets/kernel/qgesturerecognizer/CMakeLists.txt new file mode 100644 index 00000000000..fe47f9bcd6e --- /dev/null +++ b/tests/auto/widgets/kernel/qgesturerecognizer/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qgesturerecognizer" SOURCES tst_qgesturerecognizer.cpp + LIBRARIES + Qt::Widgets + Qt::GuiPrivate + Qt::CorePrivate +) diff --git a/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt new file mode 100644 index 00000000000..6cfd4ab4278 --- /dev/null +++ b/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt @@ -0,0 +1,10 @@ +add_qt_test("tst_qgridlayout" + SOURCES + sortdialog.ui + tst_qgridlayout.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/kernel/qlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qlayout/CMakeLists.txt new file mode 100644 index 00000000000..a9b80c12874 --- /dev/null +++ b/tests/auto/widgets/kernel/qlayout/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test("tst_qlayout" SOURCES tst_qlayout.cpp LIBRARIES Qt::WidgetsPrivate Qt::TestPrivate) + +extend_target("tst_qlayout" CONDITION ANDROID AND NOT ANDROID_EMBEDDED SOURCES testdata.qrc) diff --git a/tests/auto/widgets/kernel/qshortcut/CMakeLists.txt b/tests/auto/widgets/kernel/qshortcut/CMakeLists.txt new file mode 100644 index 00000000000..d71f1aae6cc --- /dev/null +++ b/tests/auto/widgets/kernel/qshortcut/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qshortcut" SOURCES tst_qshortcut.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt b/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt new file mode 100644 index 00000000000..32b17c8bba3 --- /dev/null +++ b/tests/auto/widgets/kernel/qsizepolicy/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qsizepolicy" SOURCES tst_qsizepolicy.cpp LIBRARIES Qt::WidgetsPrivate) diff --git a/tests/auto/widgets/kernel/qstackedlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qstackedlayout/CMakeLists.txt new file mode 100644 index 00000000000..24c681dc459 --- /dev/null +++ b/tests/auto/widgets/kernel/qstackedlayout/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qstackedlayout" SOURCES tst_qstackedlayout.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/qtooltip/CMakeLists.txt b/tests/auto/widgets/kernel/qtooltip/CMakeLists.txt new file mode 100644 index 00000000000..e5cdace2751 --- /dev/null +++ b/tests/auto/widgets/kernel/qtooltip/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtooltip" SOURCES tst_qtooltip.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/qwidget/CMakeLists.txt b/tests/auto/widgets/kernel/qwidget/CMakeLists.txt new file mode 100644 index 00000000000..ac09f88ae29 --- /dev/null +++ b/tests/auto/widgets/kernel/qwidget/CMakeLists.txt @@ -0,0 +1,16 @@ +add_qt_test("tst_qwidget" + SOURCES + qwidget.qrc + tst_qwidget.cpp + LIBRARIES + Qt::Widgets + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate + Qt::TestPrivate +) + +extend_target("tst_qwidget" CONDITION APPLE_OSX + SOURCES tst_qwidget_mac_helpers.mm + LIBRARIES FWSecurity FWAppKit +) diff --git a/tests/auto/widgets/kernel/qwidget_window/CMakeLists.txt b/tests/auto/widgets/kernel/qwidget_window/CMakeLists.txt new file mode 100644 index 00000000000..9d16c40be4e --- /dev/null +++ b/tests/auto/widgets/kernel/qwidget_window/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qwidget_window" SOURCES tst_qwidget_window.cpp + LIBRARIES + Qt::Widgets + Qt::CorePrivate + Qt::GuiPrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/kernel/qwidgetaction/CMakeLists.txt b/tests/auto/widgets/kernel/qwidgetaction/CMakeLists.txt new file mode 100644 index 00000000000..d58853790ec --- /dev/null +++ b/tests/auto/widgets/kernel/qwidgetaction/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qwidgetaction" SOURCES tst_qwidgetaction.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) diff --git a/tests/auto/widgets/kernel/qwidgetmetatype/CMakeLists.txt b/tests/auto/widgets/kernel/qwidgetmetatype/CMakeLists.txt new file mode 100644 index 00000000000..ab69449fba6 --- /dev/null +++ b/tests/auto/widgets/kernel/qwidgetmetatype/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qwidgetmetatype" SOURCES tst_qwidgetmetatype.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/kernel/qwidgetsvariant/CMakeLists.txt b/tests/auto/widgets/kernel/qwidgetsvariant/CMakeLists.txt new file mode 100644 index 00000000000..53a479ef80b --- /dev/null +++ b/tests/auto/widgets/kernel/qwidgetsvariant/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test("tst_qwidgetsvariant" + SOURCES + tst_qwidgetsvariant.cpp + INCLUDE_DIRECTORIES + ./../../../other/qvariant_common + LIBRARIES + Qt::Widgets +) diff --git a/tests/auto/widgets/kernel/qwindowcontainer/CMakeLists.txt b/tests/auto/widgets/kernel/qwindowcontainer/CMakeLists.txt new file mode 100644 index 00000000000..329260bd053 --- /dev/null +++ b/tests/auto/widgets/kernel/qwindowcontainer/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qwindowcontainer" SOURCES tst_qwindowcontainer.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/styles/CMakeLists.txt b/tests/auto/widgets/styles/CMakeLists.txt new file mode 100644 index 00000000000..4fc260fe399 --- /dev/null +++ b/tests/auto/widgets/styles/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from styles.pro. + +if (APPLE_OSX) + add_subdirectory(qmacstyle) +endif() +add_subdirectory(qstyle) +if (NOT APPLE_UIKIT AND NOT ANDROID AND NOT QNX) + add_subdirectory(qstyleoption) +endif() +if (QT_FEATURE_private_tests) + add_subdirectory(qstylesheetstyle) +endif() diff --git a/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt b/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt new file mode 100644 index 00000000000..a1b68b3d74d --- /dev/null +++ b/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qmacstyle" SOURCES tst_qmacstyle.cpp LIBRARIES Qt::WidgetsPrivate) diff --git a/tests/auto/widgets/styles/qstyle/CMakeLists.txt b/tests/auto/widgets/styles/qstyle/CMakeLists.txt new file mode 100644 index 00000000000..b6af3790927 --- /dev/null +++ b/tests/auto/widgets/styles/qstyle/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test("tst_qstyle" SOURCES tst_qstyle.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) + +extend_target("tst_qstyle" CONDITION ANDROID AND NOT ANDROID_EMBEDDED SOURCES testdata.qrc) diff --git a/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt b/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt new file mode 100644 index 00000000000..855336b769c --- /dev/null +++ b/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qstyleoption" SOURCES tst_qstyleoption.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt b/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt new file mode 100644 index 00000000000..608b7d299bf --- /dev/null +++ b/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt @@ -0,0 +1,9 @@ +add_qt_test("tst_qstylesheetstyle" + SOURCES + resources.qrc + tst_qstylesheetstyle.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::GuiPrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/util/CMakeLists.txt b/tests/auto/widgets/util/CMakeLists.txt new file mode 100644 index 00000000000..0372282e7b2 --- /dev/null +++ b/tests/auto/widgets/util/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from util.pro. + +add_subdirectory(qcompleter) +add_subdirectory(qscroller) +add_subdirectory(qsystemtrayicon) +add_subdirectory(qundogroup) +add_subdirectory(qundostack) diff --git a/tests/auto/widgets/util/qcompleter/CMakeLists.txt b/tests/auto/widgets/util/qcompleter/CMakeLists.txt new file mode 100644 index 00000000000..15b01f0346e --- /dev/null +++ b/tests/auto/widgets/util/qcompleter/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qcompleter" SOURCES tst_qcompleter.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) diff --git a/tests/auto/widgets/util/qscroller/CMakeLists.txt b/tests/auto/widgets/util/qscroller/CMakeLists.txt new file mode 100644 index 00000000000..006399652c9 --- /dev/null +++ b/tests/auto/widgets/util/qscroller/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qscroller" SOURCES tst_qscroller.cpp LIBRARIES Qt::Widgets Qt::GuiPrivate) diff --git a/tests/auto/widgets/util/qsystemtrayicon/CMakeLists.txt b/tests/auto/widgets/util/qsystemtrayicon/CMakeLists.txt new file mode 100644 index 00000000000..2b609725a15 --- /dev/null +++ b/tests/auto/widgets/util/qsystemtrayicon/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qsystemtrayicon" SOURCES tst_qsystemtrayicon.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/util/qundogroup/CMakeLists.txt b/tests/auto/widgets/util/qundogroup/CMakeLists.txt new file mode 100644 index 00000000000..9c67f61c51a --- /dev/null +++ b/tests/auto/widgets/util/qundogroup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qundogroup" SOURCES tst_qundogroup.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/util/qundostack/CMakeLists.txt b/tests/auto/widgets/util/qundostack/CMakeLists.txt new file mode 100644 index 00000000000..690bcdacfd7 --- /dev/null +++ b/tests/auto/widgets/util/qundostack/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qundostack" SOURCES tst_qundostack.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/CMakeLists.txt b/tests/auto/widgets/widgets/CMakeLists.txt new file mode 100644 index 00000000000..60776f5da2d --- /dev/null +++ b/tests/auto/widgets/widgets/CMakeLists.txt @@ -0,0 +1,55 @@ +# Generated from widgets.pro. + +add_subdirectory(qabstractbutton) +add_subdirectory(qabstractscrollarea) +add_subdirectory(qabstractslider) +add_subdirectory(qbuttongroup) +add_subdirectory(qcalendarwidget) +add_subdirectory(qcheckbox) +add_subdirectory(qcommandlinkbutton) +add_subdirectory(qdatetimeedit) +add_subdirectory(qdial) +add_subdirectory(qdialogbuttonbox) +add_subdirectory(qdockwidget) +add_subdirectory(qdoublespinbox) +add_subdirectory(qfocusframe) +add_subdirectory(qfontcombobox) +add_subdirectory(qframe) +add_subdirectory(qgroupbox) +add_subdirectory(qkeysequenceedit) +add_subdirectory(qlabel) +add_subdirectory(qlcdnumber) +add_subdirectory(qlineedit) +add_subdirectory(qmdiarea) +add_subdirectory(qmdisubwindow) +add_subdirectory(qmenu) +add_subdirectory(qmenubar) +add_subdirectory(qplaintextedit) +add_subdirectory(qprogressbar) +add_subdirectory(qpushbutton) +add_subdirectory(qradiobutton) +add_subdirectory(qscrollarea) +add_subdirectory(qscrollbar) +add_subdirectory(qsizegrip) +add_subdirectory(qslider) +add_subdirectory(qspinbox) +add_subdirectory(qsplitter) +add_subdirectory(qstackedwidget) +add_subdirectory(qstatusbar) +add_subdirectory(qtabbar) +add_subdirectory(qtabwidget) +add_subdirectory(qtextbrowser) +add_subdirectory(qtoolbox) +add_subdirectory(qtoolbutton) + +if(QT_FEATURE_private_tests) + add_subdirectory(qabstractspinbox) + add_subdirectory(qcombobox) + add_subdirectory(qmainwindow) + add_subdirectory(qtextedit) + add_subdirectory(qtoolbar) +endif() + +if(NOT WINRT AND QT_FEATURE_opengl) + add_subdirectory(qopenglwidget) +endif() diff --git a/tests/auto/widgets/widgets/qabstractbutton/CMakeLists.txt b/tests/auto/widgets/widgets/qabstractbutton/CMakeLists.txt new file mode 100644 index 00000000000..7b2123b5308 --- /dev/null +++ b/tests/auto/widgets/widgets/qabstractbutton/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qabstractbutton" RUN_SERIAL SOURCES tst_qabstractbutton.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qabstractscrollarea/CMakeLists.txt b/tests/auto/widgets/widgets/qabstractscrollarea/CMakeLists.txt new file mode 100644 index 00000000000..a0033463937 --- /dev/null +++ b/tests/auto/widgets/widgets/qabstractscrollarea/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qabstractscrollarea" RUN_SERIAL SOURCES tst_qabstractscrollarea.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qabstractslider/CMakeLists.txt b/tests/auto/widgets/widgets/qabstractslider/CMakeLists.txt new file mode 100644 index 00000000000..6974ae4172e --- /dev/null +++ b/tests/auto/widgets/widgets/qabstractslider/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qabstractslider" RUN_SERIAL SOURCES tst_qabstractslider.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) diff --git a/tests/auto/widgets/widgets/qabstractspinbox/CMakeLists.txt b/tests/auto/widgets/widgets/qabstractspinbox/CMakeLists.txt new file mode 100644 index 00000000000..88c69d370bb --- /dev/null +++ b/tests/auto/widgets/widgets/qabstractspinbox/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qabstractspinbox" RUN_SERIAL SOURCES tst_qabstractspinbox.cpp + LIBRARIES + Qt::Widgets + Qt::GuiPrivate + Qt::CorePrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/widgets/qbuttongroup/CMakeLists.txt b/tests/auto/widgets/widgets/qbuttongroup/CMakeLists.txt new file mode 100644 index 00000000000..37b21967055 --- /dev/null +++ b/tests/auto/widgets/widgets/qbuttongroup/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qbuttongroup" RUN_SERIAL SOURCES tst_qbuttongroup.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qcalendarwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qcalendarwidget/CMakeLists.txt new file mode 100644 index 00000000000..4aad3abff93 --- /dev/null +++ b/tests/auto/widgets/widgets/qcalendarwidget/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qcalendarwidget" RUN_SERIAL SOURCES tst_qcalendarwidget.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qcheckbox/CMakeLists.txt b/tests/auto/widgets/widgets/qcheckbox/CMakeLists.txt new file mode 100644 index 00000000000..2640889d941 --- /dev/null +++ b/tests/auto/widgets/widgets/qcheckbox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qcheckbox" RUN_SERIAL SOURCES tst_qcheckbox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qcombobox/CMakeLists.txt b/tests/auto/widgets/widgets/qcombobox/CMakeLists.txt new file mode 100644 index 00000000000..8697a67820a --- /dev/null +++ b/tests/auto/widgets/widgets/qcombobox/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test("tst_qcombobox" RUN_SERIAL SOURCES tst_qcombobox.cpp + DEFINES QTEST_QPA_MOUSE_HANDLING + LIBRARIES + Qt::WidgetsPrivate + Qt::GuiPrivate + Qt::CorePrivate + Qt::TestPrivate +) diff --git a/tests/auto/widgets/widgets/qcommandlinkbutton/CMakeLists.txt b/tests/auto/widgets/widgets/qcommandlinkbutton/CMakeLists.txt new file mode 100644 index 00000000000..2893e2d0f3c --- /dev/null +++ b/tests/auto/widgets/widgets/qcommandlinkbutton/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qcommandlinkbutton" RUN_SERIAL SOURCES tst_qcommandlinkbutton.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qdatetimeedit/CMakeLists.txt b/tests/auto/widgets/widgets/qdatetimeedit/CMakeLists.txt new file mode 100644 index 00000000000..1f977399acb --- /dev/null +++ b/tests/auto/widgets/widgets/qdatetimeedit/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qdatetimeedit" RUN_SERIAL SOURCES tst_qdatetimeedit.cpp + LIBRARIES + Qt::Widgets + Qt::CorePrivate + Qt::WidgetsPrivate +) diff --git a/tests/auto/widgets/widgets/qdial/CMakeLists.txt b/tests/auto/widgets/widgets/qdial/CMakeLists.txt new file mode 100644 index 00000000000..76fc75d85aa --- /dev/null +++ b/tests/auto/widgets/widgets/qdial/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qdial" RUN_SERIAL SOURCES tst_qdial.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qdialogbuttonbox/CMakeLists.txt b/tests/auto/widgets/widgets/qdialogbuttonbox/CMakeLists.txt new file mode 100644 index 00000000000..032189307cf --- /dev/null +++ b/tests/auto/widgets/widgets/qdialogbuttonbox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qdialogbuttonbox" RUN_SERIAL SOURCES tst_qdialogbuttonbox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qdockwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qdockwidget/CMakeLists.txt new file mode 100644 index 00000000000..4bbe5234d9e --- /dev/null +++ b/tests/auto/widgets/widgets/qdockwidget/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qdockwidget" RUN_SERIAL SOURCES tst_qdockwidget.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/widgets/qdoublespinbox/CMakeLists.txt b/tests/auto/widgets/widgets/qdoublespinbox/CMakeLists.txt new file mode 100644 index 00000000000..8030b82b42c --- /dev/null +++ b/tests/auto/widgets/widgets/qdoublespinbox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qdoublespinbox" RUN_SERIAL SOURCES tst_qdoublespinbox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qfocusframe/CMakeLists.txt b/tests/auto/widgets/widgets/qfocusframe/CMakeLists.txt new file mode 100644 index 00000000000..1aac33f254f --- /dev/null +++ b/tests/auto/widgets/widgets/qfocusframe/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qfocusframe" RUN_SERIAL SOURCES tst_qfocusframe.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qfontcombobox/CMakeLists.txt b/tests/auto/widgets/widgets/qfontcombobox/CMakeLists.txt new file mode 100644 index 00000000000..6bb659cca22 --- /dev/null +++ b/tests/auto/widgets/widgets/qfontcombobox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qfontcombobox" RUN_SERIAL SOURCES tst_qfontcombobox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qframe/CMakeLists.txt b/tests/auto/widgets/widgets/qframe/CMakeLists.txt new file mode 100644 index 00000000000..f109c76d0d5 --- /dev/null +++ b/tests/auto/widgets/widgets/qframe/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qframe" RUN_SERIAL SOURCES tst_qframe.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qgroupbox/CMakeLists.txt b/tests/auto/widgets/widgets/qgroupbox/CMakeLists.txt new file mode 100644 index 00000000000..5885420d31a --- /dev/null +++ b/tests/auto/widgets/widgets/qgroupbox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qgroupbox" RUN_SERIAL SOURCES tst_qgroupbox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qkeysequenceedit/CMakeLists.txt b/tests/auto/widgets/widgets/qkeysequenceedit/CMakeLists.txt new file mode 100644 index 00000000000..415b49dd1bb --- /dev/null +++ b/tests/auto/widgets/widgets/qkeysequenceedit/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qkeysequenceedit" RUN_SERIAL SOURCES tst_qkeysequenceedit.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qlabel/CMakeLists.txt b/tests/auto/widgets/widgets/qlabel/CMakeLists.txt new file mode 100644 index 00000000000..91ce86552ab --- /dev/null +++ b/tests/auto/widgets/widgets/qlabel/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qlabel" RUN_SERIAL SOURCES tst_qlabel.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/tests/auto/widgets/widgets/qlcdnumber/CMakeLists.txt b/tests/auto/widgets/widgets/qlcdnumber/CMakeLists.txt new file mode 100644 index 00000000000..4f748f0ae85 --- /dev/null +++ b/tests/auto/widgets/widgets/qlcdnumber/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qlcdnumber" RUN_SERIAL SOURCES tst_qlcdnumber.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt b/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt new file mode 100644 index 00000000000..626b9fc4036 --- /dev/null +++ b/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt @@ -0,0 +1,9 @@ +add_qt_test("tst_qlineedit" RUN_SERIAL SOURCES tst_qlineedit.cpp + LIBRARIES + Qt::GuiPrivate + Qt::CorePrivate + Qt::WidgetsPrivate + Qt::TestPrivate +) + +extend_target("tst_qlineedit" CONDITION APPLE_OSX LIBRARIES FWAppKit) diff --git a/tests/auto/widgets/widgets/qmainwindow/CMakeLists.txt b/tests/auto/widgets/widgets/qmainwindow/CMakeLists.txt new file mode 100644 index 00000000000..f1756bd342e --- /dev/null +++ b/tests/auto/widgets/widgets/qmainwindow/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qmainwindow" RUN_SERIAL SOURCES tst_qmainwindow.cpp LIBRARIES Qt::WidgetsPrivate) diff --git a/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt b/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt new file mode 100644 index 00000000000..b14730c5889 --- /dev/null +++ b/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt @@ -0,0 +1,14 @@ +qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::Gui) + +add_qt_test("tst_qmdiarea" RUN_SERIAL SOURCES tst_qmdiarea.cpp + DEFINES + QT_NO_CAST_TO_ASCII + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::GuiPrivate + Qt::Widgets +) + +extend_target("tst_qmdiarea" CONDITION TARGET Qt::OpenGL LIBRARIES Qt::OpenGL) + +extend_target("tst_qmdiarea" CONDITION APPLE_OSX LIBRARIES FWSecurity) diff --git a/tests/auto/widgets/widgets/qmdisubwindow/CMakeLists.txt b/tests/auto/widgets/widgets/qmdisubwindow/CMakeLists.txt new file mode 100644 index 00000000000..c095ccebd08 --- /dev/null +++ b/tests/auto/widgets/widgets/qmdisubwindow/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qmdisubwindow" RUN_SERIAL SOURCES tst_qmdisubwindow.cpp + DEFINES + QT_NO_CAST_TO_ASCII + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::WidgetsPrivate +) diff --git a/tests/auto/widgets/widgets/qmenu/CMakeLists.txt b/tests/auto/widgets/widgets/qmenu/CMakeLists.txt new file mode 100644 index 00000000000..6e9da6d474c --- /dev/null +++ b/tests/auto/widgets/widgets/qmenu/CMakeLists.txt @@ -0,0 +1,13 @@ +add_qt_test("tst_qmenu" RUN_SERIAL SOURCES tst_qmenu.cpp + LIBRARIES + Qt::GuiPrivate + Qt::Widgets + Qt::TestPrivate +) + +extend_target("tst_qmenu" CONDITION APPLE_OSX + SOURCES tst_qmenu_mac.mm + LIBRARIES -lobjc +) + +extend_target("tst_qmenu" CONDITION NOT APPLEL_OSX DEFINES QTEST_QPA_MOUSE_HANDLING) diff --git a/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt b/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt new file mode 100644 index 00000000000..84878c7ec82 --- /dev/null +++ b/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qmenubar" RUN_SERIAL SOURCES tst_qmenubar.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) + +extend_target("tst_qmenubar" CONDITION APPLE_OSX + SOURCES tst_qmenubar_mac.mm + LIBRARIES FWAppKit +) diff --git a/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt new file mode 100644 index 00000000000..a9172dec4f2 --- /dev/null +++ b/tests/auto/widgets/widgets/qopenglwidget/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test("tst_qopenglwidget" RUN_SERIAL SOURCES tst_qopenglwidget.cpp + LIBRARIES + Qt::GuiPrivate + Qt::CorePrivate + Qt::Widgets +) diff --git a/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt b/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt new file mode 100644 index 00000000000..d05e0aa8c68 --- /dev/null +++ b/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test("tst_qplaintextedit" RUN_SERIAL SOURCES tst_qplaintextedit.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::GuiPrivate +) + +extend_target("tst_qplaintextedit" CONDITION APPLE_OSX LIBRARIES FWAppKit) diff --git a/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt b/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt new file mode 100644 index 00000000000..5fb9e79056f --- /dev/null +++ b/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qprogressbar" RUN_SERIAL SOURCES tst_qprogressbar.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qpushbutton/CMakeLists.txt b/tests/auto/widgets/widgets/qpushbutton/CMakeLists.txt new file mode 100644 index 00000000000..7b78b968445 --- /dev/null +++ b/tests/auto/widgets/widgets/qpushbutton/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qpushbutton" RUN_SERIAL SOURCES tst_qpushbutton.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qradiobutton/CMakeLists.txt b/tests/auto/widgets/widgets/qradiobutton/CMakeLists.txt new file mode 100644 index 00000000000..08322899a24 --- /dev/null +++ b/tests/auto/widgets/widgets/qradiobutton/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qradiobutton" RUN_SERIAL SOURCES tst_qradiobutton.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qscrollarea/CMakeLists.txt b/tests/auto/widgets/widgets/qscrollarea/CMakeLists.txt new file mode 100644 index 00000000000..b21a9755d44 --- /dev/null +++ b/tests/auto/widgets/widgets/qscrollarea/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qscrollarea" RUN_SERIAL SOURCES tst_qscrollarea.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt b/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt new file mode 100644 index 00000000000..88163f38c33 --- /dev/null +++ b/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qscrollbar" RUN_SERIAL SOURCES tst_qscrollbar.cpp LIBRARIES Qt::Widgets Qt::TestPrivate) diff --git a/tests/auto/widgets/widgets/qsizegrip/CMakeLists.txt b/tests/auto/widgets/widgets/qsizegrip/CMakeLists.txt new file mode 100644 index 00000000000..f3f6548774d --- /dev/null +++ b/tests/auto/widgets/widgets/qsizegrip/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qsizegrip" RUN_SERIAL SOURCES tst_qsizegrip.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qslider/CMakeLists.txt b/tests/auto/widgets/widgets/qslider/CMakeLists.txt new file mode 100644 index 00000000000..1da3dc0d0a2 --- /dev/null +++ b/tests/auto/widgets/widgets/qslider/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qslider" RUN_SERIAL SOURCES tst_qslider.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qspinbox/CMakeLists.txt b/tests/auto/widgets/widgets/qspinbox/CMakeLists.txt new file mode 100644 index 00000000000..80f1de07029 --- /dev/null +++ b/tests/auto/widgets/widgets/qspinbox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qspinbox" RUN_SERIAL SOURCES tst_qspinbox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qsplashscreen/CMakeLists.txt b/tests/auto/widgets/widgets/qsplashscreen/CMakeLists.txt new file mode 100644 index 00000000000..028d8fc82e1 --- /dev/null +++ b/tests/auto/widgets/widgets/qsplashscreen/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qsplashscreen" RUN_SERIAL SOURCES tst_qsplashscreen.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qsplitter/CMakeLists.txt b/tests/auto/widgets/widgets/qsplitter/CMakeLists.txt new file mode 100644 index 00000000000..a0dfd3a9c5f --- /dev/null +++ b/tests/auto/widgets/widgets/qsplitter/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qsplitter" RUN_SERIAL SOURCES tst_qsplitter.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt new file mode 100644 index 00000000000..8b2b79b181b --- /dev/null +++ b/tests/auto/widgets/widgets/qstackedwidget/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qstackedwidget" RUN_SERIAL SOURCES tst_qstackedwidget.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qstatusbar/CMakeLists.txt b/tests/auto/widgets/widgets/qstatusbar/CMakeLists.txt new file mode 100644 index 00000000000..ba65925b6ea --- /dev/null +++ b/tests/auto/widgets/widgets/qstatusbar/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qstatusbar" RUN_SERIAL SOURCES tst_qstatusbar.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qtabbar/CMakeLists.txt b/tests/auto/widgets/widgets/qtabbar/CMakeLists.txt new file mode 100644 index 00000000000..003d4a778b8 --- /dev/null +++ b/tests/auto/widgets/widgets/qtabbar/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtabbar" RUN_SERIAL SOURCES tst_qtabbar.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qtabwidget/CMakeLists.txt b/tests/auto/widgets/widgets/qtabwidget/CMakeLists.txt new file mode 100644 index 00000000000..440603fac42 --- /dev/null +++ b/tests/auto/widgets/widgets/qtabwidget/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test("tst_qtabwidget" RUN_SERIAL SOURCES tst_qtabwidget.cpp LIBRARIES Qt::WidgetsPrivate) + +extend_target("tst_qtabwidget" CONDITION WIN32 AND NOT WINRT LIBRARIES -luser32) diff --git a/tests/auto/widgets/widgets/qtextbrowser/CMakeLists.txt b/tests/auto/widgets/widgets/qtextbrowser/CMakeLists.txt new file mode 100644 index 00000000000..15601c9855a --- /dev/null +++ b/tests/auto/widgets/widgets/qtextbrowser/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test("tst_qtextbrowser" RUN_SERIAL SOURCES tst_qtextbrowser.cpp LIBRARIES Qt::Widgets) + +extend_target("tst_qtextbrowser" CONDITION builtin_testdata DEFINES BUILTIN_TESTDATA) diff --git a/tests/auto/widgets/widgets/qtextedit/CMakeLists.txt b/tests/auto/widgets/widgets/qtextedit/CMakeLists.txt new file mode 100644 index 00000000000..1a8e79e055d --- /dev/null +++ b/tests/auto/widgets/widgets/qtextedit/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test("tst_qtextedit" RUN_SERIAL SOURCES tst_qtextedit.cpp + LIBRARIES + Qt::WidgetsPrivate + Qt::GuiPrivate + Qt::CorePrivate +) + +extend_target("tst_qtextedit" CONDITION APPLE_OSX LIBRARIES FWAppKit) diff --git a/tests/auto/widgets/widgets/qtoolbar/CMakeLists.txt b/tests/auto/widgets/widgets/qtoolbar/CMakeLists.txt new file mode 100644 index 00000000000..ab6d4d082a4 --- /dev/null +++ b/tests/auto/widgets/widgets/qtoolbar/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtoolbar" RUN_SERIAL SOURCES tst_qtoolbar.cpp LIBRARIES Qt::WidgetsPrivate Qt::GuiPrivate) diff --git a/tests/auto/widgets/widgets/qtoolbox/CMakeLists.txt b/tests/auto/widgets/widgets/qtoolbox/CMakeLists.txt new file mode 100644 index 00000000000..337f187878f --- /dev/null +++ b/tests/auto/widgets/widgets/qtoolbox/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtoolbox" RUN_SERIAL SOURCES tst_qtoolbox.cpp LIBRARIES Qt::Widgets) diff --git a/tests/auto/widgets/widgets/qtoolbutton/CMakeLists.txt b/tests/auto/widgets/widgets/qtoolbutton/CMakeLists.txt new file mode 100644 index 00000000000..a2532556177 --- /dev/null +++ b/tests/auto/widgets/widgets/qtoolbutton/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test("tst_qtoolbutton" RUN_SERIAL SOURCES tst_qtoolbutton.cpp LIBRARIES Qt::Widgets) diff --git a/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt b/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt new file mode 100644 index 00000000000..bcb10365fa5 --- /dev/null +++ b/tests/benchmarks/corelib/io/qdir/10000/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qdir_10000 SOURCES bench_qdir_10000.cpp) diff --git a/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt new file mode 100644 index 00000000000..a6c5ceebd3f --- /dev/null +++ b/tests/benchmarks/corelib/io/qprocess/test/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test(../tst_bench_qprocess SOURCES + ../tst_bench_qprocess.cpp + LIBRARIES + Qt::CorePrivate +) diff --git a/tests/benchmarks/corelib/kernel/events/CMakeLists.txt b/tests/benchmarks/corelib/kernel/events/CMakeLists.txt new file mode 100644 index 00000000000..cabe71e3d6a --- /dev/null +++ b/tests/benchmarks/corelib/kernel/events/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_events SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt new file mode 100644 index 00000000000..55d68f03726 --- /dev/null +++ b/tests/benchmarks/corelib/kernel/qcoreapplication/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qcoreapplication SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt b/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt new file mode 100644 index 00000000000..6bbaeee1e08 --- /dev/null +++ b/tests/benchmarks/corelib/kernel/qmetatype/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qmetatype SOURCES tst_qmetatype.cpp) diff --git a/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt b/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt new file mode 100644 index 00000000000..ec0cf482553 --- /dev/null +++ b/tests/benchmarks/corelib/mimetypes/qmimedatabase/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qmimedatabase SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt b/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt new file mode 100644 index 00000000000..e334bcb68a4 --- /dev/null +++ b/tests/benchmarks/corelib/plugin/quuid/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_quuid SOURCES tst_quuid.cpp) diff --git a/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt b/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt new file mode 100644 index 00000000000..aef0da25657 --- /dev/null +++ b/tests/benchmarks/corelib/thread/qmutex/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qmutex SOURCES tst_qmutex.cpp) diff --git a/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt b/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt new file mode 100644 index 00000000000..55b03b9ad94 --- /dev/null +++ b/tests/benchmarks/corelib/thread/qthreadpool/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qthreadpool SOURCES tst_qthreadpool.cpp) diff --git a/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt b/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt new file mode 100644 index 00000000000..0797d996258 --- /dev/null +++ b/tests/benchmarks/corelib/thread/qthreadstorage/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qthreadstorage SOURCES tst_qthreadstorage.cpp) diff --git a/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt b/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt new file mode 100644 index 00000000000..94c4391c848 --- /dev/null +++ b/tests/benchmarks/corelib/thread/qwaitcondition/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qwaitcondition SOURCES tst_qwaitcondition.cpp) diff --git a/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt b/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt new file mode 100644 index 00000000000..7495677c0a1 --- /dev/null +++ b/tests/benchmarks/corelib/tools/containers-associative/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_containers-associative SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt b/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt new file mode 100644 index 00000000000..6a22402a465 --- /dev/null +++ b/tests/benchmarks/corelib/tools/containers-sequential/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_containers-sequential SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/qalgorithms/CMakeLists.txt b/tests/benchmarks/corelib/tools/qalgorithms/CMakeLists.txt new file mode 100644 index 00000000000..6cfb7469341 --- /dev/null +++ b/tests/benchmarks/corelib/tools/qalgorithms/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qalgorithms SOURCES tst_qalgorithms.cpp) diff --git a/tests/benchmarks/corelib/tools/qchar/CMakeLists.txt b/tests/benchmarks/corelib/tools/qchar/CMakeLists.txt new file mode 100644 index 00000000000..c51e2a00595 --- /dev/null +++ b/tests/benchmarks/corelib/tools/qchar/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qchar SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/qdatetime/CMakeLists.txt b/tests/benchmarks/corelib/tools/qdatetime/CMakeLists.txt new file mode 100644 index 00000000000..6875fdd6134 --- /dev/null +++ b/tests/benchmarks/corelib/tools/qdatetime/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qdatetime SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt b/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt new file mode 100644 index 00000000000..6e7dec7dfe3 --- /dev/null +++ b/tests/benchmarks/corelib/tools/qlist/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qlist SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/qlocale/CMakeLists.txt b/tests/benchmarks/corelib/tools/qlocale/CMakeLists.txt new file mode 100644 index 00000000000..b8a23bc757a --- /dev/null +++ b/tests/benchmarks/corelib/tools/qlocale/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qlocale SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/qstring/CMakeLists.txt b/tests/benchmarks/corelib/tools/qstring/CMakeLists.txt new file mode 100644 index 00000000000..1dd6678e8e4 --- /dev/null +++ b/tests/benchmarks/corelib/tools/qstring/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qstring SOURCES main.cpp) diff --git a/tests/benchmarks/corelib/tools/qtimezone/CMakeLists.txt b/tests/benchmarks/corelib/tools/qtimezone/CMakeLists.txt new file mode 100644 index 00000000000..3947ae1c5e1 --- /dev/null +++ b/tests/benchmarks/corelib/tools/qtimezone/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_bench_qtimezone SOURCES main.cpp) diff --git a/tests/benchmarks/gui/image/blendbench/CMakeLists.txt b/tests/benchmarks/gui/image/blendbench/CMakeLists.txt new file mode 100644 index 00000000000..24b2a79df1f --- /dev/null +++ b/tests/benchmarks/gui/image/blendbench/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_blendbench SOURCES + main.cpp +) diff --git a/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt b/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt new file mode 100644 index 00000000000..58b9159ebac --- /dev/null +++ b/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_imageScale SOURCES + tst_qimagescale.cpp +) diff --git a/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt b/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt new file mode 100644 index 00000000000..e2aa20d75aa --- /dev/null +++ b/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_qpixmapcache SOURCES + tst_qpixmapcache.cpp +) diff --git a/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt b/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt new file mode 100644 index 00000000000..025a6d15ed6 --- /dev/null +++ b/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_qguimetatype SOURCES + tst_qguimetatype.cpp +) diff --git a/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt b/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt new file mode 100644 index 00000000000..f25c0a17d7f --- /dev/null +++ b/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_qguivariant SOURCES + tst_qguivariant.cpp +) diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt b/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt new file mode 100644 index 00000000000..7b6525bb638 --- /dev/null +++ b/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_qmatrix4x4 SOURCES + tst_qmatrix4x4.cpp +) diff --git a/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt b/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt new file mode 100644 index 00000000000..a7ed4a2ab8b --- /dev/null +++ b/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_qquaternion SOURCES + tst_qquaternion.cpp +) diff --git a/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt b/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt new file mode 100644 index 00000000000..9dbfe8106a1 --- /dev/null +++ b/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_qtransform SOURCES + tst_qtransform.cpp +) diff --git a/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt b/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt new file mode 100644 index 00000000000..44f5c090773 --- /dev/null +++ b/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(tst_bench_QFontMetrics SOURCES + main.cpp +) diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt new file mode 100644 index 00000000000..0746c0ef66c --- /dev/null +++ b/tests/manual/CMakeLists.txt @@ -0,0 +1,92 @@ +# Generated from tests/manual/manual.pro. + +add_subdirectory("bearerex") +add_subdirectory("filetest") +add_subdirectory("embeddedintoforeignwindow") +add_subdirectory("foreignwindows") +add_subdirectory("gestures") +add_subdirectory("highdpi") +add_subdirectory("inputmethodhints") +add_subdirectory("keypadnavigation") +add_subdirectory("lance") +add_subdirectory("network_remote_stresstest") +add_subdirectory("network_stresstest") +add_subdirectory("qcursor") +add_subdirectory("qdesktopservices") +add_subdirectory("qdesktopwidget") +add_subdirectory("qgraphicsitem") +add_subdirectory("qgraphicsitemgroup") +add_subdirectory("qgraphicslayout/flicker") +add_subdirectory("qhttpnetworkconnection") +add_subdirectory("qimagereader") +add_subdirectory("qlayout") +add_subdirectory("qlocale") +add_subdirectory("qmimedatabase") +add_subdirectory("qnetworkaccessmanager/qget") +add_subdirectory("qnetworkconfigurationmanager") +add_subdirectory("qnetworkconfiguration") +add_subdirectory("qnetworkreply") +add_subdirectory("qstorageinfo") +add_subdirectory("qscreen") +add_subdirectory("qssloptions") +add_subdirectory("qsslsocket") +add_subdirectory("qsysinfo") +add_subdirectory("qtabletevent") +add_subdirectory("qtexteditlist") +add_subdirectory("qtbug-8933") +add_subdirectory("qtbug-52641") +add_subdirectory("qtouchevent") +add_subdirectory("touch") +add_subdirectory("qwidget_zorder") +add_subdirectory("repaint") +add_subdirectory("socketengine") +add_subdirectory("textrendering") +add_subdirectory("widgets") +add_subdirectory("windowflags") +add_subdirectory("windowgeometry") +add_subdirectory("windowmodality") +add_subdirectory("widgetgrab") +add_subdirectory("xembed-raster") +add_subdirectory("xembed-widgets") +add_subdirectory("shortcuts") +add_subdirectory("dialogs") +add_subdirectory("windowtransparency") +add_subdirectory("unc") +add_subdirectory("qtabbar") + +if(NOT ${QT_FEATURE_openssl}) + ### remove_subdirectory("qssloptions") +endif() + +if(${QT_FEATURE_opengl}) + add_subdirectory("qopengltextureblitter") + + if(${QT_FEATURE_egl}) + add_subdirectory("qopenglcontext") + endif() +endif() + +if(WIN32) + ### remove_subdirectory("network_remote_stresstest") + ### remove_subdirectory("network_stresstest") +endif() + +if(lessThan(QT_MAJOR_VERSION, 5)) + ### remove_subdirectory("bearerex") + ### remove_subdirectory("lance") + ### remove_subdirectory("qnetworkaccessmanager/qget") + ### remove_subdirectory("qmimedatabase") + ### remove_subdirectory("qnetworkreply") + ### remove_subdirectory("qpainfo") + ### remove_subdirectory("qscreen") + ### remove_subdirectory("socketengine") + ### remove_subdirectory("xembed-raster") + ### remove_subdirectory("xembed-widgets") + ### remove_subdirectory("windowtransparency") + ### remove_subdirectory("embeddedintoforeignwindow") + ### remove_subdirectory("foreignwindows") +endif() + +if(${QT_FEATURE_vulkan}) + add_subdirectory("qvulkaninstance") +endif() diff --git a/tests/manual/qcursor/childwindow/CMakeLists.txt b/tests/manual/qcursor/childwindow/CMakeLists.txt new file mode 100644 index 00000000000..1f1001350b2 --- /dev/null +++ b/tests/manual/qcursor/childwindow/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test(childwindow SOURCES + main.cpp + INCLUDE_DIRECTORIES + . +) diff --git a/tests/manual/qmetatype/CMakeLists.txt b/tests/manual/qmetatype/CMakeLists.txt new file mode 100644 index 00000000000..5648a365f2a --- /dev/null +++ b/tests/manual/qmetatype/CMakeLists.txt @@ -0,0 +1,5 @@ +add_qt_test(tst_qmetatype_expect_fail SOURCES + declare_metatype_noninline.h + tst_qmetatype.cpp + declare_metatype_noninline.cpp +) diff --git a/tests/manual/qopenglwindow/multiwindow/CMakeLists.txt b/tests/manual/qopenglwindow/multiwindow/CMakeLists.txt new file mode 100644 index 00000000000..96e57b502cc --- /dev/null +++ b/tests/manual/qopenglwindow/multiwindow/CMakeLists.txt @@ -0,0 +1,3 @@ +add_qt_test(multiwindow SOURCES + main.cpp +) diff --git a/util/cmake/Pipfile b/util/cmake/Pipfile new file mode 100644 index 00000000000..d7e1905378d --- /dev/null +++ b/util/cmake/Pipfile @@ -0,0 +1,14 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +pytest = "*" +mypy = "*" +pyparsing = "*" + +[dev-packages] + +[requires] +python_version = "3.7" diff --git a/util/cmake/cmakeconversionrate.py b/util/cmake/cmakeconversionrate.py new file mode 100755 index 00000000000..3496ed1b91d --- /dev/null +++ b/util/cmake/cmakeconversionrate.py @@ -0,0 +1,127 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from argparse import ArgumentParser + +import os +import re +import subprocess +import sys +import typing + + +def _parse_commandline(): + parser = ArgumentParser(description='Calculate the conversion rate to cmake.') + parser.add_argument('--debug', dest='debug', action='store_true', + help='Turn on debug output') + parser.add_argument('source_directory', metavar='', type=str, + help='The Qt module source directory') + parser.add_argument('binary_directory', metavar='', type=str, + help='The CMake build directory (might be empty)') + + return parser.parse_args() + + +def calculate_baseline(source_directory: str, *, debug: bool=False) -> int: + if debug: + print('Scanning "{}" for qmake-based tests.'.format(source_directory)) + result = subprocess.run('/usr/bin/git grep -E "^\\s*CONFIG\\s*\\+?=.*\\btestcase\\b" | sort -u | wc -l', + shell=True, capture_output=True, cwd=source_directory) + return int(result.stdout) + + +def build(source_directory: str, binary_directory: str, *, debug=False) -> None: + abs_source = os.path.abspath(source_directory) + if not os.path.isdir(binary_directory): + os.makedirs(binary_directory) + if not os.path.exists(os.path.join(binary_directory, 'CMakeCache.txt')): + + if debug: + print('Running cmake in "{}".'.format(binary_directory)) + result = subprocess.run(['/usr/bin/cmake', '-GNinja', abs_source], cwd=binary_directory) + if debug: + print('CMake return code: {}.'.format(result.returncode)) + + assert result.returncode == 0 + + if debug: + print('Running ninja in "{}".'.format(binary_directory)) + result = subprocess.run('/usr/bin/ninja', cwd=binary_directory) + if debug: + print('Ninja return code: {}.'.format(result.returncode)) + + assert result.returncode == 0 + + +def test(binary_directory: str, *, debug=False) -> typing.Tuple[int, int]: + if debug: + print('Running ctest in "{}".'.format(binary_directory)) + result = subprocess.run('/usr/bin/ctest -j 250 | grep "tests passed, "', + shell=True, capture_output=True, cwd=binary_directory) + summary = result.stdout.decode('utf-8').replace('\n', '') + if debug: + print('Test summary: {} ({}).'.format(summary, result.returncode)) + + matches = re.fullmatch(r'\d+% tests passed, (\d+) tests failed out of (\d+)', summary) + if matches: + if debug: + print('Matches: failed {}, total {}.'.format(matches.group(1), matches.group(2))) + return (int(matches.group(2)), int(matches.group(2)) - int(matches.group(1)), ) + + return (0, 0,) + + +def main() -> int: + args = _parse_commandline() + + base_line = calculate_baseline(args.source_directory, debug=args.debug) + if base_line <= 0: + print('Could not find the qmake baseline in {}.'.format(args.source_directory)) + return 1 + + if args.debug: + print('qmake baseline: {} test binaries.'.format(base_line)) + + cmake_total = 0 + cmake_success = 0 + try: + build(args.source_directory, args.binary_directory, debug=args.debug) + (cmake_total, cmake_success, ) = test(args.binary_directory, debug=args.debug) + finally: + if cmake_total == 0: + print('\n\n\nCould not calculate the cmake state.') + return 2 + else: + print('\n\n\nCMake test conversion rate: {:.2%}.'.format(cmake_total / base_line)) + print('CMake test success rate : {:.2%}.'.format(cmake_success / base_line)) + return 0 + + +if __name__ == '__main__': + main() diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py new file mode 100755 index 00000000000..4623e8d874c --- /dev/null +++ b/util/cmake/configurejson2cmake.py @@ -0,0 +1,860 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import json +import os.path +import re +import sys +from typing import Set, Union, List, Dict + +from helper import map_qt_library, featureName, substitute_platform + +knownTests = set() # type: Set[str] + + +class LibraryMapping: + def __init__(self, package: str, resultVariable: str, appendFoundSuffix: bool = True) -> None: + self.package = package + self.resultVariable = resultVariable + self.appendFoundSuffix = appendFoundSuffix + + +def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: + libmap = { + 'zlib': 'ZLIB', + 'gbm': 'gbm', + 'host_dbus': None, + 'libdl': None, # handled by CMAKE_DL_LIBS + 'libatomic': 'Atomic', + 'double-conversion': 'WrapDoubleConversion', + 'gnu_iconv': None, + 'sun_iconv': None, + 'posix_iconv': None, + 'icu': ['ICU', 'COMPONENTS', 'i18n', 'uc', 'data'], + 'pcre2': ['PCRE2', 'REQUIRED'], + 'libpng': 'PNG', + 'libudev': 'Libudev', + 'udev': 'Libudev', + 'journald': 'Libsystemd', + 'vulkan': 'Vulkan', + 'glib': 'GLib', + 'harfbuzz': 'harfbuzz', + 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), + 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), + 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), + 'libpng': 'PNG', + 'libjpeg': 'JPEG', + 'freetype': 'Freetype', + 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), + 'libinput': 'Libinput', + 'xcb': ['XCB', '1.9'], + 'libproxy': 'libproxy', + 'drm': 'Libdrm', + 'xkbcommon': ['XKB', '0.4.1'], + 'xlib': 'X11', + 'xcb_xlib': 'X11_XCB', + 'xrender': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), + 'xcb_render': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), + 'xcb_glx': LibraryMapping(package="XCB", resultVariable="XCB_GLX"), + 'xcb_xkb': LibraryMapping(package="XCB", resultVariable="XCB_XKB"), + 'xcb_xinput': LibraryMapping(package="XCB", resultVariable="XCB_XINPUT"), + 'x11sm': LibraryMapping(package="X11", resultVariable="X11_SM"), + 'wayland_server': 'Wayland', + } # type: Dict[str, Union[str, List[str], LibraryMapping]] + if lib not in libmap: + raise Exception(' XXXX Unknown library "{}".'.format(lib)) + + return libmap[lib] + + +def map_tests(test: str) -> str: + testmap = { + 'c++11': '$', + 'c++14': '$', + 'c++1z': '$', + 'c99': '$', + 'c11': '$', + + 'x86SimdAlways': 'ON', # FIXME: Is this the right thing? + + 'aesni': 'TEST_subarch_aes', + 'avx': 'TEST_subarch_avx', + 'avx2': 'TEST_subarch_avx2', + 'avx512f': 'TEST_subarch_avx512f', + 'avx512cd': 'TEST_subarch_avx512cd', + 'avx512dq': 'TEST_subarch_avx512dq', + 'avx512bw': 'TEST_subarch_avx512bw', + 'avx512er': 'TEST_subarch_avx512er', + 'avx512pf': 'TEST_subarch_avx512pf', + 'avx512vl': 'TEST_subarch_avx512vl', + 'avx512ifma': 'TEST_subarch_avx512ifma', + 'avx512vbmi': 'TEST_subarch_avx512vbmi', + 'avx512vbmi2': 'TEST_subarch_avx512vbmi2', + 'avx512vpopcntdq': 'TEST_subarch_avx512vpopcntdq', + 'avx5124fmaps': 'TEST_subarch_avx5124fmaps', + 'avx5124vnniw': 'TEST_subarch_avx5124vnniw', + 'bmi': 'TEST_subarch_bmi', + 'bmi2': 'TEST_subarch_bmi2', + 'cx16': 'TEST_subarch_cx16', + 'f16c': 'TEST_subarch_c16c', + 'fma': 'TEST_subarch_fma', + 'fma4': 'TEST_subarch_fma4', + 'fsgsbase': 'TEST_subarch_fsgsbase', + 'gfni': 'TEST_subarch_gfni', + 'ibt': 'TEST_subarch_ibt', + 'lwp': 'TEST_subarch_lwp', + 'lzcnt': 'TEST_subarch_lzcnt', + 'mmx': 'TEST_subarch_mmx', + 'movbe': 'TEST_subarch_movbe', + 'mpx': 'TEST_subarch_mpx', + 'no-sahf': 'TEST_subarch_no_shaf', + 'pclmul': 'TEST_subarch_pclmul', + 'popcnt': 'TEST_subarch_popcnt', + 'prefetchwt1': 'TEST_subarch_prefetchwt1', + 'prfchw': 'TEST_subarch_prfchw', + 'pdpid': 'TEST_subarch_rdpid', + 'rdpid': 'TEST_subarch_rdpid', + 'rdseed': 'TEST_subarch_rdseed', + 'rdrnd': 'TEST_subarch_rdseed', # FIXME: Is this the right thing? + 'rtm': 'TEST_subarch_rtm', + 'shani': 'TEST_subarch_sha', + 'shstk': 'TEST_subarch_shstk', + 'sse2': 'TEST_subarch_sse2', + 'sse3': 'TEST_subarch_sse3', + 'ssse3': 'TEST_subarch_ssse3', + 'sse4a': 'TEST_subarch_sse4a', + 'sse4_1': 'TEST_subarch_sse4_1', + 'sse4_2': 'TEST_subarch_sse4_2', + 'tbm': 'TEST_subarch_tbm', + 'xop': 'TEST_subarch_xop', + + 'neon': 'TEST_subarch_neon', + 'iwmmxt': 'TEST_subarch_iwmmxt', + 'crc32': 'TEST_subarch_crc32', + + 'vis': 'TEST_subarch_vis', + 'vis2': 'TEST_subarch_vis2', + 'vis3': 'TEST_subarch_vis3', + + 'dsp': 'TEST_subarch_dsp', + 'dspr2': 'TEST_subarch_dspr2', + + 'altivec': 'TEST_subarch_altivec', + 'spe': 'TEST_subarch_spe', + 'vsx': 'TEST_subarch_vsx', + + 'posix-iconv': 'TEST_posix_iconv', + 'sun-iconv': 'TEST_sun_iconv', + + 'openssl11': '(OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.0")', + + 'reduce_exports': 'CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY', + } + if test in testmap: + return testmap.get(test, None) + if test in knownTests: + return 'TEST_{}'.format(featureName(test)) + return None + + +def cm(ctx, *output): + txt = ctx['output'] + if txt != '' and not txt.endswith('\n'): + txt += '\n' + txt += '\n'.join(output) + + ctx['output'] = txt + return ctx + + +def readJsonFromDir(dir): + path = os.path.join(dir, 'configure.json') + + print('Reading {}...'.format(path)) + assert os.path.exists(path) + + with open(path, 'r') as fh: + return json.load(fh) + + +def processFiles(ctx, data): + print(' files:') + if 'files' in data: + for (k, v) in data['files'].items(): + ctx[k] = v + return ctx + +def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): + extra = [] + try: + newlib = map_library(lib) + if isinstance(newlib, list): + extra = newlib[1:] + newlib = newlib[0] + elif isinstance(newlib, LibraryMapping): + newlib = newlib.package + except Exception: + return ctx + + if newlib is None: + print(' **** Skipping library "{}" -- was masked.'.format(lib)) + return + + print(' mapped library {} to {}.'.format(lib, newlib)) + + # Avoid duplicate find_package calls. + if newlib in cmake_find_packages_set: + return + + cmake_find_packages_set.add(newlib) + + isRequired = False + + if extra: + if "REQUIRED" in extra: + isRequired = True + extra.remove("REQUIRED") + + if extra: + cm_fh.write('find_package({} {})\n'.format(newlib, ' '.join(extra))) + else: + cm_fh.write('find_package({})\n'.format(newlib)) + + cm_fh.write('set_package_properties({} PROPERTIES TYPE {})\n' + .format(newlib, 'REQUIRED' if isRequired else 'OPTIONAL') + ) + +def lineify(label, value, quote=True): + if value: + if quote: + return ' {} "{}"\n'.format(label, value.replace('"', '\\"')) + return ' {} {}\n'.format(label, value) + return '' + +def map_condition(condition): + # Handle NOT: + if isinstance(condition, list): + condition = '(' + ') AND ('.join(condition) + ')' + if isinstance(condition, bool): + if condition: + return 'ON' + else: + return 'OFF' + assert isinstance(condition, str) + + mapped_features = { + "dlopen": "UNIX", + 'gbm': 'gbm_FOUND', + "sun-libiconv": "TEST_sun_iconv", + "system-xcb": "ON", + "system-freetype": "ON", + } + + # Turn foo != "bar" into (NOT foo STREQUAL 'bar') + condition = re.sub(r"(.+)\s*!=\s*('.+')", '(! \\1 == \\2)', condition) + + condition = condition.replace('!', 'NOT ') + condition = condition.replace('&&', ' AND ') + condition = condition.replace('||', ' OR ') + condition = condition.replace('==', ' STREQUAL ') + + # explicitly handle input.sdk == '': + condition = re.sub(r"input\.sdk\s*==\s*''", 'NOT INPUT_SDK', condition) + + last_pos = 0 + mapped_condition = '' + has_failed = False + for match in re.finditer(r'([a-zA-Z0-9_]+)\.([a-zA-Z0-9_+-]+)', condition): + substitution = None + appendFoundSuffix = True + if match.group(1) == 'libs': + try: + substitution = map_library(match.group(2)) + if isinstance(substitution, list): + substitution = substitution[0] + elif isinstance(substitution, LibraryMapping): + appendFoundSuffix = substitution.appendFoundSuffix + substitution = substitution.resultVariable + except Exception: + substitution = None + + if substitution is not None and appendFoundSuffix: + substitution += '_FOUND' + + elif match.group(1) == 'features': + feature = match.group(2) + if feature in mapped_features: + substitution = mapped_features.get(feature) + else: + substitution = 'QT_FEATURE_{}'.format(featureName(match.group(2))) + + elif match.group(1) == 'subarch': + substitution = 'TEST_subarch_{}'.format(match.group(2)) + + elif match.group(1) == 'call': + if match.group(2) == 'crossCompile': + substitution = 'CMAKE_CROSSCOMPILING' + + elif match.group(1) == 'tests': + substitution = map_tests(match.group(2)) + + elif match.group(1) == 'input': + substitution = 'INPUT_{}'.format(featureName(match.group(2))) + + elif match.group(1) == 'config': + substitution = substitute_platform(match.group(2)) + + elif match.group(1) == 'arch': + if match.group(2) == 'i386': + # FIXME: Does this make sense? + substitution = '(TEST_architecture_arch STREQUAL i386)' + elif match.group(2) == 'x86_64': + substitution = '(TEST_architecture_arch STREQUAL x86_64)' + elif match.group(2) == 'arm': + # FIXME: Does this make sense? + substitution = '(TEST_architecture_arch STREQUAL arm)' + elif match.group(2) == 'arm64': + # FIXME: Does this make sense? + substitution = '(TEST_architecture_arch STREQUAL arm64)' + elif match.group(2) == 'mips': + # FIXME: Does this make sense? + substitution = '(TEST_architecture_arch STREQUAL mips)' + + if substitution is None: + print(' XXXX Unknown condition "{}".'.format(match.group(0))) + has_failed = True + else: + mapped_condition += condition[last_pos:match.start(1)] + substitution + last_pos = match.end(2) + + mapped_condition += condition[last_pos:] + + # Space out '(' and ')': + mapped_condition = mapped_condition.replace('(', ' ( ') + mapped_condition = mapped_condition.replace(')', ' ) ') + + # Prettify: + condition = re.sub('\\s+', ' ', mapped_condition) + condition = condition.strip() + + if has_failed: + condition += ' OR FIXME' + + return condition + + +def parseInput(ctx, input, data, cm_fh): + skip_inputs = { + "prefix", "hostprefix", "extprefix", + + "archdatadir", "bindir", "datadir", "docdir", + "examplesdir", "external-hostbindir", "headerdir", + "hostbindir", "hostdatadir", "hostlibdir", + "importdir", "libdir", "libexecdir", + "plugindir", "qmldir", "settingsdir", + "sysconfdir", "testsdir", "translationdir", + + "android-arch", "android-ndk", "android-ndk-host", + "android-ndk-platform", "android-sdk", + "android-toolchain-version", "android-style-assets", + + "appstore-compliant", + + "avx", "avx2", "avx512", "c++std", "ccache", "commercial", + "compile-examples", "confirm-license", + "dbus", + "dbus-runtime", + + "debug", "debug-and-release", + + "developer-build", + + "device", "device-option", + + "f16c", + + "force-asserts", "force-debug-info", "force-pkg-config", + "framework", + + "gc-binaries", + + "gdb-index", + + "gcc-sysroot", + + "gcov", + + "gnumake", + + "gui", + + "headersclean", + + "incredibuild-xge", + + "libudev", + "ltcg", + "make", + "make-tool", + + "mips_dsp", + "mips_dspr2", + "mp", + + "nomake", + + "opensource", + + "optimize-debug", "optimize-size", "optimized-qmake", "optimized-tools", + + "pch", + + "pkg-config", + + "platform", + + "plugin-manifests", + "profile", + "qreal", + + "reduce-exports", "reduce-relocations", + + "release", + + "rpath", + + "sanitize", + + "sdk", + + "separate-debug-info", + + "shared", + + "silent", + + "qdbus", + + "sse2", + "sse3", + "sse4.1", + "sse4.2", + "ssse3", + "static", + "static-runtime", + "strip", + "syncqt", + "sysroot", + "testcocoon", + "use-gold-linker", + "warnings-are-errors", + "Werror", + "widgets", + "xplatform", + "zlib", + + "doubleconversion", + + "eventfd", + "glib", + "icu", + "inotify", + "journald", + "pcre", + "posix-ipc", + "pps", + "slog2", + "syslog", + + "sqlite", + } + + if input in skip_inputs: + print(' **** Skipping input {}: masked.'.format(input)) + return + + type = data + if isinstance(data, dict): + type = data["type"] + + if type == "boolean": + print(' **** Skipping boolean input {}: masked.'.format(input)) + return + + if type == "enum": + cm_fh.write("# input {}\n".format(input)) + cm_fh.write('set(INPUT_{} "undefined" CACHE STRING "")\n'.format(featureName(input))) + cm_fh.write('set_property(CACHE INPUT_{} PROPERTY STRINGS undefined {})\n\n'.format(featureName(input), " ".join(data["values"]))) + return + + print(' XXXX UNHANDLED INPUT TYPE {} in input description'.format(type)) + return + + +# "tests": { +# "cxx11_future": { +# "label": "C++11 ", +# "type": "compile", +# "test": { +# "include": "future", +# "main": [ +# "std::future f = std::async([]() { return 42; });", +# "(void)f.get();" +# ], +# "qmake": "unix:LIBS += -lpthread" +# } +# }, +def parseTest(ctx, test, data, cm_fh): + skip_tests = { + 'c11', 'c99', + 'c++11', 'c++14', 'c++1y', 'c++1z', + 'reduce_exports', + 'posix-iconv', "sun-iconv", + 'separate_debug_info', # FIXME: see if cmake can do this + 'gc_binaries', + } + + if test in skip_tests: + print(' **** Skipping features {}: masked.'.format(test)) + return + + if data["type"] == "compile": + knownTests.add(test) + + details = data["test"] + + if isinstance(details, str): + print(' XXXX UNHANDLED TEST SUB-TYPE {} in test description'.format(details)) + return + + head = details.get("head", "") + if isinstance(head, list): + head = "\n".join(head) + + sourceCode = head + '\n' + + include = details.get("include", "") + if isinstance(include, list): + include = '#include <' + '>\n#include <'.join(include) + '>' + elif include: + include = '#include <{}>'.format(include) + + sourceCode += include + '\n' + + tail = details.get("tail", "") + if isinstance(tail, list): + tail = "\n".join(tail) + + sourceCode += tail + '\n' + + sourceCode += "int main(int argc, char **argv)\n" + sourceCode += "{\n" + sourceCode += " (void)argc; (void)argv;\n" + sourceCode += " /* BEGIN TEST: */\n" + + main = details.get("main", "") + if isinstance(main, list): + main = "\n".join(main) + + sourceCode += main + '\n' + + sourceCode += " /* END TEST: */\n" + sourceCode += " return 0;\n" + sourceCode += "}\n" + + sourceCode = sourceCode.replace('"', '\\"') + + cm_fh.write("# {}\n".format(test)) + cm_fh.write("qt_config_compile_test({}\n".format(featureName(test))) + cm_fh.write(lineify("LABEL", data.get("label", ""))) + cm_fh.write('"' + sourceCode + '"') + if "qmake" in details: + cm_fh.write("# FIXME: qmake: {}\n".format(details["qmake"])) + cm_fh.write(")\n\n") + + elif data["type"] == "x86Simd": + knownTests.add(test) + + label = data["label"] + + cm_fh.write("# {}\n".format(test)) + cm_fh.write("qt_config_compile_test_x86simd({} \"{}\")\n".format(test, label)) + cm_fh.write("\n") + +# "features": { +# "android-style-assets": { +# "label": "Android Style Assets", +# "condition": "config.android", +# "output": [ "privateFeature" ], +# "comment": "This belongs into gui, but the license check needs it here already." +# }, + else: + print(' XXXX UNHANDLED TEST TYPE {} in test description'.format(data["type"])) + + +def parseFeature(ctx, feature, data, cm_fh): + skip_features = { + 'c++11', 'c++14', 'c++1y', 'c++1z', # C++ versions + 'c89', 'c99', 'c11', # C versions + 'stl', # Do we really need to test for this in 2018?! + 'rpath', 'rpath_dir', # rpath related + 'static', 'shared', # static/shared libs + 'debug', 'release', 'debug_and_release', 'build_all', 'optimize_debug', 'optimize_size', # build types + 'release_tools', 'gcov', 'silent', 'profile', + 'msvc_mp', 'static_runtime', 'incredibuild_xge', 'ccache', # compiler specific stuff + 'sanitize_address', 'sanitize_thread', 'sanitize_memory', # sanitizer + 'sanitize_undefined', 'sanitizer', + 'force_debug_info', 'separate_debug_info', 'warnings_are_errors', # FIXME: Do we need these? + 'strip', 'precompile_header', 'ltcg', 'enable_new_dtags', + 'enable_gdb_index', 'reduce_relocations', + 'stack-protector-strong', + 'host-dbus', # dbus related + 'cross_compile', 'gcc-sysroot', # cross compile related + 'gc_binaries', 'qmakeargs', 'use_gold_linker', 'pkg-config', 'verifyspec', # qmake stuff... + 'GNUmake', 'compiler-flags', + 'system-doubleconversion', 'system-pcre2', 'system-zlib', 'system-png', 'system-jpeg', 'system-freetype', 'system-xcb', 'xkbcommon-system', # system libraries + 'doubleconversion', + 'dlopen', # handled by CMAKE_DL_LIBS + 'alloc_stdlib_h', 'alloc_h', 'alloc_malloc_h', # handled by alloc target + 'posix_fallocate', # Only needed for sqlite, which we do not want to build + 'qpa_default_platform', # Not a bool! + 'sun-libiconv', # internal feature but not referenced in our system + } + if feature in skip_features: + print(' **** Skipping features {}: masked.'.format(feature)) + return + + disabled_features = set() + + override_condition = {} + + handled = { 'autoDetect', 'comment', 'condition', 'description', 'disable', 'emitIf', 'enable', 'label', 'output', 'purpose', 'section' } + label = data.get('label', '') + purpose = data.get('purpose', data.get('description', label)) + autoDetect = map_condition(data.get('autoDetect', '')) + condition = override_condition.get(feature, map_condition(data.get('condition', ''))) + output = data.get('output', []) + comment = data.get('comment', '') + section = data.get('section', '') + enable = map_condition(data.get('enable', '')) + disable = map_condition(data.get('disable', '')) + emitIf = map_condition(data.get('emitIf', '')) + + if feature in disabled_features: + condition = "FALSE" + + for k in [k for k in data.keys() if k not in handled]: + print(' XXXX UNHANDLED KEY {} in feature description'.format(k)) + + if not output: + # feature that is only used in the conditions of other features + output = ["internalFeature"] + + publicInfo = False + privateInfo = False + internalFeature = False + + for o in output: + outputType = o + outputArgs = {} + if isinstance(o, dict): + outputType = o['type'] + outputArgs = o + + if outputType in ['varAssign', 'varAppend', 'varRemove', 'publicQtConfig', 'privateConfig', 'publicConfig']: + continue + + elif outputType in ['feature', 'publicFeature', 'define']: + publicInfo = True + elif outputType == 'privateFeature': + privateInfo = True + elif outputType == 'internalFeature': + internalFeature = True + else: + print(' XXXX UNHANDLED OUTPUT TYPE {} in feature {}.'.format(outputType, feature)) + continue + + if not publicInfo and not privateInfo and not internalFeature: + print(' **** Skipping feature {}: Not relevant for C++.'.format(feature)) + return + + # write feature: + cxxFeature = featureName(feature) + if comment: + cm_fh.write('# {}\n'.format(comment)) + + cm_fh.write('qt_feature("{}"'.format(cxxFeature)) + if publicInfo: + cm_fh.write(' PUBLIC') + if privateInfo: + cm_fh.write(' PRIVATE') + cm_fh.write('\n') + + cm_fh.write(lineify('SECTION', section)) + cm_fh.write(lineify('LABEL', label)) + if purpose != label: + cm_fh.write(lineify('PURPOSE', purpose)) + cm_fh.write(lineify('AUTODETECT', autoDetect, quote=False)) + cm_fh.write(lineify('CONDITION', condition, quote=False)) + cm_fh.write(lineify('ENABLE', enable, quote=False)) + cm_fh.write(lineify('DISABLE', disable, quote=False)) + cm_fh.write(lineify('EMIT_IF', emitIf, quote=False)) + cm_fh.write(')\n') + + for o in output: + outputType = o + outputArgs = {} + if isinstance(o, dict): + outputType = o['type'] + outputArgs = o + + # Map feature to define: + if outputType == 'feature': + outputType = 'define' + outputArgs = {'name': 'QT_NO_{}'.format(cxxFeature.upper()), + 'negative': True, + 'value': 1, + 'type': 'define'} + + if outputType != 'define': + continue + + if outputArgs.get('name') is None: + print(' XXXX DEFINE output without name in feature {}.'.format(feature)) + continue + + cm_fh.write('qt_feature_definition("{}" "{}"'.format(cxxFeature, outputArgs.get('name'))) + if outputArgs.get('negative', False): + cm_fh.write(' NEGATE') + if outputArgs.get('value') is not None: + cm_fh.write(' VALUE "{}"'.format(outputArgs.get('value'))) + cm_fh.write(')\n') + + +def processInputs(ctx, data, cm_fh): + print(' inputs:') + if 'commandline' not in data: + return + + commandLine = data['commandline'] + if "options" not in commandLine: + return + + for input in commandLine['options']: + parseInput(ctx, input, commandLine['options'][input], cm_fh) + + +def processTests(ctx, data, cm_fh): + print(' tests:') + if 'tests' not in data: + return + + for test in data['tests']: + parseTest(ctx, test, data['tests'][test], cm_fh) + + +def processFeatures(ctx, data, cm_fh): + print(' features:') + if 'features' not in data: + return + + for feature in data['features']: + parseFeature(ctx, feature, data['features'][feature], cm_fh) + + +def processLibraries(ctx, data, cm_fh): + cmake_find_packages_set = set() + print(' libraries:') + if 'libraries' not in data: + return + + for lib in data['libraries']: + parseLib(ctx, lib, data['libraries'][lib], cm_fh, cmake_find_packages_set) + + +def processSubconfigs(dir, ctx, data): + assert ctx is not None + if 'subconfigs' in data: + for subconf in data['subconfigs']: + subconfDir = os.path.join(dir, subconf) + subconfData = readJsonFromDir(subconfDir) + subconfCtx = ctx + processJson(subconfDir, subconfCtx, subconfData) + + +def processJson(dir, ctx, data): + ctx['module'] = data.get('module', 'global') + + ctx = processFiles(ctx, data) + + with open(os.path.join(dir, "configure.cmake"), 'w') as cm_fh: + cm_fh.write("\n\n#### Inputs\n\n") + + processInputs(ctx, data, cm_fh) + + cm_fh.write("\n\n#### Libraries\n\n") + + processLibraries(ctx, data, cm_fh) + + cm_fh.write("\n\n#### Tests\n\n") + + processTests(ctx, data, cm_fh) + + cm_fh.write("\n\n#### Features\n\n") + + processFeatures(ctx, data, cm_fh) + + if ctx.get('module') == 'global': + cm_fh.write('\nqt_extra_definition("QT_VERSION_STR" "\\\"${PROJECT_VERSION}\\\"" PUBLIC)\n') + cm_fh.write('qt_extra_definition("QT_VERSION_MAJOR" ${PROJECT_VERSION_MAJOR} PUBLIC)\n') + cm_fh.write('qt_extra_definition("QT_VERSION_MINOR" ${PROJECT_VERSION_MINOR} PUBLIC)\n') + cm_fh.write('qt_extra_definition("QT_VERSION_PATCH" ${PROJECT_VERSION_PATCH} PUBLIC)\n') + + if ctx.get('module') == 'gui': + cm_fh.write('\nqt_extra_definition("QT_QPA_DEFAULT_PLATFORM" "${QT_QPA_DEFAULT_PLATFORM}" PUBLIC)\n') + + # do this late: + processSubconfigs(dir, ctx, data) + + +def main(): + if len(sys.argv) != 2: + print("This scripts needs one directory to process!") + quit(1) + + dir = sys.argv[1] + + print("Processing: {}.".format(dir)) + + data = readJsonFromDir(dir) + processJson(dir, {}, data) + + +if __name__ == '__main__': + main() diff --git a/util/cmake/generate_module_map.sh b/util/cmake/generate_module_map.sh new file mode 100755 index 00000000000..1ca0bfc43c8 --- /dev/null +++ b/util/cmake/generate_module_map.sh @@ -0,0 +1,38 @@ +#!/usr/bin/bash +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +pro_files=$(find . -name \*.pro) + +for f in ${pro_files}; do + if grep "^load(qt_module)" "${f}" > /dev/null ; then + target=$(grep "TARGET" "${f}" | cut -d'=' -f2 | sed -e "s/\s*//g") + module=$(basename ${f}) + echo "'${module%.pro}': '${target}'," + fi +done diff --git a/util/cmake/helper.py b/util/cmake/helper.py new file mode 100644 index 00000000000..2ddeee98c1e --- /dev/null +++ b/util/cmake/helper.py @@ -0,0 +1,206 @@ +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import re + + +def featureName(input: str) -> str: + return re.sub(r'[^a-zA-Z0-9_]', '_', input) + + +def map_qt_base_library(lib: str) -> str: + library_map = { + 'global': 'Qt::Core', # manually added special case + 'accessibility_support': 'Qt::AccessibilitySupport', + 'androidextras': 'Qt::AndroidExtras', + 'animation': 'Qt::3DAnimation', + 'application-lib': 'Qt::AppManApplication', + 'bluetooth': 'Qt::Bluetooth', + 'bootstrap-dbus': 'Qt::BootstrapDBus', + 'bootstrap': 'Qt::Bootstrap', + 'client': 'Qt::WaylandClient', + 'clipboard_support': 'Qt::ClipboardSupport', + 'common-lib': 'Qt::AppManCommon', + 'compositor': 'Qt::WaylandCompositor', + 'concurrent': 'Qt::Concurrent', + 'container': 'Qt::AxContainer', + 'control': 'Qt::AxServer', + 'core_headers': 'Qt::WebEngineCore', + 'core': 'Qt::Core', + 'coretest': 'Qt::3DCoreTest', + 'crypto-lib': 'Qt::AppManCrypto', + 'dbus': 'Qt::DBus', + 'devicediscovery': 'Qt::DeviceDiscoverySupport', + 'edid': 'Qt::EdidSupport', + 'eglconvenience': 'Qt::EglSupport', + 'eglfsdeviceintegration': 'Qt::EglFSDeviceIntegration', + 'eglfs_kms_support': 'Qt::EglFsKmsSupport', + 'enginio_client': 'Enginio', + 'eventdispatchers': 'Qt::EventDispatcherSupport', + 'extras': 'Qt::3DExtras', + 'fbconvenience': 'Qt::FbSupport', + 'fontdatabase_support': 'Qt::FontDatabaseSupport', + 'gamepad': 'Qt::Gamepad', + 'glxconvenience': 'Qt::GlxSupport', + 'graphics_support': 'Qt::GraphicsSupport', + 'gsttools': 'Qt::MultimediaGstTools', + 'gui': 'Qt::Gui', + 'help': 'Qt::Help', + 'hunspellinputmethod': 'Qt::HunspellInputMethod', + 'input': 'Qt::InputSupport', + 'installer-lib': 'Qt::AppManInstaller', + 'kmsconvenience': 'Qt::KmsSupport', + 'launcher-lib': 'Qt::AppManLauncher', + 'lib': 'Qt::Designer', + 'linuxaccessibility': 'Qt::LinuxAccessibilitySupport', + 'location': 'Qt::Location', + 'logic': 'Qt::3DLogic', + 'macextras': 'Qt::MacExtras', + 'main-lib': 'Qt::AppManMain', + 'manager-lib': 'Qt::AppManManager', + 'monitor-lib': 'Qt::AppManMonitor', + 'multimedia': 'Qt::Multimedia', + 'multimediawidgets': 'Qt::MultimediaWidgets', + 'network': 'Qt::Network', + 'nfc': 'Qt::Nfc', + 'oauth': 'Qt::NetworkAuth', + 'openglextensions': 'Qt::OpenGLExtensions', + 'opengl': 'Qt::OpenGL', + 'package-lib': 'Qt::AppManPackage', + 'packetprotocol': 'Qt::PacketProtocol', + 'particles': 'Qt::QuickParticles', + 'platformcompositor': 'Qt::PlatformCompositorSupport', + 'plugin-interfaces': 'Qt::AppManPluginInterfaces', + 'positioning': 'Qt::Positioning', + 'positioningquick': 'Qt::PositioningQuick', + 'printsupport': 'Qt::PrintSupport', + 'purchasing': 'Qt::Purchasing', + 'qmldebug': 'Qt::QmlDebug', + 'qmldevtools': 'Qt::QmlDevTools', + 'qml': 'Qt::Qml', + 'qmltest': 'Qt::QuickTest', + 'qtmultimediaquicktools': 'Qt::MultimediaQuick', + 'qtzlib': 'Qt::Zlib', + 'quick3danimation': 'Qt::3DQuickAnimation', + 'quick3dextras': 'Qt::3DQuickExtras', + 'quick3dinput': 'Qt::3DQuickInput', + 'quick3d': 'Qt::3DQuick', + 'quick3drender': 'Qt::3DQuickRender', + 'quick3dscene2d': 'Qt::3DQuickScene2D', + 'quickcontrols2': 'Qt::QuickControls2', + 'quick': 'Qt::Quick', + 'quickshapes': 'Qt::QuickShapes', + 'quicktemplates2': 'Qt::QuickTemplates2', + 'quickwidgets': 'Qt::QuickWidgets', + 'render': 'Qt::3DRender', + 'script': 'Qt::Script', + 'scripttools': 'Qt::ScriptTools', + 'sensors': 'Qt::Sensors', + 'serialport': 'Qt::SerialPort', + 'services': 'Qt::ServiceSupport', + 'sql': 'Qt::Sql', + 'svg': 'Qt::Svg', + 'testlib': 'Qt::Test', + 'theme_support': 'Qt::ThemeSupport', + 'service_support': 'Qt::ServiceSupport', + 'eventdispatcher_support': 'Qt::EventDispatcherSupport', + 'edid_support': 'Qt::EdidSupport', + 'tts': 'Qt::TextToSpeech', + 'uiplugin': 'Qt::UiPlugin', + 'uitools': 'Qt::UiTools', + 'virtualkeyboard': 'Qt::VirtualKeyboard', + 'vkconvenience': 'Qt::VulkanSupport', + 'webchannel': 'Qt::WebChannel', + 'webengine': 'Qt::WebEngine', + 'webenginewidgets': 'Qt::WebEngineWidgets', + 'websockets': 'Qt::WebSockets', + 'webview': 'Qt::WebView', + 'widgets': 'Qt::Widgets', + 'window-lib': 'Qt::AppManWindow', + 'windowsuiautomation': 'Qt::WindowsUIAutomationSupport', + 'winextras': 'Qt::WinExtras', + 'x11extras': 'Qt::X11Extras', + 'xcb_qpa_lib': 'Qt::XcbQpa', + 'xmlpatterns': 'Qt::XmlPatterns', + 'xml': 'Qt::Xml', + } + return library_map.get(lib, lib) + + +def map_qt_library(lib: str) -> str: + private = False + if lib.endswith('-private'): + private = True + lib = lib[:-8] + mapped = map_qt_base_library(lib) + if private: + mapped += 'Private' + return mapped + + +platform_mapping = { + 'win32': 'WIN32', + 'unix': 'UNIX', + 'darwin': 'APPLE', + 'linux': 'LINUX', + 'integrity': 'INTEGRITY', + 'qnx': 'QNX', + 'vxworks': 'VXWORKS', + 'hpux': 'HPUX', + 'nacl': 'NACL', + 'android': 'ANDROID', + 'android-embedded': 'ANDROID_EMBEDDED', + 'uikit': 'APPLE_UIKIT', + 'tvos': 'APPLE_TVOS', + 'watchos': 'APPLE_WATCHOS', + 'winrt': 'WINRT', + 'wasm': 'WASM', + 'msvc': 'MSVC', + 'clang': 'CLANG', + 'gcc': 'GCC', + 'osx': 'APPLE_OSX', + 'freebsd': 'FREEBSD', + 'haiku': 'HAIKU', + 'netbsd': 'NETBSD', + 'mac': 'APPLE_OSX', +} + + +def substitute_platform(platform: str) -> str: + """ Return the qmake platform as cmake platform or the unchanged string. """ + return platform_mapping.get(platform, platform) + + +libray_mapping = { + 'zlib': 'ZLIB::ZLIB', + 'glib': 'PkgConfig::GLib', +} + + +def substitute_libs(lib: str) -> str: + return libray_mapping.get(lib, lib) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py new file mode 100755 index 00000000000..37364d63ada --- /dev/null +++ b/util/cmake/pro2cmake.py @@ -0,0 +1,736 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from argparse import ArgumentParser +import os.path +import re +import sys +import io +from typing import IO, List, Dict, Union +import typing + +import pyparsing as pp + +from helper import map_qt_library, featureName, substitute_platform, substitute_libs + + +def _parse_commandline(): + parser = ArgumentParser(description='Generate CMakeLists.txt files from .pro files.') + parser.add_argument('--debug', dest='debug', action='store_true', + help='Turn on all debug output') + parser.add_argument('--debug-parser', dest='debug_parser', action='store_true', + help='Print debug output from qmake parser.') + parser.add_argument('--debug-parse-result', dest='debug_parse_result', action='store_true', + help='Dump the qmake parser result.') + parser.add_argument('--debug-parse-dictionary', dest='debug_parse_dictionary', action='store_true', + help='Dump the qmake parser result as dictionary.') + parser.add_argument('--debug-pro-structure', dest='debug_pro_structure', action='store_true', + help='Dump the structure of the qmake .pro-file.') + parser.add_argument('--debug-full-pro-structure', dest='debug_full_pro_structure', action='store_true', + help='Dump the full structure of the qmake .pro-file (with includes).') + parser.add_argument('files', metavar='<.pro/.pri file>', type=str, nargs='+', + help='The .pro/.pri file to process') + + return parser.parse_args() + + +def spaces(indent: int) -> str: + return ' ' * indent + + +def map_to_file(f: str, top_dir: str, current_dir: str, + want_absolute_path: bool = False) -> typing.Optional[str]: + if f == '$$NO_PCH_SOURCES': + return None + if f.startswith('$$PWD/') or f == '$$PWD': # INCLUDEPATH += $$PWD + return os.path.join(os.path.relpath(current_dir, top_dir), f[6:]) + if f.startswith('$$OUT_PWD/'): + return "${CMAKE_CURRENT_BUILD_DIR}/" + f[10:] + if f.startswith('$$QT_SOURCE_TREE'): + return "${PROJECT_SOURCE_DIR}/" + f[17:] + if f.startswith("./"): + return os.path.join(current_dir, f) + if want_absolute_path and not os.path.isabs(f): + return os.path.join(current_dir, f) + return f + + +def map_source_to_cmake(source: str) -> typing.Optional[str]: + if not source or source == '$$NO_PCH_SOURCES': + return None + if source.startswith('$$PWD/'): + return source[6:] + if source == '.': + return "${CMAKE_CURRENT_SOURCE_DIR}" + if source.startswith('$$QT_SOURCE_TREE/'): + return "${PROJECT_SOURCE_DIR}/" + source[17:] + return source + + +def map_source_to_fs(base_dir: str, file: str, source: str) -> typing.Optional[str]: + if source is None or source == '$$NO_PCH_SOURCES': + return None + if source.startswith('$$PWD/'): + return os.path.join(os.path.dirname(file), source[6:]) + if source.startswith('$$QT_SOURCE_TREE/'): + return os.path.join('.', source[17:]) + if source.startswith('${PROJECT_SOURCE_DIR}/'): + return os.path.join('.', source[22:]) + if source.startswith('${CMAKE_CURRENT_SOURCE_DIR}/'): + return os.path.join(base_dir, source[28:]) + return os.path.join(base_dir, source) + + +class Scope: + def __init__(self, file: typing.Optional[str]=None, condition: str='', base_dir: str='') -> None: + self._parent = None # type: Scope + self._basedir = base_dir + if file: + self._currentdir = os.path.dirname(file) + if not self._currentdir: + self._currentdir = '.' + if not self._basedir: + self._basedir = self._currentdir + + self._file = file + self._condition = map_condition(condition) + self._children = [] # type: List[Scope] + self._values = {} # type: Dict[str, List[str]] + + def merge(self, other: 'Scope') -> None: + for c in other._children: + self.add_child(c) + other.set_basedir(self._basedir) + + for k in self._values.keys(): + self.append_value(k, other.get(k, [])) + + for k in other._values.keys(): + if k not in self._values: + self.set_value(k, other.get(k)) + + def set_basedir(self, dir: str) -> None: + self._basedir = dir + for c in self._children: + c.set_basedir(dir) + + def basedir(self) -> str: + return self._basedir + + def currentdir(self) -> str: + return self._currentdir + + @staticmethod + def FromDict(file: str, statements, cond: str = '', base_dir: str = ''): + scope = Scope(file, cond, base_dir) + for statement in statements: + if isinstance(statement, list): # Handle skipped parts... + assert not statement + continue + + operation = statement.get('operation', None) + if operation: + key = statement.get('key', '') + value = statement.get('value', []) + assert key != '' + + if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH') or key.endswith('_HEADERS') or key.endswith('_SOURCES'): + value = [map_to_file(v, scope.basedir(), scope.currentdir()) for v in value] + + if operation == '=': + scope.set_value(key, value) + elif operation == '-=': + scope.substract_value(key, value) + elif operation == '+=' or operation == '*=': + scope.append_value(key, value) + else: + print('Unexpected operation "{}" in scope with condition {}.'.format(operation, cond)) + assert(False) + + continue + + condition = statement.get('condition', None) + if condition: + child = Scope.FromDict(file, statement.get('statements'), condition, scope.basedir()) + scope.add_child(child) + + else_statements = statement.get('else_statements') + if else_statements: + child = Scope.FromDict(file, else_statements, 'NOT ' + condition, scope.basedir()) + scope.add_child(child) + continue + + loaded = statement.get('loaded', None) + if loaded: + scope.append_value('_LOADED', loaded) + continue + + option = statement.get('option', None) + if option: + scope.append_value('_OPTION', option) + continue + + included = statement.get('included', None) + if included: + scope.append_value('_INCLUDED', + map_to_file(included, scope.basedir(), scope.currentdir())) + continue + + return scope + + def file(self) -> str: + return self._file or '' + + def cMakeListsFile(self) -> str: + return os.path.join(self.basedir(), 'CMakeLists.txt') + + def condition(self) -> str: + return self._condition + + def _push_down_TEMPLATE(self, template: str) -> None: + if not self._rawTemplate(): + self.set_value('TEMPLATE', [template, ]) + for c in self._children: + c._push_down_TEMPLATE(template) + + def add_child(self, scope: 'Scope') -> None: + scope._parent = self + if not scope._rawTemplate(): + scope._push_down_TEMPLATE(self.getTemplate()) + self._children.append(scope) + + def set_value(self, key: str, value: List[str]) -> None: + self._values[key] = value + + def append_value(self, key: str, value: Union[str, List[str]]) -> None: + array = self._values.get(key, []) + if isinstance(value, str): + array.append(value) + elif isinstance(value, list): + array += value + else: + assert False + self._values[key] = array + + def substract_value(self, key: str, value: Union[str, List[str]]) -> None: + if isinstance(value, str): + to_remove = [value, ] + if isinstance(value, list): + to_remove = value + + self.append_value(key, ['-{}'.format(v) for v in to_remove]) + + def children(self) -> List['Scope']: + return self._children + + def dump(self, *, indent: int = 0) -> None: + ind = ' ' * indent + if self._condition == '': + print('{}Scope {} in {}.'.format(ind, self._file, self._basedir)) + else: + print('{}Scope {} in {} with condition: {}.'.format(ind, self._file, self._basedir, self._condition)) + print('{}Keys:'.format(ind)) + for k in sorted(self._values.keys()): + print('{} {} = "{}"'.format(ind, k, self._values[k])) + print('{}Children:'.format(ind)) + for c in self._children: + c.dump(indent=indent + 1) + + def get(self, key: str, default=None) -> List[str]: + default = default or [] + return self._values.get(key, default) + + def getString(self, key: str, default: str = '') -> str: + v = self.get(key) + if isinstance(v, list): + if len(v) == 0: + return default + assert len(v) == 1 + return v[0] + elif isinstance(v, str): + return v + else: + assert False + return default + + def getTemplate(self) -> str: + return self.getString('TEMPLATE', 'app') + + def _rawTemplate(self) -> str: + return self.getString('TEMPLATE') + + def getTarget(self) -> str: + return self.getString('TARGET') or os.path.splitext(os.path.basename(self.file()))[0] + + +class QmakeParser: + def __init__(self, *, debug: bool = False) -> None: + self._Grammar = self._generate_grammar(debug) + + def _generate_grammar(self, debug: bool): + # Define grammar: + pp.ParserElement.setDefaultWhitespaceChars(' \t') + + LC = pp.Suppress(pp.Literal('\\') + pp.LineEnd()) + EOL = pp.Suppress(pp.Optional(pp.pythonStyleComment()) + pp.LineEnd()) + + Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_./') + Substitution = pp.Combine(pp.Literal('$') + + (((pp.Literal('$') + Identifier + pp.Optional(pp.nestedExpr())) + | (pp.Literal('(') + Identifier + pp.Literal(')')) + | (pp.Literal('{') + Identifier + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('{') + Identifier + pp.Optional(pp.nestedExpr()) + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('[') + Identifier + pp.Literal(']')) + ))) + # Do not match word ending in '\' since that breaks line continuation:-/ + LiteralValuePart = pp.Word(pp.printables, excludeChars='$#{}()') + SubstitutionValue = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart | pp.Literal('$'))) + Value = (pp.QuotedString(quoteChar='"', escChar='\\') | SubstitutionValue) + + Values = pp.ZeroOrMore(Value)('value') + + Op = pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') | pp.Literal('*=') + + Operation = Identifier('key') + Op('operation') + Values('value') + Load = pp.Keyword('load') + pp.Suppress('(') + Identifier('loaded') + pp.Suppress(')') + Include = pp.Keyword('include') + pp.Suppress('(') + pp.CharsNotIn(':{=}#)\n')('included') + pp.Suppress(')') + Option = pp.Keyword('option') + pp.Suppress('(') + Identifier('option') + pp.Suppress(')') + DefineTest = pp.Suppress(pp.Keyword('defineTest') + pp.Suppress('(') + Identifier + pp.Suppress(')') + + pp.nestedExpr(opener='{', closer='}') + pp.LineEnd()) # ignore the whole thing... + FunctionCall = pp.Suppress(Identifier + pp.nestedExpr()) + + Scope = pp.Forward() + + Statement = pp.Group(Load | Include | Option | DefineTest | FunctionCall | Operation) + StatementLine = Statement + EOL + StatementGroup = pp.ZeroOrMore(Scope | EOL | StatementLine) + + Block = pp.Suppress('{') + pp.Optional(EOL) \ + + pp.ZeroOrMore(EOL | Statement + EOL | Scope) \ + + pp.Optional(Statement) + pp.Optional(EOL) \ + + pp.Suppress('}') + pp.Optional(EOL) + + Condition = pp.Optional(pp.White()) + pp.CharsNotIn(':{=}#\\\n') + Condition.setParseAction(lambda x: ' '.join(x).strip()) + + SingleLineScope = pp.Suppress(pp.Literal(':')) + pp.Group(Scope | Block | StatementLine)('statements') + MultiLineScope = Block('statements') + + SingleLineElse = pp.Suppress(pp.Literal(':')) + pp.Group(Scope | StatementLine)('else_statements') + MultiLineElse = pp.Group(Block)('else_statements') + Else = pp.Suppress(pp.Keyword('else')) + (SingleLineElse | MultiLineElse) + Scope <<= pp.Group(Condition('condition') + (SingleLineScope | MultiLineScope) + pp.Optional(Else)) + + if debug: + for ename in "EOL Identifier Substitution SubstitutionValue LiteralValuePart Value Values SingleLineScope MultiLineScope Scope SingleLineElse MultiLineElse Else Condition Block StatementGroup Statement Load Include Option DefineTest FunctionCall Operation".split(): + expr = locals()[ename] + expr.setName(ename) + expr.setDebug() + + Grammar = StatementGroup('statements') + Grammar.ignore(LC) + + return Grammar + + def parseFile(self, file: str): + print('Parsing \"{}\"...'.format(file)) + try: + result = self._Grammar.parseFile(file, parseAll=True) + except pp.ParseException as pe: + print(pe.line) + print(' '*(pe.col-1) + '^') + print(pe) + raise pe + return result + + +def parseProFile(file: str, *, debug=False): + parser = QmakeParser(debug=debug) + return parser.parseFile(file) + + +def map_condition(condition: str) -> str: + condition = condition.replace('!', 'NOT ') + condition = condition.replace('&&', ' AND ') + condition = condition.replace('|', ' OR ') + condition = condition.replace('==', ' STREQUAL ') + + cmake_condition = '' + for part in condition.split(): + # some features contain e.g. linux, that should not be turned upper case + feature = re.match(r"(qtConfig|qtHaveModule)\(([a-zA-Z0-9_-]+)\)", part) + if feature: + part = 'QT_FEATURE_' + featureName(feature.group(2)) + else: + part = substitute_platform(part) + + part = part.replace('true', 'ON') + part = part.replace('false', 'OFF') + cmake_condition += ' ' + part + + return cmake_condition.strip() + + +def handle_subdir(scope: Scope, cm_fh: IO[str], *, indent: int = 0) -> None: + assert scope.getTemplate() == 'subdirs' + ind = ' ' * indent + for sd in scope.get('SUBDIRS', []): + full_sd = os.path.join(scope.basedir(), sd) + if os.path.isdir(full_sd): + cm_fh.write('{}add_subdirectory({})\n'.format(ind, sd)) + elif os.path.isfile(full_sd): + subdir_result = parseProFile(full_sd, debug=False) + subdir_scope = Scope.FromDict(full_sd, subdir_result.asDict().get('statements'), + '', scope.basedir()) + + cmakeify_scope(subdir_scope, cm_fh, indent=indent + 1) + elif sd.startswith('-'): + cm_fh.write('{}### remove_subdirectory("{}")\n'.format(ind, sd[1:])) + else: + print(' XXXX: SUBDIR {} in {}: Not found.'.format(sd, scope.file())) + + for c in scope.children(): + cond = c.condition() + if cond == 'else': + cm_fh.write('\n{}else()\n'.format(ind)) + elif cond: + cm_fh.write('\n{}if({})\n'.format(ind, cond)) + + handle_subdir(c, cm_fh, indent=indent + 1) + + if cond: + cm_fh.write('{}endif()\n'.format(ind)) + + +def sort_sources(sources) -> List[str]: + to_sort = {} # type: Dict[str, List[str]] + for s in sources: + if s is None: + continue + + dir = os.path.dirname(s) + base = os.path.splitext(os.path.basename(s))[0] + if base.endswith('_p'): + base = base[:-2] + sort_name = os.path.join(dir, base) + + array = to_sort.get(sort_name, []) + array.append(s) + + to_sort[sort_name] = array + + lines = [] + for k in sorted(to_sort.keys()): + lines.append(' '.join(sorted(to_sort[k]))) + + return lines + + +def write_header(cm_fh: IO[str], name: str, typename: str, *, indent: int=0): + cm_fh.write('{}#####################################################################\n'.format(spaces(indent))) + cm_fh.write('{}## {} {}:\n'.format(spaces(indent), name, typename)) + cm_fh.write('{}#####################################################################\n\n'.format(spaces(indent))) + + +def write_scope_header(cm_fh: IO[str], *, indent: int=0): + cm_fh.write('\n{}## Scopes:\n'.format(spaces(indent))) + cm_fh.write('{}#####################################################################\n'.format(spaces(indent))) + + +def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, + known_libraries=set()) -> None: + ind = spaces(indent) + + plugin_type = scope.get('PLUGIN_TYPE') + if plugin_type: + cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) + + sources = scope.get('SOURCES') + scope.get('HEADERS') + scope.get('OBJECTIVE_SOURCES') + scope.get('NO_PCH_SOURCES') + scope.get('FORMS') + resources = scope.get('RESOURCES') + if resources: + qrc_only = True + for r in resources: + if not r.endswith('.qrc'): + qrc_only = False + break + + if not qrc_only: + print(' XXXX Ignoring non-QRC file resources.') + else: + sources += resources + + sources = [map_source_to_cmake(s) for s in sources] + if sources: + cm_fh.write('{} SOURCES\n'.format(ind)) + for l in sort_sources(sources): + cm_fh.write('{} {}\n'.format(ind, l)) + + if scope.get('DEFINES'): + cm_fh.write('{} DEFINES\n'.format(ind)) + for d in scope.get('DEFINES'): + d = d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') + cm_fh.write('{} {}\n'.format(ind, d)) + if scope.get('INCLUDEPATH'): + cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) + for i in scope.get('INCLUDEPATH'): + cm_fh.write('{} {}\n'.format(ind, i)) + + dependencies = [map_qt_library(q) for q in scope.get('QT') if map_qt_library(q) not in known_libraries] + dependencies += [map_qt_library(q) for q in scope.get('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] + dependencies += scope.get('QMAKE_USE_PRIVATE') + scope.get('LIBS_PRIVATE') + scope.get('LIBS') + if dependencies: + cm_fh.write('{} LIBRARIES\n'.format(ind)) + is_framework = False + for d in dependencies: + if d == '-framework': + is_framework = True + continue + if is_framework: + d = '${FW%s}' % d + if d.startswith('-l'): + d = d[2:] + d = substitute_libs(d) + cm_fh.write('{} {}\n'.format(ind, d)) + is_framework = False + + +def write_extend_target(cm_fh: IO[str], target: str, scope: Scope, parent_condition: str='', + previous_conditon: str='', *, indent: int=0) -> str: + total_condition = scope.condition() + if total_condition == 'else': + assert previous_conditon, "Else branch without previous condition in: %s" % scope.file() + total_condition = 'NOT ({})'.format(previous_conditon) + if parent_condition: + total_condition = '({}) AND ({})'.format(parent_condition, total_condition) + + extend_qt_io_string = io.StringIO() + write_sources_section(extend_qt_io_string, scope) + extend_qt_string = extend_qt_io_string.getvalue() + + extend_scope = '\n{}extend_target({} CONDITION {}\n{})\n'.format(spaces(indent), target, total_condition, extend_qt_string) + + if not extend_qt_string: + # Comment out the generated extend_target call because there no sources were found, but keep it commented + # for informational purposes. + extend_scope = ''.join(['#' + line for line in extend_scope.splitlines(keepends=True)]) + cm_fh.write(extend_scope) + + children = scope.children() + if children: + prev_condition = '' + for c in children: + prev_condition = write_extend_target(cm_fh, target, c, total_condition, prev_condition) + + return total_condition + + +def write_main_part(cm_fh: IO[str], name: str, typename: str, + cmake_function: str, scope: Scope, *, + extra_lines: typing.List[str] = [], + indent: int=0, + **kwargs: typing.Any): + write_header(cm_fh, name, typename, indent=indent) + + cm_fh.write('{}{}({}\n'.format(spaces(indent), cmake_function, name)) + for extra_line in extra_lines: + cm_fh.write('{} {}\n'.format(spaces(indent), extra_line)) + + write_sources_section(cm_fh, scope, indent=indent, **kwargs) + + # Footer: + cm_fh.write('{})\n'.format(spaces(indent))) + + # Scopes: + if not scope.children(): + return + + write_scope_header(cm_fh, indent=indent) + + for c in scope.children(): + write_extend_target(cm_fh, name, c, '', indent=indent) + + + +def write_module(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: + module_name = scope.getTarget() + assert module_name.startswith('Qt') + + extra = [] + if 'static' in scope.get('CONFIG'): + extra.append('STATIC') + if 'no_module_headers' in scope.get('CONFIG'): + extra.append('NO_MODULE_HEADERS') + + write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, + extra_lines=extra, indent=indent, known_libraries={'Qt::Core', }) + + + if 'qt_tracepoints' in scope.get('CONFIG'): + tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), scope.basedir(), scope.currentdir()) + cm_fh.write('\n\n{}qt_create_tracepoints({} {})\n'.format(spaces(indent), module_name[2:], tracepoints)) + + +def write_tool(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: + tool_name = scope.getTarget() + + write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope, + indent=indent, known_libraries={'Qt::Core', }) + + +def write_test(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: + test_name = scope.getTarget() + assert test_name + + write_main_part(cm_fh, test_name, 'Test', 'add_qt_test', scope, + indent=indent, known_libraries={'Qt::Core', 'Qt::Test', }) + + +def write_binary(cm_fh: IO[str], scope: Scope, gui: bool=False, *, indent: int=0) -> None: + binary_name = scope.getTarget() + assert binary_name + + extra = ['GUI',] if gui else [] + write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope, + extra_lines=extra, indent=indent, known_libraries={'Qt::Core', }) + + +def write_plugin(cm_fh, scope, *, indent: int=0): + plugin_name = scope.getTarget() + assert plugin_name + + write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope, + indent=indent, known_libraries={'QtCore', }) + + +def handle_app_or_lib(scope: Scope, cm_fh: IO[str], *, indent=0) -> None: + assert scope.getTemplate() in ('app', 'lib', None) + + is_lib = scope.getTemplate() == 'lib' + is_plugin = any('qt_plugin' == s for s in scope.get('_LOADED', [])) + + if is_lib or 'qt_module' in scope.get('_LOADED', []): + write_module(cm_fh, scope, indent=indent) + elif is_plugin: + write_plugin(cm_fh, scope, indent=indent) + elif 'qt_tool' in scope.get('_LOADED', []): + write_tool(cm_fh, scope, indent=indent) + else: + if 'testcase' in scope.get('CONFIG') or 'testlib' in scope.get('CONFIG'): + write_test(cm_fh, scope, indent=indent) + else: + gui = 'console' not in scope.get('CONFIG') + write_binary(cm_fh, scope, gui, indent=indent) + + docs = scope.getString("QMAKE_DOCS") + if docs: + cm_fh.write("\n{}add_qt_docs({})\n".format(spaces(indent), map_to_file(docs, scope.basedir(), scope.currentdir()))) + + +def handle_qt_for_config(scope: Scope, cm_fh: IO[str], *, indent: int=0) -> None: + for config in scope.get("QT_FOR_CONFIG") or []: + lib = map_qt_library(config) + if lib.endswith("Private"): + cm_fh.write('{}qt_pull_features_into_current_scope(PRIVATE_FEATURES {})\n'.format(spaces(indent), lib[:-len("Private")])) + else: + cm_fh.write('{}qt_pull_features_into_current_scope(PUBLIC_FEATURES {})\n'.format(spaces(indent), lib)) + + +def cmakeify_scope(scope: Scope, cm_fh: IO[str], *, indent: int=0) -> None: + template = scope.getTemplate() + handle_qt_for_config(scope, cm_fh) + if template == 'subdirs': + handle_subdir(scope, cm_fh, indent=indent) + elif template in ('app', 'lib', None): + handle_app_or_lib(scope, cm_fh, indent=indent) + else: + print(' XXXX: {}: Template type {} not yet supported.' + .format(scope.file(), template)) + + +def generate_cmakelists(scope: Scope) -> None: + with open(scope.cMakeListsFile(), 'w') as cm_fh: + assert scope.file() + cm_fh.write('# Generated from {}.\n\n'.format(os.path.basename(scope.file()))) + cmakeify_scope(scope, cm_fh) + + +def do_include(scope: Scope, *, debug: bool=False) -> None: + for i in scope.get('_INCLUDED', []): + dir = scope.basedir() + include_file = map_to_file(i, dir, scope.currentdir(), want_absolute_path=True) + if not os.path.isfile(include_file): + print(' XXXX: Failed to include {}.'.format(include_file)) + continue + + include_result = parseProFile(include_file, debug=debug) + include_scope = Scope.FromDict(include_file, include_result.asDict().get('statements'), + '', dir) + + do_include(include_scope) + + scope.merge(include_scope) + + for c in scope.children(): + do_include(c) + + +def main() -> None: + args = _parse_commandline() + + for file in args.files: + parseresult = parseProFile(file, debug=args.debug_parser or args.debug) + + if args.debug_parse_result or args.debug: + print('\n\n#### Parser result:') + print(parseresult) + print('\n#### End of parser result.\n') + if args.debug_parse_dictionary or args.debug: + print('\n\n####Parser result dictionary:') + print(parseresult.asDict()) + print('\n#### End of parser result dictionary.\n') + + file_scope = Scope.FromDict(file, parseresult.asDict().get('statements')) + + if args.debug_pro_structure or args.debug: + print('\n\n#### .pro/.pri file structure:') + print(file_scope.dump()) + print('\n#### End of .pro/.pri file structure.\n') + + do_include(file_scope) + + if args.debug_full_pro_structure or args.debug: + print('\n\n#### Full .pro/.pri file structure:') + print(file_scope.dump()) + print('\n#### End of full .pro/.pri file structure.\n') + + generate_cmakelists(file_scope) + + +if __name__ == '__main__': + main() diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py new file mode 100755 index 00000000000..4340eab0941 --- /dev/null +++ b/util/cmake/run_pro2cmake.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import glob +import os +import subprocess +import sys + +script_path = os.path.dirname(os.path.abspath(__file__)) +base_path = os.path.dirname(script_path) +pro2cmake = script_path + '/pro2cmake.py' + +if len(sys.argv) > 1: + base_path = os.path.abspath(sys.argv[1]) + +for filename in glob.iglob(base_path + '/**/*.pro', recursive=True): + print('Converting:', filename) + subprocess.run([pro2cmake, filename]) diff --git a/util/cmake/tests/__init__.py b/util/cmake/tests/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/util/cmake/tests/data/complex_values.pro b/util/cmake/tests/data/complex_values.pro new file mode 100644 index 00000000000..4d747c1dd73 --- /dev/null +++ b/util/cmake/tests/data/complex_values.pro @@ -0,0 +1,22 @@ +linux:!static { + precompile_header { + # we'll get an error if we just use SOURCES += + no_pch_assembler.commands = $$QMAKE_CC -c $(CFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} + no_pch_assembler.dependency_type = TYPE_C + no_pch_assembler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} + no_pch_assembler.input = NO_PCH_ASM + no_pch_assembler.name = compiling[no_pch] ${QMAKE_FILE_IN} + silent: no_pch_assembler.commands = @echo compiling[no_pch] ${QMAKE_FILE_IN} && $$no_pch_assembler.commands + CMAKE_ANGLE_GLES2_IMPLIB_RELEASE = libGLESv2.$${QMAKE_EXTENSION_STATICLIB} + HOST_BINS = $$[QT_HOST_BINS] + CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA/src]/ + TR_EXCLUDE += ../3rdparty/* + + QMAKE_EXTRA_COMPILERS += no_pch_assembler + NO_PCH_ASM += global/minimum-linux.S + } else { + SOURCES += global/minimum-linux.S + } + HEADERS += global/minimum-linux_p.h +} + diff --git a/util/cmake/tests/data/definetest.pro b/util/cmake/tests/data/definetest.pro new file mode 100644 index 00000000000..76b63d239fb --- /dev/null +++ b/util/cmake/tests/data/definetest.pro @@ -0,0 +1,6 @@ +defineTest(pathIsAbsolute) { + p = $$clean_path($$1) + !isEmpty(p):isEqual(p, $$absolute_path($$p)): return(true) + return(false) +} + diff --git a/util/cmake/tests/data/else.pro b/util/cmake/tests/data/else.pro new file mode 100644 index 00000000000..bbf9c5ac9f9 --- /dev/null +++ b/util/cmake/tests/data/else.pro @@ -0,0 +1,6 @@ + +linux { + SOURCES += a.cpp +} else { + SOURCES += b.cpp +} diff --git a/util/cmake/tests/data/else2.pro b/util/cmake/tests/data/else2.pro new file mode 100644 index 00000000000..f2ef36ec288 --- /dev/null +++ b/util/cmake/tests/data/else2.pro @@ -0,0 +1,4 @@ + +osx: A = 1 +else: win32: B = 2 +else: C = 3 diff --git a/util/cmake/tests/data/else3.pro b/util/cmake/tests/data/else3.pro new file mode 100644 index 00000000000..0de9c2c1d99 --- /dev/null +++ b/util/cmake/tests/data/else3.pro @@ -0,0 +1,7 @@ +qtConfig(timezone) { + A = 1 +} else:win32 { + B = 2 +} else { + C = 3 +} diff --git a/util/cmake/tests/data/else4.pro b/util/cmake/tests/data/else4.pro new file mode 100644 index 00000000000..9ed676ccfae --- /dev/null +++ b/util/cmake/tests/data/else4.pro @@ -0,0 +1,6 @@ +qtConfig(timezone) { + A = 1 +} else:win32: B = 2 +else { + C = 3 +} diff --git a/util/cmake/tests/data/else5.pro b/util/cmake/tests/data/else5.pro new file mode 100644 index 00000000000..3de76af50ad --- /dev/null +++ b/util/cmake/tests/data/else5.pro @@ -0,0 +1,10 @@ +# comments +qtConfig(timezone) { # bar + A = 1 +} else:win32 { + B = 2 # foo +} else { C = 3 +# baz + # foobar +} +# endcomment diff --git a/util/cmake/tests/data/else6.pro b/util/cmake/tests/data/else6.pro new file mode 100644 index 00000000000..9eaa834a193 --- /dev/null +++ b/util/cmake/tests/data/else6.pro @@ -0,0 +1,11 @@ +qtConfig(timezone) \ +{ + A = \ +1 +} \ +else:win32: \ +B = 2 +else: \ + C \ += 3 + diff --git a/util/cmake/tests/data/else7.pro b/util/cmake/tests/data/else7.pro new file mode 100644 index 00000000000..e663b1c05e9 --- /dev/null +++ b/util/cmake/tests/data/else7.pro @@ -0,0 +1,2 @@ +msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x65000000 + diff --git a/util/cmake/tests/data/else8.pro b/util/cmake/tests/data/else8.pro new file mode 100644 index 00000000000..6d4d5f01edf --- /dev/null +++ b/util/cmake/tests/data/else8.pro @@ -0,0 +1,5 @@ +qtConfig(timezone) { A = 1 } else:win32: {\ +B = 2 \ +} else: \ + C \ += 3 \ diff --git a/util/cmake/tests/data/function_if.pro b/util/cmake/tests/data/function_if.pro new file mode 100644 index 00000000000..9af018f864d --- /dev/null +++ b/util/cmake/tests/data/function_if.pro @@ -0,0 +1,4 @@ +pathIsAbsolute($$CMAKE_HOST_DATA_DIR) { + CMAKE_HOST_DATA_DIR = $$[QT_HOST_DATA/src]/ +} + diff --git a/util/cmake/tests/data/include.pro b/util/cmake/tests/data/include.pro new file mode 100644 index 00000000000..22d8a40919c --- /dev/null +++ b/util/cmake/tests/data/include.pro @@ -0,0 +1,3 @@ +A = 42 +include(foo) # load foo +B=23 diff --git a/util/cmake/tests/data/load.pro b/util/cmake/tests/data/load.pro new file mode 100644 index 00000000000..c9717e98326 --- /dev/null +++ b/util/cmake/tests/data/load.pro @@ -0,0 +1,3 @@ +A = 42 +load(foo)# load foo +B=23 diff --git a/util/cmake/tests/data/quoted.pro b/util/cmake/tests/data/quoted.pro new file mode 100644 index 00000000000..61682aa0d01 --- /dev/null +++ b/util/cmake/tests/data/quoted.pro @@ -0,0 +1,5 @@ +if(linux*|hurd*):!cross_compile:!static:!*-armcc* { + prog=$$quote(if (/program interpreter: (.*)]/) { print $1; }) + DEFINES += ELF_INTERPRETER=\\\"$$system(LC_ALL=C readelf -l /bin/ls | perl -n -e \'$$prog\')\\\" +} + diff --git a/util/cmake/tests/data/unset.pro b/util/cmake/tests/data/unset.pro new file mode 100644 index 00000000000..7ffb0582f1e --- /dev/null +++ b/util/cmake/tests/data/unset.pro @@ -0,0 +1,2 @@ +unset(f16c_cxx) + diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py new file mode 100755 index 00000000000..78ac7fed266 --- /dev/null +++ b/util/cmake/tests/test_parsing.py @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import os +from pro2cmake import QmakeParser + + +_tests_path = os.path.dirname(os.path.abspath(__file__)) + + +def validate_op(key, op, value, to_validate): + assert key == to_validate['key'] + assert op == to_validate['operation'] + assert value == to_validate['value'] + + +def validate_single_op(key, op, value, to_validate): + assert len(to_validate) == 1 + validate_op(key, op, value, to_validate[0]) + + +def evaluate_condition(to_validate): + assert 'condition' in to_validate + assert 'statements' in to_validate + + return (to_validate['condition'], to_validate['statements'], to_validate.get('else_statements', {})) + + +def validate_default_else_test(file_name): + result = parse_file(file_name) + assert len(result) == 1 + + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + assert cond == 'qtConfig(timezone)' + validate_single_op('A', '=', ['1'], if_branch) + + assert len(else_branch) == 1 + (cond2, if2_branch, else2_branch) = evaluate_condition(else_branch[0]) + assert cond2 == 'win32' + validate_single_op('B', '=', ['2'], if2_branch) + validate_single_op('C', '=', ['3'], else2_branch) + + +def parse_file(file): + p = QmakeParser(debug=True) + result = p.parseFile(file).asDict() + assert len(result) == 1 + + return result['statements'] + + +def test_else(): + result = parse_file(_tests_path + '/data/else.pro') + assert len(result) == 1 + + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + + assert cond == 'linux' + validate_single_op('SOURCES', '+=', ['a.cpp'], if_branch) + validate_single_op('SOURCES', '+=', ['b.cpp'], else_branch) + + +def test_else2(): + result = parse_file(_tests_path + '/data/else2.pro') + assert len(result) == 1 + + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + assert cond == 'osx' + validate_single_op('A', '=', ['1'], if_branch) + + assert len(else_branch) == 1 + (cond2, if2_branch, else2_branch) = evaluate_condition(else_branch[0]) + assert cond2 == 'win32' + validate_single_op('B', '=', ['2'], if2_branch) + + validate_single_op('C', '=', ['3'], else2_branch) + + +def test_else3(): + validate_default_else_test(_tests_path + '/data/else3.pro') + +def test_else4(): + validate_default_else_test(_tests_path + '/data/else4.pro') + +def test_else5(): + validate_default_else_test(_tests_path + '/data/else5.pro') + +def test_else6(): + validate_default_else_test(_tests_path + '/data/else6.pro') + +def test_else7(): + result = parse_file(_tests_path + '/data/else7.pro') + assert len(result) == 1 + +def test_else8(): + validate_default_else_test(_tests_path + '/data/else8.pro') + +def test_include(): + result = parse_file(_tests_path + '/data/include.pro') + assert len(result) == 3 + validate_op('A', '=', ['42'], result[0]) + include = result[1] + assert len(include) == 1 + assert include.get('included', '') == 'foo' + validate_op('B', '=', ['23'], result[2]) + +def test_load(): + result = parse_file(_tests_path + '/data/load.pro') + assert len(result) == 3 + validate_op('A', '=', ['42'], result[0]) + load = result[1] + assert len(load) == 1 + assert load.get('loaded', '') == 'foo' + validate_op('B', '=', ['23'], result[2]) + +def test_definetest(): + result = parse_file(_tests_path + '/data/definetest.pro') + assert len(result) == 1 + assert result[0] == [] + +def test_unset(): + result = parse_file(_tests_path + '/data/unset.pro') + assert len(result) == 1 + assert result[0] == [] + +def test_quoted(): + result = parse_file(_tests_path + '/data/quoted.pro') + assert len(result) == 1 + +def test_complex_values(): + result = parse_file(_tests_path + '/data/complex_values.pro') + assert len(result) == 1 + +def test_function_if(): + result = parse_file(_tests_path + '/data/function_if.pro') + assert len(result) == 1 From 8cea61e14d8425c7842b5fa85ca1883aca0df63c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 30 Oct 2018 15:25:53 +0100 Subject: [PATCH 0003/1322] QtPostProcess: Fix generation of *Depends header files Normalize Qt module names before trying to match them. Deduplicate the names while at it. Change-Id: I5821c34fe5904cf9e9b986ac3ae4af2b248466b7 Reviewed-by: Simon Hausmann --- cmake/QtPostProcess.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 5e563d4c915..48de9ef3964 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -9,7 +9,7 @@ function(qt_internal_write_depends_file target) endforeach() string(APPEND contents "#endif\n") - file(GENERATE OUTPUT ${outfile} CONTENT ${contents}) + file(GENERATE OUTPUT "${outfile}" CONTENT "${contents}") endfunction() function(qt_internal_create_depends_files) @@ -17,11 +17,24 @@ function(qt_internal_create_depends_files) foreach (target ${KNOWN_QT_MODULES}) get_target_property(depends "${target}" LINK_LIBRARIES) foreach (dep ${depends}) + # Normalize module by stripping leading "Qt::" and trailing "Private" + if (dep MATCHES "Qt::(.*)") + set(dep "${CMAKE_MATCH_1}") + endif() + if (dep MATCHES "(.*)Private") + set(dep "${CMAKE_MATCH_1}") + endif() + list(FIND KNOWN_QT_MODULES "${dep}" _pos) if (_pos GREATER -1) list(APPEND qtdeps "${dep}") endif() endforeach() + + if (DEFINED qtdeps) + list(REMOVE_DUPLICATES qtdeps) + endif() + get_target_property(hasModuleHeaders "${target}" MODULE_HAS_HEADERS) if (${hasModuleHeaders}) qt_internal_write_depends_file("${target}" ${qtdeps}) From 6ae0821a090ddd68437e0ffe01aab97b86b1ae19 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 29 Oct 2018 17:03:48 +0100 Subject: [PATCH 0004/1322] configurejson2cmake: Sort library map Change-Id: Ifb8aa5f1583592a9eb71a93973f17d9714628953 Reviewed-by: Simon Hausmann --- util/cmake/configurejson2cmake.py | 68 +++++++++++++++---------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 4623e8d874c..513f7498dd4 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -47,45 +47,45 @@ class LibraryMapping: def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: libmap = { - 'zlib': 'ZLIB', - 'gbm': 'gbm', - 'host_dbus': None, - 'libdl': None, # handled by CMAKE_DL_LIBS - 'libatomic': 'Atomic', 'double-conversion': 'WrapDoubleConversion', - 'gnu_iconv': None, - 'sun_iconv': None, - 'posix_iconv': None, - 'icu': ['ICU', 'COMPONENTS', 'i18n', 'uc', 'data'], - 'pcre2': ['PCRE2', 'REQUIRED'], - 'libpng': 'PNG', - 'libudev': 'Libudev', - 'udev': 'Libudev', - 'journald': 'Libsystemd', - 'vulkan': 'Vulkan', - 'glib': 'GLib', - 'harfbuzz': 'harfbuzz', - 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), - 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), - 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), - 'libpng': 'PNG', - 'libjpeg': 'JPEG', - 'freetype': 'Freetype', - 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), - 'libinput': 'Libinput', - 'xcb': ['XCB', '1.9'], - 'libproxy': 'libproxy', 'drm': 'Libdrm', + 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), + 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), + 'freetype': 'Freetype', + 'gbm': 'gbm', + 'glib': 'GLib', + 'gnu_iconv': None, + 'harfbuzz': 'harfbuzz', + 'host_dbus': None, + 'icu': ['ICU', 'COMPONENTS', 'i18n', 'uc', 'data'], + 'journald': 'Libsystemd', + 'libatomic': 'Atomic', + 'libdl': None, # handled by CMAKE_DL_LIBS + 'libinput': 'Libinput', + 'libjpeg': 'JPEG', + 'libpng': 'PNG', + 'libpng': 'PNG', + 'libproxy': 'libproxy', + 'libudev': 'Libudev', + 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), + 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), + 'pcre2': ['PCRE2', 'REQUIRED'], + 'posix_iconv': None, + 'sun_iconv': None, + 'udev': 'Libudev', + 'vulkan': 'Vulkan', + 'wayland_server': 'Wayland', + 'x11sm': LibraryMapping(package="X11", resultVariable="X11_SM"), + 'xcb_glx': LibraryMapping(package="XCB", resultVariable="XCB_GLX"), + 'xcb_render': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), + 'xcb': ['XCB', '1.9'], + 'xcb_xinput': LibraryMapping(package="XCB", resultVariable="XCB_XINPUT"), + 'xcb_xkb': LibraryMapping(package="XCB", resultVariable="XCB_XKB"), + 'xcb_xlib': 'X11_XCB', 'xkbcommon': ['XKB', '0.4.1'], 'xlib': 'X11', - 'xcb_xlib': 'X11_XCB', 'xrender': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), - 'xcb_render': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), - 'xcb_glx': LibraryMapping(package="XCB", resultVariable="XCB_GLX"), - 'xcb_xkb': LibraryMapping(package="XCB", resultVariable="XCB_XKB"), - 'xcb_xinput': LibraryMapping(package="XCB", resultVariable="XCB_XINPUT"), - 'x11sm': LibraryMapping(package="X11", resultVariable="X11_SM"), - 'wayland_server': 'Wayland', + 'zlib': 'ZLIB', } # type: Dict[str, Union[str, List[str], LibraryMapping]] if lib not in libmap: raise Exception(' XXXX Unknown library "{}".'.format(lib)) From 6456d9e14a2f36694111c0aae774435a9647940f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 29 Oct 2018 17:08:36 +0100 Subject: [PATCH 0005/1322] Rerun configurejson2cmake after rebase on top of newer dev Change-Id: I1af79e5c87bb17e9145f817d2488c6d24531a2fc Reviewed-by: Simon Hausmann --- configure.cmake | 1 - src/corelib/configure.cmake | 7 +++++++ src/widgets/configure.cmake | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.cmake b/configure.cmake index 0fe41299626..dc9fed82fe3 100644 --- a/configure.cmake +++ b/configure.cmake @@ -392,7 +392,6 @@ qt_feature("gui" PRIVATE ) qt_feature("network" PRIVATE LABEL "Qt Network" - CONDITION QT_FEATURE_thread ) qt_feature("sql" PRIVATE LABEL "Qt Sql" diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 21886b06aaa..7836577e5ce 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -614,6 +614,13 @@ qt_feature("identityproxymodel" PUBLIC CONDITION QT_FEATURE_proxymodel ) qt_feature_definition("identityproxymodel" "QT_NO_IDENTITYPROXYMODEL" NEGATE VALUE "1") +qt_feature("concatenatetablesproxymodel" PUBLIC + SECTION "ItemViews" + LABEL "QConcatenateTablesProxyModel" + PURPOSE "Supports concatenating source models." + CONDITION QT_FEATURE_proxymodel +) +qt_feature_definition("concatenatetablesproxymodel" "QT_NO_CONCATENATETABLESPROXYMODEL" NEGATE VALUE "1") qt_feature("stringlistmodel" PUBLIC SECTION "ItemViews" LABEL "QStringListModel" diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake index 3fae04b0d21..2c828a67114 100644 --- a/src/widgets/configure.cmake +++ b/src/widgets/configure.cmake @@ -53,7 +53,7 @@ qt_feature("filesystemmodel" PUBLIC SECTION "File I/O" LABEL "QFileSystemModel" PURPOSE "Provides a data model for the local filesystem." - CONDITION QT_FEATURE_itemmodel AND QT_FEATURE_thread + CONDITION QT_FEATURE_itemmodel ) qt_feature_definition("filesystemmodel" "QT_NO_FILESYSTEMMODEL" NEGATE VALUE "1") qt_feature("itemviews" PUBLIC From e3f047f1cd4b7e74023bf4521da71015fd0ba36c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 30 Oct 2018 10:29:33 +0100 Subject: [PATCH 0006/1322] Build qdbusxml2cpp and qdbuscpp2xml Change-Id: Ic14eb1d3608608d00836b216969acb4ed017b678 Reviewed-by: Simon Hausmann --- src/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 4 ++++ src/tools/qdbuscpp2xml/CMakeLists.txt | 22 ++++++++++++++++++++++ src/tools/qdbusxml2cpp/CMakeLists.txt | 9 +++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/tools/qdbuscpp2xml/CMakeLists.txt create mode 100644 src/tools/qdbusxml2cpp/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 204d7f67972..fd9016598ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,10 +44,10 @@ endfunction() find_or_build_bootstrap_names() add_subdirectory(corelib) -add_subdirectory(tools) add_subdirectory(network) add_subdirectory(xml) add_subdirectory(dbus) +add_subdirectory(tools) if(QT_FEATURE_gui) add_subdirectory(gui) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 6c8866b3711..0e4158ca20f 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,2 +1,6 @@ add_subdirectory(uic) +if (QT_FEATURE_dbus) + add_subdirectory(qdbuscpp2xml) + add_subdirectory(qdbusxml2cpp) +endif() add_subdirectory(qvkgen) diff --git a/src/tools/qdbuscpp2xml/CMakeLists.txt b/src/tools/qdbuscpp2xml/CMakeLists.txt new file mode 100644 index 00000000000..58f9b3a9e63 --- /dev/null +++ b/src/tools/qdbuscpp2xml/CMakeLists.txt @@ -0,0 +1,22 @@ +add_qt_tool(qdbuscpp2xml + SOURCES + ../moc/cbordevice.h + ../moc/generator.cpp ../moc/generator.h + ../moc/moc.cpp ../moc/moc.h + ../moc/outputrevision.h + ../moc/parser.cpp ../moc/parser.h + ../moc/preprocessor.cpp ../moc/preprocessor.h + ../moc/symbols.h + ../moc/token.cpp ../moc/token.h + ../moc/utils.h + qdbuscpp2xml.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + INCLUDE_DIRECTORIES + ../moc/ + ../moc/../../3rdparty/tinycbor/src + LIBRARIES + Qt::CorePrivate + Qt::DBusPrivate +) diff --git a/src/tools/qdbusxml2cpp/CMakeLists.txt b/src/tools/qdbusxml2cpp/CMakeLists.txt new file mode 100644 index 00000000000..7db59b48839 --- /dev/null +++ b/src/tools/qdbusxml2cpp/CMakeLists.txt @@ -0,0 +1,9 @@ +add_qt_tool(qdbusxml2cpp + SOURCES qdbusxml2cpp.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::DBusPrivate +) From b5aaea7998870c88d700ce4b41219cd15c29c0b4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 29 Oct 2018 16:53:51 +0100 Subject: [PATCH 0007/1322] Support dbus adaptors and interfaces Change-Id: I06ffff19574bbb8df79adabfcc447acff09d7ecf Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 60 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index cf16be6126d..25cfe7e8ba5 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -405,7 +405,7 @@ function(qt_internal_process_automatic_sources target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES") @@ -423,7 +423,16 @@ function(extend_target target) qt_evaluate_config_expression(result ${_arg_CONDITION}) if (${result}) - qt_internal_process_automatic_sources("${target}" ${_arg_SOURCES}) + set(dbus_sources "") + foreach(adaptor ${_arg_DBUS_ADAPTOR_SOURCES}) + qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}") + list(APPEND dbus_sources "${sources}") + endforeach() + foreach(interface ${_arg_DBUS_INTERFACE_SOURCES}) + qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE FLAGS "${_arg_DBUS_INTERFACE_FLAGS}") + list(APPEND dbus_sources "${sources}") + endforeach() + qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}") foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "Qt::(.+)(Private?)") @@ -445,7 +454,7 @@ function(extend_target target) endif() endforeach() - target_sources("${target}" PRIVATE ${_arg_SOURCES}) + target_sources("${target}" PRIVATE ${_arg_SOURCES} ${dbus_sources}) if (_arg_COMPILE_FLAGS) set_source_files_properties(${_arg_SOURCES} PROPERTIES COMPILE_FLAGS "${_arg_COMPILE_FLAGS}") endif() @@ -635,6 +644,10 @@ function(add_qt_module name) ${_arg_PUBLIC_LIBRARIES} LIBRARIES ${_arg_LIBRARIES} + DBUS_ADAPTOR_SOURCES "${_arg_DBUS_ADAPTOR_SOURCES}" + DBUS_ADAPTOR_FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}" + DBUS_INTERFACE_SOURCES "${_arg_DBUS_INTERFACE_SOURCES}" + DBUS_INTERFACE_FLAGS "${_arg_DBUS_INTERFACE_FLAGS}" ) ### FIXME: Can we replace headers.pri? @@ -774,6 +787,10 @@ function(add_qt_plugin name) PUBLIC_DEFINES QT_${name_upper}_LIB ${_arg_PUBLIC_DEFINES} + DBUS_ADAPTOR_SOURCES "${_arg_DBUS_ADAPTOR_SOURCES}" + DBUS_ADAPTOR_FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}" + DBUS_INTERFACE_SOURCES "${_arg_DBUS_INTERFACE_SOURCES}" + DBUS_INTERFACE_FLAGS "${_arg_DBUS_INTERFACE_FLAGS}" ) install(TARGETS "${module}" EXPORT "${module}Targets" @@ -811,6 +828,10 @@ function(add_qt_executable name) ${_arg_INCLUDE_DIRECTORIES} DEFINES ${_arg_DEFINES} LIBRARIES ${_arg_LIBRARIES} + DBUS_ADAPTOR_SOURCES "${_arg_DBUS_ADAPTOR_SOURCES}" + DBUS_ADAPTOR_FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}" + DBUS_INTERFACE_SOURCES "${_arg_DBUS_INTERFACE_SOURCES}" + DBUS_INTERFACE_FLAGS "${_arg_DBUS_INTERFACE_FLAGS}" ) set_target_properties("${name}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${_arg_OUTPUT_DIRECTORY}" @@ -1047,6 +1068,39 @@ function(qt_create_uic_command infile _result) endfunction() +# helper to set up a qdbusxml2cpp rule +function(qt_create_qdbusxml2cpp_command target infile) + qt_parse_all_arguments(_arg "qt_create_qdbusxml2cpp_command" "ADAPTOR;INTERFACE" "" "FLAGS" ${ARGN}) + if((_arg_ADAPTOR AND _arg_INTERFACE) OR (NOT _arg_ADAPTOR AND NOT _arg_INTERFACE)) + message(FATAL_ERROR "qt_create_dbusxml2cpp_command needs either ADAPTOR or INTERFACE.") + endif() + + set(_option "-a") + set(_type "adaptor") + if (_arg_INTERFACE) + set(_option "-p") + set(_type "interface") + endif() + + get_filename_component(file_name "${infile}" NAME_WE) + string(TOLOWER "${file_name}" file_name) + + set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${_type}.h") + set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${_type}.cpp") + + add_custom_command(OUTPUT "${header_file}" "${source_file}" + COMMAND Qt::qdbusxml2cpp ${_arg_FLAGS} "${_option}" "${header_file}:${source_file}" "${infile}" + DEPENDS "${infile}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + VERBATIM) + + # Moc the header: + qt_internal_wrap_cpp(moc_sources TARGET "${target}" MOC "${header_file}" HEADER_FILE_ONLY OFF) + + target_sources("${target}" PRIVATE "${header_file}" "${source_file}" "${moc_sources}") +endfunction() + + function(qt_generate_forwarding_headers module) qt_parse_all_arguments(_arg "qt_generate_forwarding_headers" "PRIVATE" "SOURCE;DESTINATION" "CLASSES" ${ARGN}) From b102b41be71a18dbc94e289051ddb3437824ae35 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 29 Oct 2018 17:09:14 +0100 Subject: [PATCH 0008/1322] Add ATSPI2 library support Change-Id: I304ba2b9df65008340b698eb3a74dc3b4abfb826 Reviewed-by: Simon Hausmann --- cmake/FindATSPI2.cmake | 3 +++ src/gui/configure.cmake | 4 +++- util/cmake/configurejson2cmake.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 cmake/FindATSPI2.cmake diff --git a/cmake/FindATSPI2.cmake b/cmake/FindATSPI2.cmake new file mode 100644 index 00000000000..eb87a33e84f --- /dev/null +++ b/cmake/FindATSPI2.cmake @@ -0,0 +1,3 @@ +include(FindPkgConfig) + +pkg_check_modules(ATSPI2 atspi-2 IMPORTED_TARGET) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index be056b34e3a..002d46c2728 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -34,6 +34,8 @@ set_property(CACHE INPUT_xkbcommon_x11 PROPERTY STRINGS undefined no qt system) #### Libraries +find_package(ATSPI2) +set_package_properties(ATSPI2 PROPERTIES TYPE OPTIONAL) find_package(Libdrm) set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL) find_package(OpenGL) @@ -430,7 +432,7 @@ XCloseDisplay(d); qt_feature("accessibility_atspi_bridge" PUBLIC PRIVATE LABEL "ATSPI Bridge" - CONDITION QT_FEATURE_accessibility AND QT_FEATURE_xcb AND QT_FEATURE_dbus AND libs.atspi OR FIXME + CONDITION QT_FEATURE_accessibility AND QT_FEATURE_xcb AND QT_FEATURE_dbus AND ATSPI2_FOUND ) qt_feature_definition("accessibility_atspi_bridge" "QT_NO_ACCESSIBILITY_ATSPI_BRIDGE" NEGATE VALUE "1") qt_feature("angle" PUBLIC diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 513f7498dd4..934c53f3540 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -47,6 +47,7 @@ class LibraryMapping: def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: libmap = { + 'atspi': 'ATSPI2', 'double-conversion': 'WrapDoubleConversion', 'drm': 'Libdrm', 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), From 0ec6b3049b4e486a1781ca75fc1afad05f4427d1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 30 Oct 2018 10:28:41 +0100 Subject: [PATCH 0009/1322] Add linuxaccessibility support Change-Id: I6766756e58cadf2d3f13331f4a453123ea575c6f Reviewed-by: Simon Hausmann --- src/platformsupport/CMakeLists.txt | 3 +++ .../linuxaccessibility/CMakeLists.txt | 26 +++++++++++++++++++ src/plugins/platforms/xcb/CMakeLists.txt | 4 +-- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 src/platformsupport/linuxaccessibility/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index 158cecbec02..c571f940c81 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -15,6 +15,9 @@ endif() if(QT_FEATURE_accessibility) add_subdirectory(accessibility) + if(QT_FEATURE_accessibility_atspi_bridge) + add_subdirectory(linuxaccessibility) + endif() endif() if(APPLE) diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt new file mode 100644 index 00000000000..81e32e26667 --- /dev/null +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -0,0 +1,26 @@ +find_package(ATSPI2 REQUIRED) + +add_qt_module(LinuxAccessibilitySupport + STATIC + SOURCES + application.cpp application_p.h + atspiadaptor.cpp atspiadaptor_p.h + bridge.cpp bridge_p.h + cache.cpp cache_p.h + constant_mappings.cpp constant_mappings_p.h + dbusconnection.cpp dbusconnection_p.h + struct_marshallers.cpp struct_marshallers_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::AccessibilitySupportPrivate + Qt::CorePrivate + Qt::DBus + Qt::GuiPrivate + PkgConfig::ATSPI2 + DBUS_ADAPTOR_SOURCES dbusxml/Cache.xml dbusxml/DeviceEventController.xml + DBUS_ADAPTOR_FLAGS -i struct_marshallers_p.h + DBUS_INTERFACE_SOURCES dbusxml/Socket.xml dbusxml/Bus.xml + DBUS_INTERFACE_FLAGS -i struct_marshallers_p.h +) + diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 90c924b4b1a..fc7a6eb1bfa 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -68,9 +68,9 @@ add_qt_module(XcbQpa ## Scopes: ##################################################################### -extend_target(XcbQpa CONDITION TARGET Qt::linuxaccessibility_support_private +extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate LIBRARIES - linuxaccessibility_supportPrivate + Qt::LinuxAccessibilitySupportPrivate ) extend_target(XcbQpa CONDITION QT_FEATURE_vulkan From 60d7331f93f0607955a27946061a365e7b3fa7ee Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 30 Oct 2018 13:12:23 +0100 Subject: [PATCH 0010/1322] Build qlalr Change-Id: I81d69e6f79027f0811174db261c4d9e071852606 Reviewed-by: Simon Hausmann --- src/tools/CMakeLists.txt | 1 + src/tools/qlalr/CMakeLists.txt | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/tools/qlalr/CMakeLists.txt diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 0e4158ca20f..77942a9c7e8 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -3,4 +3,5 @@ if (QT_FEATURE_dbus) add_subdirectory(qdbuscpp2xml) add_subdirectory(qdbusxml2cpp) endif() +add_subdirectory(qlalr) add_subdirectory(qvkgen) diff --git a/src/tools/qlalr/CMakeLists.txt b/src/tools/qlalr/CMakeLists.txt new file mode 100644 index 00000000000..b63607e937e --- /dev/null +++ b/src/tools/qlalr/CMakeLists.txt @@ -0,0 +1,13 @@ +add_qt_tool(qlalr + SOURCES + compress.cpp compress.h + cppgenerator.cpp cppgenerator.h + dotgraph.cpp dotgraph.h + grammar.cpp grammar_p.h + lalr.cpp lalr.h + main.cpp + parsetable.cpp parsetable.h + recognizer.cpp recognizer.h + DEFINES + QT_NO_FOREACH +) From f43667a6a11e6766d72a7a2432b683fb3aae6284 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 30 Oct 2018 14:23:48 +0100 Subject: [PATCH 0011/1322] Tests: Use TARGET over features to decide which tests to run Change-Id: I57642907c2e8e5e1424c5b70a905a2b26b93df88 Reviewed-by: Simon Hausmann --- tests/auto/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 5ee23c0023e..13728bd49bc 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -22,11 +22,11 @@ if (QT_FEATURE_dbus) add_subdirectory("dbus") endif() endif() -if (NOT APPLE_UIKIT AND QT_FEATURE_gui) +if (NOT APPLE_UIKIT AND TARGET Qt::Gui) add_subdirectory("gui") endif() -if (QT_FEATURE_network AND NOT WINRT) -# add_subdirectory("network") +if (TARGET Qt::Network AND NOT WINRT) + # add_subdirectory("network") endif() if (TARGET Qt::OpenGL AND NOT WINRT) add_subdirectory("opengl") @@ -38,17 +38,17 @@ add_subdirectory("testlib") if (NOT CMAKE_CROSSCOMPILE AND QT_FEATURE_process) # add_subdirectory("tools") endif() -if (QT_FEATURE_xml) +if (TARGET Qt::Xml) # add_subdirectory("xml") endif() -if (QT_FEATURE_concurrent) +if (TARGET Qt::Concurrent) # add_subdirectory("concurrent") endif() # add_subdirectory("other") -if (QT_FEATURE_widgets) +if (TARGET Qt::Widgets) add_subdirectory("widgets") endif() -if (QT_FEATURE_printsupport) +if (TARGET Qt::PrintSupport) # add_subdirectory("printsupport") endif() # add_subdirectory("cmake") ## FIXME: Does this still make sense in this form? From 465da04bcbddffdb4f66d74d5f40907fa23d3e29 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 30 Oct 2018 14:25:57 +0100 Subject: [PATCH 0012/1322] Build and test QtConcurrent Change-Id: I2d4b64d3e9b2cb22c67ce462155e73b5d600fb32 Reviewed-by: Simon Hausmann --- src/CMakeLists.txt | 19 +++++++++++--- src/concurrent/CMakeLists.txt | 25 +++++++++++++++++++ tests/auto/CMakeLists.txt | 2 +- tests/auto/concurrent/CMakeLists.txt | 8 ++++++ .../qtconcurrentfilter/CMakeLists.txt | 14 +++++++++++ .../qtconcurrentiteratekernel/CMakeLists.txt | 12 +++++++++ .../concurrent/qtconcurrentmap/CMakeLists.txt | 20 +++++++++++++++ .../qtconcurrentmedian/CMakeLists.txt | 14 +++++++++++ .../concurrent/qtconcurrentrun/CMakeLists.txt | 18 +++++++++++++ .../qtconcurrentthreadengine/CMakeLists.txt | 12 +++++++++ 10 files changed, 139 insertions(+), 5 deletions(-) create mode 100644 src/concurrent/CMakeLists.txt create mode 100644 tests/auto/concurrent/CMakeLists.txt create mode 100644 tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt create mode 100644 tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt create mode 100644 tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt create mode 100644 tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt create mode 100644 tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt create mode 100644 tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd9016598ea..f81ad05f9de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -44,9 +44,18 @@ endfunction() find_or_build_bootstrap_names() add_subdirectory(corelib) -add_subdirectory(network) -add_subdirectory(xml) -add_subdirectory(dbus) +if (QT_FEATURE_concurrent) + add_subdirectory(concurrent) +endif() +if (QT_FEATURE_network) + add_subdirectory(network) +endif() +if (QT_FEATURE_xml) + add_subdirectory(xml) +endif() +if (QT_FEATURE_dbus) + add_subdirectory(dbus) +endif() add_subdirectory(tools) if(QT_FEATURE_gui) add_subdirectory(gui) @@ -61,5 +70,7 @@ if(QT_FEATURE_gui) add_subdirectory(platformsupport) add_subdirectory(platformheaders) endif() -add_subdirectory(testlib) +if (QT_FEATURE_testlib) + add_subdirectory(testlib) +endif() add_subdirectory(plugins) diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt new file mode 100644 index 00000000000..d760844a8c1 --- /dev/null +++ b/src/concurrent/CMakeLists.txt @@ -0,0 +1,25 @@ +add_qt_module(Concurrent + SOURCES + qtconcurrent_global.h + qtconcurrentcompilertest.h + qtconcurrentexception.h + qtconcurrentfilter.cpp qtconcurrentfilter.h + qtconcurrentfilterkernel.h + qtconcurrentfunctionwrappers.h + qtconcurrentiteratekernel.cpp qtconcurrentiteratekernel.h + qtconcurrentmap.cpp qtconcurrentmap.h + qtconcurrentmapkernel.h + qtconcurrentmedian.h + qtconcurrentreducekernel.h + qtconcurrentrun.cpp qtconcurrentrun.h + qtconcurrentrunbase.h + qtconcurrentstoredfunctioncall.h + qtconcurrentthreadengine.cpp qtconcurrentthreadengine.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH + LIBRARIES Qt::CorePrivate + PUBLIC_LIBRARIES Qt::Core +) + +add_qt_docs(./doc/qtconcurrent.qdocconf) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 13728bd49bc..d9d1b8349f1 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -42,7 +42,7 @@ if (TARGET Qt::Xml) # add_subdirectory("xml") endif() if (TARGET Qt::Concurrent) -# add_subdirectory("concurrent") + add_subdirectory("concurrent") endif() # add_subdirectory("other") if (TARGET Qt::Widgets) diff --git a/tests/auto/concurrent/CMakeLists.txt b/tests/auto/concurrent/CMakeLists.txt new file mode 100644 index 00000000000..ae1e256bbd4 --- /dev/null +++ b/tests/auto/concurrent/CMakeLists.txt @@ -0,0 +1,8 @@ +# Generated from concurrent.pro. + +add_subdirectory(qtconcurrentfilter) +add_subdirectory(qtconcurrentiteratekernel) +add_subdirectory(qtconcurrentmap) +add_subdirectory(qtconcurrentmedian) +add_subdirectory(qtconcurrentrun) +add_subdirectory(qtconcurrentthreadengine) diff --git a/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt new file mode 100644 index 00000000000..e4e6884728b --- /dev/null +++ b/tests/auto/concurrent/qtconcurrentfilter/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qtconcurrentfilter.pro. + +##################################################################### +## tst_qtconcurrentfilter Test: +##################################################################### + +add_qt_test(tst_qtconcurrentfilter + SOURCES + tst_qtconcurrentfilter.cpp + DEFINES + QT_STRICT_ITERATORS + LIBRARIES + Qt::Concurrent +) diff --git a/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt new file mode 100644 index 00000000000..ae3e950af83 --- /dev/null +++ b/tests/auto/concurrent/qtconcurrentiteratekernel/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qtconcurrentiteratekernel.pro. + +##################################################################### +## tst_qtconcurrentiteratekernel Test: +##################################################################### + +add_qt_test(tst_qtconcurrentiteratekernel + SOURCES + tst_qtconcurrentiteratekernel.cpp + LIBRARIES + Qt::Concurrent +) diff --git a/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt new file mode 100644 index 00000000000..2158aa7d754 --- /dev/null +++ b/tests/auto/concurrent/qtconcurrentmap/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qtconcurrentmap.pro. + +##################################################################### +## tst_qtconcurrentmap Test: +##################################################################### + +add_qt_test(tst_qtconcurrentmap + SOURCES + tst_qtconcurrentmap.cpp + DEFINES + QT_STRICT_ITERATORS + LIBRARIES + Qt::Concurrent +) + +## Scopes: +##################################################################### +# +#extend_target(tst_qtconcurrentmap CONDITION contains(QT_CONFIG, c++1z) +#) diff --git a/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt new file mode 100644 index 00000000000..6e49501d016 --- /dev/null +++ b/tests/auto/concurrent/qtconcurrentmedian/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qtconcurrentmedian.pro. + +##################################################################### +## tst_qtconcurrentmedian Test: +##################################################################### + +add_qt_test(tst_qtconcurrentmedian + SOURCES + tst_qtconcurrentmedian.cpp + DEFINES + QT_STRICT_ITERATORS + LIBRARIES + Qt::Concurrent +) diff --git a/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt new file mode 100644 index 00000000000..d3ce0d5e4dd --- /dev/null +++ b/tests/auto/concurrent/qtconcurrentrun/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from qtconcurrentrun.pro. + +##################################################################### +## tst_qtconcurrentrun Test: +##################################################################### + +add_qt_test(tst_qtconcurrentrun + SOURCES + tst_qtconcurrentrun.cpp + LIBRARIES + Qt::Concurrent +) + +## Scopes: +##################################################################### +# +#extend_target(tst_qtconcurrentrun CONDITION contains(QT_CONFIG, c++1z) +#) diff --git a/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt b/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt new file mode 100644 index 00000000000..7833f6b7f43 --- /dev/null +++ b/tests/auto/concurrent/qtconcurrentthreadengine/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qtconcurrentthreadengine.pro. + +##################################################################### +## tst_qtconcurrentthreadengine Test: +##################################################################### + +add_qt_test(tst_qtconcurrentthreadengine + SOURCES + tst_qtconcurrentthreadengine.cpp + LIBRARIES + Qt::Concurrent +) From ec510d0ebcaabbdfafc4eb6545150376871d5468 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 25 Oct 2018 13:16:42 +0200 Subject: [PATCH 0013/1322] Store QT_FEATUREs that are not emitted Store QT_FEATUREs that are not emitted, but do not show them in the UI. Also separate out the UI (FEATURE_foo) from the internal CMake value (QT_FEATURE_foo). This does break the overriding of settings, but that did not work well before either. This will be fixed in follow-up patches. Remove fallout: xkbcommon_system was now evaluated where it was not before. Remove it as that is always the case now. Change-Id: I2d303827a1cc9afeef93ad73285a2043ddaa9766 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 34 +++++++++++++----------- src/plugins/platforms/xcb/CMakeLists.txt | 12 --------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index a4d9421935f..8073f5178ba 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -32,22 +32,14 @@ function(qt_feature _feature) "PRIVATE;PUBLIC" "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${ARGN}) - if("${_arg_EMIT_IF}" STREQUAL "") - set(_arg_EMIT_IF 1) + # Register feature for future use: + if (_arg_PUBLIC) + list(APPEND __QtFeature_public_features "${_feature}") + endif() + if (_arg_PRIVATE) + list(APPEND __QtFeature_private_features "${_feature}") endif() - if (${_arg_EMIT_IF}) - set(QT_FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") - set_property(CACHE QT_FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) - - # Register feature for future use: - if (_arg_PUBLIC) - list(APPEND __QtFeature_public_features "${_feature}") - endif() - if (_arg_PRIVATE) - list(APPEND __QtFeature_private_features "${_feature}") - endif() - endif() set(__QtFeature_public_features ${__QtFeature_public_features} PARENT_SCOPE) set(__QtFeature_private_features ${__QtFeature_private_features} PARENT_SCOPE) endfunction() @@ -114,7 +106,7 @@ function(qt_evaluate_config_expression resultVar) elseif("${member}" STREQUAL "STREQUAL" AND memberIdx LESS ${length}) # Unfortunately the semantics for STREQUAL in if() are broken when the # RHS is an empty string and the parameters to if are coming through a variable. - # So we expect people two write the empty string with single quotes and then we + # So we expect people to write the empty string with single quotes and then we # do the comparison manually here. list(LENGTH result lhsIndex) math(EXPR lhsIndex "${lhsIndex}-1") @@ -157,7 +149,8 @@ endfunction() function(qt_evaluate_feature _feature) # If the feature was set explicitly by the user to be on or off, in the cache, then # there's nothing for us to do. - if(NOT QT_FEATURE_${_feature} STREQUAL UNSET) + if(DEFINED "QT_FEATURE_${_feature}") + message("${_feature} is already defined...") return() endif() @@ -201,6 +194,15 @@ function(qt_evaluate_feature _feature) set(QT_FEATURE_COMPUTED_VALUE_${_feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") set(QT_FEATURE_${_feature} "${result}" PARENT_SCOPE) + + if("${_arg_EMIT_IF}" STREQUAL "") + set(_arg_EMIT_IF ON) + endif() + + if (${_arg_EMIT_IF}) + set(FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") + set_property(CACHE FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) + endif() endfunction() function(qt_feature_definition _feature _name) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index fc7a6eb1bfa..d1fff8bf25d 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -122,18 +122,6 @@ extend_target(XcbQpa CONDITION QT_FEATURE_vulkan #extend_target(XcbQpa CONDITION NOT QT_FEATURE_xkbcommon_system #) -extend_target(XcbQpa CONDITION (NOT QT_FEATURE_xkbcommon_system) AND (QT_FEATURE_xkb) - INCLUDE_DIRECTORIES - ../../../3rdparty/xkbcommon/src/x11 -) - -extend_target(XcbQpa CONDITION (NOT QT_FEATURE_xkbcommon_system) AND (NOT QT_FEATURE_xkb) - INCLUDE_DIRECTORIES - ../../../3rdparty/xkbcommon - ../../../3rdparty/xkbcommon/xkbcommon - ../../../3rdparty/xkbcommon/src - ../../../3rdparty/xkbcommon/src/xkbcomp -) # #extend_target(XcbQpa CONDITION NOT NOT QT_FEATURE_xkbcommon_system #) From 86098596cac5ca8d21fb22201030573dd75f83c1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 25 Oct 2018 14:28:06 +0200 Subject: [PATCH 0014/1322] QtFeature: Prefix temporary values with _ This gets makes it easier to see the QT_FEATURE_foo variables;-) Change-Id: Ide9354d90eecdb15d6d5cec7c2bfb9cee348fb29 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 8073f5178ba..b35c2459ce8 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -27,11 +27,12 @@ function(qt_feature_module_begin) endfunction() function(qt_feature _feature) - set(QT_FEATURE_DEFINITION_${_feature} ${ARGN} PARENT_SCOPE) qt_parse_all_arguments(_arg "qt_feature" "PRIVATE;PUBLIC" "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${ARGN}) + set(_QT_FEATURE_DEFINITION_${_feature} ${ARGN} PARENT_SCOPE) + # Register feature for future use: if (_arg_PUBLIC) list(APPEND __QtFeature_public_features "${_feature}") @@ -150,20 +151,19 @@ function(qt_evaluate_feature _feature) # If the feature was set explicitly by the user to be on or off, in the cache, then # there's nothing for us to do. if(DEFINED "QT_FEATURE_${_feature}") - message("${_feature} is already defined...") return() endif() - if(NOT DEFINED QT_FEATURE_DEFINITION_${_feature}) + if(NOT DEFINED _QT_FEATURE_DEFINITION_${_feature}) message(FATAL_ERROR "Attempting to evaluate feature ${_feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing") endif() cmake_parse_arguments(_arg "PRIVATE;PUBLIC" - "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${QT_FEATURE_DEFINITION_${_feature}}) + "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${_QT_FEATURE_DEFINITION_${_feature}}) - if(DEFINED QT_FEATURE_COMPUTED_VALUE_${_feature}) - set(QT_FEATURE_${_feature} ${QT_FEATURE_COMPUTED_VALUE_${_feature}} PARENT_SCOPE) + if(DEFINED _QT_FEATURE_VALUE_${_feature}) + set(QT_FEATURE_${_feature} ${_QT_FEATURE_VALUE_${_feature}} PARENT_SCOPE) return() endif() @@ -180,29 +180,33 @@ function(qt_evaluate_feature _feature) endif() if("${_arg_CONDITION}" STREQUAL "") - set(_arg_CONDITION ON) + set(condition ON) + else() + qt_evaluate_config_expression(condition ${_arg_CONDITION}) endif() if(${_arg_DISABLE}) set(result OFF) elseif((${_arg_ENABLE}) OR (${_arg_AUTODETECT})) - qt_evaluate_config_expression(result ${_arg_CONDITION}) + set(result ${condition}) else() # feature not auto-detected and not explicitly enabled set(result OFF) endif() - set(QT_FEATURE_COMPUTED_VALUE_${_feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") - set(QT_FEATURE_${_feature} "${result}" PARENT_SCOPE) - if("${_arg_EMIT_IF}" STREQUAL "") - set(_arg_EMIT_IF ON) + set(emit_if ON) + else() + qt_evaluate_config_expression(emit_if ${_arg_EMIT_IF}) endif() - if (${_arg_EMIT_IF}) + if (${emit_if}) set(FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") set_property(CACHE FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) endif() + + set(_QT_FEATURE_VALUE_${_feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") + set(QT_FEATURE_${_feature} "${result}" PARENT_SCOPE) endfunction() function(qt_feature_definition _feature _name) @@ -278,7 +282,7 @@ function(qt_feature_module_end target) list(REMOVE_DUPLICATES all_features) foreach(feature ${all_features}) - unset(QT_FEATURE_COMPUTED_VALUE_${feature} CACHE) + unset(_QT_FEATURE_VALUE_${feature} CACHE) endforeach() foreach(feature ${all_features}) @@ -309,8 +313,8 @@ function(qt_feature_module_end target) endforeach() foreach(feature ${all_features}) - unset(QT_FEATURE_COMPUTED_VALUE_${feature} CACHE) - unset(QT_FEATURE_DEFINITION_${feature} CACHE) + unset(_QT_FEATURE_VALUE_${feature} CACHE) + unset(_QT_FEATURE_DEFINITION_${feature} CACHE) endforeach() _qt_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_private_file}" From 3b74e0cc0bccb12456d77783a961eefe922060e4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 26 Oct 2018 11:49:58 +0200 Subject: [PATCH 0015/1322] QtFeature: (Re-)evaluate QT_FEATURES based on cached values (Re-)evaluate QT_FEATURE_* based on the corresponding cache values named FEATURE_*. Change-Id: I57e76af90221937e45979a6d0c366923983ca7d5 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 47 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index b35c2459ce8..0a19fcd6bb2 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -147,6 +147,44 @@ function(qt_evaluate_config_expression resultVar) set(${resultVar} ${result} PARENT_SCOPE) endfunction() +function(qt_feature_set_cache_value resultVar feature emit_if calculated label) + if (DEFINED "FEATURE_${feature}") + # Must set up the cache + if (NOT (emit_if)) + message(FATAL_ERROR "Sanity check failed: FEATURE_${feature} that was not emitted was found in the CMakeCache.") + endif() + + # Revisit value: + set(cache "${FEATURE_${feature}}") + if ((cache STREQUAL "ON") OR (cache STREQUAL "OFF")) + set(result "${cache}") + else() + message(FATAL_ERROR "Sanity check failed: FEATURE_${feature} has invalid value \"${cache}\"!") + endif() + # Fix-up user-provided values + set("FEATURE_${feature}" "${cache}" CACHE BOOL "${label}") + else() + # Initial setup: + if (emit_if) + set("FEATURE_${feature}" "${calculated}" CACHE BOOL "${label}") + endif() + set(result "${calculated}") + endif() + + set("${resultVar}" "${result}" PARENT_SCOPE) +endfunction() + +macro(qt_feature_set_value feature cache condition label) + set(result "${cache}") + + if (NOT (condition) AND (cache)) + message(SEND_ERROR "Feature \"${feature}\": Forcing to \"${cache}\" breaks its condition.") + endif() + + set(_QT_FEATURE_VALUE_${feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") + set(QT_FEATURE_${feature} "${result}" PARENT_SCOPE) +endmacro() + function(qt_evaluate_feature _feature) # If the feature was set explicitly by the user to be on or off, in the cache, then # there's nothing for us to do. @@ -200,13 +238,12 @@ function(qt_evaluate_feature _feature) qt_evaluate_config_expression(emit_if ${_arg_EMIT_IF}) endif() - if (${emit_if}) - set(FEATURE_${_feature} "UNSET" CACHE STRING "${_arg_LABEL}") - set_property(CACHE FEATURE_${_feature} PROPERTY STRINGS UNSET ON OFF) + if (NOT (condition) AND (calculated)) + message(FATAL_ERROR "Sanity check failed: Feature ${_feature} is enabled but condition does not hold true.") endif() - set(_QT_FEATURE_VALUE_${_feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") - set(QT_FEATURE_${_feature} "${result}" PARENT_SCOPE) + qt_feature_set_cache_value(cache "${_feature}" "${emit_if}" "${result}" "${_arg_LABEL}") + qt_feature_set_value("${_feature}" "${cache}" "${condition}" "${_arg_LABEL}") endfunction() function(qt_feature_definition _feature _name) From 5869195a9ada64ce9d6317b90b9d50b59fb931cf Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 10:43:05 +0100 Subject: [PATCH 0016/1322] CMake: put linebreaks into module path setup Change-Id: I68a1bbfd9f936a408e304fdae47fb42f72d6db46 Reviewed-by: Simon Hausmann --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0030bc5662e..e9b1293843e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,11 @@ project(QtBase ) ## Add some paths to check for cmake modules: -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin") +list(APPEND CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules/find-modules" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin" +) ## Qt specific setup common for all modules: include(QtSetup) From f3cf1a6856c6f981d0fd8c229ae7f41ffd93f84b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 14:56:13 +0100 Subject: [PATCH 0017/1322] CMake: Improve handling of qtHaveModule in pro2cmake script Map "qtHaveModule(foo)" in qmake to "TARGET Qt::Foo" in cmake. Change-Id: I63c251f0f2dfd2e95adc996a83b528e9b4e9636e Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 37364d63ada..f79bf19ca4a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -37,7 +37,7 @@ import typing import pyparsing as pp -from helper import map_qt_library, featureName, substitute_platform, substitute_libs +from helper import map_qt_library, map_qt_base_library, featureName, substitute_platform, substitute_libs def _parse_commandline(): @@ -386,7 +386,10 @@ def map_condition(condition: str) -> str: # some features contain e.g. linux, that should not be turned upper case feature = re.match(r"(qtConfig|qtHaveModule)\(([a-zA-Z0-9_-]+)\)", part) if feature: - part = 'QT_FEATURE_' + featureName(feature.group(2)) + if (feature.group(1) == "qtHaveModule"): + part = 'TARGET {}'.format(map_qt_base_library(feature.group(2))) + else: + part = 'QT_FEATURE_' + featureName(feature.group(2)) else: part = substitute_platform(part) From 96ddd79b032b80410c98b8e71f2b153973226d0a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 14:57:31 +0100 Subject: [PATCH 0018/1322] CMake: Handle '-' better in pro2cmake Do not fail on tests/benchmarks/benchmark.pro. Change-Id: I0ffdf9d38ea6fa73856f33d44c5a428c9cab9107 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index f79bf19ca4a..b39ca744e7b 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -300,7 +300,7 @@ class QmakeParser: LC = pp.Suppress(pp.Literal('\\') + pp.LineEnd()) EOL = pp.Suppress(pp.Optional(pp.pythonStyleComment()) + pp.LineEnd()) - Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_./') + Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') Substitution = pp.Combine(pp.Literal('$') + (((pp.Literal('$') + Identifier + pp.Optional(pp.nestedExpr())) | (pp.Literal('(') + Identifier + pp.Literal(')')) From 41eabf01c415af078b3853c801ac7ab491025367 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 15:52:21 +0100 Subject: [PATCH 0019/1322] pro2cmake.py: Make handling of TEMPLATE more robust Change-Id: I43b6dac3984b66585408c9fb91ae28c5b134fe40 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index b39ca744e7b..25cdab3115f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -129,7 +129,10 @@ class Scope: other.set_basedir(self._basedir) for k in self._values.keys(): - self.append_value(k, other.get(k, [])) + if k == 'TEMPLATE': + assert other.get(k, []) == self.get(k, []) + else: + self.append_value(k, other.get(k, [])) for k in other._values.keys(): if k not in self._values: @@ -214,10 +217,9 @@ class Scope: return self._condition def _push_down_TEMPLATE(self, template: str) -> None: - if not self._rawTemplate(): - self.set_value('TEMPLATE', [template, ]) - for c in self._children: - c._push_down_TEMPLATE(template) + self.set_value('TEMPLATE', [template, ]) + for c in self._children: + c._push_down_TEMPLATE(template) def add_child(self, scope: 'Scope') -> None: scope._parent = self @@ -632,7 +634,7 @@ def write_plugin(cm_fh, scope, *, indent: int=0): def handle_app_or_lib(scope: Scope, cm_fh: IO[str], *, indent=0) -> None: - assert scope.getTemplate() in ('app', 'lib', None) + assert scope.getTemplate() in ('app', 'lib') is_lib = scope.getTemplate() == 'lib' is_plugin = any('qt_plugin' == s for s in scope.get('_LOADED', [])) @@ -669,7 +671,7 @@ def cmakeify_scope(scope: Scope, cm_fh: IO[str], *, indent: int=0) -> None: handle_qt_for_config(scope, cm_fh) if template == 'subdirs': handle_subdir(scope, cm_fh, indent=indent) - elif template in ('app', 'lib', None): + elif template in ('app', 'lib'): handle_app_or_lib(scope, cm_fh, indent=indent) else: print(' XXXX: {}: Template type {} not yet supported.' @@ -694,6 +696,8 @@ def do_include(scope: Scope, *, debug: bool=False) -> None: include_result = parseProFile(include_file, debug=debug) include_scope = Scope.FromDict(include_file, include_result.asDict().get('statements'), '', dir) + if not include_scope._rawTemplate(): + include_scope._push_down_TEMPLATE(scope.getTemplate()) do_include(include_scope) From 187c466d9aeac94db39e1ad4899663c74e2f54f9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 15:55:19 +0100 Subject: [PATCH 0020/1322] pro2cmake.py: Improve debugging off included files Change-Id: I1007a5134a3d3e9ca7e5d3cd9b23ad64f76602be Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 25cdab3115f..353d22762d2 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -710,8 +710,10 @@ def do_include(scope: Scope, *, debug: bool=False) -> None: def main() -> None: args = _parse_commandline() + debug_parsing = args.debug_parser or args.debug + for file in args.files: - parseresult = parseProFile(file, debug=args.debug_parser or args.debug) + parseresult = parseProFile(file, debug=debug_parsing) if args.debug_parse_result or args.debug: print('\n\n#### Parser result:') @@ -729,7 +731,7 @@ def main() -> None: print(file_scope.dump()) print('\n#### End of .pro/.pri file structure.\n') - do_include(file_scope) + do_include(file_scope, debug=debug_parsing) if args.debug_full_pro_structure or args.debug: print('\n\n#### Full .pro/.pri file structure:') From ead9c0b1b894505097f4de0039c9b55dd799cf3c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 16:12:21 +0100 Subject: [PATCH 0021/1322] pro2cmake: Handle Statements before Scopes This fixes among other things the unit tests. Change-Id: If9e23735d1d52cf49dc1f03749129fd726e8dea5 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 353d22762d2..6471f3ff5f0 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -331,7 +331,7 @@ class QmakeParser: Statement = pp.Group(Load | Include | Option | DefineTest | FunctionCall | Operation) StatementLine = Statement + EOL - StatementGroup = pp.ZeroOrMore(Scope | EOL | StatementLine) + StatementGroup = pp.ZeroOrMore(StatementLine | Scope | EOL) Block = pp.Suppress('{') + pp.Optional(EOL) \ + pp.ZeroOrMore(EOL | Statement + EOL | Scope) \ From da7811dc758a99b4aee5737713d90a5c12959fc9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 1 Nov 2018 16:13:11 +0100 Subject: [PATCH 0022/1322] pro2cmake: Explicitly handle for loops Handle for loops by ignoring them:-) Change-Id: If4716e0615f4a0fa982281b94dbd4f70ae868fd8 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6471f3ff5f0..3053b365988 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -325,11 +325,13 @@ class QmakeParser: Option = pp.Keyword('option') + pp.Suppress('(') + Identifier('option') + pp.Suppress(')') DefineTest = pp.Suppress(pp.Keyword('defineTest') + pp.Suppress('(') + Identifier + pp.Suppress(')') + pp.nestedExpr(opener='{', closer='}') + pp.LineEnd()) # ignore the whole thing... + ForLoop = pp.Suppress(pp.Keyword('for') + pp.nestedExpr() + + pp.nestedExpr(opener='{', closer='}', ignoreExpr=None) + pp.LineEnd()) # ignore the whole thing... FunctionCall = pp.Suppress(Identifier + pp.nestedExpr()) Scope = pp.Forward() - Statement = pp.Group(Load | Include | Option | DefineTest | FunctionCall | Operation) + Statement = pp.Group(Load | Include | Option | DefineTest | ForLoop | FunctionCall | Operation) StatementLine = Statement + EOL StatementGroup = pp.ZeroOrMore(StatementLine | Scope | EOL) @@ -350,7 +352,7 @@ class QmakeParser: Scope <<= pp.Group(Condition('condition') + (SingleLineScope | MultiLineScope) + pp.Optional(Else)) if debug: - for ename in "EOL Identifier Substitution SubstitutionValue LiteralValuePart Value Values SingleLineScope MultiLineScope Scope SingleLineElse MultiLineElse Else Condition Block StatementGroup Statement Load Include Option DefineTest FunctionCall Operation".split(): + for ename in "EOL Identifier Substitution SubstitutionValue LiteralValuePart Value Values SingleLineScope MultiLineScope Scope SingleLineElse MultiLineElse Else Condition Block StatementGroup Statement Load Include Option DefineTest ForLoop FunctionCall Operation".split(): expr = locals()[ename] expr.setName(ename) expr.setDebug() From b7b4af575f119ddabe0f7f3e8c075306b347dda3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 2 Nov 2018 11:42:58 +0100 Subject: [PATCH 0023/1322] CMake: Simplify Feature handling Simplify the scope handling of features by providing a function that just pushes all QT_FEATURES into the parent scope. Use it. Change-Id: Ic6552fe495394d73fcec6becf6852745ec2d6d59 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 28 ++++++++++++++--------- cmake/QtFeature.cmake | 52 +++++++++++-------------------------------- 2 files changed, 30 insertions(+), 50 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 25cfe7e8ba5..3a4f2fbc9cf 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -442,10 +442,8 @@ function(extend_target target) # caller as well as to the local scope for configure.cmake evaluation. if("x${CMAKE_MATCH_2}" STREQUAL "xPrivate") - qt_push_features_into_parent_scope(PRIVATE_FEATURES ${depTarget}) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() - qt_push_features_into_parent_scope(PUBLIC_FEATURES ${depTarget}) qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) if(TARGET "${dep}") continue() @@ -462,6 +460,8 @@ function(extend_target target) target_compile_definitions("${target}" PUBLIC ${_arg_PUBLIC_DEFINES} PRIVATE ${_arg_DEFINES}) target_link_libraries("${target}" PUBLIC ${_arg_PUBLIC_LIBRARIES} PRIVATE ${_arg_LIBRARIES}) endif() + + qt_push_features_into_parent_scope() endfunction() @@ -549,20 +549,18 @@ function(add_qt_module name) # Import global features if(NOT "${target}" STREQUAL "Core") - qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) endif() # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. - foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) + foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES} ${_arg_FEATURE_DEPENDENCIES}) if("${dep}" MATCHES "(Qt::.+)Private") set(publicDep ${CMAKE_MATCH_1}) - qt_push_features_into_parent_scope(PRIVATE_FEATURES ${publicDep}) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) else() set(publicDep ${dep}) endif() - qt_push_features_into_parent_scope(PUBLIC_FEATURES ${publicDep}) qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) endforeach() @@ -602,7 +600,7 @@ function(add_qt_module name) ) include(${configureFile}) qt_feature_module_end("${target}") - qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES "${target}") + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES "${target}") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${_arg_CONFIG_MODULE_NAME}-config.h") set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${_arg_CONFIG_MODULE_NAME}-config_p.h") @@ -665,7 +663,7 @@ function(add_qt_module name) qt_internal_add_linker_version_script("${target}") endif() - qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${_arg_FEATURE_DEPENDENCIES}) + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${_arg_FEATURE_DEPENDENCIES}) install(TARGETS "${target}" "${target_private}" EXPORT "${versioned_module_name}Targets" LIBRARY DESTINATION ${INSTALL_LIBDIR} @@ -726,6 +724,8 @@ function(add_qt_module name) $ $ ) + + qt_push_features_into_parent_scope() endfunction() @@ -748,19 +748,17 @@ function(add_qt_plugin name) set_target_properties("${module}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") # Import global features - qt_push_features_into_parent_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "(Qt::.+)Private") set(publicDep ${CMAKE_MATCH_1}) - qt_push_features_into_parent_scope(PRIVATE_FEATURES ${publicDep}) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) else() set(publicDep ${dep}) endif() - qt_push_features_into_parent_scope(PUBLIC_FEATURES ${publicDep}) qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) endforeach() @@ -806,6 +804,8 @@ function(add_qt_plugin name) endif() qt_internal_add_linker_version_script(${module}) + + qt_push_features_into_parent_scope() endfunction() @@ -838,6 +838,8 @@ function(add_qt_executable name) WIN32_EXECUTABLE "${_arg_GUI}" MACOSX_BUNDLE "${_arg_GUI}" ) + + qt_push_features_into_parent_scope() endfunction() @@ -862,6 +864,8 @@ function(add_qt_test name) set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${_arg_RUN_SERIAL}") set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${_path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}") set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${PROJECT_BINARY_DIR}/${INSTALL_PLUGINSDIR}") + + qt_push_features_into_parent_scope() endfunction() @@ -869,6 +873,7 @@ endfunction() # tests launch separate programs to test certainly input/output behavior. function(add_qt_test_helper name) add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ${ARGN}) + qt_push_features_into_parent_scope() endfunction() @@ -899,6 +904,7 @@ function(add_qt_tool name) endif() install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) + qt_push_features_into_parent_scope() endfunction() diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 0a19fcd6bb2..6330200fd17 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -22,8 +22,7 @@ function(qt_feature_module_begin) set(__QtFeature_private_extra "" PARENT_SCOPE) set(__QtFeature_public_extra "" PARENT_SCOPE) - qt_push_features_into_parent_scope(PUBLIC_FEATURES ${_arg_PUBLIC_DEPENDENCIES}) - qt_push_features_into_parent_scope(PRIVATE_FEATURES ${_arg_PRIVATE_DEPENDENCIES}) + qt_push_features_into_parent_scope() endfunction() function(qt_feature _feature) @@ -181,7 +180,6 @@ macro(qt_feature_set_value feature cache condition label) message(SEND_ERROR "Feature \"${feature}\": Forcing to \"${cache}\" breaks its condition.") endif() - set(_QT_FEATURE_VALUE_${feature} "${result}" CACHE INTERNAL "${_arg_LABEL}") set(QT_FEATURE_${feature} "${result}" PARENT_SCOPE) endmacro() @@ -193,6 +191,7 @@ function(qt_evaluate_feature _feature) endif() if(NOT DEFINED _QT_FEATURE_DEFINITION_${_feature}) + qt_debug_print_variables(DEDUP MATCH "^QT_FEATURE") message(FATAL_ERROR "Attempting to evaluate feature ${_feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing") endif() @@ -200,8 +199,7 @@ function(qt_evaluate_feature _feature) "PRIVATE;PUBLIC" "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${_QT_FEATURE_DEFINITION_${_feature}}) - if(DEFINED _QT_FEATURE_VALUE_${_feature}) - set(QT_FEATURE_${_feature} ${_QT_FEATURE_VALUE_${_feature}} PARENT_SCOPE) + if(DEFINED QT_FEATURE_${_feature}) return() endif() @@ -318,14 +316,8 @@ function(qt_feature_module_end target) set(all_features ${__QtFeature_public_features} ${__QtFeature_private_features}) list(REMOVE_DUPLICATES all_features) - foreach(feature ${all_features}) - unset(_QT_FEATURE_VALUE_${feature} CACHE) - endforeach() - foreach(feature ${all_features}) qt_evaluate_feature(${feature}) - - set(QT_FEATURE_${feature} ${QT_FEATURE_${feature}} PARENT_SCOPE) endforeach() set(enabled_public_features "") @@ -350,8 +342,7 @@ function(qt_feature_module_end target) endforeach() foreach(feature ${all_features}) - unset(_QT_FEATURE_VALUE_${feature} CACHE) - unset(_QT_FEATURE_DEFINITION_${feature} CACHE) + unset(_QT_FEATURE_DEFINITION_${feature} PARENT_SCOPE) endforeach() _qt_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_private_file}" @@ -389,6 +380,8 @@ function(qt_feature_module_end target) unset(__QtFeature_private_extra PARENT_SCOPE) unset(__QtFeature_public_extra PARENT_SCOPE) + + qt_push_features_into_parent_scope() endfunction() function(qt_config_compile_test name) @@ -440,33 +433,14 @@ function(qt_pull_features_into_current_scope) endfunction() macro(qt_push_features_into_parent_scope) - cmake_parse_arguments(__arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "FEATURE_PROPERTY_INFIX" "" ${ARGN}) - foreach(__target IN ITEMS ${__arg_UNPARSED_ARGUMENTS}) - if(NOT TARGET ${__target}) - continue() + get_cmake_property(__variableNames VARIABLES) + list (SORT __variableNames) + list(REMOVE_DUPLICATES __variableNames) + + foreach(__var ${__variableNames}) + if(__var MATCHES "^QT_FEATURE_[a-z][a-z0-9_]*$") + set("${__var}" "${${__var}}" PARENT_SCOPE) endif() - get_target_property(__target_type "${__target}" TYPE) - if("${__target_type}" STREQUAL "INTERFACE_LIBRARY") - set(__property_prefix "INTERFACE_") - else() - set(__property_prefix "") - endif() - foreach(__visibility PUBLIC PRIVATE) - set(__value ON) - foreach(__state ENABLED DISABLED) - if(NOT ${__arg_${__visibility}_FEATURES}) - continue() - endif() - get_target_property(__features "${__target}" ${__property_prefix}QT_${__arg_FEATURE_PROPERTY_INFIX}${__state}_${__visibility}_FEATURES) - if("${__features}" STREQUAL "__features-NOTFOUND") - continue() - endif() - foreach(__feature ${__features}) - set(QT_FEATURE_${__feature} ${__value} PARENT_SCOPE) - endforeach() - set(__value OFF) - endforeach() - endforeach() endforeach() endmacro() From cda5d06bd83141bef1b3caa10413d39598814b26 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 2 Nov 2018 12:11:19 +0100 Subject: [PATCH 0024/1322] CMake: Fix import of features Make sure the features of Qt libraries are available when linking to that library via the add_qt_* functions. This was broken for any library that did not end with "Privat" or "Private". Change-Id: Iff0ad441b601e0d131b0e30f2069110806410297 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3a4f2fbc9cf..a0985918c11 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -435,20 +435,20 @@ function(extend_target target) qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}") foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) - if("${dep}" MATCHES "Qt::(.+)(Private?)") + if("${dep}" MATCHES "^Qt::(.+)(Private)?$") set(depTarget ${CMAKE_MATCH_1}) # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. + if(NOT TARGET "${dep}") + find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) + endif() + if("x${CMAKE_MATCH_2}" STREQUAL "xPrivate") qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) - if(TARGET "${dep}") - continue() - endif() - find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) endif() endforeach() @@ -856,7 +856,7 @@ function(add_qt_test name) "${CMAKE_CURRENT_BINARY_DIR}" "${_arg_INCLUDE_DIRECTORIES}" DEFINES "${_arg_DEFINES}" - LIBRARIES "Qt::Core;Qt::Test;${_arg_LIBRARIES}" + LIBRARIES Qt::Core Qt::Test ${_arg_LIBRARIES} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") From 4769830034ee2cb503173229c79bd69042e4fffb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 2 Nov 2018 12:32:57 +0100 Subject: [PATCH 0025/1322] pro2cmake.py: Do not try to add libraries that qmake substracts Add a comment that a library was removed when running into "QT -= gui" and similar lines. Change-Id: I17b7922827f228c6b45e1e6867fdc5e316af3781 Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 3053b365988..40043d15d54 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -522,7 +522,11 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, d = '${FW%s}' % d if d.startswith('-l'): d = d[2:] - d = substitute_libs(d) + + if d.startswith('-'): + d = '# Remove: {}'.format(d[1:]) + else: + d = substitute_libs(d) cm_fh.write('{} {}\n'.format(ind, d)) is_framework = False From 806595c5b6c9fc3bfc3bc843ddd1a4b126d6a426 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 2 Nov 2018 14:27:57 +0100 Subject: [PATCH 0026/1322] Add Sql build and tests Change-Id: I9bf7d61a65950eafcfe6b3ea9c437e353ff7b2ed Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- src/CMakeLists.txt | 3 ++ src/sql/CMakeLists.txt | 37 +++++++++++++++++++ src/sql/configure.cmake | 21 +++++++++++ tests/auto/CMakeLists.txt | 32 ++++++++-------- tests/auto/sql/CMakeLists.txt | 2 + tests/auto/sql/kernel/CMakeLists.txt | 9 +++++ tests/auto/sql/kernel/qsql/CMakeLists.txt | 6 +++ .../sql/kernel/qsqldatabase/CMakeLists.txt | 6 +++ .../auto/sql/kernel/qsqldriver/CMakeLists.txt | 6 +++ .../auto/sql/kernel/qsqlerror/CMakeLists.txt | 1 + .../auto/sql/kernel/qsqlfield/CMakeLists.txt | 1 + .../auto/sql/kernel/qsqlquery/CMakeLists.txt | 6 +++ .../auto/sql/kernel/qsqlrecord/CMakeLists.txt | 1 + .../auto/sql/kernel/qsqlresult/CMakeLists.txt | 8 ++++ .../auto/sql/kernel/qsqlthread/CMakeLists.txt | 6 +++ tests/auto/sql/models/CMakeLists.txt | 6 +++ .../sql/models/qsqlquerymodel/CMakeLists.txt | 7 ++++ .../qsqlrelationaldelegate/CMakeLists.txt | 7 ++++ .../qsqlrelationaltablemodel/CMakeLists.txt | 6 +++ .../sql/models/qsqltablemodel/CMakeLists.txt | 6 +++ 20 files changed, 161 insertions(+), 16 deletions(-) create mode 100644 src/sql/CMakeLists.txt create mode 100644 src/sql/configure.cmake create mode 100644 tests/auto/sql/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsql/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqldatabase/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqldriver/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqlerror/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqlfield/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqlquery/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqlrecord/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqlresult/CMakeLists.txt create mode 100644 tests/auto/sql/kernel/qsqlthread/CMakeLists.txt create mode 100644 tests/auto/sql/models/CMakeLists.txt create mode 100644 tests/auto/sql/models/qsqlquerymodel/CMakeLists.txt create mode 100644 tests/auto/sql/models/qsqlrelationaldelegate/CMakeLists.txt create mode 100644 tests/auto/sql/models/qsqlrelationaltablemodel/CMakeLists.txt create mode 100644 tests/auto/sql/models/qsqltablemodel/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f81ad05f9de..16cb36e1459 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,6 +47,9 @@ add_subdirectory(corelib) if (QT_FEATURE_concurrent) add_subdirectory(concurrent) endif() +if (QT_FEATURE_sql) + add_subdirectory(sql) +endif() if (QT_FEATURE_network) add_subdirectory(network) endif() diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt new file mode 100644 index 00000000000..ac4dd8f023b --- /dev/null +++ b/src/sql/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from sql.pro. + +##################################################################### +## Sql Module: +##################################################################### + +add_qt_module(Sql + SOURCES + kernel/qsqlcachedresult.cpp kernel/qsqlcachedresult_p.h + kernel/qsqldatabase.cpp kernel/qsqldatabase.h + kernel/qsqldriver.cpp kernel/qsqldriver.h kernel/qsqldriver_p.h + kernel/qsqldriverplugin.cpp kernel/qsqldriverplugin.h + kernel/qsqlerror.cpp kernel/qsqlerror.h + kernel/qsqlfield.cpp kernel/qsqlfield.h + kernel/qsqlindex.cpp kernel/qsqlindex.h + kernel/qsqlnulldriver_p.h + kernel/qsqlquery.cpp kernel/qsqlquery.h + kernel/qsqlrecord.cpp kernel/qsqlrecord.h + kernel/qsqlresult.cpp kernel/qsqlresult.h kernel/qsqlresult_p.h + kernel/qtsqlglobal.h kernel/qtsqlglobal_p.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate +) + +extend_target(Sql CONDITION QT_FEATURE_sqlmodel + SOURCES + models/qsqlquerymodel.cpp models/qsqlquerymodel.h models/qsqlquerymodel_p.h + models/qsqlrelationaldelegate.cpp models/qsqlrelationaldelegate.h + models/qsqlrelationaltablemodel.cpp models/qsqlrelationaltablemodel.h + models/qsqltablemodel.cpp models/qsqltablemodel.h models/qsqltablemodel_p.h +) + +add_qt_docs(./doc/qtsql.qdocconf) diff --git a/src/sql/configure.cmake b/src/sql/configure.cmake new file mode 100644 index 00000000000..545b542d6bd --- /dev/null +++ b/src/sql/configure.cmake @@ -0,0 +1,21 @@ + + +#### Inputs + + + +#### Libraries + + + +#### Tests + + + +#### Features + +qt_feature("sqlmodel" PUBLIC + LABEL "SQL item models" + PURPOSE "Provides item model classes backed by SQL databases." + CONDITION QT_FEATURE_itemmodel +) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index d9d1b8349f1..423c6fe8846 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from auto.pro. if (NOT APPLE_UIKIT) - add_subdirectory("corelib") + add_subdirectory(corelib) endif() if (QT_FEATURE_dbus) set(run_dbus_tests ON) @@ -19,37 +19,37 @@ if (QT_FEATURE_dbus) endif() endif() if(run_dbus_tests) - add_subdirectory("dbus") + add_subdirectory(dbus) endif() endif() if (NOT APPLE_UIKIT AND TARGET Qt::Gui) - add_subdirectory("gui") + add_subdirectory(gui) endif() if (TARGET Qt::Network AND NOT WINRT) - # add_subdirectory("network") + # add_subdirectory(network) endif() if (TARGET Qt::OpenGL AND NOT WINRT) - add_subdirectory("opengl") + add_subdirectory(opengl) endif() -if (QT_FEATURE_sql) -# add_subdirectory("sql") +if (TARGET Qt::Sql) + add_subdirectory(sql) endif() -add_subdirectory("testlib") +add_subdirectory(testlib) if (NOT CMAKE_CROSSCOMPILE AND QT_FEATURE_process) -# add_subdirectory("tools") +# add_subdirectory(tools) endif() if (TARGET Qt::Xml) -# add_subdirectory("xml") +# add_subdirectory(xml) endif() if (TARGET Qt::Concurrent) - add_subdirectory("concurrent") + add_subdirectory(concurrent) endif() -# add_subdirectory("other") +# add_subdirectory(other) if (TARGET Qt::Widgets) - add_subdirectory("widgets") + add_subdirectory(widgets) endif() if (TARGET Qt::PrintSupport) -# add_subdirectory("printsupport") +# add_subdirectory(printsupport) endif() -# add_subdirectory("cmake") ## FIXME: Does this still make sense in this form? -# add_subdirectory("installed_cmake") ## FIXME: Does this still make sense in this form? +# add_subdirectory(cmake) ## FIXME: Does this still make sense in this form? +# add_subdirectory(installed_cmake) ## FIXME: Does this still make sense in this form? diff --git a/tests/auto/sql/CMakeLists.txt b/tests/auto/sql/CMakeLists.txt new file mode 100644 index 00000000000..7d4cd486b48 --- /dev/null +++ b/tests/auto/sql/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(kernel) +add_subdirectory(models) diff --git a/tests/auto/sql/kernel/CMakeLists.txt b/tests/auto/sql/kernel/CMakeLists.txt new file mode 100644 index 00000000000..8d3f0b6bc51 --- /dev/null +++ b/tests/auto/sql/kernel/CMakeLists.txt @@ -0,0 +1,9 @@ +add_subdirectory(qsqlfield) +add_subdirectory(qsqldatabase) +add_subdirectory(qsqlerror) +add_subdirectory(qsqldriver) +add_subdirectory(qsqlquery) +add_subdirectory(qsqlrecord) +add_subdirectory(qsqlthread) +add_subdirectory(qsql) +add_subdirectory(qsqlresult) diff --git a/tests/auto/sql/kernel/qsql/CMakeLists.txt b/tests/auto/sql/kernel/qsql/CMakeLists.txt new file mode 100644 index 00000000000..0e11fced12d --- /dev/null +++ b/tests/auto/sql/kernel/qsql/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsql + SOURCES tst_qsql.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/kernel/qsqldatabase/CMakeLists.txt b/tests/auto/sql/kernel/qsqldatabase/CMakeLists.txt new file mode 100644 index 00000000000..344d96406ba --- /dev/null +++ b/tests/auto/sql/kernel/qsqldatabase/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsqldatabase + SOURCES tst_qsqldatabase.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/kernel/qsqldriver/CMakeLists.txt b/tests/auto/sql/kernel/qsqldriver/CMakeLists.txt new file mode 100644 index 00000000000..66139b08c9a --- /dev/null +++ b/tests/auto/sql/kernel/qsqldriver/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsqldriver + SOURCES tst_qsqldriver.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/kernel/qsqlerror/CMakeLists.txt b/tests/auto/sql/kernel/qsqlerror/CMakeLists.txt new file mode 100644 index 00000000000..4c2b7a89880 --- /dev/null +++ b/tests/auto/sql/kernel/qsqlerror/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsqlerror SOURCES tst_qsqlerror.cpp LIBRARIES Qt::Sql) diff --git a/tests/auto/sql/kernel/qsqlfield/CMakeLists.txt b/tests/auto/sql/kernel/qsqlfield/CMakeLists.txt new file mode 100644 index 00000000000..71b470706f4 --- /dev/null +++ b/tests/auto/sql/kernel/qsqlfield/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsqlfield SOURCES tst_qsqlfield.cpp LIBRARIES Qt::Sql) diff --git a/tests/auto/sql/kernel/qsqlquery/CMakeLists.txt b/tests/auto/sql/kernel/qsqlquery/CMakeLists.txt new file mode 100644 index 00000000000..5c357656794 --- /dev/null +++ b/tests/auto/sql/kernel/qsqlquery/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsqlquery + SOURCES tst_qsqlquery.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/kernel/qsqlrecord/CMakeLists.txt b/tests/auto/sql/kernel/qsqlrecord/CMakeLists.txt new file mode 100644 index 00000000000..68c80ed9907 --- /dev/null +++ b/tests/auto/sql/kernel/qsqlrecord/CMakeLists.txt @@ -0,0 +1 @@ +add_qt_test(tst_qsqlrecord SOURCES tst_qsqlrecord.cpp LIBRARIES Qt::Sql) diff --git a/tests/auto/sql/kernel/qsqlresult/CMakeLists.txt b/tests/auto/sql/kernel/qsqlresult/CMakeLists.txt new file mode 100644 index 00000000000..01ac844bc5d --- /dev/null +++ b/tests/auto/sql/kernel/qsqlresult/CMakeLists.txt @@ -0,0 +1,8 @@ +add_qt_test(tst_qsqlresult + SOURCES + testsqldriver.h + tst_qsqlresult.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/kernel/qsqlthread/CMakeLists.txt b/tests/auto/sql/kernel/qsqlthread/CMakeLists.txt new file mode 100644 index 00000000000..77762d286fd --- /dev/null +++ b/tests/auto/sql/kernel/qsqlthread/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsqlthread + SOURCES tst_qsqlthread.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/models/CMakeLists.txt b/tests/auto/sql/models/CMakeLists.txt new file mode 100644 index 00000000000..df530443c45 --- /dev/null +++ b/tests/auto/sql/models/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(qsqlrelationaltablemodel) +add_subdirectory(qsqltablemodel) + +if(TARGET Qt::Widgets) + add_subdirectory(qsqlquerymodel) +endif() diff --git a/tests/auto/sql/models/qsqlquerymodel/CMakeLists.txt b/tests/auto/sql/models/qsqlquerymodel/CMakeLists.txt new file mode 100644 index 00000000000..0233cd8dc8e --- /dev/null +++ b/tests/auto/sql/models/qsqlquerymodel/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test(tst_qsqlquerymodel + SOURCES tst_qsqlquerymodel.cpp + LIBRARIES + Qt::Widgets + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/models/qsqlrelationaldelegate/CMakeLists.txt b/tests/auto/sql/models/qsqlrelationaldelegate/CMakeLists.txt new file mode 100644 index 00000000000..f84a74417c2 --- /dev/null +++ b/tests/auto/sql/models/qsqlrelationaldelegate/CMakeLists.txt @@ -0,0 +1,7 @@ +add_qt_test(tst_qsqlrelationaldelegate + SOURCES tst_qsqlrelationaldelegate.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate + Qt::Widgets +) diff --git a/tests/auto/sql/models/qsqlrelationaltablemodel/CMakeLists.txt b/tests/auto/sql/models/qsqlrelationaltablemodel/CMakeLists.txt new file mode 100644 index 00000000000..efb2aa84a57 --- /dev/null +++ b/tests/auto/sql/models/qsqlrelationaltablemodel/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsqlrelationaltablemodel + SOURCES tst_qsqlrelationaltablemodel.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) diff --git a/tests/auto/sql/models/qsqltablemodel/CMakeLists.txt b/tests/auto/sql/models/qsqltablemodel/CMakeLists.txt new file mode 100644 index 00000000000..b364e176f00 --- /dev/null +++ b/tests/auto/sql/models/qsqltablemodel/CMakeLists.txt @@ -0,0 +1,6 @@ +add_qt_test(tst_qsqltablemodel + SOURCES tst_qsqltablemodel.cpp + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate +) From 1dd5acf9aa2b1c9e1efbbacc67c5aa94f3483fd4 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Tue, 6 Nov 2018 00:08:03 +0100 Subject: [PATCH 0027/1322] CMake: Fix import of features while generating CMakeLists extend_target does not import public and private features. For example: Qt::CorePrivate matches as ('CorePrivate'), but it should be ('Core', 'Private') Change-Id: I99144d42b7e0a8f7c4501d3e0eaf04b270c6b4d6 Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a0985918c11..ef4caa27de2 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -435,17 +435,20 @@ function(extend_target target) qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}") foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) - if("${dep}" MATCHES "^Qt::(.+)(Private)?$") - set(depTarget ${CMAKE_MATCH_1}) + if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") + if (${CMAKE_MATCH_COUNT} EQUAL 3) + set(depTarget ${CMAKE_MATCH_2}) + else() + set(depTarget ${CMAKE_MATCH_4}) + endif() # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. - if(NOT TARGET "${dep}") find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) endif() - if("x${CMAKE_MATCH_2}" STREQUAL "xPrivate") + if("x${CMAKE_MATCH_3}" STREQUAL "xPrivate") qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) From da3c73ad13b1fb26e94a17ff4d744b2162638139 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Tue, 6 Nov 2018 00:13:53 +0100 Subject: [PATCH 0028/1322] CMake: cocoa disable printsupport features cmake have not built printsupport yet. Change-Id: I635b4678bbf0b659750e7f6b842834e084b6f3a5 Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- src/plugins/platforms/cocoa/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 66cc2bcd892..a757c402934 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -87,13 +87,13 @@ extend_target(qcocoa CONDITION QT_FEATURE_vulkan extend_target(qcocoa CONDITION QT_FEATURE_widgets SOURCES - qcocoaprintdevice.h qcocoaprintdevice.mm - qcocoaprintersupport.h qcocoaprintersupport.mm - qpaintengine_mac.mm qpaintengine_mac_p.h - qprintengine_mac.mm qprintengine_mac_p.h + # qcocoaprintdevice.h qcocoaprintdevice.mm + # qcocoaprintersupport.h qcocoaprintersupport.mm + # qpaintengine_mac.mm qpaintengine_mac_p.h + # qprintengine_mac.mm qprintengine_mac_p.h LIBRARIES Qt::WidgetsPrivate - Qt::PrintSupportPrivate + # Qt::PrintSupportPrivate ) extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_colordialog) From 89368f5b26b32501d70265259c67aa0f6794273d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 6 Nov 2018 11:18:25 +0100 Subject: [PATCH 0029/1322] configurejson2cmake: Add generic feature mapping Add a way to map individual parts of a feature to new values and use that also to skip features. Change-Id: Ibddfcbbf9dfac29d460922e991934997b3e8387b Reviewed-by: Frederik Gladhorn --- util/cmake/configurejson2cmake.py | 127 +++++++++++++++++++----------- 1 file changed, 83 insertions(+), 44 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 934c53f3540..0cd0f24e4d2 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -620,55 +620,94 @@ def parseTest(ctx, test, data, cm_fh): def parseFeature(ctx, feature, data, cm_fh): - skip_features = { - 'c++11', 'c++14', 'c++1y', 'c++1z', # C++ versions - 'c89', 'c99', 'c11', # C versions - 'stl', # Do we really need to test for this in 2018?! - 'rpath', 'rpath_dir', # rpath related - 'static', 'shared', # static/shared libs - 'debug', 'release', 'debug_and_release', 'build_all', 'optimize_debug', 'optimize_size', # build types - 'release_tools', 'gcov', 'silent', 'profile', - 'msvc_mp', 'static_runtime', 'incredibuild_xge', 'ccache', # compiler specific stuff - 'sanitize_address', 'sanitize_thread', 'sanitize_memory', # sanitizer - 'sanitize_undefined', 'sanitizer', - 'force_debug_info', 'separate_debug_info', 'warnings_are_errors', # FIXME: Do we need these? - 'strip', 'precompile_header', 'ltcg', 'enable_new_dtags', - 'enable_gdb_index', 'reduce_relocations', - 'stack-protector-strong', - 'host-dbus', # dbus related - 'cross_compile', 'gcc-sysroot', # cross compile related - 'gc_binaries', 'qmakeargs', 'use_gold_linker', 'pkg-config', 'verifyspec', # qmake stuff... - 'GNUmake', 'compiler-flags', - 'system-doubleconversion', 'system-pcre2', 'system-zlib', 'system-png', 'system-jpeg', 'system-freetype', 'system-xcb', 'xkbcommon-system', # system libraries - 'doubleconversion', - 'dlopen', # handled by CMAKE_DL_LIBS - 'alloc_stdlib_h', 'alloc_h', 'alloc_malloc_h', # handled by alloc target - 'posix_fallocate', # Only needed for sqlite, which we do not want to build - 'qpa_default_platform', # Not a bool! - 'sun-libiconv', # internal feature but not referenced in our system + # This is *before* the feature name gets normalized! So keep - and + chars, etc. + feature_mapping = { + 'alloc_h': None, # handled by alloc target + 'alloc_malloc_h': None, + 'alloc_stdlib_h': None, + 'build_all': None, + 'c++11': None, # C and C++ versions + 'c11': None, + 'c++14': None, + 'c++1y': None, + 'c++1z': None, + 'c89': None, + 'c99': None, + 'ccache': None, + 'compiler-flags': None, + 'cross_compile': None, + 'debug_and_release': None, + 'debug': None, + 'dlopen': None, # handled by CMAKE_DL_LIBS + 'doubleconversion': None, + 'enable_gdb_index': None, + 'enable_new_dtags': None, + 'force_debug_info': None, + 'gc_binaries': None, + 'gcc-sysroot': None, + 'gcov': None, + 'GNUmake': None, + 'host-dbus': None, + 'incredibuild_xge': None, + 'ltcg': None, + 'msvc_mp': None, + 'optimize_debug': None, + 'optimize_size': None, + 'pkg-config': None, + 'posix_fallocate': None, # Only needed for sqlite, which we do not want to build + 'precompile_header': None, + 'profile': None, + 'qmakeargs': None, + 'qpa_default_platform': None, # Not a bool! + 'reduce_relocations': None, + 'release': None, + 'release_tools': None, + 'rpath_dir': None, # rpath related + 'rpath': None, + 'sanitize_address': None, # sanitizer + 'sanitize_memory': None, + 'sanitizer': None, + 'sanitize_thread': None, + 'sanitize_undefined': None, + 'separate_debug_info': None, + 'shared': None, + 'silent': None, + 'stack-protector-strong': None, + 'static': None, + 'static_runtime': None, + 'stl': None, # Do we really need to test for this in 2018?! + 'strip': None, + 'sun-libiconv': None, # internal feature but not referenced in our system + 'system-doubleconversion': None, # No system libraries anymore! + 'system-freetype': None, + 'system-jpeg': None, + 'system-pcre2': None, + 'system-png': None, + 'system-xcb': None, + 'system-zlib': None, + 'use_gold_linker': None, + 'verifyspec': None, # qmake specific... + 'warnings_are_errors': None, # FIXME: Do we need these? + 'xkbcommon-system': None, # another system library, just named a bit different from the rest } - if feature in skip_features: + + mapping = feature_mapping.get(feature, {}) + + if mapping is None: print(' **** Skipping features {}: masked.'.format(feature)) return - disabled_features = set() - - override_condition = {} - handled = { 'autoDetect', 'comment', 'condition', 'description', 'disable', 'emitIf', 'enable', 'label', 'output', 'purpose', 'section' } - label = data.get('label', '') - purpose = data.get('purpose', data.get('description', label)) - autoDetect = map_condition(data.get('autoDetect', '')) - condition = override_condition.get(feature, map_condition(data.get('condition', ''))) - output = data.get('output', []) - comment = data.get('comment', '') - section = data.get('section', '') - enable = map_condition(data.get('enable', '')) - disable = map_condition(data.get('disable', '')) - emitIf = map_condition(data.get('emitIf', '')) - - if feature in disabled_features: - condition = "FALSE" + label = mapping.get('label', data.get('label', '')) + purpose = mapping.get('purpose', data.get('purpose', data.get('description', label))) + autoDetect = map_condition(mapping.get('autoDetect', data.get('autoDetect', ''))) + condition = map_condition(mapping.get('condition', data.get('condition', ''))) + output = mapping.get('output', data.get('output', [])) + comment = mapping.get('comment', data.get('comment', '')) + section = mapping.get('section', data.get('section', '')) + enable = map_condition(mapping.get('enable', data.get('enable', ''))) + disable = map_condition(mapping.get('disable', data.get('disable', ''))) + emitIf = map_condition(mapping.get('emitIf', data.get('emitIf', ''))) for k in [k for k in data.keys() if k not in handled]: print(' XXXX UNHANDLED KEY {} in feature description'.format(k)) From df2975236dcf522cf9f70097ac6fbfa467439664 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 6 Nov 2018 11:23:45 +0100 Subject: [PATCH 0030/1322] CMake: Replace QT_FEATURE_shared with BUILD_SHARED_LIBS Change-Id: I7f3efde01a98cd6a25de661624afbf7eda2c57af Reviewed-by: Frederik Gladhorn --- configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.cmake b/configure.cmake index dc9fed82fe3..2a8bbd336f1 100644 --- a/configure.cmake +++ b/configure.cmake @@ -212,7 +212,7 @@ qt_feature("force_asserts" PUBLIC ) qt_feature("framework" PUBLIC LABEL "Build Apple Frameworks" - CONDITION APPLE AND QT_FEATURE_shared + CONDITION APPLE AND BUILD_SHARED_LIBS ) qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD") qt_feature("largefile" PUBLIC diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 0cd0f24e4d2..27a72202d26 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -643,6 +643,7 @@ def parseFeature(ctx, feature, data, cm_fh): 'enable_gdb_index': None, 'enable_new_dtags': None, 'force_debug_info': None, + 'framework': { 'condition': 'APPLE AND BUILD_SHARED_LIBS', }, 'gc_binaries': None, 'gcc-sysroot': None, 'gcov': None, From bebbb410301f388af1a85de30e6a05588c3ab4d0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 5 Nov 2018 14:18:57 +0100 Subject: [PATCH 0031/1322] CMake: Find librt Change-Id: Ibc39ba7a385146cd0428b78e12a793f0ddbfae91 Reviewed-by: Frederik Gladhorn --- cmake/FindWrapRt.cmake | 27 +++++++++++++++++++++++++++ src/corelib/CMakeLists.txt | 1 + src/corelib/configure.cmake | 4 +++- util/cmake/configurejson2cmake.py | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 cmake/FindWrapRt.cmake diff --git a/cmake/FindWrapRt.cmake b/cmake/FindWrapRt.cmake new file mode 100644 index 00000000000..221399b259a --- /dev/null +++ b/cmake/FindWrapRt.cmake @@ -0,0 +1,27 @@ +include(CheckCXXSourceCompiles) + +find_library(LIBRT rt) + +set(_libraries "${CMAKE_REQUIRED_LIBRARIES}") +if(LIBRT_FOUND) + list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBRT}") +endif() + +check_cxx_source_compiles(" +#include +#include + +int main(int argc, char *argv[]) { + timespec ts; clock_gettime(CLOCK_REALTIME, &ts); +}" HAVE_GETTIME) + +set(CMAKE_REQUIRED_LIBRARIES "${_libraries}") +unset(_libraries) + +add_library(WrapRt INTERFACE) +if (LIBRT_FOUND) + target_link_libraries(WrapRt INTERFACE "${LIBRT}") +endif() + +set(WrapRt_FOUND "${HAVE_GETTIME}") + diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index eaa2ab8654c..c56b0031370 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -231,6 +231,7 @@ add_qt_module(Core tools/qvsnprintf.cpp LIBRARIES WrapDoubleConversion + WrapRt tinycbor Threads::Threads ZLIB::ZLIB QtHarfBuzz PUBLIC_LIBRARIES Qt::Platform diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 7836577e5ce..a8acac8f812 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -18,6 +18,8 @@ find_package(Libsystemd) set_package_properties(Libsystemd PROPERTIES TYPE OPTIONAL) find_package(Atomic) set_package_properties(Atomic PROPERTIES TYPE OPTIONAL) +find_package(WrapRt) +set_package_properties(WrapRt PROPERTIES TYPE OPTIONAL) find_package(PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) @@ -340,7 +342,7 @@ closelog(); qt_feature("clock_gettime" PRIVATE LABEL "clock_gettime()" - CONDITION UNIX AND libs.librt OR FIXME + CONDITION UNIX AND WrapRt_FOUND ) qt_feature("clock_monotonic" PUBLIC LABEL "POSIX monotonic clock" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 27a72202d26..03902f1648b 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -67,6 +67,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'libpng': 'PNG', 'libpng': 'PNG', 'libproxy': 'libproxy', + 'librt': 'WrapRt', 'libudev': 'Libudev', 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), From e11522726bc7f05947e447ae96b85bc1e2d4685c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 5 Nov 2018 14:49:53 +0100 Subject: [PATCH 0032/1322] CMake: Add FindPPS and use it in src/corelib/configure.cmake Find the PPS library and use the result PPS_FOUND in configure.cmake where needed. Change-Id: I08d3ace421278dc0ae5c3128d4234e6bca906c05 Reviewed-by: Frederik Gladhorn --- cmake/FindPPS.cmake | 19 +++++++++++++++++++ src/corelib/CMakeLists.txt | 2 +- src/corelib/configure.cmake | 4 +++- util/cmake/configurejson2cmake.py | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 cmake/FindPPS.cmake diff --git a/cmake/FindPPS.cmake b/cmake/FindPPS.cmake new file mode 100644 index 00000000000..b1e418f227e --- /dev/null +++ b/cmake/FindPPS.cmake @@ -0,0 +1,19 @@ +# Find the PPS library + +# Will make the target PPS::PPS available when found. + +find_library(PPS_LIBRARY NAMES "pps") +find_path(PPS_INCLUDE_DIR NAMES "sys/pps.h" DOC "The PPS Include path") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PPS DEFAULT_MSG PPS_INCLUDE_DIR PPS_LIBRARY) + +mark_as_advanced(PPS_INCLUDE_DIR PPS_LIBRARY) + +if(PPS_FOUND) + add_library(__PPS IMPORTED) + target_link_libraries(__PPS INTERFACE ${PPS_LIBRARY}) + target_include_directories(__PPS INTERFACE ${PPS_INCLUDE_DIR}) + + add_library(PPS::PPS ALIAS __PPS) +endif() diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index c56b0031370..8c8c033859c 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -508,7 +508,7 @@ extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps kernel/qppsattributeprivate_p.h kernel/qppsobject.cpp kernel/qppsobject_p.h kernel/qppsobjectprivate_p.h - LIBRARIES pps + LIBRARIES PPS::PPS ) ## clock_gettime: diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index a8acac8f812..5770882bc8f 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -22,6 +22,8 @@ find_package(WrapRt) set_package_properties(WrapRt PROPERTIES TYPE OPTIONAL) find_package(PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) +find_package(PPS) +set_package_properties(PPS PROPERTIES TYPE OPTIONAL) #### Tests @@ -460,7 +462,7 @@ qt_feature("poll_select" PUBLIC PRIVATE qt_feature_definition("poll_select" "QT_NO_NATIVE_POLL") qt_feature("qqnx_pps" PRIVATE LABEL "PPS" - CONDITION libs.pps OR FIXME + CONDITION PPS_FOUND EMIT_IF QNX ) qt_feature("renameat2" PRIVATE diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 03902f1648b..e0335a0e527 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -73,6 +73,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), 'pcre2': ['PCRE2', 'REQUIRED'], 'posix_iconv': None, + 'pps': 'PPS', 'sun_iconv': None, 'udev': 'Libudev', 'vulkan': 'Vulkan', From 38f1a10b6f6deeee0871535fe7430ebd90f3a935 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 6 Nov 2018 14:20:19 +0100 Subject: [PATCH 0033/1322] CMake: Improve handling of the different kinds of iconv Improve conditions/enable/disable conditions for iconv related features. These are detected a bit different from what qmake does, so adapt to that. Change-Id: I7b3e4baf05dc324507f370d7f651a62f29e42a98 Reviewed-by: Frederik Gladhorn --- cmake/QtBaseConfigureTests.cmake | 4 +++- src/corelib/configure.cmake | 14 ++++++++++---- util/cmake/configurejson2cmake.py | 24 +++++++++++++++++++++--- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index d7f9788fc5d..b79a1e3839c 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -131,7 +131,9 @@ function(run_config_tests) target_link_libraries(Iconv PUBLIC iconv) endif() - run_config_test_sun_iconv() + if(NOT TEST_posix_iconv) + run_config_test_sun_iconv() + endif() run_config_test_architecture() run_linker_version_script_support() endfunction() diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 5770882bc8f..7436ced79ba 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -386,7 +386,7 @@ qt_feature("iconv" PUBLIC PRIVATE SECTION "Internationalization" LABEL "iconv" PURPOSE "Provides internationalization on Unix." - CONDITION NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( QT_FEATURE_posix_libiconv OR TEST_sun_iconv OR QT_FEATURE_gnu_libiconv ) + CONDITION NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( TEST_posix_iconv OR TEST_sun_iconv ) ) qt_feature_definition("iconv" "QT_NO_ICONV" NEGATE VALUE "1") qt_feature("posix_libiconv" PRIVATE @@ -395,11 +395,17 @@ qt_feature("posix_libiconv" PRIVATE ENABLE INPUT_iconv STREQUAL 'posix' DISABLE INPUT_iconv STREQUAL 'sun' OR INPUT_iconv STREQUAL 'gnu' OR INPUT_iconv STREQUAL 'no' ) +qt_feature("sun_libiconv" + LABEL "SUN iconv" + CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_sun_iconv + ENABLE TEST_sun_iconv + DISABLE NOT TEST_sun_iconv +) qt_feature("gnu_libiconv" PRIVATE LABEL "GNU iconv" - CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND NOT QT_FEATURE_posix_libiconv AND NOT TEST_sun_iconv AND libs.gnu_iconv OR FIXME - ENABLE INPUT_iconv STREQUAL 'gnu' - DISABLE INPUT_iconv STREQUAL 'posix' OR INPUT_iconv STREQUAL 'sun' OR INPUT_iconv STREQUAL 'no' + CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv AND NOT TEST_iconv_needlib + ENABLE TEST_posix_iconv AND NOT TEST_iconv_needlib + DISABLE NOT TEST_posix_iconv OR TEST_iconv_needlib ) qt_feature("icu" PRIVATE LABEL "ICU" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index e0335a0e527..5c137c394f0 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -274,7 +274,6 @@ def map_condition(condition): mapped_features = { "dlopen": "UNIX", 'gbm': 'gbm_FOUND', - "sun-libiconv": "TEST_sun_iconv", "system-xcb": "ON", "system-freetype": "ON", } @@ -645,12 +644,22 @@ def parseFeature(ctx, feature, data, cm_fh): 'enable_gdb_index': None, 'enable_new_dtags': None, 'force_debug_info': None, - 'framework': { 'condition': 'APPLE AND BUILD_SHARED_LIBS', }, + 'framework': { + 'condition': 'APPLE AND BUILD_SHARED_LIBS', + }, 'gc_binaries': None, 'gcc-sysroot': None, 'gcov': None, + 'gnu-libiconv': { + 'condition': 'NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv AND NOT TEST_iconv_needlib', + 'enable': 'TEST_posix_iconv AND NOT TEST_iconv_needlib', + 'disable': 'NOT TEST_posix_iconv OR TEST_iconv_needlib', + }, 'GNUmake': None, 'host-dbus': None, + 'iconv': { + 'condition': 'NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( TEST_posix_iconv OR TEST_sun_iconv )' + }, 'incredibuild_xge': None, 'ltcg': None, 'msvc_mp': None, @@ -658,6 +667,11 @@ def parseFeature(ctx, feature, data, cm_fh): 'optimize_size': None, 'pkg-config': None, 'posix_fallocate': None, # Only needed for sqlite, which we do not want to build + 'posix_libiconv': { + 'condition': 'NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv AND TEST_iconv_needlib', + 'enable': 'TEST_posix_iconv AND TEST_iconv_needlib', + 'disable': 'NOT TEST_posix_iconv OR NOT TEST_iconv_needlib', + }, 'precompile_header': None, 'profile': None, 'qmakeargs': None, @@ -680,7 +694,11 @@ def parseFeature(ctx, feature, data, cm_fh): 'static_runtime': None, 'stl': None, # Do we really need to test for this in 2018?! 'strip': None, - 'sun-libiconv': None, # internal feature but not referenced in our system + 'sun-libiconv': { + 'condition': 'NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_sun_iconv', + 'enable': 'TEST_sun_iconv', + 'disable': 'NOT TEST_sun_iconv', + }, 'system-doubleconversion': None, # No system libraries anymore! 'system-freetype': None, 'system-jpeg': None, From eb2ece3c59773f8948819349d6f86fc453967588 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 6 Nov 2018 14:58:26 +0100 Subject: [PATCH 0034/1322] CMake: Add FindSlog2 Add FindSlog2 and use it in src/corelib/configure.cmake. Change-Id: I7e6a696a49df568a41ed1224228ab608db2dbb0e Reviewed-by: Frederik Gladhorn --- cmake/FindSlog2.cmake | 19 +++++++++++++++++++ src/corelib/configure.cmake | 4 +++- util/cmake/configurejson2cmake.py | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 cmake/FindSlog2.cmake diff --git a/cmake/FindSlog2.cmake b/cmake/FindSlog2.cmake new file mode 100644 index 00000000000..8ff00e4157b --- /dev/null +++ b/cmake/FindSlog2.cmake @@ -0,0 +1,19 @@ +# Find the Slog2 library + +# Will make the target Slog2::Slog2 available when found. + +find_library(Slog2_LIBRARY NAMES "slog2") +find_path(Slog2_INCLUDE_DIR NAMES "sys/slog2.h" DOC "The Slog2 Include path") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Slog2 DEFAULT_MSG Slog2_INCLUDE_DIR Slog2_LIBRARY) + +mark_as_advanced(Slog2_INCLUDE_DIR Slog2_LIBRARY) + +if(Slog2_FOUND) + add_library(__Slog2 IMPORTED) + target_link_libraries(__Slog2 INTERFACE ${Slog2_LIBRARY}) + target_include_directories(__Slog2 INTERFACE ${Slog2_INCLUDE_DIR}) + + add_library(Slog2::Slog2 ALIAS __Slog2) +endif() diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 7436ced79ba..163a5980eca 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -24,6 +24,8 @@ find_package(PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) find_package(PPS) set_package_properties(PPS PROPERTIES TYPE OPTIONAL) +find_package(Slog2) +set_package_properties(Slog2 PROPERTIES TYPE OPTIONAL) #### Tests @@ -477,7 +479,7 @@ qt_feature("renameat2" PRIVATE ) qt_feature("slog2" PRIVATE LABEL "slog2" - CONDITION libs.slog2 OR FIXME + CONDITION Slog2_FOUND ) qt_feature("statx" PRIVATE LABEL "statx() in libc" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 5c137c394f0..a54a692fac5 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -74,6 +74,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'pcre2': ['PCRE2', 'REQUIRED'], 'posix_iconv': None, 'pps': 'PPS', + 'slog2': 'Slog2', 'sun_iconv': None, 'udev': 'Libudev', 'vulkan': 'Vulkan', From 3acebfe6eb9ff0c97ab0e79f9f0b35835a4df57a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 6 Nov 2018 15:06:25 +0100 Subject: [PATCH 0035/1322] CMake: Add support to find LTTng-ust CMake comes with a Find module for this, so use it in src/corelib/configure.cmake Change-Id: I8f4abcb32fb10513d67c3c959310eefaf7b56d3d Reviewed-by: Frederik Gladhorn --- src/corelib/configure.cmake | 4 +++- util/cmake/configurejson2cmake.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 163a5980eca..a30f8d1bca1 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -20,6 +20,8 @@ find_package(Atomic) set_package_properties(Atomic PROPERTIES TYPE OPTIONAL) find_package(WrapRt) set_package_properties(WrapRt PROPERTIES TYPE OPTIONAL) +find_package(LTTngUST) +set_package_properties(LTTngUST PROPERTIES TYPE OPTIONAL) find_package(PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) find_package(PPS) @@ -713,7 +715,7 @@ qt_feature("commandlineparser" PUBLIC qt_feature("lttng" PRIVATE LABEL "LTTNG" AUTODETECT OFF - CONDITION LINUX AND libs.lttng-ust OR FIXME + CONDITION LINUX AND LTTNGUST_FOUND ENABLE INPUT_trace STREQUAL 'lttng' OR ( INPUT_trace STREQUAL 'yes' AND LINUX ) DISABLE INPUT_trace STREQUAL 'etw' OR INPUT_trace STREQUAL 'no' ) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index a54a692fac5..ad80146b9f0 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -69,6 +69,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'libproxy': 'libproxy', 'librt': 'WrapRt', 'libudev': 'Libudev', + 'lttng-ust': LibraryMapping(package='LTTngUST', resultVariable="LTTNGUST"), 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), 'pcre2': ['PCRE2', 'REQUIRED'], From f37ce9ab84400a45752787b9e015a7919c8771bd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 14 Nov 2018 13:37:52 +0100 Subject: [PATCH 0036/1322] CMake: Add option to run cmake build tests Use "cmake -DBUILD_CMAKE_TESTING=ON" to enable running cmake build system tests with ctest. Change-Id: I0a32e2d1771c9bbb0df013d0d955a9b58b1d4b79 Reviewed-by: Frederik Gladhorn --- CMakeLists.txt | 3 +++ cmake/QtBaseCMakeTesting.cmake | 9 +++++++++ cmake/tests/CMakeLists.txt | 25 +++++++++++++++++++++++++ cmake/tests/features/CMakeLists.txt | 2 ++ cmake/tests/main.cpp | 1 + 5 files changed, 40 insertions(+) create mode 100644 cmake/QtBaseCMakeTesting.cmake create mode 100644 cmake/tests/CMakeLists.txt create mode 100644 cmake/tests/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e9b1293843e..622cc5e00bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,9 @@ include(FeatureSummary) ## QtBase specific configure tests: include(QtBaseConfigureTests) +## Build System tests: +include(QtBaseCMakeTesting) + ## Targets for global features, etc.: include(QtBaseGlobalTargets) diff --git a/cmake/QtBaseCMakeTesting.cmake b/cmake/QtBaseCMakeTesting.cmake new file mode 100644 index 00000000000..662ac8f4986 --- /dev/null +++ b/cmake/QtBaseCMakeTesting.cmake @@ -0,0 +1,9 @@ +## Test the cmake build system: +option(BUILD_CMAKE_TESTING "Build tests for the Qt build system" OFF) +mark_as_advanced(BUILD_CMAKE_TESTING) + +if(BUILD_CMAKE_TESTING) + add_subdirectory("${PROJECT_SOURCE_DIR}/cmake/tests") +endif() + + diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt new file mode 100644 index 00000000000..28568ce46f2 --- /dev/null +++ b/cmake/tests/CMakeLists.txt @@ -0,0 +1,25 @@ +# These macros are taken from the ECM: + +# a macro for tests that have a simple format where the name matches the +# directory and project +macro(add_test_variant NAME BASE COMMAND) + string(REPLACE "." "/" src_dir "${BASE}") + string(REPLACE "." "/" build_dir "${NAME}") + string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") + add_test("cmake_${NAME}" ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMAKE_CURRENT_SOURCE_DIR}/${src_dir}" + "${CMAKE_CURRENT_BINARY_DIR}/${build_dir}" + --build-two-config + --build-generator ${CMAKE_GENERATOR} + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + --build-project ${proj} + ${${NAME}_EXTRA_OPTIONS} + --test-command ${COMMAND} ${ARGN}) +endmacro() + +macro(add_test_macro NAME) + add_test_variant("${NAME}" "${NAME}" ${ARGN}) +endmacro() + +add_test_macro(features features) diff --git a/cmake/tests/features/CMakeLists.txt b/cmake/tests/features/CMakeLists.txt index 0208e3d890e..7b76a4529fe 100644 --- a/cmake/tests/features/CMakeLists.txt +++ b/cmake/tests/features/CMakeLists.txt @@ -40,3 +40,5 @@ include(QtPostProcess) ## Print a feature summary: feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) + +add_executable(features ../main.cpp) diff --git a/cmake/tests/main.cpp b/cmake/tests/main.cpp new file mode 100644 index 00000000000..a9b87389901 --- /dev/null +++ b/cmake/tests/main.cpp @@ -0,0 +1 @@ +int main(int argc, char** argv) { return 0; } From fac800ad1c5355e9002bf819ae06923a4edaf572 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 14 Nov 2018 14:24:34 +0100 Subject: [PATCH 0037/1322] CMake: Fix cmake test for features Features are now always defined (to OFF) when they are not emitted. Adapt the test for that. Change-Id: Id5f662f07fea15c22027b9b00d1b53a288b4a0dc Reviewed-by: Frederik Gladhorn --- cmake/QtFeature.cmake | 8 +++++--- cmake/tests/features/CMakeLists.txt | 2 +- cmake/tests/features/src/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 6330200fd17..2ebf7e86e6e 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -166,14 +166,16 @@ function(qt_feature_set_cache_value resultVar feature emit_if calculated label) # Initial setup: if (emit_if) set("FEATURE_${feature}" "${calculated}" CACHE BOOL "${label}") + set(result "${calculated}") + else() + set(result OFF) endif() - set(result "${calculated}") endif() set("${resultVar}" "${result}" PARENT_SCOPE) endfunction() -macro(qt_feature_set_value feature cache condition label) +macro(qt_feature_set_value feature cache emit_if condition label) set(result "${cache}") if (NOT (condition) AND (cache)) @@ -241,7 +243,7 @@ function(qt_evaluate_feature _feature) endif() qt_feature_set_cache_value(cache "${_feature}" "${emit_if}" "${result}" "${_arg_LABEL}") - qt_feature_set_value("${_feature}" "${cache}" "${condition}" "${_arg_LABEL}") + qt_feature_set_value("${_feature}" "${cache}" "${emit_if}" "${condition}" "${_arg_LABEL}") endfunction() function(qt_feature_definition _feature _name) diff --git a/cmake/tests/features/CMakeLists.txt b/cmake/tests/features/CMakeLists.txt index 7b76a4529fe..e255b209c9e 100644 --- a/cmake/tests/features/CMakeLists.txt +++ b/cmake/tests/features/CMakeLists.txt @@ -28,7 +28,7 @@ assert(QT_FEATURE_top_b STREQUAL "OFF") assert(QT_FEATURE_top_enabled STREQUAL "ON") assert(QT_FEATURE_top_disabled STREQUAL "OFF") assert(QT_FEATURE_top_disabled_enabled STREQUAL "OFF") -assert(NOT DEFINED QT_FEATURE_top_not_emitted) +assert(QT_FEATURE_top_not_emitted STREQUAL "OFF") ## Enable feature summary at the end of the configure run: include(FeatureSummary) diff --git a/cmake/tests/features/src/CMakeLists.txt b/cmake/tests/features/src/CMakeLists.txt index 1a31dbc8c5f..bfb02be07dc 100644 --- a/cmake/tests/features/src/CMakeLists.txt +++ b/cmake/tests/features/src/CMakeLists.txt @@ -4,4 +4,4 @@ assert(QT_FEATURE_top_b STREQUAL "OFF") assert(QT_FEATURE_top_enabled STREQUAL "ON") assert(QT_FEATURE_top_disabled STREQUAL "OFF") assert(QT_FEATURE_top_disabled_enabled STREQUAL "OFF") -assert(NOT DEFINED QT_FEATURE_top_not_emitted) +assert(QT_FEATURE_top_not_emitted STREQUAL "OFF") From bdb5e2a48ea206005eaa8305b7517b2843f2aba1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 8 Nov 2018 22:29:27 +0100 Subject: [PATCH 0038/1322] CMake: Simplify qt_make_output_file Simplify qt_make_output_file and add a simple test for it. Change-Id: I87694291cd877545ade5d9c42d1424d7b3b7b567 Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 43 ++++++++----------- cmake/tests/CMakeLists.txt | 1 + .../tests/qt_make_output_file/CMakeLists.txt | 24 +++++++++++ 3 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 cmake/tests/qt_make_output_file/CMakeLists.txt diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ef4caa27de2..a8ca77b64a0 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -239,7 +239,7 @@ function(qt_internal_wrap_cpp result) set(file_extension "moc") endif() - qt_make_output_file("${it}" "${file_prefix}" "${file_extension}" outfile) + qt_make_output_file("${it}" "${file_prefix}" ".${file_extension}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" outfile) qt_create_moc_command("${it}" "${outfile}" "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}") set_source_files_properties(${outfile} PROPERTIES HEADER_FILE_ONLY ${_arg_HEADER_FILE_ONLY}) list(APPEND wrapped_files "${outfile}") @@ -339,7 +339,7 @@ function(qt_extract_qrc_dependencies resourceFile _out_depends _rc_depends) # Since this cmake function is doing the dependency scanning for these files, # let's make a configured file and add it as a dependency so cmake is run # again when dependencies need to be recomputed. - qt_make_output_file("${infile}" "" "qrc.depends" out_depends) + qt_make_output_file("${infile}" "" ".qrc.depends" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" out_depends) configure_file("${infile}" "${out_depends}" COPYONLY) else() # The .qrc file does not exist (yet). Let's add a dependency and hope @@ -958,32 +958,27 @@ endfunction() # From Qt5CoreMacros # Function used to create the names of output files preserving relative dirs -function(qt_make_output_file infile prefix ext result) - string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) - string(LENGTH ${infile} _infileLength) - set(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR}) - if(_infileLength GREATER _binlength) - string(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile) - if(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") - file(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile}) - else() - file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) - endif() - else() - file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) +function(qt_make_output_file infile prefix suffix source_dir binary_dir result) + get_filename_component(outfilename "${infile}" NAME_WE) + + set(base_dir "${source_dir}") + string(FIND "${infile}" "${binary_dir}/" in_binary) + if (in_binary EQUAL 0) + set(base_dir "${binary_dir}") endif() - if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path - set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") - endif() - set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") - string(REPLACE ".." "__" _outfile "${_outfile}") - get_filename_component(outpath "${_outfile}" PATH) - get_filename_component(_outfile "${_outfile}" NAME_WE) + + get_filename_component(abs_infile "${infile}" ABSOLUTE BASE_DIR "${base_dir}") + file(RELATIVE_PATH rel_infile "${base_dir}" "${abs_infile}") + string(REPLACE "../" "__/" mapped_infile "${rel_infile}") + + get_filename_component(abs_mapped_infile "${mapped_infile}" ABSOLUTE BASE_DIR "${binary_dir}") + get_filename_component(outpath "${abs_mapped_infile}" PATH) + file(MAKE_DIRECTORY "${outpath}") - set(full_outfile "${outpath}/${prefix}${_outfile}.${ext}") - set("${result}" "${full_outfile}" PARENT_SCOPE) + set("${result}" "${outpath}/${prefix}${outfilename}${suffix}" PARENT_SCOPE) endfunction() + macro(qt_get_moc_flags _moc_flags) set(${_moc_flags}) get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index 28568ce46f2..c7f7baafe18 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -23,3 +23,4 @@ macro(add_test_macro NAME) endmacro() add_test_macro(features features) +add_test_macro(qt_make_output_file qt_make_output_file) diff --git a/cmake/tests/qt_make_output_file/CMakeLists.txt b/cmake/tests/qt_make_output_file/CMakeLists.txt new file mode 100644 index 00000000000..d66579f514b --- /dev/null +++ b/cmake/tests/qt_make_output_file/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(QtMakeOutputFileTest + VERSION 1.0.0 + DESCRIPTION "qt_make_output_file test" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") + +include(QtBuild) + +qt_make_output_file("foo.cpp" "" ".mapped" "/tmp/foo" "/tmp/bar" outfile) +assert(outfile STREQUAL "/tmp/bar/foo.mapped") + +qt_make_output_file("../foo.cpp" "prefix_" ".cpp" "/tmp/foo" "/tmp/bar" outfile) +assert(outfile STREQUAL "/tmp/bar/__/prefix_foo.cpp") + +qt_make_output_file("/tmp/bar/foo.cpp" "prefix_" ".cpp" "/tmp/foo" "/tmp/bar" outfile) +assert(outfile STREQUAL "/tmp/bar/prefix_foo.cpp") + +add_executable(qt_make_output_file ../main.cpp) From c68e5fc59ba8f0fd8b782a37df20ab9b7d7ecafa Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 22 Nov 2018 11:35:17 +0100 Subject: [PATCH 0039/1322] CMake: Add macro to generate cmake build-only tests In addition to cmake tests that run cmake, build and then run the tests of that project, also add a macro for tests that only run cmake. Use this new kind of test for the existing tests. Change-Id: I465600974ed4114e724988b309404ccd3db2e0cb Reviewed-by: Frederik Gladhorn --- cmake/tests/CMakeLists.txt | 58 +++++++++++++------ cmake/tests/features/CMakeLists.txt | 2 - .../tests/qt_make_output_file/CMakeLists.txt | 2 - 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index c7f7baafe18..6b53c9703d8 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -1,26 +1,48 @@ -# These macros are taken from the ECM: +# These macros are inspired by ECM: # a macro for tests that have a simple format where the name matches the # directory and project -macro(add_test_variant NAME BASE COMMAND) - string(REPLACE "." "/" src_dir "${BASE}") - string(REPLACE "." "/" build_dir "${NAME}") - string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") - add_test("cmake_${NAME}" ${CMAKE_CTEST_COMMAND} - --build-and-test + +# The following macros will produce tests that generate the build +# system for the test project, build it and then run its tests. +macro(add_cmake_test_generate_build_run_variant name base command) + string(REPLACE "." "/" src_dir "${base}") + string(REPLACE "." "/" build_dir "${name}") + string(REGEX REPLACE "[^.]*\\." "" proj "${name}") + add_test(NAME "cmake_${name}" + COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMAKE_CURRENT_SOURCE_DIR}/${src_dir}" + "${CMAKE_CURRENT_BINARY_DIR}/${build_dir}" + --build-two-config + --build-generator ${CMAKE_GENERATOR} + --build-makeprogram ${CMAKE_MAKE_PROGRAM} + --build-project ${proj} + ${${name}_EXTRA_OPTIONS} + --test-command ${command} ${ARGN}) +endmacro() + +macro(add_cmake_test_generate_build_run name) + add_cmake_test_generate_build_run_variant("${name}" "${name}" ${ARGN}) +endmacro() + +# The following macros will produce tests that just run cmake +# to generate the build system for the test project. +macro(add_cmake_test_generate_variant name base) + string(REPLACE "." "/" src_dir "${base}") + string(REPLACE "." "/" build_dir "${name}") + file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${build_dir}") + add_test(NAME "cmake_${name}" + COMMAND "${CMAKE_COMMAND}" "-G${CMAKE_GENERATOR}" + "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}" + ${${name}_EXTRA_OPTIONS} "${CMAKE_CURRENT_SOURCE_DIR}/${src_dir}" - "${CMAKE_CURRENT_BINARY_DIR}/${build_dir}" - --build-two-config - --build-generator ${CMAKE_GENERATOR} - --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-project ${proj} - ${${NAME}_EXTRA_OPTIONS} - --test-command ${COMMAND} ${ARGN}) + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${build_dir}") endmacro() -macro(add_test_macro NAME) - add_test_variant("${NAME}" "${NAME}" ${ARGN}) +macro(add_cmake_test_generate name) + add_cmake_test_generate_variant("${name}" "${name}") endmacro() -add_test_macro(features features) -add_test_macro(qt_make_output_file qt_make_output_file) +add_cmake_test_generate(features) +add_cmake_test_generate(qt_make_output_file) diff --git a/cmake/tests/features/CMakeLists.txt b/cmake/tests/features/CMakeLists.txt index e255b209c9e..3cda8ebe260 100644 --- a/cmake/tests/features/CMakeLists.txt +++ b/cmake/tests/features/CMakeLists.txt @@ -40,5 +40,3 @@ include(QtPostProcess) ## Print a feature summary: feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) - -add_executable(features ../main.cpp) diff --git a/cmake/tests/qt_make_output_file/CMakeLists.txt b/cmake/tests/qt_make_output_file/CMakeLists.txt index d66579f514b..36209094944 100644 --- a/cmake/tests/qt_make_output_file/CMakeLists.txt +++ b/cmake/tests/qt_make_output_file/CMakeLists.txt @@ -20,5 +20,3 @@ assert(outfile STREQUAL "/tmp/bar/__/prefix_foo.cpp") qt_make_output_file("/tmp/bar/foo.cpp" "prefix_" ".cpp" "/tmp/foo" "/tmp/bar" outfile) assert(outfile STREQUAL "/tmp/bar/prefix_foo.cpp") - -add_executable(qt_make_output_file ../main.cpp) From f4dc3dcacb61694915f45a0a0c47c85c21580d40 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 14 Nov 2018 14:57:48 +0100 Subject: [PATCH 0040/1322] CMake: Add test for uic handling Add a test for uic handling and make it pass. Change-Id: I7e11f9f1fba0e40c748e3590a0d0cbb72c9ebc28 Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 36 ++++++++++------------- cmake/tests/CMakeLists.txt | 1 + cmake/tests/empty.cpp | 0 cmake/tests/test.cmake | 50 ++++++++++++++++++++++++++++++++ cmake/tests/uic/CMakeLists.txt | 31 ++++++++++++++++++++ cmake/tests/uic/dialog/dialog.ui | 0 cmake/tests/uic/window.ui | 0 7 files changed, 98 insertions(+), 20 deletions(-) create mode 100644 cmake/tests/empty.cpp create mode 100644 cmake/tests/test.cmake create mode 100644 cmake/tests/uic/CMakeLists.txt create mode 100644 cmake/tests/uic/dialog/dialog.ui create mode 100644 cmake/tests/uic/window.ui diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a8ca77b64a0..771d04f3a77 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -300,20 +300,23 @@ endfunction() # Any sources with the .ui extension are passed on to uic and the generated output # is added to the target sources. function(qt_internal_autouic target) - if ("x${ARGN}" STREQUAL "x") - return() - endif() + set(outfiles "") - set(_ui_files "") + get_target_property(source_dir "${target}" SOURCE_DIR) + get_target_property(binary_dir "${target}" BINARY_DIR) - foreach(s ${ARGN}) - get_filename_component(ext "${s}" EXT) + foreach(infile ${ARGN}) + get_filename_component(ext "${infile}" EXT) if("${ext}" STREQUAL ".ui") - qt_create_uic_command("${s}" _ui_file) - list(APPEND _ui_files "${_ui_file}") + qt_make_output_file("${infile}" "ui_" ".h" "${source_dir}" "${binary_dir}" outfile) + qt_create_uic_command("${infile}" "${source_dir}" "${outfile}") + list(APPEND outfiles "${outfile}") + + get_filename_component(outfile_path "${outfile}" PATH) + target_include_directories("${target}" PRIVATE "${outfile_path}") endif() endforeach() - target_sources("${target}" PRIVATE "${_ui_files}") + target_sources("${target}" PRIVATE "${outfiles}") endfunction() @@ -1055,20 +1058,13 @@ endfunction() # helper to set up a uic rule -function(qt_create_uic_command infile _result) - # Pass the parameters in a file. Set the working directory to - # be that containing the parameters file and reference it by - # just the file name. This is necessary because the moc tool on - # MinGW builds does not seem to handle spaces in the path to the - # file given with the @ syntax. - get_filename_component(_uic_basename "${infile}" NAME_WE) - set(outfile "ui_${_uic_basename}.h") +function(qt_create_uic_command infile source_dir outfile) add_custom_command(OUTPUT "${outfile}" - COMMAND "Qt::uic" "${CMAKE_CURRENT_SOURCE_DIR}/${infile}" -o "${CMAKE_CURRENT_BINARY_DIR}/${outfile}" + COMMAND "Qt::uic" "${infile}" -o "${outfile}" DEPENDS "${infile}" COMMENT "Running UIC on ${infile}." - VERBATIM) - set(${_result} "${CMAKE_CURRENT_BINARY_DIR}/${outfile}" PARENT_SCOPE) + WORKING_DIRECTORY "${source_dir}" VERBATIM) + set_source_files_properties("${outfile}" PROPERTIES HEADER_FILE_ONLY ON) endfunction() diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index 6b53c9703d8..dd268bf254d 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -46,3 +46,4 @@ endmacro() add_cmake_test_generate(features) add_cmake_test_generate(qt_make_output_file) +add_cmake_test_generate(uic) diff --git a/cmake/tests/empty.cpp b/cmake/tests/empty.cpp new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cmake/tests/test.cmake b/cmake/tests/test.cmake new file mode 100644 index 00000000000..8c11b3a42ed --- /dev/null +++ b/cmake/tests/test.cmake @@ -0,0 +1,50 @@ +# FAKE moc-ing: +set(QT_MOCSCANNER /usr/bin/true) + +# Fake mocscanner run. +# The files passed in after MOC will be reported to be in need of moc-ing, +# but will not be built. +# The files passed in after MOC_AND_BUILD will be reported to be in need +# of moc-ing and should also be built by the target. +function(fake_moc_results) + cmake_parse_arguments(arg "" "" "INCLUDED;BUILT") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" "${arg_INCLUDED}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" "${arg_BUILT}") +endfunction() + +# Test whether a target has a file listed in its sources. +# Tests with the BUILD flag set will require this file to be built, +# while those without will require the file to not be built by +# the target. +function(test_source_file target file) + cmake_parse_arguments(arg "BUILD" "" "" ${ARGN}) + + get_target_property(sources "${target}" SOURCES) + list(FIND sources "${file}" source_pos) + assert(NOT source_pos STREQUAL "-1") + + get_source_file_property(prop "${file}" HEADER_FILE_ONLY) + if (arg_BUILD) + assert(NOT prop) + else() + assert(prop) + endif() +endfunction() + +# Test whether or not a target uses a header path +# The test passes when the path is in the list of include directories. +# Passing 'UNKNOWN' to this function reverses the test result. +function(test_include_directory target path) + cmake_parse_arguments(arg "UNKNOWN" "" "" ${ARGN}) + get_target_property(includes "${target}" INCLUDE_DIRECTORIES) + list(FIND includes "${path}" include_pos) + if(arg_UNKNOWN) + assert(include_pos STREQUAL "-1") + else() + assert(NOT include_pos STREQUAL "-1") + endif() +endfunction() + +# Add Core and Qt::Core libraries: +add_library(Core SHARED "${CMAKE_CURRENT_LIST_DIR}/empty.cpp") +add_library(Qt::Core ALIAS Core) diff --git a/cmake/tests/uic/CMakeLists.txt b/cmake/tests/uic/CMakeLists.txt new file mode 100644 index 00000000000..b8455821ded --- /dev/null +++ b/cmake/tests/uic/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(UicTest + VERSION 1.0.0 + DESCRIPTION "Uic test" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") + +## Qt specific setup common for all modules: +include(QtSetup) + +include(../test.cmake) + +fake_moc_results() +add_qt_executable(test_executable + SOURCES + ../main.cpp + window.ui +) + +fake_moc_results() +extend_target(test_executable SOURCES dialog/dialog.ui) + +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/ui_window.h") +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog/ui_dialog.h") + +test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog") diff --git a/cmake/tests/uic/dialog/dialog.ui b/cmake/tests/uic/dialog/dialog.ui new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cmake/tests/uic/window.ui b/cmake/tests/uic/window.ui new file mode 100644 index 00000000000..e69de29bb2d From 13e1c93e370551a7398d8e819b8ec4710def0151 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 15 Nov 2018 12:01:22 +0100 Subject: [PATCH 0041/1322] CMake: Add test for QRC and make it pass Add a test for QRC file handling in cmake and fix the qrc file handling to handle qrc files in subfolders properly. Change-Id: Iff4224e59e7ee1badacce5fc00dbf68aef69bffe Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 44 ++++++++++++++++--------------- cmake/tests/CMakeLists.txt | 1 + cmake/tests/qrc/CMakeLists.txt | 31 ++++++++++++++++++++++ cmake/tests/qrc/dialog/dialog.qrc | 0 cmake/tests/qrc/qrc.qrc | 0 5 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 cmake/tests/qrc/CMakeLists.txt create mode 100644 cmake/tests/qrc/dialog/dialog.qrc create mode 100644 cmake/tests/qrc/qrc.qrc diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 771d04f3a77..c453e413341 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -358,21 +358,18 @@ endfunction() # This function creates the necessary rule to call rcc on the given # resource file and stores the name of the to-be generated C++ source # file (created by rcc) in the outCppFile variable. -function(qt_create_rcc_command resourceFile outCppFile) - get_filename_component(outfilename "${resourceFile}" NAME_WE) - get_filename_component(infile "${resourceFile}" ABSOLUTE) - set(generatedCppFile "${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cpp") - - qt_extract_qrc_dependencies("${infile}" _out_depends _rc_depends) +function(qt_create_rcc_command resourceFile source_dir binary_dir outfile) + qt_extract_qrc_dependencies("${infile}" out_depends rc_depends "${source_dir}" "${binary_dir}") set_source_files_properties("${infile}" PROPERTIES SKIP_AUTORCC ON) - add_custom_command(OUTPUT "${generatedCppFile}" - COMMAND "Qt::rcc" --name "${outfilename}" --output "${generatedCppFile}" "${infile}" + get_filename_component(outfilename "${resourceFile}" NAME_WE) + add_custom_command(OUTPUT "${outfile}" + COMMAND "Qt::rcc" --name "${outfilename}" --output "${outfile}" "${resourceFile}" MAIN_DEPENDENCY "${infile}" - DEPENDS "${_rc_depends}" "${_out_depends}" VERBATIM) - set_source_files_properties("${generatedCppFile}" PROPERTIES SKIP_AUTOMOC ON) - set_source_files_properties("${generatedCppFile}" PROPERTIES SKIP_AUTOUIC ON) - set("${outCppFile}" "${generatedCppFile}" PARENT_SCOPE) + DEPENDS "${rc_depends}" "${out_depends}" + WORKING_DIRECTORY "${source_dir}" VERBATIM) + set_source_files_properties("${outfile}" PROPERTIES SKIP_AUTOMOC ON) + set_source_files_properties("${outfile}" PROPERTIES SKIP_AUTOUIC ON) endfunction() @@ -380,20 +377,25 @@ endfunction() # Any sources ending with the .qrc extension are treated as Qt resources and rules # to call rcc are generated. The source files rcc generates are added to the target. function(qt_internal_autorcc target) - if ("x${ARGN}" STREQUAL "x") - return() - endif() + get_target_property(binary_dir "${target}" BINARY_DIR) + get_target_property(source_dir "${target}" SOURCE_DIR) - set(_qrc_cpp_files "") + set(qrc_outfiles "") - foreach(s ${ARGN}) - get_filename_component(ext "${s}" EXT) + foreach(infile ${ARGN}) + get_filename_component(ext "${infile}" EXT) if("${ext}" STREQUAL ".qrc") - qt_create_rcc_command("${s}" _qrc_cpp_file) - list(APPEND _qrc_cpp_files "${_qrc_cpp_file}") + qt_make_output_file("${infile}" "qrc_" ".cpp" "${source_dir}" "${binary_dir}" outfile) + list(FIND all_sources "${outfile}" known_result) + if (known_result GREATER -1) + continue() + endif() + + qt_create_rcc_command("${infile}" "${source_dir}" "${binary_dir}" "${outfile}") + list(APPEND qrc_outfiles "${outfile}") endif() endforeach() - target_sources("${target}" PRIVATE "${_qrc_cpp_files}") + target_sources("${target}" PRIVATE "${qrc_outfiles}") endfunction() diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index dd268bf254d..3f51c240255 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -45,5 +45,6 @@ macro(add_cmake_test_generate name) endmacro() add_cmake_test_generate(features) +add_cmake_test_generate(qrc) add_cmake_test_generate(qt_make_output_file) add_cmake_test_generate(uic) diff --git a/cmake/tests/qrc/CMakeLists.txt b/cmake/tests/qrc/CMakeLists.txt new file mode 100644 index 00000000000..fc283903008 --- /dev/null +++ b/cmake/tests/qrc/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(QrcTest + VERSION 1.0.0 + DESCRIPTION "Qrc test" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") + +## Qt specific setup common for all modules: +include(QtSetup) + +include(../test.cmake) + +fake_moc_results() +add_qt_executable(test_executable + SOURCES + ../main.cpp + qrc.qrc +) + +fake_moc_results() +extend_target(test_executable SOURCES dialog/dialog.qrc) + +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/qrc_qrc.cpp" BUILD) +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog/qrc_dialog.cpp" BUILD) + +test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog" UNKNOWN) diff --git a/cmake/tests/qrc/dialog/dialog.qrc b/cmake/tests/qrc/dialog/dialog.qrc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cmake/tests/qrc/qrc.qrc b/cmake/tests/qrc/qrc.qrc new file mode 100644 index 00000000000..e69de29bb2d From 24fe9211617ad1f98c69c2702e2b10412c7a55d7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 15 Nov 2018 14:21:17 +0100 Subject: [PATCH 0042/1322] CMake: Add simple test for moc handling and fix the implementation Add a simple test for moc-file handling and fix the implementation to make the test pass. Change-Id: I34e8d65a5e01a6f557d3a3d8cb262fd147ad78e4 Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 103 ++++++++++++++------------------- cmake/tests/CMakeLists.txt | 1 + cmake/tests/moc/CMakeLists.txt | 34 +++++++++++ cmake/tests/moc/foo.cpp | 0 cmake/tests/moc/sub/bar.h | 0 cmake/tests/moc/sub2/foobar.h | 0 cmake/tests/test.cmake | 10 +++- 7 files changed, 86 insertions(+), 62 deletions(-) create mode 100644 cmake/tests/moc/CMakeLists.txt create mode 100644 cmake/tests/moc/foo.cpp create mode 100644 cmake/tests/moc/sub/bar.h create mode 100644 cmake/tests/moc/sub2/foobar.h diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c453e413341..ee910155dd6 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -215,38 +215,43 @@ function(qt_internal_add_linker_version_script target) endfunction() # Generates the necessary rules to run moc on the sources specified after the MOC parameter. -# The resulting moc files are returned in the variable specified by the result parameter. -function(qt_internal_wrap_cpp result) +# The resulting moc files are added to the target. +function(qt_internal_wrap_cpp target) # get include dirs qt_get_moc_flags(moc_flags) - qt_parse_all_arguments(_arg "qt_internal_wrap_cpp" "" "TARGET;HEADER_FILE_ONLY" "OPTIONS;DEPENDS;MOC" ${ARGN}) + qt_parse_all_arguments(arg "qt_internal_wrap_cpp" "" "HEADER_FILE_ONLY" "OPTIONS;DEPENDS;MOC" ${ARGN}) - set(moc_files ${_arg_MOC}) - set(moc_options ${_arg_OPTIONS}) - set(moc_target ${_arg_TARGET}) - set(moc_depends ${_arg_DEPENDS}) - set(wrapped_files "") + set(outfiles) - foreach(it ${moc_files}) - get_filename_component(it ${it} ABSOLUTE) + get_target_property(binary_dir "${target}" BINARY_DIR) + get_target_property(source_dir "${target}" SOURCE_DIR) + + foreach(it ${arg_MOC}) get_filename_component(moc_file_extension ${it} EXT) - if(${moc_file_extension} STREQUAL ".h") + if("x${moc_file_extension}" STREQUAL "x.h") set(file_prefix "moc_") - set(file_extension "cpp") + set(file_extension ".cpp") else() set(file_prefix "") - set(file_extension "moc") + set(file_extension ".moc") endif() - qt_make_output_file("${it}" "${file_prefix}" ".${file_extension}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" outfile) - qt_create_moc_command("${it}" "${outfile}" "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}") - set_source_files_properties(${outfile} PROPERTIES HEADER_FILE_ONLY ${_arg_HEADER_FILE_ONLY}) - list(APPEND wrapped_files "${outfile}") + qt_make_output_file("${it}" "${file_prefix}" "${file_extension}" "${source_dir}" "${binary_dir}" outfile) + + qt_create_moc_command("${target}" "${source_dir}" "${it}" "${outfile}" "${moc_flags}" "${arg_OPTIONS}" "${arg_DEPENDS}") + set_source_files_properties("${outfile}" PROPERTIES HEADER_FILE_ONLY ${arg_HEADER_FILE_ONLY}) + if (arg_HEADER_FILE_ONLY) + get_filename_component(directory "${outfile}" DIRECTORY) + target_include_directories("${target}" PRIVATE "${directory}") + endif() + + list(APPEND outfiles "${outfile}") endforeach() - set("${result}" ${wrapped_files} PARENT_SCOPE) + target_sources("${target}" PRIVATE "${outfiles}") endfunction() + function(_qt_module_name name result) set("${result}" "Qt${name}" PARENT_SCOPE) endfunction() @@ -284,15 +289,8 @@ function(qt_internal_automoc target) file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt") file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt") - qt_internal_wrap_cpp(included_mocs TARGET "${target}" MOC ${moc_files_included} HEADER_FILE_ONLY ON) - qt_internal_wrap_cpp(moc_and_build_sources TARGET "${target}" MOC ${moc_files_to_build} HEADER_FILE_ONLY OFF) - - target_sources("${target}" PRIVATE ${moc_and_build_sources} ${included_mocs}) - - foreach(generated_source ${included_mocs}) - get_filename_component(directory "${generated_source}" DIRECTORY) - target_include_directories("${target}" PRIVATE "${directory}") - endforeach() + qt_internal_wrap_cpp("${target}" MOC ${moc_files_included} HEADER_FILE_ONLY ON) + qt_internal_wrap_cpp("${target}" MOC ${moc_files_to_build} HEADER_FILE_ONLY OFF) endfunction() @@ -980,7 +978,8 @@ function(qt_make_output_file infile prefix suffix source_dir binary_dir result) get_filename_component(outpath "${abs_mapped_infile}" PATH) file(MAKE_DIRECTORY "${outpath}") - set("${result}" "${outpath}/${prefix}${outfilename}${suffix}" PARENT_SCOPE) + set(_result "${outpath}/${prefix}${outfilename}${suffix}") + set("${result}" "${_result}" PARENT_SCOPE) endfunction() @@ -1016,46 +1015,32 @@ endmacro() # helper to set up a moc rule -function(qt_create_moc_command infile outfile moc_flags moc_options moc_target moc_depends) +function(qt_create_moc_command target source_dir infile outfile moc_flags moc_options moc_depends) # Pass the parameters in a file. Set the working directory to # be that containing the parameters file and reference it by # just the file name. This is necessary because the moc tool on # MinGW builds does not seem to handle spaces in the path to the # file given with the @ syntax. - get_filename_component(_moc_outfile_name "${outfile}" NAME) - get_filename_component(_moc_outfile_dir "${outfile}" PATH) - if(_moc_outfile_dir) - set(_moc_working_dir WORKING_DIRECTORY "${_moc_outfile_dir}") - endif() - set (_moc_parameters_file "${outfile}_parameters") - set (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") - string (REPLACE ";" "\n" _moc_parameters "${_moc_parameters}") + set (moc_parameters_file "${outfile}_parameters") + set (moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") + string (REPLACE ";" "\n" moc_parameters "${moc_parameters}") - if(moc_target) - set(_moc_parameters_file "${_moc_parameters_file}$<$>:_$>") - set(targetincludes "$") - set(targetdefines "$") + set(moc_parameters_file "${moc_parameters_file}$<$>:_$>") + set(targetincludes "$") + set(targetdefines "$") + set(targetincludes "$<$:-I$\n>") + set(targetdefines "$<$:-D$\n>") - set(targetincludes "$<$:-I$\n>") - set(targetdefines "$<$:-D$\n>") + file (GENERATE + OUTPUT "${moc_parameters_file}" + CONTENT "${targetdefines}${targetincludes}${moc_parameters}\n" + ) - file (GENERATE - OUTPUT "${_moc_parameters_file}" - CONTENT "${targetdefines}${targetincludes}${_moc_parameters}\n" - ) - - set(targetincludes) - set(targetdefines) - else() - file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n") - endif() - - set(_moc_extra_parameters_file @${_moc_parameters_file}) + set(moc_extra_parameters_file @${moc_parameters_file}) add_custom_command(OUTPUT "${outfile}" - COMMAND "Qt::moc" "${_moc_extra_parameters_file}" + COMMAND "Qt::moc" "${moc_extra_parameters_file}" DEPENDS "${infile}" ${moc_depends} - ${_moc_working_dir} - VERBATIM) + WORKING_DIRECTORY "${source_dir}" VERBATIM) endfunction() @@ -1097,7 +1082,7 @@ function(qt_create_qdbusxml2cpp_command target infile) VERBATIM) # Moc the header: - qt_internal_wrap_cpp(moc_sources TARGET "${target}" MOC "${header_file}" HEADER_FILE_ONLY OFF) + qt_internal_wrap_cpp("${target}" MOC "${header_file}" HEADER_FILE_ONLY OFF) target_sources("${target}" PRIVATE "${header_file}" "${source_file}" "${moc_sources}") endfunction() diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index 3f51c240255..44aacb7b078 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -45,6 +45,7 @@ macro(add_cmake_test_generate name) endmacro() add_cmake_test_generate(features) +add_cmake_test_generate(moc) add_cmake_test_generate(qrc) add_cmake_test_generate(qt_make_output_file) add_cmake_test_generate(uic) diff --git a/cmake/tests/moc/CMakeLists.txt b/cmake/tests/moc/CMakeLists.txt new file mode 100644 index 00000000000..297b1ac17d4 --- /dev/null +++ b/cmake/tests/moc/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.12.0) + +project(MocTest + VERSION 1.0.0 + DESCRIPTION "Moc test" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX +) + +## Add some paths to check for cmake modules: +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") + +## Qt specific setup common for all modules: +include(QtSetup) + +include(../test.cmake) + +fake_moc_results(MOC foo.cpp sub2/foobar.h MOC_AND_BUILD main.cpp sub/bar.h) +add_qt_executable(test_executable + SOURCES + ../main.cpp + sub/bar.h + sub2/foobar.h + foo.cpp +) + +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/main.moc" BUILD) +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub/moc_bar.cpp" BUILD) +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub2/moc_foobar.cpp") +test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/foo.moc") + +test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub" UNKNOWN) +test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub2") + diff --git a/cmake/tests/moc/foo.cpp b/cmake/tests/moc/foo.cpp new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cmake/tests/moc/sub/bar.h b/cmake/tests/moc/sub/bar.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cmake/tests/moc/sub2/foobar.h b/cmake/tests/moc/sub2/foobar.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cmake/tests/test.cmake b/cmake/tests/test.cmake index 8c11b3a42ed..099f490c942 100644 --- a/cmake/tests/test.cmake +++ b/cmake/tests/test.cmake @@ -7,9 +7,13 @@ set(QT_MOCSCANNER /usr/bin/true) # The files passed in after MOC_AND_BUILD will be reported to be in need # of moc-ing and should also be built by the target. function(fake_moc_results) - cmake_parse_arguments(arg "" "" "INCLUDED;BUILT") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" "${arg_INCLUDED}") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" "${arg_BUILT}") + cmake_parse_arguments(arg "" "" "MOC;MOC_AND_BUILD" ${ARGN}) + + string(REPLACE ";" "\n" arg_MOC "${arg_MOC}") + string(REPLACE ";" "\n" arg_MOC_AND_BUILD "${arg_MOC_AND_BUILD}") + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" "${arg_MOC}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" "${arg_MOC_AND_BUILD}") endfunction() # Test whether a target has a file listed in its sources. From 74e927855385d46d53ce13460d4d72ad605b1dae Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 8 Nov 2018 22:29:54 +0100 Subject: [PATCH 0043/1322] CMake: Simplify registration of known Qt targets Change-Id: Ibd7b5f628c0a1a3087bdfebb0c35242b42c5e938 Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ee910155dd6..0081f064ecc 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -67,9 +67,12 @@ set(QT_PLATFORM_DEFINITION_DIR ${QT_DEFAULT_PLATFORM_DEFINITION_DIR} CACHE PATH "Path to directory that contains qplatformdefs.h") set(QT_NAMESPACE "" CACHE STRING "Qt Namespace") -# Reset: -set(KNOWN_QT_MODULES "" CACHE INTERNAL "Known Qt modules" FORCE) +macro(_set_known_qt_modules) + set(KNOWN_QT_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) +endmacro() +# Reset: +_set_known_qt_modules("") # For adjusting variables when running tests, we need to know what # the correct variable is for separating entries in PATH-alike @@ -531,8 +534,7 @@ function(add_qt_module name) string(TOUPPER "${name}" name_upper) string(TOLOWER "${name}" name_lower) - set(known_modules "${KNOWN_QT_MODULES}" "${target}") - set(KNOWN_QT_MODULES ${known_modules} CACHE INTERNAL "Modules that are built." FORCE) + _set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") ### Define Targets: if(${_arg_STATIC}) From a2da0175cd29712a699edb1d4ab8a1d30e019821 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 8 Nov 2018 22:29:55 +0100 Subject: [PATCH 0044/1322] CMake: Do less feature-pushing Do not try to push features up into the parent scope if none were added. This avoids a lot of iterations over all defined variables. Change-Id: Idb9a4c86643c0ca773584a05b3a0590cfab7514d Reviewed-by: Mikhail Svetkin Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0081f064ecc..788d6d614b3 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -440,6 +440,7 @@ function(extend_target target) endforeach() qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}") + set(must_push_features OFF) foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") if (${CMAKE_MATCH_COUNT} EQUAL 3) @@ -458,6 +459,8 @@ function(extend_target target) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) + + set(must_push_features ON) endif() endforeach() @@ -468,9 +471,11 @@ function(extend_target target) target_include_directories("${target}" PUBLIC ${_arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${_arg_INCLUDE_DIRECTORIES}) target_compile_definitions("${target}" PUBLIC ${_arg_PUBLIC_DEFINES} PRIVATE ${_arg_DEFINES}) target_link_libraries("${target}" PUBLIC ${_arg_PUBLIC_LIBRARIES} PRIVATE ${_arg_LIBRARIES}) - endif() - qt_push_features_into_parent_scope() + if(must_push_features) + qt_push_features_into_parent_scope() + endif() + endif() endfunction() From c22dcf6ae1fce7c70cfbbb8618b5940df088fb95 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 7 Dec 2018 13:13:24 +0100 Subject: [PATCH 0045/1322] CMake: Unify on variable names without _ in functions Change-Id: I28883775d8f9bd718de477c03628b291972f4590 Reviewed-by: Frederik Gladhorn Reviewed-by: Mikhail Svetkin --- cmake/QtBuild.cmake | 281 ++++++++++++++++++++++---------------------- 1 file changed, 140 insertions(+), 141 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 788d6d614b3..d5e027dbb38 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -161,23 +161,23 @@ function(qt_internal_module_include_dir result module) endfunction() function(qt_internal_add_link_flags target to_add) - get_target_property(_flags "${target}" LINK_FLAGS) - if ("${_flags}" STREQUAL "_flags-NOTFOUND") - set(_flags "") + get_target_property(flags "${target}" LINK_FLAGS) + if ("${flags}" STREQUAL "flags-NOTFOUND") + set(flags "") endif() - string(APPEND _flags " ${to_add}") - set_target_properties("${target}" PROPERTIES LINK_FLAGS "${_flags}") + string(APPEND flags " ${to_add}") + set_target_properties("${target}" PROPERTIES LINK_FLAGS "${flags}") endfunction() function(qt_internal_add_linker_version_script target) - qt_parse_all_arguments(_arg "qt_internal_add_linker" "INTERNAL" "" "PRIVATE_HEADERS" ${ARGN}) + qt_parse_all_arguments(arg "qt_internal_add_linker" "INTERNAL" "" "PRIVATE_HEADERS" ${ARGN}) if (TEST_ld_version_script) - if (_arg_INTERNAL) + if (arg_INTERNAL) set(contents "Qt_${PROJECT_VERSION_MAJOR}_PRIVATE_API { *; };") else() set(contents "Qt_${PROJECT_VERSION_MAJOR}_PRIVATE_API {\n qt_private_api_tag*;\n") - foreach(ph ${_arg_PRIVATE_HEADERS}) + foreach(ph ${arg_PRIVATE_HEADERS}) string(APPEND contents " @FILE:${ph}@\n") endforeach() string(APPEND contents "};\n") @@ -324,7 +324,7 @@ endfunction() # This function attempts to (poorly) parse the given resourceFile (.qrc) and # determine the dependencies, i.e. which files are intended for inclusion into # the Qt resource. -function(qt_extract_qrc_dependencies resourceFile _out_depends _rc_depends) +function(qt_extract_qrc_dependencies resourceFile out_depends_ rc_depends_) get_filename_component(rc_path ${resourceFile} PATH) if(EXISTS "${infile}") @@ -351,8 +351,8 @@ function(qt_extract_qrc_dependencies resourceFile _out_depends _rc_depends) set(out_depends) endif() - set(${_out_depends} ${out_depends} PARENT_SCOPE) - set(${_rc_depends} ${RC_DEPENDS} PARENT_SCOPE) + set(${out_depends_} ${out_depends} PARENT_SCOPE) + set(${rc_depends_} ${RC_DEPENDS} PARENT_SCOPE) endfunction() @@ -421,27 +421,27 @@ function(extend_target target) if (NOT TARGET "${target}") message(FATAL_ERROR "Trying to extend non-existing target \"${target}\".") endif() - qt_parse_all_arguments(_arg "extend_target" "" "" + qt_parse_all_arguments(arg "extend_target" "" "" "CONDITION;${__default_public_args};${__default_private_args};COMPILE_FLAGS" ${ARGN}) - if ("x${_arg_CONDITION}" STREQUAL x) - set(_arg_CONDITION ON) + if ("x${arg_CONDITION}" STREQUAL x) + set(arg_CONDITION ON) endif() - qt_evaluate_config_expression(result ${_arg_CONDITION}) + qt_evaluate_config_expression(result ${arg_CONDITION}) if (${result}) set(dbus_sources "") - foreach(adaptor ${_arg_DBUS_ADAPTOR_SOURCES}) - qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}") + foreach(adaptor ${arg_DBUS_ADAPTOR_SOURCES}) + qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR FLAGS "${arg_DBUS_ADAPTOR_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() - foreach(interface ${_arg_DBUS_INTERFACE_SOURCES}) - qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE FLAGS "${_arg_DBUS_INTERFACE_FLAGS}") + foreach(interface ${arg_DBUS_INTERFACE_SOURCES}) + qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE FLAGS "${arg_DBUS_INTERFACE_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() - qt_internal_process_automatic_sources("${target}" "${_arg_SOURCES}") + qt_internal_process_automatic_sources("${target}" "${arg_SOURCES}") set(must_push_features OFF) - foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) + foreach(dep ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") if (${CMAKE_MATCH_COUNT} EQUAL 3) set(depTarget ${CMAKE_MATCH_2}) @@ -464,13 +464,13 @@ function(extend_target target) endif() endforeach() - target_sources("${target}" PRIVATE ${_arg_SOURCES} ${dbus_sources}) - if (_arg_COMPILE_FLAGS) - set_source_files_properties(${_arg_SOURCES} PROPERTIES COMPILE_FLAGS "${_arg_COMPILE_FLAGS}") + target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) + if (arg_COMPILE_FLAGS) + set_source_files_properties(${arg_SOURCES} PROPERTIES COMPILE_FLAGS "${arg_COMPILE_FLAGS}") endif() - target_include_directories("${target}" PUBLIC ${_arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${_arg_INCLUDE_DIRECTORIES}) - target_compile_definitions("${target}" PUBLIC ${_arg_PUBLIC_DEFINES} PRIVATE ${_arg_DEFINES}) - target_link_libraries("${target}" PUBLIC ${_arg_PUBLIC_LIBRARIES} PRIVATE ${_arg_LIBRARIES}) + target_include_directories("${target}" PUBLIC ${arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${arg_INCLUDE_DIRECTORIES}) + target_compile_definitions("${target}" PUBLIC ${arg_PUBLIC_DEFINES} PRIVATE ${arg_DEFINES}) + target_link_libraries("${target}" PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE ${arg_LIBRARIES}) if(must_push_features) qt_push_features_into_parent_scope() @@ -530,7 +530,7 @@ endfunction() # and testing. Any features defined as well as any features coming from dependencies to # this module are imported into the scope of the calling feature. function(add_qt_module name) - qt_parse_all_arguments(_arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" + qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};FEATURE_DEPENDENCIES" ${ARGN}) _qt_module_name("${name}" module) @@ -542,7 +542,7 @@ function(add_qt_module name) _set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") ### Define Targets: - if(${_arg_STATIC}) + if(${arg_STATIC}) add_library("${target}" STATIC) elseif(${QT_BUILD_SHARED_LIBS}) add_library("${target}" SHARED) @@ -556,8 +556,8 @@ function(add_qt_module name) add_library("${target_private}" INTERFACE) add_library("Qt::${target_private}" ALIAS ${target_private}) - if(NOT DEFINED _arg_CONFIG_MODULE_NAME) - set(_arg_CONFIG_MODULE_NAME "${name_lower}") + if(NOT DEFINED arg_CONFIG_MODULE_NAME) + set(arg_CONFIG_MODULE_NAME "${name_lower}") endif() # Import global features @@ -567,7 +567,7 @@ function(add_qt_module name) # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. - foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES} ${_arg_FEATURE_DEPENDENCIES}) + foreach(dep ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES} ${arg_FEATURE_DEPENDENCIES}) if("${dep}" MATCHES "(Qt::.+)Private") set(publicDep ${CMAKE_MATCH_1}) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) @@ -577,7 +577,7 @@ function(add_qt_module name) qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) endforeach() - if(NOT ${_arg_NO_MODULE_HEADERS}) + if(NOT ${arg_NO_MODULE_HEADERS}) qt_ensure_perl() if(NOT DEFINED QT_SYNCQT) get_target_property(mocPath "Qt::moc" LOCATION) @@ -590,7 +590,7 @@ function(add_qt_module name) execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") endif() - if(NOT ${_arg_NO_MODULE_HEADERS}) + if(NOT ${arg_NO_MODULE_HEADERS}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) else() set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) @@ -606,17 +606,17 @@ function(add_qt_module name) if(EXISTS "${configureFile}") qt_feature_module_begin( LIBRARY "${module}" - PUBLIC_FILE "qt${_arg_CONFIG_MODULE_NAME}-config.h" - PRIVATE_FILE "qt${_arg_CONFIG_MODULE_NAME}-config_p.h" - PUBLIC_DEPENDENCIES ${_arg_FEATURE_DEPENDENCIES} - PRIVATE_DEPENDENCIES ${_arg_FEATURE_DEPENDENCIES} + PUBLIC_FILE "qt${arg_CONFIG_MODULE_NAME}-config.h" + PRIVATE_FILE "qt${arg_CONFIG_MODULE_NAME}-config_p.h" + PUBLIC_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} + PRIVATE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} ) include(${configureFile}) qt_feature_module_end("${target}") qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES "${target}") - set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${_arg_CONFIG_MODULE_NAME}-config.h") - set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${_arg_CONFIG_MODULE_NAME}-config_p.h") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config.h") + set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config_p.h") if("${target}" STREQUAL "Core") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") @@ -627,23 +627,23 @@ function(add_qt_module name) qt_internal_library_deprecation_level(deprecation_define) extend_target("${target}" - SOURCES ${_arg_SOURCES} + SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES $ $ - ${_arg_PUBLIC_INCLUDE_DIRECTORIES} + ${arg_PUBLIC_INCLUDE_DIRECTORIES} INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" $ "${include_dir}/${PROJECT_VERSION}" "${include_dir}/${PROJECT_VERSION}/${module}" - ${_arg_INCLUDE_DIRECTORIES} + ${arg_INCLUDE_DIRECTORIES} PUBLIC_DEFINES - ${_arg_PUBLIC_DEFINES} + ${arg_PUBLIC_DEFINES} QT_${name_upper}_LIB DEFINES - ${_arg_DEFINES} + ${arg_DEFINES} QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code QT_USE_QSTRINGBUILDER @@ -652,18 +652,18 @@ function(add_qt_module name) QT_BUILD_${name_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_LIBRARIES - ${_arg_PUBLIC_LIBRARIES} + ${arg_PUBLIC_LIBRARIES} LIBRARIES - ${_arg_LIBRARIES} - DBUS_ADAPTOR_SOURCES "${_arg_DBUS_ADAPTOR_SOURCES}" - DBUS_ADAPTOR_FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}" - DBUS_INTERFACE_SOURCES "${_arg_DBUS_INTERFACE_SOURCES}" - DBUS_INTERFACE_FLAGS "${_arg_DBUS_INTERFACE_FLAGS}" + ${arg_LIBRARIES} + DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" + DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" + DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" + DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" ) ### FIXME: Can we replace headers.pri? qt_internal_module_include_dir(include_dir "${module}") - if(NOT ${_arg_NO_MODULE_HEADERS}) + if(NOT ${arg_NO_MODULE_HEADERS}) qt_read_headers_pri("${module}" "module_headers") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") @@ -676,7 +676,7 @@ function(add_qt_module name) qt_internal_add_linker_version_script("${target}") endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${_arg_FEATURE_DEPENDENCIES}) + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${arg_FEATURE_DEPENDENCIES}) install(TARGETS "${target}" "${target_private}" EXPORT "${versioned_module_name}Targets" LIBRARY DESTINATION ${INSTALL_LIBDIR} @@ -719,15 +719,15 @@ function(add_qt_module name) endif() # When a public module depends on private, also make its private depend on the other's private - set(_qt_libs_private "") + set(qt_libs_private "") foreach(it ${KNOWN_QT_MODULES}) - list(FIND _arg_LIBRARIES "Qt::${it}Private" _pos) - if(_pos GREATER -1) - list(APPEND _qt_libs_private "Qt::${it}Private") + list(FIND arg_LIBRARIES "Qt::${it}Private" pos) + if(pos GREATER -1) + list(APPEND qt_libs_private "Qt::${it}Private") endif() endforeach() - target_link_libraries("${target_private}" INTERFACE "${target}" "${_qt_libs_private}") + target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") qt_internal_module_include_dir(include_dir "${module}") target_include_directories("${target_private}" INTERFACE @@ -751,13 +751,13 @@ function(add_qt_plugin name) set(module "${name}") string(TOUPPER "${name}" name_upper) - qt_parse_all_arguments(_arg "add_qt_plugin" "" "TYPE" "${__default_private_args};${__default_public_args}" ${ARGN}) - if (NOT DEFINED _arg_TYPE) + qt_parse_all_arguments(arg "add_qt_plugin" "" "TYPE" "${__default_private_args};${__default_public_args}" ${ARGN}) + if (NOT DEFINED arg_TYPE) message(FATAL_ERROR "add_qt_plugin called without setting a TYPE.") endif() add_library("${module}") - set_target_properties("${module}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${_arg_TYPE}") + set_target_properties("${module}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") set_target_properties("${module}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") # Import global features @@ -765,7 +765,7 @@ function(add_qt_plugin name) # Fetch features from dependencies and make them available to the # caller as well as to the local scope for configure.cmake evaluation. - foreach(dep ${_arg_LIBRARIES} ${_arg_PUBLIC_LIBRARIES}) + foreach(dep ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "(Qt::.+)Private") set(publicDep ${CMAKE_MATCH_1}) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) @@ -778,16 +778,16 @@ function(add_qt_plugin name) qt_internal_library_deprecation_level(deprecation_define) extend_target("${module}" - SOURCES ${_arg_SOURCES} + SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" - ${_arg_INCLUDE_DIRECTORIES} - PUBLIC_INCLUDE_DIRECTORIES ${_arg_PUBLIC_INCLUDE_DIRECTORIES} - LIBRARIES ${_arg_LIBRARIES} - PUBLIC_LIBRARIES ${_arg_PUBLIC_LIBRARIES} + ${arg_INCLUDE_DIRECTORIES} + PUBLIC_INCLUDE_DIRECTORIES ${arg_PUBLIC_INCLUDE_DIRECTORIES} + LIBRARIES ${arg_LIBRARIES} + PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} DEFINES - ${_arg_DEFINES} + ${arg_DEFINES} QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code QT_USE_QSTRINGBUILDER @@ -797,16 +797,16 @@ function(add_qt_plugin name) "${deprecation_define}" PUBLIC_DEFINES QT_${name_upper}_LIB - ${_arg_PUBLIC_DEFINES} - DBUS_ADAPTOR_SOURCES "${_arg_DBUS_ADAPTOR_SOURCES}" - DBUS_ADAPTOR_FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}" - DBUS_INTERFACE_SOURCES "${_arg_DBUS_INTERFACE_SOURCES}" - DBUS_INTERFACE_FLAGS "${_arg_DBUS_INTERFACE_FLAGS}" + ${arg_PUBLIC_DEFINES} + DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" + DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" + DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" + DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" ) install(TARGETS "${module}" EXPORT "${module}Targets" - LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${_arg_TYPE} - ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${_arg_TYPE} + LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${arg_TYPE} + ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${arg_TYPE} ) install(EXPORT "${module}Targets" NAMESPACE Qt:: DESTINATION ${INSTALL_LIBDIR}/cmake) @@ -826,30 +826,30 @@ endfunction() # Please consider to use a more specific version target like the one created # by add_qt_test or add_qt_tool below. function(add_qt_executable name) - qt_parse_all_arguments(_arg "add_qt_executable" "GUI" "OUTPUT_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_executable" "GUI" "OUTPUT_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) - if ("x${_arg_OUTPUT_DIRECTORY}" STREQUAL "x") - set(_arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") + if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x") + set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") endif() - add_executable("${name}" ${_arg_EXE_FLAGS}) + add_executable("${name}" ${arg_EXE_FLAGS}) extend_target("${name}" - SOURCES ${_arg_SOURCES} + SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" - ${_arg_INCLUDE_DIRECTORIES} - DEFINES ${_arg_DEFINES} - LIBRARIES ${_arg_LIBRARIES} - DBUS_ADAPTOR_SOURCES "${_arg_DBUS_ADAPTOR_SOURCES}" - DBUS_ADAPTOR_FLAGS "${_arg_DBUS_ADAPTOR_FLAGS}" - DBUS_INTERFACE_SOURCES "${_arg_DBUS_INTERFACE_SOURCES}" - DBUS_INTERFACE_FLAGS "${_arg_DBUS_INTERFACE_FLAGS}" + ${arg_INCLUDE_DIRECTORIES} + DEFINES ${arg_DEFINES} + LIBRARIES ${arg_LIBRARIES} + DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" + DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" + DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" + DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" ) set_target_properties("${name}" PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${_arg_OUTPUT_DIRECTORY}" - WIN32_EXECUTABLE "${_arg_GUI}" - MACOSX_BUNDLE "${_arg_GUI}" + RUNTIME_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" + WIN32_EXECUTABLE "${arg_GUI}" + MACOSX_BUNDLE "${arg_GUI}" ) qt_push_features_into_parent_scope() @@ -858,24 +858,24 @@ endfunction() # This function creates a CMake test target with the specified name for use with CTest. function(add_qt_test name) - qt_parse_all_arguments(_arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) - set(_path "${CMAKE_CURRENT_BINARY_DIR}") + qt_parse_all_arguments(arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) + set(path "${CMAKE_CURRENT_BINARY_DIR}") add_qt_executable("${name}" - OUTPUT_DIRECTORY "${_path}" - SOURCES "${_arg_SOURCES}" + OUTPUT_DIRECTORY "${path}" + SOURCES "${arg_SOURCES}" INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" - "${_arg_INCLUDE_DIRECTORIES}" - DEFINES "${_arg_DEFINES}" - LIBRARIES Qt::Core Qt::Test ${_arg_LIBRARIES} + "${arg_INCLUDE_DIRECTORIES}" + DEFINES "${arg_DEFINES}" + LIBRARIES Qt::Core Qt::Test ${arg_LIBRARIES} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") - set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${_arg_RUN_SERIAL}") - set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${_path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}") + set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${arg_RUN_SERIAL}") + set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}") set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${PROJECT_BINARY_DIR}/${INSTALL_PLUGINSDIR}") qt_push_features_into_parent_scope() @@ -894,9 +894,9 @@ endfunction() # The BOOTSTRAP option allows building it as standalone program, otherwise # it will be linked against QtCore. function(add_qt_tool name) - qt_parse_all_arguments(_arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) - if (_arg_BOOTSTRAP) + if (arg_BOOTSTRAP) set(corelib Qt::Bootstrap) else() set(corelib Qt::Core) @@ -905,15 +905,15 @@ function(add_qt_tool name) add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" # Do not pass sources here: They may not get processed when BOOTSTRAP is set! INCLUDE_DIRECTORIES - ${_arg_INCLUDE_DIRECTORIES} - DEFINES ${_arg_DEFINES} - LIBRARIES ${corelib} ${_arg_LIBRARIES} + ${arg_INCLUDE_DIRECTORIES} + DEFINES ${arg_DEFINES} + LIBRARIES ${corelib} ${arg_LIBRARIES} ) - target_sources("${name}" PRIVATE "${_arg_SOURCES}") + target_sources("${name}" PRIVATE "${arg_SOURCES}") add_executable("Qt::${name}" ALIAS "${name}") - if (NOT _arg_BOOTSTRAP) - qt_internal_process_automatic_sources("${name}" ${_arg_SOURCES}) + if (NOT arg_BOOTSTRAP) + qt_internal_process_automatic_sources("${name}" ${arg_SOURCES}) endif() install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) @@ -985,38 +985,37 @@ function(qt_make_output_file infile prefix suffix source_dir binary_dir result) get_filename_component(outpath "${abs_mapped_infile}" PATH) file(MAKE_DIRECTORY "${outpath}") - set(_result "${outpath}/${prefix}${outfilename}${suffix}") - set("${result}" "${_result}" PARENT_SCOPE) + set("${result}" "${outpath}/${prefix}${outfilename}${suffix}" PARENT_SCOPE) endfunction() -macro(qt_get_moc_flags _moc_flags) - set(${_moc_flags}) - get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES) +macro(qt_get_moc_flags moc_flags) + set(${moc_flags}) + get_directory_property(inc_DIRS INCLUDE_DIRECTORIES) if(CMAKE_INCLUDE_CURRENT_DIR) - list(APPEND _inc_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + list(APPEND inc_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) endif() - foreach(_current ${_inc_DIRS}) - if("${_current}" MATCHES "\\.framework/?$") - string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}") - set(${_moc_flags} ${${_moc_flags}} "-F${framework_path}") + foreach(current ${inc_DIRS}) + if("${current}" MATCHES "\\.framework/?$") + string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${current}") + set(${moc_flags} ${${moc_flags}} "-F${framework_path}") else() - set(${_moc_flags} ${${_moc_flags}} "-I${_current}") + set(${moc_flags} ${${moc_flags}} "-I${current}") endif() endforeach() - get_directory_property(_defines COMPILE_DEFINITIONS) - foreach(_current ${_defines}) - set(${_moc_flags} ${${_moc_flags}} "-D${_current}") + get_directory_property(defines COMPILE_DEFINITIONS) + foreach(current ${defines}) + set(${moc_flags} ${${moc_flags}} "-D${current}") endforeach() if(WIN32) - set(${_moc_flags} ${${_moc_flags}} -DWIN32) + set(${moc_flags} ${${moc_flags}} -DWIN32) endif() if (MSVC) - set(${_moc_flags} ${${_moc_flags}} --compiler-flavor=msvc) + set(${moc_flags} ${${moc_flags}} --compiler-flavor=msvc) endif() endmacro() @@ -1064,26 +1063,26 @@ endfunction() # helper to set up a qdbusxml2cpp rule function(qt_create_qdbusxml2cpp_command target infile) - qt_parse_all_arguments(_arg "qt_create_qdbusxml2cpp_command" "ADAPTOR;INTERFACE" "" "FLAGS" ${ARGN}) - if((_arg_ADAPTOR AND _arg_INTERFACE) OR (NOT _arg_ADAPTOR AND NOT _arg_INTERFACE)) + qt_parse_all_arguments(arg "qt_create_qdbusxml2cpp_command" "ADAPTOR;INTERFACE" "" "FLAGS" ${ARGN}) + if((arg_ADAPTOR AND arg_INTERFACE) OR (NOT arg_ADAPTOR AND NOT arg_INTERFACE)) message(FATAL_ERROR "qt_create_dbusxml2cpp_command needs either ADAPTOR or INTERFACE.") endif() - set(_option "-a") - set(_type "adaptor") - if (_arg_INTERFACE) - set(_option "-p") - set(_type "interface") + set(option "-a") + set(type "adaptor") + if (arg_INTERFACE) + set(option "-p") + set(type "interface") endif() get_filename_component(file_name "${infile}" NAME_WE) string(TOLOWER "${file_name}" file_name) - set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${_type}.h") - set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${_type}.cpp") + set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${type}.h") + set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${type}.cpp") add_custom_command(OUTPUT "${header_file}" "${source_file}" - COMMAND Qt::qdbusxml2cpp ${_arg_FLAGS} "${_option}" "${header_file}:${source_file}" "${infile}" + COMMAND Qt::qdbusxml2cpp ${arg_FLAGS} "${option}" "${header_file}:${source_file}" "${infile}" DEPENDS "${infile}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) @@ -1096,26 +1095,26 @@ endfunction() function(qt_generate_forwarding_headers module) - qt_parse_all_arguments(_arg "qt_generate_forwarding_headers" + qt_parse_all_arguments(arg "qt_generate_forwarding_headers" "PRIVATE" "SOURCE;DESTINATION" "CLASSES" ${ARGN}) qt_internal_module_include_dir(include_dir "${module}") - if (NOT _arg_DESTINATION) - get_filename_component(_arg_DESTINATION "${_arg_SOURCE}" NAME) + if (NOT arg_DESTINATION) + get_filename_component(arg_DESTINATION "${arg_SOURCE}" NAME) endif() - if (_arg_PRIVATE) - set(main_fwd "${include_dir}/${PROJECT_VERSION}/${module}/private/${_arg_DESTINATION}") + if (arg_PRIVATE) + set(main_fwd "${include_dir}/${PROJECT_VERSION}/${module}/private/${arg_DESTINATION}") else() - set(main_fwd "${include_dir}/${_arg_DESTINATION}") + set(main_fwd "${include_dir}/${arg_DESTINATION}") endif() get_filename_component(main_fwd_dir "${main_fwd}" DIRECTORY) - file(RELATIVE_PATH relpath "${main_fwd_dir}" "${CMAKE_CURRENT_BINARY_DIR}/${_arg_SOURCE}") + file(RELATIVE_PATH relpath "${main_fwd_dir}" "${CMAKE_CURRENT_BINARY_DIR}/${arg_SOURCE}") set(main_contents "#include \"${relpath}\"") file(GENERATE OUTPUT "${main_fwd}" CONTENT "${main_contents}") - foreach(class_fwd ${_arg_CLASSES}) + foreach(class_fwd ${arg_CLASSES}) set(class_fwd_contents "#include \"${fwd_hdr}\"") message("Generating forwarding header: ${class_fwd} -> ${relpath}.") file(GENERATE OUTPUT "${include_dir}/${class_fwd}" CONTENT "${class_fwd_contents}") From 8d5c9ebf8c0173c536ca170eb294998188baebc4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 7 Dec 2018 13:16:39 +0100 Subject: [PATCH 0046/1322] Prefer qt_internal_ over _qt_ for internal functions Change-Id: Idb6f3d8f29890bb4d8f0d1d644c0d1103342946a Reviewed-by: Frederik Gladhorn Reviewed-by: Mikhail Svetkin --- cmake/QtBuild.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index d5e027dbb38..b57d95d7a90 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -254,8 +254,7 @@ function(qt_internal_wrap_cpp target) target_sources("${target}" PRIVATE "${outfiles}") endfunction() - -function(_qt_module_name name result) +function(qt_internal_module_name name result) set("${result}" "Qt${name}" PARENT_SCOPE) endfunction() @@ -533,7 +532,7 @@ function(add_qt_module name) qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};FEATURE_DEPENDENCIES" ${ARGN}) - _qt_module_name("${name}" module) + qt_internal_module_name("${name}" module) set(versioned_module_name "Qt${PROJECT_VERSION_MAJOR}${name}") set(target "${name}") string(TOUPPER "${name}" name_upper) From 78d34c3a30e58d7c994bd5b58052d5c148b0e3ca Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 7 Dec 2018 13:30:51 +0100 Subject: [PATCH 0047/1322] CMake: Refactor qt module name related code Change-Id: Ib14c030ef6d2e988aaaebca354cf1a6881e05e25 Reviewed-by: Kevin Funk --- cmake/QtBuild.cmake | 55 +++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index b57d95d7a90..a08022923f3 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -254,8 +254,21 @@ function(qt_internal_wrap_cpp target) target_sources("${target}" PRIVATE "${outfiles}") endfunction() -function(qt_internal_module_name name result) - set("${result}" "Qt${name}" PARENT_SCOPE) + +# Get a set of Qt module related values based on the target name. +# When doing qt_internal_module_info(foo Core) this method will set +# the following variables in the caller's scope: +# * foo with the value "QtCore" +# * foo_versioned with the value "Qt5Core" (based on major Qt version) +# * foo_upper with the value "CORE" +# * foo_lower with the value "core" +function(qt_internal_module_info result target) + set("${result}" "Qt${target}" PARENT_SCOPE) + set("${result}_versioned" "Qt${PROJECT_VERSION_MAJOR}${target}" PARENT_SCOPE) + string(TOUPPER "${target}" upper) + string(TOLOWER "${target}" lower) + set("${result}_upper" "${upper}" PARENT_SCOPE) + set("${result}_lower" "${lower}" PARENT_SCOPE) endfunction() @@ -524,19 +537,17 @@ endfunction() # consists of a library, public header files, private header files and configurable # features. # -# A CMake target with the specified name parameter is created. If the current source +# A CMake target with the specified target parameter is created. If the current source # directory has a configure.cmake file, then that is also processed for feature definition # and testing. Any features defined as well as any features coming from dependencies to # this module are imported into the scope of the calling feature. -function(add_qt_module name) +# +# Target is without leading "Qt". So e.g. the "QtCore" module has the target "Core". +function(add_qt_module target) qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};FEATURE_DEPENDENCIES" ${ARGN}) - qt_internal_module_name("${name}" module) - set(versioned_module_name "Qt${PROJECT_VERSION_MAJOR}${name}") - set(target "${name}") - string(TOUPPER "${name}" name_upper) - string(TOLOWER "${name}" name_lower) + qt_internal_module_info(module "${target}") _set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") @@ -556,7 +567,7 @@ function(add_qt_module name) add_library("Qt::${target_private}" ALIAS ${target_private}) if(NOT DEFINED arg_CONFIG_MODULE_NAME) - set(arg_CONFIG_MODULE_NAME "${name_lower}") + set(arg_CONFIG_MODULE_NAME "${module_lower}") endif() # Import global features @@ -597,7 +608,7 @@ function(add_qt_module name) set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}") set_target_properties("${target}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") - set_target_properties("${target}" PROPERTIES OUTPUT_NAME "${versioned_module_name}") + set_target_properties("${target}" PROPERTIES OUTPUT_NAME "${module_versioned}") qt_internal_module_include_dir(include_dir "${module}") @@ -640,7 +651,7 @@ function(add_qt_module name) ${arg_INCLUDE_DIRECTORIES} PUBLIC_DEFINES ${arg_PUBLIC_DEFINES} - QT_${name_upper}_LIB + QT_${module_upper}_LIB DEFINES ${arg_DEFINES} QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS @@ -648,7 +659,7 @@ function(add_qt_module name) QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS QT_BUILDING_QT - QT_BUILD_${name_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore + QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} @@ -677,35 +688,35 @@ function(add_qt_module name) qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${arg_FEATURE_DEPENDENCIES}) - install(TARGETS "${target}" "${target_private}" EXPORT "${versioned_module_name}Targets" + install(TARGETS "${target}" "${target_private}" EXPORT "${module_versioned}Targets" LIBRARY DESTINATION ${INSTALL_LIBDIR} ARCHIVE DESTINATION ${INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/private ) - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${versioned_module_name}") - install(EXPORT "${versioned_module_name}Targets" NAMESPACE Qt:: DESTINATION ${config_install_dir}) + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${module_versioned}") + install(EXPORT "${module_versioned}Targets" NAMESPACE Qt:: DESTINATION ${config_install_dir}) configure_package_config_file( "${Qt${PROJECT_VERSION_MAJOR}_DIR}/QtModuleConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}Config.cmake" INSTALL_DESTINATION "${config_install_dir}" ) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}ConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) set(extra_cmake_files) - if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${versioned_module_name}Macros.cmake") - list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${versioned_module_name}Macros.cmake") + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${module_versioned}Macros.cmake") + list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${module_versioned}Macros.cmake") endif() install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${versioned_module_name}ConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}ConfigVersion.cmake" ${extra_cmake_files} DESTINATION "${config_install_dir}" COMPONENT Devel From ece38e7e184bbf4f458093bb2da5f8fa26ba8578 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 7 Dec 2018 13:48:36 +0100 Subject: [PATCH 0048/1322] CMake: Unify creation of target aliases For Qt6 we want to have Qt6::foo and Qt::foo. Enable that consistently. Change-Id: I3cf05c4171b13029bf508d307945e8be4687e86b Reviewed-by: Simon Hausmann Reviewed-by: Kevin Funk --- cmake/QtBuild.cmake | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a08022923f3..987114d8146 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -533,6 +533,19 @@ function(qt_read_headers_pri module resultVarPrefix) endfunction() +# Add Qt::target and Qt6::target as aliases for the target +function(qt_internal_add_target_aliases target) + get_target_property(type "${target}" TYPE) + if (type STREQUAL EXECUTABLE) + add_executable("Qt::${target}" ALIAS "${target}") + add_executable("Qt${PROJECT_VERSION_MAJOR}::${target}" ALIAS "${target}") + else() + add_library("Qt::${target}" ALIAS "${target}") + add_library("Qt${PROJECT_VERSION_MAJOR}::${target}" ALIAS "${target}") + endif() +endfunction() + + # This is the main entry function for creating a Qt module, that typically # consists of a library, public header files, private header files and configurable # features. @@ -559,12 +572,12 @@ function(add_qt_module target) else() add_library("${target}" STATIC) endif() - add_library("Qt::${target}" ALIAS "${target}") + qt_internal_add_target_aliases("${target}") # Add _private target to link against the private headers: set(target_private "${target}Private") add_library("${target_private}" INTERFACE) - add_library("Qt::${target_private}" ALIAS ${target_private}) + qt_internal_add_target_aliases("${target_private}") if(NOT DEFINED arg_CONFIG_MODULE_NAME) set(arg_CONFIG_MODULE_NAME "${module_lower}") @@ -587,7 +600,9 @@ function(add_qt_module target) qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) endforeach() - if(NOT ${arg_NO_MODULE_HEADERS}) + if(${arg_NO_MODULE_HEADERS}) + set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) + else() qt_ensure_perl() if(NOT DEFINED QT_SYNCQT) get_target_property(mocPath "Qt::moc" LOCATION) @@ -598,17 +613,14 @@ function(add_qt_module target) set(QT_SYNCQT "${binDirectory}/syncqt.pl") endif() execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") - endif() - if(NOT ${arg_NO_MODULE_HEADERS}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) - else() - set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) endif() - set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}") - set_target_properties("${target}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") - set_target_properties("${target}" PROPERTIES OUTPUT_NAME "${module_versioned}") + set_target_properties("${target}" PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" + OUTPUT_NAME "${module_versioned}") qt_internal_module_include_dir(include_dir "${module}") @@ -920,7 +932,7 @@ function(add_qt_tool name) LIBRARIES ${corelib} ${arg_LIBRARIES} ) target_sources("${name}" PRIVATE "${arg_SOURCES}") - add_executable("Qt::${name}" ALIAS "${name}") + qt_internal_add_target_aliases("${name}") if (NOT arg_BOOTSTRAP) qt_internal_process_automatic_sources("${name}" ${arg_SOURCES}) From 3a8d8344e5301badd9bcef79d7f622fd16487438 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 7 Dec 2018 14:04:42 +0100 Subject: [PATCH 0049/1322] CMake: Merge qt_internal_module_include_dir and qt_internal_module_info ... and fix the fallout of this change. It results in more targets being passed overall (instead of a strange mix of targets and module names), so this is a good thing(TM). Change-Id: I1c4326b80e2c6675356587879ec8471ef7249a50 Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 2 +- cmake/QtBuild.cmake | 89 ++++++++++++++--------------- cmake/tests/features/CMakeLists.txt | 2 +- src/gui/CMakeLists.txt | 6 +- 4 files changed, 48 insertions(+), 51 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 5b2b746ef10..b53fd0f3680 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -39,7 +39,7 @@ install(FILES ## Library to hold global features: add_library(Qt_global_Config INTERFACE) -qt_feature_module_begin(LIBRARY QtCore +qt_feature_module_begin(LIBRARY Core PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 987114d8146..cae2aaf1b54 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -67,12 +67,12 @@ set(QT_PLATFORM_DEFINITION_DIR ${QT_DEFAULT_PLATFORM_DEFINITION_DIR} CACHE PATH "Path to directory that contains qplatformdefs.h") set(QT_NAMESPACE "" CACHE STRING "Qt Namespace") -macro(_set_known_qt_modules) +macro(qt_internal_set_known_qt_modules) set(KNOWN_QT_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) endmacro() # Reset: -_set_known_qt_modules("") +qt_internal_set_known_qt_modules("") # For adjusting variables when running tests, we need to know what # the correct variable is for separating entries in PATH-alike @@ -143,6 +143,18 @@ function(qt_ensure_perl) endfunction() +function(qt_ensure_sync_qt) + qt_ensure_perl() + if(NOT DEFINED QT_SYNCQT) + get_target_property(mocPath "Qt::moc" LOCATION) + get_filename_component(binDirectory "${mocPath}" DIRECTORY) + # We could put this into the cache, but on the other hand there's no real need to + # pollute the app's cache with this. For the first qtbase build, the variable is + # set in global scope. + set(QT_SYNCQT "${binDirectory}/syncqt.pl") + endif() +endfunction() + # A version of cmake_parse_arguments that makes sure all arguments are processed and errors out # with a message about ${type} having received unknown arguments. macro(qt_parse_all_arguments result type flags options multiopts) @@ -153,13 +165,6 @@ macro(qt_parse_all_arguments result type flags options multiopts) endmacro() -# Determines the directory where the generated class-style header files for -# the specified module are located and stores the result in the given result -# variable. -function(qt_internal_module_include_dir result module) - set(${result} "${PROJECT_BINARY_DIR}/include/${module}" PARENT_SCOPE) -endfunction() - function(qt_internal_add_link_flags target to_add) get_target_property(flags "${target}" LINK_FLAGS) if ("${flags}" STREQUAL "flags-NOTFOUND") @@ -262,13 +267,16 @@ endfunction() # * foo_versioned with the value "Qt5Core" (based on major Qt version) # * foo_upper with the value "CORE" # * foo_lower with the value "core" +# * foo_include_dir with the module's include directory in the binary tree function(qt_internal_module_info result target) - set("${result}" "Qt${target}" PARENT_SCOPE) + set(module "Qt${target}") + set("${result}" "${module}" PARENT_SCOPE) set("${result}_versioned" "Qt${PROJECT_VERSION_MAJOR}${target}" PARENT_SCOPE) string(TOUPPER "${target}" upper) string(TOLOWER "${target}" lower) set("${result}_upper" "${upper}" PARENT_SCOPE) set("${result}_lower" "${lower}" PARENT_SCOPE) + set("${result}_include_dir" "${PROJECT_BINARY_DIR}/include/${module}" PARENT_SCOPE) endfunction() @@ -503,9 +511,9 @@ function(qt_internal_library_deprecation_level result) endfunction() -function(qt_read_headers_pri module resultVarPrefix) - qt_internal_module_include_dir(include_dir "${module}") - file(STRINGS "${include_dir}/headers.pri" headers_pri_contents) +function(qt_read_headers_pri target resultVarPrefix) + qt_internal_module_info(module "${target}") + file(STRINGS "${module_include_dir}/headers.pri" headers_pri_contents) foreach(line ${headers_pri_contents}) if("${line}" MATCHES "SYNCQT.HEADER_FILES = (.*)") set(public_module_headers "${CMAKE_MATCH_1}") @@ -517,7 +525,7 @@ function(qt_read_headers_pri module resultVarPrefix) set(generated_module_headers "${CMAKE_MATCH_1}") separate_arguments(generated_module_headers UNIX_COMMAND "${generated_module_headers}") foreach(generated_header ${generated_module_headers}) - list(APPEND public_module_headers "${include_dir}/${generated_header}") + list(APPEND public_module_headers "${module_include_dir}/${generated_header}") endforeach() # Ignore INJECTIONS! elseif("${line}" MATCHES "SYNCQT.([A-Z_]+)_HEADER_FILES = (.+)") @@ -557,12 +565,17 @@ endfunction() # # Target is without leading "Qt". So e.g. the "QtCore" module has the target "Core". function(add_qt_module target) + qt_internal_module_info(module "${target}") + + # Process arguments: qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};FEATURE_DEPENDENCIES" ${ARGN}) - qt_internal_module_info(module "${target}") + if(NOT DEFINED arg_CONFIG_MODULE_NAME) + set(arg_CONFIG_MODULE_NAME "${module_lower}") + endif() - _set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") + qt_internal_set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") ### Define Targets: if(${arg_STATIC}) @@ -579,10 +592,6 @@ function(add_qt_module target) add_library("${target_private}" INTERFACE) qt_internal_add_target_aliases("${target_private}") - if(NOT DEFINED arg_CONFIG_MODULE_NAME) - set(arg_CONFIG_MODULE_NAME "${module_lower}") - endif() - # Import global features if(NOT "${target}" STREQUAL "Core") qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) @@ -603,15 +612,7 @@ function(add_qt_module target) if(${arg_NO_MODULE_HEADERS}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) else() - qt_ensure_perl() - if(NOT DEFINED QT_SYNCQT) - get_target_property(mocPath "Qt::moc" LOCATION) - get_filename_component(binDirectory "${mocPath}" DIRECTORY) - # We could put this into the cache, but on the other hand there's no real need to - # pollute the app's cache with this. For the first qtbase build, the variable is - # set in global scope. - set(QT_SYNCQT "${binDirectory}/syncqt.pl") - endif() + qt_ensure_sync_qt() execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) @@ -622,12 +623,10 @@ function(add_qt_module target) RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" OUTPUT_NAME "${module_versioned}") - qt_internal_module_include_dir(include_dir "${module}") - set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") qt_feature_module_begin( - LIBRARY "${module}" + LIBRARY "${target}" PUBLIC_FILE "qt${arg_CONFIG_MODULE_NAME}-config.h" PRIVATE_FILE "qt${arg_CONFIG_MODULE_NAME}-config_p.h" PUBLIC_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} @@ -651,15 +650,15 @@ function(add_qt_module target) extend_target("${target}" SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES - $ + $ $ ${arg_PUBLIC_INCLUDE_DIRECTORIES} INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" $ - "${include_dir}/${PROJECT_VERSION}" - "${include_dir}/${PROJECT_VERSION}/${module}" + "${module_include_dir}/${PROJECT_VERSION}" + "${module_include_dir}/${PROJECT_VERSION}/${module}" ${arg_INCLUDE_DIRECTORIES} PUBLIC_DEFINES ${arg_PUBLIC_DEFINES} @@ -684,12 +683,11 @@ function(add_qt_module target) ) ### FIXME: Can we replace headers.pri? - qt_internal_module_include_dir(include_dir "${module}") if(NOT ${arg_NO_MODULE_HEADERS}) - qt_read_headers_pri("${module}" "module_headers") + qt_read_headers_pri("${target}" "module_headers") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") - set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${include_dir}/${module}Depends") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_include_dir}/${module}Depends") endif() if(DEFINED module_headers_private) @@ -751,11 +749,10 @@ function(add_qt_module target) target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") - qt_internal_module_include_dir(include_dir "${module}") target_include_directories("${target_private}" INTERFACE $ - $ - $ + $ + $ $ $ ) @@ -1116,19 +1113,19 @@ function(qt_create_qdbusxml2cpp_command target infile) endfunction() -function(qt_generate_forwarding_headers module) +function(qt_generate_forwarding_headers target) qt_parse_all_arguments(arg "qt_generate_forwarding_headers" "PRIVATE" "SOURCE;DESTINATION" "CLASSES" ${ARGN}) - qt_internal_module_include_dir(include_dir "${module}") + qt_internal_module_info(module "${target}") if (NOT arg_DESTINATION) get_filename_component(arg_DESTINATION "${arg_SOURCE}" NAME) endif() if (arg_PRIVATE) - set(main_fwd "${include_dir}/${PROJECT_VERSION}/${module}/private/${arg_DESTINATION}") + set(main_fwd "${module_include_dir}/${PROJECT_VERSION}/${module}/private/${arg_DESTINATION}") else() - set(main_fwd "${include_dir}/${arg_DESTINATION}") + set(main_fwd "${module_include_dir}/${arg_DESTINATION}") endif() get_filename_component(main_fwd_dir "${main_fwd}" DIRECTORY) @@ -1139,7 +1136,7 @@ function(qt_generate_forwarding_headers module) foreach(class_fwd ${arg_CLASSES}) set(class_fwd_contents "#include \"${fwd_hdr}\"") message("Generating forwarding header: ${class_fwd} -> ${relpath}.") - file(GENERATE OUTPUT "${include_dir}/${class_fwd}" CONTENT "${class_fwd_contents}") + file(GENERATE OUTPUT "${module_include_dir}/${class_fwd}" CONTENT "${class_fwd_contents}") endforeach() endfunction() diff --git a/cmake/tests/features/CMakeLists.txt b/cmake/tests/features/CMakeLists.txt index 3cda8ebe260..32cff572bd1 100644 --- a/cmake/tests/features/CMakeLists.txt +++ b/cmake/tests/features/CMakeLists.txt @@ -16,7 +16,7 @@ include(QtSetup) ## Library to hold global features: add_library(Qt_global_Config INTERFACE) -qt_feature_module_begin(LIBRARY QtCore +qt_feature_module_begin(LIBRARY Core PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 3af191a18a7..69f5d31af72 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -470,11 +470,11 @@ if (QT_FEATURE_vulkan) COMMENT "Generating vulkan data" ) - qt_generate_forwarding_headers("QtGui" SOURCE "${vulkan_fun}" + qt_generate_forwarding_headers("Gui" SOURCE "${vulkan_fun}" DESTINATION qvulkanfunctions.h CLASSES QVulkanFunctions QVulkanDeviceFunctions ) - qt_generate_forwarding_headers("QtGui" SOURCE "${vulkan_fun_p}" + qt_generate_forwarding_headers("Gui" SOURCE "${vulkan_fun_p}" DESTINATION qvulkanfunctions_p.h PRIVATE ) @@ -488,7 +488,7 @@ endif() # headers. So a private QtGui header is #include and # a qpa header is #include , both of them implying # linkage against Qt::GuiPrivate. -qt_read_headers_pri("QtGui" "module_headers") +qt_read_headers_pri("Gui" "module_headers") install(FILES ${module_headers_qpa} DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) add_qt_docs(./doc/qtgui.qdocconf) From 42d6e5c5fa840c5c486752c4ab699e37af72c516 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 11 Dec 2018 11:38:20 +0100 Subject: [PATCH 0050/1322] CMake: Simplify * Only import features once * Move Core specific code into its CMakeLists.txt file * More consistently use target names like "Core" to refer to "Qt modules". We tend to require either "Core" or "QtCore" in places, which I find confusing. Change-Id: Id54161bc5468412750cb9eb7eeb15de3812e8a09 Reviewed-by: Simon Hausmann --- CMakeLists.txt | 2 +- cmake/QtBuild.cmake | 148 ++++++++++++++----------------------- src/corelib/CMakeLists.txt | 3 + src/testlib/CMakeLists.txt | 6 +- 4 files changed, 61 insertions(+), 98 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 622cc5e00bd..4f00d333dc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12.0) +cmake_minimum_required(VERSION 3.13.0) project(QtBase VERSION 5.12.0 diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index cae2aaf1b54..1bc55348e90 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -431,7 +431,7 @@ function(qt_internal_process_automatic_sources target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES") @@ -454,14 +454,19 @@ function(extend_target target) qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR FLAGS "${arg_DBUS_ADAPTOR_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() + foreach(interface ${arg_DBUS_INTERFACE_SOURCES}) qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE FLAGS "${arg_DBUS_INTERFACE_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() qt_internal_process_automatic_sources("${target}" "${arg_SOURCES}") - set(must_push_features OFF) - foreach(dep ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) + # Import features + if(NOT "${target}" STREQUAL "Core") + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) + endif() + + foreach(dep ${arg_FEATURE_DEPENDENCIES} ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") if (${CMAKE_MATCH_COUNT} EQUAL 3) set(depTarget ${CMAKE_MATCH_2}) @@ -479,8 +484,6 @@ function(extend_target target) qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) endif() qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) - - set(must_push_features ON) endif() endforeach() @@ -492,9 +495,7 @@ function(extend_target target) target_compile_definitions("${target}" PUBLIC ${arg_PUBLIC_DEFINES} PRIVATE ${arg_DEFINES}) target_link_libraries("${target}" PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE ${arg_LIBRARIES}) - if(must_push_features) - qt_push_features_into_parent_scope() - endif() + qt_push_features_into_parent_scope() endif() endfunction() @@ -569,7 +570,7 @@ function(add_qt_module target) # Process arguments: qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" - "${__default_private_args};${__default_public_args};FEATURE_DEPENDENCIES" ${ARGN}) + "${__default_private_args};${__default_public_args}" ${ARGN}) if(NOT DEFINED arg_CONFIG_MODULE_NAME) set(arg_CONFIG_MODULE_NAME "${module_lower}") @@ -592,23 +593,7 @@ function(add_qt_module target) add_library("${target_private}" INTERFACE) qt_internal_add_target_aliases("${target_private}") - # Import global features - if(NOT "${target}" STREQUAL "Core") - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) - endif() - - # Fetch features from dependencies and make them available to the - # caller as well as to the local scope for configure.cmake evaluation. - foreach(dep ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES} ${arg_FEATURE_DEPENDENCIES}) - if("${dep}" MATCHES "(Qt::.+)Private") - set(publicDep ${CMAKE_MATCH_1}) - qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) - else() - set(publicDep ${dep}) - endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) - endforeach() - + # Module headers: if(${arg_NO_MODULE_HEADERS}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) else() @@ -616,6 +601,12 @@ function(add_qt_module target) execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) + + ### FIXME: Can we replace headers.pri? + qt_read_headers_pri("${target}" "module_headers") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_include_dir}/${module}Depends") + set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") endif() set_target_properties("${target}" PROPERTIES @@ -623,28 +614,6 @@ function(add_qt_module target) RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" OUTPUT_NAME "${module_versioned}") - set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") - if(EXISTS "${configureFile}") - qt_feature_module_begin( - LIBRARY "${target}" - PUBLIC_FILE "qt${arg_CONFIG_MODULE_NAME}-config.h" - PRIVATE_FILE "qt${arg_CONFIG_MODULE_NAME}-config_p.h" - PUBLIC_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} - PRIVATE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} - ) - include(${configureFile}) - qt_feature_module_end("${target}") - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES "${target}") - - set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config.h") - set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config_p.h") - - if("${target}" STREQUAL "Core") - set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") - set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") - endif() - endif() - qt_internal_library_deprecation_level(deprecation_define) extend_target("${target}" @@ -672,22 +641,29 @@ function(add_qt_module target) QT_BUILDING_QT QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" - PUBLIC_LIBRARIES - ${arg_PUBLIC_LIBRARIES} - LIBRARIES - ${arg_LIBRARIES} - DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" - DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" - DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" - DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" + PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} + LIBRARIES ${arg_LIBRARIES} + FEATURE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} + DBUS_ADAPTOR_SOURCES ${arg_DBUS_ADAPTOR_SOURCES} + DBUS_ADAPTOR_FLAGS ${arg_DBUS_ADAPTOR_FLAGS} + DBUS_INTERFACE_SOURCES ${arg_DBUS_INTERFACE_SOURCES} + DBUS_INTERFACE_FLAGS ${arg_DBUS_INTERFACE_FLAGS} ) - ### FIXME: Can we replace headers.pri? - if(NOT ${arg_NO_MODULE_HEADERS}) - qt_read_headers_pri("${target}" "module_headers") - set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") - set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") - set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_include_dir}/${module}Depends") + set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") + if(EXISTS "${configureFile}") + qt_feature_module_begin( + LIBRARY "${target}" + PUBLIC_FILE "qt${arg_CONFIG_MODULE_NAME}-config.h" + PRIVATE_FILE "qt${arg_CONFIG_MODULE_NAME}-config_p.h" + PUBLIC_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} + PRIVATE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} + ) + include(${configureFile}) + qt_feature_module_end("${target}") + + set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config.h") + set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/qt${arg_CONFIG_MODULE_NAME}-config_p.h") endif() if(DEFINED module_headers_private) @@ -696,8 +672,6 @@ function(add_qt_module target) qt_internal_add_linker_version_script("${target}") endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES ${arg_FEATURE_DEPENDENCIES}) - install(TARGETS "${target}" "${target_private}" EXPORT "${module_versioned}Targets" LIBRARY DESTINATION ${INSTALL_LIBDIR} ARCHIVE DESTINATION ${INSTALL_LIBDIR} @@ -762,41 +736,26 @@ endfunction() # This is the main entry point for defining Qt plugins. -# A CMake target is created with the given name. The TYPE parameter is needed to place the +# A CMake target is created with the given target. The TYPE parameter is needed to place the # plugin into the correct plugins/ sub-directory. -function(add_qt_plugin name) - # This is a copy paste of add_qt_module with minor changes and some commented out stuff. - # FIXME !!! - set(module "${name}") - string(TOUPPER "${name}" name_upper) +function(add_qt_plugin target) + qt_internal_module_info(module "${target}") qt_parse_all_arguments(arg "add_qt_plugin" "" "TYPE" "${__default_private_args};${__default_public_args}" ${ARGN}) if (NOT DEFINED arg_TYPE) message(FATAL_ERROR "add_qt_plugin called without setting a TYPE.") endif() - add_library("${module}") - set_target_properties("${module}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") - set_target_properties("${module}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") + add_library("${target}") + qt_internal_add_target_aliases("${target}") - # Import global features - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) - - # Fetch features from dependencies and make them available to the - # caller as well as to the local scope for configure.cmake evaluation. - foreach(dep ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) - if("${dep}" MATCHES "(Qt::.+)Private") - set(publicDep ${CMAKE_MATCH_1}) - qt_pull_features_into_current_scope(PRIVATE_FEATURES ${publicDep}) - else() - set(publicDep ${dep}) - endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES ${publicDep}) - endforeach() + set_target_properties("${target}" PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") qt_internal_library_deprecation_level(deprecation_define) - extend_target("${module}" + extend_target("${target}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" @@ -812,30 +771,31 @@ function(add_qt_plugin name) QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS QT_BUILDING_QT - QT_BUILD_${name_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore + QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_DEFINES - QT_${name_upper}_LIB + QT_${module_upper}_LIB ${arg_PUBLIC_DEFINES} + FEATURE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" ) - install(TARGETS "${module}" EXPORT "${module}Targets" + install(TARGETS "${target}" EXPORT "${target}Targets" LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${arg_TYPE} ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${arg_TYPE} ) - install(EXPORT "${module}Targets" NAMESPACE Qt:: DESTINATION ${INSTALL_LIBDIR}/cmake) + install(EXPORT "${target}Targets" NAMESPACE Qt:: DESTINATION ${INSTALL_LIBDIR}/cmake) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. if (GCC) - qt_internal_add_link_flags("${module}" "-Wl,--no-undefined") + qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") endif() - qt_internal_add_linker_version_script(${module}) + qt_internal_add_linker_version_script(${target}) qt_push_features_into_parent_scope() endfunction() diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 8c8c033859c..7824a2e506c 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -240,6 +240,9 @@ add_qt_module(Core QT_NO_FOREACH ) +set_property(TARGET Core APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") +set_property(TARGET Core APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") + # As a special feature, the global features are attached to QtCore as # custom properties. That's symmetric to qconfig.cpp/h being part of # QtCore and not of a QtGlobal library. diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index 3650fd0e37b..ed8d2c8df74 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -49,11 +49,11 @@ add_qt_module(Test qxmltestlogger.cpp qxunittestlogger.cpp LIBRARIES - CorePrivate + Qt::CorePrivate PUBLIC_LIBRARIES - Core + Qt::Core DEFINES - QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII + QT_NO_CAST_FROM_ASCII QT_NO_FOREACH QT_NO_DATASTREAM ) From 07dfa3013c94ddfda692ac235b2e022f8265c450 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 11 Dec 2018 16:02:39 +0100 Subject: [PATCH 0051/1322] CMake: Get rid of useless underscores in QtFeature.cmake Change-Id: I87eb55ed2ce01ab136dac3e2a587b43bd3f8a98e Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 203 +++++++++++++++++++++--------------------- 1 file changed, 101 insertions(+), 102 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 2ebf7e86e6e..416c7fc397c 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -1,23 +1,23 @@ function(qt_feature_module_begin) - qt_parse_all_arguments(_arg "qt_feature_module_begin" + qt_parse_all_arguments(arg "qt_feature_module_begin" "" "LIBRARY;PRIVATE_FILE;PUBLIC_FILE" "PUBLIC_DEPENDENCIES;PRIVATE_DEPENDENCIES" ${ARGN}) - if ("${_arg_LIBRARY}" STREQUAL "") + if ("${arg_LIBRARY}" STREQUAL "") message(FATAL_ERROR "qt_feature_begin_module needs a LIBRARY name!") endif() - if ("${_arg_PUBLIC_FILE}" STREQUAL "") + if ("${arg_PUBLIC_FILE}" STREQUAL "") message(FATAL_ERROR "qt_feature_begin_module needs a PUBLIC_FILE name!") endif() - if ("${_arg_PRIVATE_FILE}" STREQUAL "") + if ("${arg_PRIVATE_FILE}" STREQUAL "") message(FATAL_ERROR "qt_feature_begin_module needs a PRIVATE_FILE name!") endif() - set(__QtFeature_library "${_arg_LIBRARY}" PARENT_SCOPE) + set(__QtFeature_library "${arg_LIBRARY}" PARENT_SCOPE) set(__QtFeature_private_features "" PARENT_SCOPE) set(__QtFeature_public_features "" PARENT_SCOPE) - set(__QtFeature_private_file "${_arg_PRIVATE_FILE}" PARENT_SCOPE) - set(__QtFeature_public_file "${_arg_PUBLIC_FILE}" PARENT_SCOPE) + set(__QtFeature_private_file "${arg_PRIVATE_FILE}" PARENT_SCOPE) + set(__QtFeature_public_file "${arg_PUBLIC_FILE}" PARENT_SCOPE) set(__QtFeature_private_extra "" PARENT_SCOPE) set(__QtFeature_public_extra "" PARENT_SCOPE) @@ -25,19 +25,19 @@ function(qt_feature_module_begin) qt_push_features_into_parent_scope() endfunction() -function(qt_feature _feature) - qt_parse_all_arguments(_arg "qt_feature" +function(qt_feature feature) + qt_parse_all_arguments(arg "qt_feature" "PRIVATE;PUBLIC" "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${ARGN}) - set(_QT_FEATURE_DEFINITION_${_feature} ${ARGN} PARENT_SCOPE) + set(_QT_FEATURE_DEFINITION_${feature} ${ARGN} PARENT_SCOPE) # Register feature for future use: - if (_arg_PUBLIC) - list(APPEND __QtFeature_public_features "${_feature}") + if (arg_PUBLIC) + list(APPEND __QtFeature_public_features "${feature}") endif() - if (_arg_PRIVATE) - list(APPEND __QtFeature_private_features "${_feature}") + if (arg_PRIVATE) + list(APPEND __QtFeature_private_features "${feature}") endif() set(__QtFeature_public_features ${__QtFeature_public_features} PARENT_SCOPE) @@ -185,133 +185,132 @@ macro(qt_feature_set_value feature cache emit_if condition label) set(QT_FEATURE_${feature} "${result}" PARENT_SCOPE) endmacro() -function(qt_evaluate_feature _feature) +function(qt_evaluate_feature feature) # If the feature was set explicitly by the user to be on or off, in the cache, then # there's nothing for us to do. - if(DEFINED "QT_FEATURE_${_feature}") + if(DEFINED "QT_FEATURE_${feature}") return() endif() - if(NOT DEFINED _QT_FEATURE_DEFINITION_${_feature}) + if(NOT DEFINED _QT_FEATURE_DEFINITION_${feature}) qt_debug_print_variables(DEDUP MATCH "^QT_FEATURE") - message(FATAL_ERROR "Attempting to evaluate feature ${_feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing") + message(FATAL_ERROR "Attempting to evaluate feature ${feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing") endif() - cmake_parse_arguments(_arg + cmake_parse_arguments(arg "PRIVATE;PUBLIC" - "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${_QT_FEATURE_DEFINITION_${_feature}}) + "LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${_QT_FEATURE_DEFINITION_${feature}}) - if(DEFINED QT_FEATURE_${_feature}) + if(DEFINED QT_FEATURE_${feature}) return() endif() - if("${_arg_ENABLE}" STREQUAL "") - set(_arg_ENABLE OFF) + if("${arg_ENABLE}" STREQUAL "") + set(arg_ENABLE OFF) endif() - if("${_arg_DISABLE}" STREQUAL "") - set(_arg_DISABLE OFF) + if("${arg_DISABLE}" STREQUAL "") + set(arg_DISABLE OFF) endif() - if("${_arg_AUTODETECT}" STREQUAL "") - set(_arg_AUTODETECT ON) + if("${arg_AUTODETECT}" STREQUAL "") + set(arg_AUTODETECT ON) endif() - if("${_arg_CONDITION}" STREQUAL "") + if("${arg_CONDITION}" STREQUAL "") set(condition ON) else() - qt_evaluate_config_expression(condition ${_arg_CONDITION}) + qt_evaluate_config_expression(condition ${arg_CONDITION}) endif() - if(${_arg_DISABLE}) + if(${arg_DISABLE}) set(result OFF) - elseif((${_arg_ENABLE}) OR (${_arg_AUTODETECT})) + elseif((${arg_ENABLE}) OR (${arg_AUTODETECT})) set(result ${condition}) else() # feature not auto-detected and not explicitly enabled set(result OFF) endif() - if("${_arg_EMIT_IF}" STREQUAL "") + if("${arg_EMIT_IF}" STREQUAL "") set(emit_if ON) else() - qt_evaluate_config_expression(emit_if ${_arg_EMIT_IF}) + qt_evaluate_config_expression(emit_if ${arg_EMIT_IF}) endif() if (NOT (condition) AND (calculated)) - message(FATAL_ERROR "Sanity check failed: Feature ${_feature} is enabled but condition does not hold true.") + message(FATAL_ERROR "Sanity check failed: Feature ${feature} is enabled but condition does not hold true.") endif() - qt_feature_set_cache_value(cache "${_feature}" "${emit_if}" "${result}" "${_arg_LABEL}") - qt_feature_set_value("${_feature}" "${cache}" "${emit_if}" "${condition}" "${_arg_LABEL}") + qt_feature_set_cache_value(cache "${feature}" "${emit_if}" "${result}" "${arg_LABEL}") + qt_feature_set_value("${feature}" "${cache}" "${emit_if}" "${condition}" "${arg_LABEL}") endfunction() -function(qt_feature_definition _feature _name) - qt_parse_all_arguments(_arg "qt_feature_definition" "NEGATE" "VALUE" "" ${ARGN}) +function(qt_feature_definition feature name) + qt_parse_all_arguments(arg "qt_feature_definition" "NEGATE" "VALUE" "" ${ARGN}) # Generate code: - set(_expected 1) - if (_arg_NEGATE) - set(_expected -1) + set(expected 1) + if (arg_NEGATE) + set(expected -1) endif() - set(_msg "\n#if defined(QT_FEATURE_${_feature}) && QT_FEATURE_${_feature} == ${_expected}\n") - if (_arg_VALUE) - string(APPEND _msg "# define ${_name} ${_arg_VALUE}\n") + set(msg "\n#if defined(QT_FEATURE_${feature}) && QT_FEATURE_${feature} == ${expected}\n") + if (arg_VALUE) + string(APPEND msg "# define ${name} ${arg_VALUE}\n") else() - string(APPEND _msg "# define ${_name}\n") + string(APPEND msg "# define ${name}\n") endif() - string(APPEND _msg "#endif\n") + string(APPEND msg "#endif\n") # Store for later use: - list(FIND __QtFeature_public_features "${_feature}" _public_index) - if (_public_index GREATER -1) - string(APPEND __QtFeature_public_extra "${_msg}") + list(FIND __QtFeature_public_features "${feature}" public_index) + if (public_index GREATER -1) + string(APPEND __QtFeature_public_extra "${msg}") endif() - list(FIND __QtFeature_private_features "${_feature}" _private_index) - if (_private_index GREATER -1) - string(APPEND __QtFeature_private_extra "${_msg}") + list(FIND __QtFeature_private_features "${feature}" private_index) + if (private_index GREATER -1) + string(APPEND __QtFeature_private_extra "${msg}") endif() set(__QtFeature_public_extra ${__QtFeature_public_extra} PARENT_SCOPE) set(__QtFeature_private_extra ${__QtFeature_private_extra} PARENT_SCOPE) endfunction() -function(qt_extra_definition _name _value) - qt_parse_all_arguments(_arg "qt_extra_definition" "PUBLIC;PRIVATE" "" "" ${ARGN}) +function(qt_extra_definition name value) + qt_parse_all_arguments(arg "qt_extra_definition" "PUBLIC;PRIVATE" "" "" ${ARGN}) - if (_arg_PUBLIC) - string(APPEND __QtFeature_public_extra "\n#define ${_name} ${_value}\n") - elseif(_arg_PRIVATE) - string(APPEND __QtFeature_private_extra "\n#define ${_name} ${_value}\n") + if (arg_PUBLIC) + string(APPEND __QtFeature_public_extra "\n#define ${name} ${value}\n") + elseif(arg_PRIVATE) + string(APPEND __QtFeature_private_extra "\n#define ${name} ${value}\n") endif() set(__QtFeature_public_extra ${__QtFeature_public_extra} PARENT_SCOPE) set(__QtFeature_private_extra ${__QtFeature_private_extra} PARENT_SCOPE) endfunction() -function(_qt_generate_feature_line _line _feature) - set(_line "") - if (QT_FEATURE_${_feature} STREQUAL "ON") - set(_line "#define QT_FEATURE_${_feature} 1\n\n" PARENT_SCOPE) - elseif(QT_FEATURE_${_feature} STREQUAL "OFF") - set(_line "#define QT_FEATURE_${_feature} -1\n\n" PARENT_SCOPE) - elseif(QT_FEATURE_${_feature} STREQUAL "UNSET") - set(_line "#define QT_FEATURE_${_feature} 0\n\n" PARENT_SCOPE) +function(qt_internal_generate_feature_line line feature) + if (QT_FEATURE_${feature} STREQUAL "ON") + set(line "#define QT_FEATURE_${feature} 1\n\n" PARENT_SCOPE) + elseif(QT_FEATURE_${feature} STREQUAL "OFF") + set(line "#define QT_FEATURE_${feature} -1\n\n" PARENT_SCOPE) + elseif(QT_FEATURE_${feature} STREQUAL "UNSET") + set(line "#define QT_FEATURE_${feature} 0\n\n" PARENT_SCOPE) else() - message(FATAL_ERROR "${_feature} has unexpected value \"${QT_FEATURE_${_feature}}\"!") + message(FATAL_ERROR "${feature} has unexpected value \"${QT_FEATURE_${feature}}\"!") endif() endfunction() -function(_qt_feature_write_file _file _features _extra) - message("Generating file ${_file}.") - set(_contents "") - foreach(_it ${_features}) - _qt_generate_feature_line(_line "${_it}") - string(APPEND _contents "${_line}") +function(qt_internal_feature_write_file file features extra) + message("Generating file ${file}.") + set(contents "") + foreach(it ${features}) + qt_internal_generate_feature_line(line "${it}") + string(APPEND contents "${line}") endforeach() - string(APPEND _contents "${_extra}") + string(APPEND contents "${extra}") - file(GENERATE OUTPUT "${_file}" CONTENT "${_contents}") + file(GENERATE OUTPUT "${file}" CONTENT "${contents}") endfunction() function(qt_feature_module_end target) @@ -347,12 +346,12 @@ function(qt_feature_module_end target) unset(_QT_FEATURE_DEFINITION_${feature} PARENT_SCOPE) endforeach() - _qt_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_private_file}" + qt_internal_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_private_file}" "${__QtFeature_private_features}" "${__QtFeature_private_extra}" ) qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_private_file}" PRIVATE) - _qt_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_public_file}" + qt_internal_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_public_file}" "${__QtFeature_public_features}" "${__QtFeature_public_extra}" ) qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_public_file}") @@ -387,10 +386,10 @@ function(qt_feature_module_end target) endfunction() function(qt_config_compile_test name) - cmake_parse_arguments(_arg "" "LABEL" "" ${ARGN}) + cmake_parse_arguments(arg "" "LABEL" "" ${ARGN}) - check_cxx_source_compiles("${_arg_UNPARSED_ARGUMENTS}" HAVE_${name}) - set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${_arg_LABEL}") + check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS}" HAVE_${name}) + set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}") endfunction() function(qt_config_compile_test_x86simd extension label) @@ -404,44 +403,44 @@ function(qt_config_compile_test_x86simd extension label) endfunction() function(qt_pull_features_into_current_scope) - cmake_parse_arguments(__arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "FEATURE_PROPERTY_INFIX" "" ${ARGN}) - foreach(__target IN ITEMS ${__arg_UNPARSED_ARGUMENTS}) - if(NOT TARGET ${__target}) + cmake_parse_arguments(arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "FEATURE_PROPERTY_INFIX" "" ${ARGN}) + foreach(target IN ITEMS ${arg_UNPARSED_ARGUMENTS}) + if(NOT TARGET ${target}) continue() endif() - get_target_property(__target_type "${__target}" TYPE) - if("${__target_type}" STREQUAL "INTERFACE_LIBRARY") - set(__property_prefix "INTERFACE_") + get_target_property(target_type "${target}" TYPE) + if("${target_type}" STREQUAL "INTERFACE_LIBRARY") + set(property_prefix "INTERFACE_") else() - set(__property_prefix "") + set(property_prefix "") endif() - foreach(__visibility PUBLIC PRIVATE) - set(__value ON) - foreach(__state ENABLED DISABLED) - if(NOT ${__arg_${__visibility}_FEATURES}) + foreach(visibility PUBLIC PRIVATE) + set(value ON) + foreach(state ENABLED DISABLED) + if(NOT ${arg_${visibility}_FEATURES}) continue() endif() - get_target_property(__features "${__target}" ${__property_prefix}QT_${__arg_FEATURE_PROPERTY_INFIX}${__state}_${__visibility}_FEATURES) - if("${__features}" STREQUAL "__features-NOTFOUND") + get_target_property(features "${target}" ${property_prefix}QT_${arg_FEATURE_PROPERTY_INFIX}${state}_${visibility}_FEATURES) + if("${features}" STREQUAL "features-NOTFOUND") continue() endif() - foreach(__feature ${__features}) - set(QT_FEATURE_${__feature} ${__value} PARENT_SCOPE) + foreach(feature ${features}) + set(QT_FEATURE_${feature} ${value} PARENT_SCOPE) endforeach() - set(__value OFF) + set(value OFF) endforeach() endforeach() endforeach() endfunction() macro(qt_push_features_into_parent_scope) - get_cmake_property(__variableNames VARIABLES) - list (SORT __variableNames) - list(REMOVE_DUPLICATES __variableNames) + get_cmake_property(_variableNames VARIABLES) + list (SORT _variableNames) + list(REMOVE_DUPLICATES _variableNames) - foreach(__var ${__variableNames}) - if(__var MATCHES "^QT_FEATURE_[a-z][a-z0-9_]*$") - set("${__var}" "${${__var}}" PARENT_SCOPE) + foreach(_var ${_variableNames}) + if(_var MATCHES "^QT_FEATURE_[a-z][a-z0-9_]*$") + set("${_var}" "${${_var}}" PARENT_SCOPE) endif() endforeach() endmacro() From e57a94cbd8f28ccab8b3368afc4365237c533a4f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 12 Dec 2018 10:55:20 +0100 Subject: [PATCH 0052/1322] CMake: Use AUTOMOC/AUTOUIC/AUTORCC Change-Id: I0235ca4f227623e5937348b4b010637921dbf154 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 295 +-------- cmake/README.md | 2 + cmake/tests/CMakeLists.txt | 3 - cmake/tests/moc/CMakeLists.txt | 34 - cmake/tests/moc/foo.cpp | 0 cmake/tests/moc/sub/bar.h | 0 cmake/tests/moc/sub2/foobar.h | 0 cmake/tests/qrc/CMakeLists.txt | 31 - cmake/tests/qrc/dialog/dialog.qrc | 0 cmake/tests/qrc/qrc.qrc | 0 cmake/tests/uic/CMakeLists.txt | 31 - cmake/tests/uic/dialog/dialog.ui | 0 cmake/tests/uic/window.ui | 0 examples/gui/rasterwindow/CMakeLists.txt | 22 +- src/CMakeLists.txt | 6 +- src/corelib/CMakeLists.txt | 29 +- src/corelib/kernel/qvariant.cpp | 4 +- src/gui/CMakeLists.txt | 8 + src/gui/util/qshaderlanguage_p.h | 3 +- src/network/CMakeLists.txt | 8 + src/opengl/CMakeLists.txt | 6 + src/platformheaders/CMakeLists.txt | 5 + .../fontdatabases/CMakeLists.txt | 5 + src/tools/qmocscanner/CMakeLists.txt | 10 - src/tools/qmocscanner/main.cpp | 623 ------------------ tests/auto/CMakeLists.txt | 2 +- 26 files changed, 101 insertions(+), 1026 deletions(-) delete mode 100644 cmake/tests/moc/CMakeLists.txt delete mode 100644 cmake/tests/moc/foo.cpp delete mode 100644 cmake/tests/moc/sub/bar.h delete mode 100644 cmake/tests/moc/sub2/foobar.h delete mode 100644 cmake/tests/qrc/CMakeLists.txt delete mode 100644 cmake/tests/qrc/dialog/dialog.qrc delete mode 100644 cmake/tests/qrc/qrc.qrc delete mode 100644 cmake/tests/uic/CMakeLists.txt delete mode 100644 cmake/tests/uic/dialog/dialog.ui delete mode 100644 cmake/tests/uic/window.ui delete mode 100644 src/tools/qmocscanner/CMakeLists.txt delete mode 100644 src/tools/qmocscanner/main.cpp diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 1bc55348e90..446746c0116 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -222,43 +222,6 @@ function(qt_internal_add_linker_version_script target) endif() endfunction() -# Generates the necessary rules to run moc on the sources specified after the MOC parameter. -# The resulting moc files are added to the target. -function(qt_internal_wrap_cpp target) - # get include dirs - qt_get_moc_flags(moc_flags) - qt_parse_all_arguments(arg "qt_internal_wrap_cpp" "" "HEADER_FILE_ONLY" "OPTIONS;DEPENDS;MOC" ${ARGN}) - - set(outfiles) - - get_target_property(binary_dir "${target}" BINARY_DIR) - get_target_property(source_dir "${target}" SOURCE_DIR) - - foreach(it ${arg_MOC}) - get_filename_component(moc_file_extension ${it} EXT) - - if("x${moc_file_extension}" STREQUAL "x.h") - set(file_prefix "moc_") - set(file_extension ".cpp") - else() - set(file_prefix "") - set(file_extension ".moc") - endif() - - qt_make_output_file("${it}" "${file_prefix}" "${file_extension}" "${source_dir}" "${binary_dir}" outfile) - - qt_create_moc_command("${target}" "${source_dir}" "${it}" "${outfile}" "${moc_flags}" "${arg_OPTIONS}" "${arg_DEPENDS}") - set_source_files_properties("${outfile}" PROPERTIES HEADER_FILE_ONLY ${arg_HEADER_FILE_ONLY}) - if (arg_HEADER_FILE_ONLY) - get_filename_component(directory "${outfile}" DIRECTORY) - target_include_directories("${target}" PRIVATE "${directory}") - endif() - - list(APPEND outfiles "${outfile}") - endforeach() - target_sources("${target}" PRIVATE "${outfiles}") -endfunction() - # Get a set of Qt module related values based on the target name. # When doing qt_internal_module_info(foo Core) this method will set @@ -280,157 +243,6 @@ function(qt_internal_module_info result target) endfunction() -# This function takes a target as a parameter, followed by a list of sources. -# The sources are scanned for Q_OBJECT/Q_GADGET use as well as the inclusion of -# moc_*.cpp/*.moc. Rules are created to call moc accordingly at build time and -# add the generated sources to the target, if the generated code is not -# directly included otherwise. -function(qt_internal_automoc target) - if ("x${ARGN}" STREQUAL "x") - return() - endif() - - if(NOT DEFINED QT_MOCSCANNER) - get_target_property(mocPath "Qt::moc" LOCATION) - get_filename_component(binDirectory "${mocPath}" DIRECTORY) - set(QT_MOCSCANNER "${binDirectory}/qmocscanner${CMAKE_EXECUTABLE_SUFFIX}") - endif() - - string(REPLACE ";" "\n" sources "${ARGN}") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/moc_sources_and_headers.txt" ${sources}) - execute_process(COMMAND "${QT_MOCSCANNER}" - "${CMAKE_CURRENT_BINARY_DIR}/moc_sources_and_headers.txt" - "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" - "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - ) - - file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt" moc_files_included) - file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt" moc_files_to_build) - - file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_sources_and_headers.txt") - file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_included.txt") - file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/moc_files_to_build.txt") - - qt_internal_wrap_cpp("${target}" MOC ${moc_files_included} HEADER_FILE_ONLY ON) - qt_internal_wrap_cpp("${target}" MOC ${moc_files_to_build} HEADER_FILE_ONLY OFF) -endfunction() - - -# This function takes a target as a parameter, followed by a list of sources. -# Any sources with the .ui extension are passed on to uic and the generated output -# is added to the target sources. -function(qt_internal_autouic target) - set(outfiles "") - - get_target_property(source_dir "${target}" SOURCE_DIR) - get_target_property(binary_dir "${target}" BINARY_DIR) - - foreach(infile ${ARGN}) - get_filename_component(ext "${infile}" EXT) - if("${ext}" STREQUAL ".ui") - qt_make_output_file("${infile}" "ui_" ".h" "${source_dir}" "${binary_dir}" outfile) - qt_create_uic_command("${infile}" "${source_dir}" "${outfile}") - list(APPEND outfiles "${outfile}") - - get_filename_component(outfile_path "${outfile}" PATH) - target_include_directories("${target}" PRIVATE "${outfile_path}") - endif() - endforeach() - target_sources("${target}" PRIVATE "${outfiles}") -endfunction() - - -# This function attempts to (poorly) parse the given resourceFile (.qrc) and -# determine the dependencies, i.e. which files are intended for inclusion into -# the Qt resource. -function(qt_extract_qrc_dependencies resourceFile out_depends_ rc_depends_) - get_filename_component(rc_path ${resourceFile} PATH) - - if(EXISTS "${infile}") - # parse file for dependencies - # all files are absolute paths or relative to the location of the qrc file - file(READ "${infile}" RC_FILE_CONTENTS) - string(REGEX MATCHALL "]*>" "" RC_FILE "${RC_FILE}") - if(NOT IS_ABSOLUTE "${RC_FILE}") - set(RC_FILE "${rc_path}/${RC_FILE}") - endif() - set(RC_DEPENDS ${RC_DEPENDS} "${RC_FILE}") - endforeach() - # Since this cmake function is doing the dependency scanning for these files, - # let's make a configured file and add it as a dependency so cmake is run - # again when dependencies need to be recomputed. - qt_make_output_file("${infile}" "" ".qrc.depends" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" out_depends) - configure_file("${infile}" "${out_depends}" COPYONLY) - else() - # The .qrc file does not exist (yet). Let's add a dependency and hope - # that it will be generated later - set(out_depends) - endif() - - set(${out_depends_} ${out_depends} PARENT_SCOPE) - set(${rc_depends_} ${RC_DEPENDS} PARENT_SCOPE) -endfunction() - - -# This function creates the necessary rule to call rcc on the given -# resource file and stores the name of the to-be generated C++ source -# file (created by rcc) in the outCppFile variable. -function(qt_create_rcc_command resourceFile source_dir binary_dir outfile) - qt_extract_qrc_dependencies("${infile}" out_depends rc_depends "${source_dir}" "${binary_dir}") - set_source_files_properties("${infile}" PROPERTIES SKIP_AUTORCC ON) - - get_filename_component(outfilename "${resourceFile}" NAME_WE) - add_custom_command(OUTPUT "${outfile}" - COMMAND "Qt::rcc" --name "${outfilename}" --output "${outfile}" "${resourceFile}" - MAIN_DEPENDENCY "${infile}" - DEPENDS "${rc_depends}" "${out_depends}" - WORKING_DIRECTORY "${source_dir}" VERBATIM) - set_source_files_properties("${outfile}" PROPERTIES SKIP_AUTOMOC ON) - set_source_files_properties("${outfile}" PROPERTIES SKIP_AUTOUIC ON) -endfunction() - - -# This function takes a target as a parameter, followed by a list of sources. -# Any sources ending with the .qrc extension are treated as Qt resources and rules -# to call rcc are generated. The source files rcc generates are added to the target. -function(qt_internal_autorcc target) - get_target_property(binary_dir "${target}" BINARY_DIR) - get_target_property(source_dir "${target}" SOURCE_DIR) - - set(qrc_outfiles "") - - foreach(infile ${ARGN}) - get_filename_component(ext "${infile}" EXT) - if("${ext}" STREQUAL ".qrc") - qt_make_output_file("${infile}" "qrc_" ".cpp" "${source_dir}" "${binary_dir}" outfile) - list(FIND all_sources "${outfile}" known_result) - if (known_result GREATER -1) - continue() - endif() - - qt_create_rcc_command("${infile}" "${source_dir}" "${binary_dir}" "${outfile}") - list(APPEND qrc_outfiles "${outfile}") - endif() - endforeach() - target_sources("${target}" PRIVATE "${qrc_outfiles}") -endfunction() - - -# This function takes a target as a parameter, followed by a list of sources. -# The sources are scanned for .ui and .qrc as well as Q_OBJECT/Q_GADGET use -# and rules to call uic/rcc/moc are created. Any generated sources are added -# as private sources to the specified target. -function(qt_internal_process_automatic_sources target) - qt_internal_automoc("${target}" ${ARGN}) - qt_internal_autouic("${target}" ${ARGN}) - qt_internal_autorcc("${target}" ${ARGN}) -endfunction() - - set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES") @@ -459,7 +271,6 @@ function(extend_target target) qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE FLAGS "${arg_DBUS_INTERFACE_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() - qt_internal_process_automatic_sources("${target}" "${arg_SOURCES}") # Import features if(NOT "${target}" STREQUAL "Core") @@ -487,6 +298,15 @@ function(extend_target target) endif() endforeach() + set_target_properties("${target}" PROPERTIES + AUTOMOC ON + AUTOMOC_EXECUTABLE "$" + AUTORCC ON + AUTORCC_EXECUTABLE "$" + AUTOUIC ON + AUTOUIC_EXECUTABLE "$" + ) + target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) if (arg_COMPILE_FLAGS) set_source_files_properties(${arg_SOURCES} PROPERTIES COMPILE_FLAGS "${arg_COMPILE_FLAGS}") @@ -882,19 +702,14 @@ function(add_qt_tool name) endif() add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" - # Do not pass sources here: They may not get processed when BOOTSTRAP is set! + SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES ${arg_INCLUDE_DIRECTORIES} DEFINES ${arg_DEFINES} LIBRARIES ${corelib} ${arg_LIBRARIES} ) - target_sources("${name}" PRIVATE "${arg_SOURCES}") qt_internal_add_target_aliases("${name}") - if (NOT arg_BOOTSTRAP) - qt_internal_process_automatic_sources("${name}" ${arg_SOURCES}) - endif() - install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) qt_push_features_into_parent_scope() endfunction() @@ -968,75 +783,28 @@ function(qt_make_output_file infile prefix suffix source_dir binary_dir result) endfunction() -macro(qt_get_moc_flags moc_flags) - set(${moc_flags}) - get_directory_property(inc_DIRS INCLUDE_DIRECTORIES) +# Complete manual moc invocation with full control. +# Use AUTOMOC whenever possible. +function(qt_manual_moc result) + cmake_parse_arguments(arg "" "" "FLAGS" ${ARGN}) + set(moc_files) + foreach(infile ${arg_UNPARSED_ARGUMENTS}) + qt_make_output_file("${infile}" "moc_" ".cpp" + "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" outfile) + list(APPEND moc_files "${outfile}") - if(CMAKE_INCLUDE_CURRENT_DIR) - list(APPEND inc_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - endif() + set(moc_parameters_file "${outfile}_parameters$<$>:_$>") + set(moc_parameters ${arg_FLAGS} -o "${outfile}" "${infile}") + string (REPLACE ";" "\n" moc_parameters "${moc_parameters}") - foreach(current ${inc_DIRS}) - if("${current}" MATCHES "\\.framework/?$") - string(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${current}") - set(${moc_flags} ${${moc_flags}} "-F${framework_path}") - else() - set(${moc_flags} ${${moc_flags}} "-I${current}") - endif() + file(GENERATE OUTPUT "${moc_parameters_file}" CONTENT "${moc_parameters}\n") + + add_custom_command(OUTPUT "${outfile}" + COMMAND Qt::moc "@${moc_parameters_file}" + DEPENDS "${infile}" ${moc_depends} Qt::moc + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) endforeach() - - get_directory_property(defines COMPILE_DEFINITIONS) - foreach(current ${defines}) - set(${moc_flags} ${${moc_flags}} "-D${current}") - endforeach() - - if(WIN32) - set(${moc_flags} ${${moc_flags}} -DWIN32) - endif() - if (MSVC) - set(${moc_flags} ${${moc_flags}} --compiler-flavor=msvc) - endif() -endmacro() - - -# helper to set up a moc rule -function(qt_create_moc_command target source_dir infile outfile moc_flags moc_options moc_depends) - # Pass the parameters in a file. Set the working directory to - # be that containing the parameters file and reference it by - # just the file name. This is necessary because the moc tool on - # MinGW builds does not seem to handle spaces in the path to the - # file given with the @ syntax. - set (moc_parameters_file "${outfile}_parameters") - set (moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}") - string (REPLACE ";" "\n" moc_parameters "${moc_parameters}") - - set(moc_parameters_file "${moc_parameters_file}$<$>:_$>") - set(targetincludes "$") - set(targetdefines "$") - set(targetincludes "$<$:-I$\n>") - set(targetdefines "$<$:-D$\n>") - - file (GENERATE - OUTPUT "${moc_parameters_file}" - CONTENT "${targetdefines}${targetincludes}${moc_parameters}\n" - ) - - set(moc_extra_parameters_file @${moc_parameters_file}) - add_custom_command(OUTPUT "${outfile}" - COMMAND "Qt::moc" "${moc_extra_parameters_file}" - DEPENDS "${infile}" ${moc_depends} - WORKING_DIRECTORY "${source_dir}" VERBATIM) -endfunction() - - -# helper to set up a uic rule -function(qt_create_uic_command infile source_dir outfile) - add_custom_command(OUTPUT "${outfile}" - COMMAND "Qt::uic" "${infile}" -o "${outfile}" - DEPENDS "${infile}" - COMMENT "Running UIC on ${infile}." - WORKING_DIRECTORY "${source_dir}" VERBATIM) - set_source_files_properties("${outfile}" PROPERTIES HEADER_FILE_ONLY ON) + set("${result}" ${moc_files} PARENT_SCOPE) endfunction() @@ -1066,10 +834,7 @@ function(qt_create_qdbusxml2cpp_command target infile) WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) - # Moc the header: - qt_internal_wrap_cpp("${target}" MOC "${header_file}" HEADER_FILE_ONLY OFF) - - target_sources("${target}" PRIVATE "${header_file}" "${source_file}" "${moc_sources}") + target_sources("${target}" PRIVATE "${header_file}" "${source_file}") endfunction() diff --git a/cmake/README.md b/cmake/README.md index 6ae8162d80e..5a548d06517 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -4,6 +4,8 @@ Initial port is on-going. Some modules of QtBase are ported, incl. some of the p Basic functionality is there (moc, uic, etc.), but documentation, translations, qdbusxml2cpp, etc. are missing. +NOTE: YOU WILL NEED CMAKE 3.14 or later (if that is not released yet you will need to have +https://gitlab.kitware.com/cmake/cmake/merge_requests/2679 applied). # Intro diff --git a/cmake/tests/CMakeLists.txt b/cmake/tests/CMakeLists.txt index 44aacb7b078..6b53c9703d8 100644 --- a/cmake/tests/CMakeLists.txt +++ b/cmake/tests/CMakeLists.txt @@ -45,7 +45,4 @@ macro(add_cmake_test_generate name) endmacro() add_cmake_test_generate(features) -add_cmake_test_generate(moc) -add_cmake_test_generate(qrc) add_cmake_test_generate(qt_make_output_file) -add_cmake_test_generate(uic) diff --git a/cmake/tests/moc/CMakeLists.txt b/cmake/tests/moc/CMakeLists.txt deleted file mode 100644 index 297b1ac17d4..00000000000 --- a/cmake/tests/moc/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -cmake_minimum_required(VERSION 3.12.0) - -project(MocTest - VERSION 1.0.0 - DESCRIPTION "Moc test" - HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX -) - -## Add some paths to check for cmake modules: -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") - -## Qt specific setup common for all modules: -include(QtSetup) - -include(../test.cmake) - -fake_moc_results(MOC foo.cpp sub2/foobar.h MOC_AND_BUILD main.cpp sub/bar.h) -add_qt_executable(test_executable - SOURCES - ../main.cpp - sub/bar.h - sub2/foobar.h - foo.cpp -) - -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/main.moc" BUILD) -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub/moc_bar.cpp" BUILD) -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub2/moc_foobar.cpp") -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/foo.moc") - -test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub" UNKNOWN) -test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/sub2") - diff --git a/cmake/tests/moc/foo.cpp b/cmake/tests/moc/foo.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmake/tests/moc/sub/bar.h b/cmake/tests/moc/sub/bar.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmake/tests/moc/sub2/foobar.h b/cmake/tests/moc/sub2/foobar.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmake/tests/qrc/CMakeLists.txt b/cmake/tests/qrc/CMakeLists.txt deleted file mode 100644 index fc283903008..00000000000 --- a/cmake/tests/qrc/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -cmake_minimum_required(VERSION 3.12.0) - -project(QrcTest - VERSION 1.0.0 - DESCRIPTION "Qrc test" - HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX -) - -## Add some paths to check for cmake modules: -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") - -## Qt specific setup common for all modules: -include(QtSetup) - -include(../test.cmake) - -fake_moc_results() -add_qt_executable(test_executable - SOURCES - ../main.cpp - qrc.qrc -) - -fake_moc_results() -extend_target(test_executable SOURCES dialog/dialog.qrc) - -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/qrc_qrc.cpp" BUILD) -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog/qrc_dialog.cpp" BUILD) - -test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog" UNKNOWN) diff --git a/cmake/tests/qrc/dialog/dialog.qrc b/cmake/tests/qrc/dialog/dialog.qrc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmake/tests/qrc/qrc.qrc b/cmake/tests/qrc/qrc.qrc deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmake/tests/uic/CMakeLists.txt b/cmake/tests/uic/CMakeLists.txt deleted file mode 100644 index b8455821ded..00000000000 --- a/cmake/tests/uic/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -cmake_minimum_required(VERSION 3.12.0) - -project(UicTest - VERSION 1.0.0 - DESCRIPTION "Uic test" - HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX -) - -## Add some paths to check for cmake modules: -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/extra-cmake-modules/find-modules;${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/kwin") - -## Qt specific setup common for all modules: -include(QtSetup) - -include(../test.cmake) - -fake_moc_results() -add_qt_executable(test_executable - SOURCES - ../main.cpp - window.ui -) - -fake_moc_results() -extend_target(test_executable SOURCES dialog/dialog.ui) - -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/ui_window.h") -test_source_file(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog/ui_dialog.h") - -test_include_directory(test_executable "${CMAKE_CURRENT_BINARY_DIR}/dialog") diff --git a/cmake/tests/uic/dialog/dialog.ui b/cmake/tests/uic/dialog/dialog.ui deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cmake/tests/uic/window.ui b/cmake/tests/uic/window.ui deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt index 13caffe5bb1..667f91c268e 100644 --- a/examples/gui/rasterwindow/CMakeLists.txt +++ b/examples/gui/rasterwindow/CMakeLists.txt @@ -1,18 +1,6 @@ -# Generated from rasterwindow.pro. - -##################################################################### -## None Binary: -##################################################################### - -set(sources main.cpp - rasterwindow.cpp rasterwindow.h) -add_executable(rasterwindow - ${sources} +add_qt_executable(rasterwindow + SOURCES + main.cpp + rasterwindow.cpp rasterwindow.h + LIBRARIES Qt::Core Qt::Test Qt::Gui ) -qt_internal_automoc(rasterwindow ${sources}) -target_include_directories(rasterwindow - PRIVATE - "${CMAKE_CURRENT_SOURCE_DIR}" - "${CMAKE_CURRENT_BINARY_DIR}" - ) -target_link_libraries(rasterwindow PRIVATE Qt::Core Qt::Test Qt::Gui) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 16cb36e1459..375b102f58e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,6 @@ function(find_or_build_bootstrap_names) endif() endfunction() - find_or_build_bootstrap_tool(qmocscanner) if (_build_tools) add_subdirectory(tools/bootstrap) # bootstrap library endif() @@ -32,10 +31,6 @@ function(find_or_build_bootstrap_names) find_or_build_bootstrap_tool(qfloat16-tables) find_or_build_bootstrap_tool(tracegen) - # $ does not work during configure run, so export into a plain variable: - get_target_property(_mocscanner "Qt::qmocscanner" IMPORTED_LOCATION) - set(QT_MOCSCANNER "${_mocscanner}" CACHE INTERNAL "Qt moc scanner") - if (_build_tools) install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "Qt::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") endif() @@ -76,4 +71,5 @@ endif() if (QT_FEATURE_testlib) add_subdirectory(testlib) endif() +add_subdirectory(printsupport) add_subdirectory(plugins) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 7824a2e506c..66cdf1ef1f4 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1,4 +1,3 @@ - find_package(Threads) find_package(WrapDoubleConversion REQUIRED) @@ -51,7 +50,6 @@ add_qt_module(Core global/qlibraryinfo.cpp global/qlibraryinfo.h global/qlogging.cpp global/qlogging.h global/qmalloc.cpp - global/qnamespace.h global/qnumeric.cpp global/qnumeric.h global/qnumeric_p.h global/qoperatingsystemversion.cpp global/qoperatingsystemversion.h global/qoperatingsystemversion_p.h global/qprocessordetection.h @@ -117,7 +115,6 @@ add_qt_module(Core kernel/qmetatype.cpp kernel/qmetatype.h kernel/qmetatype_p.h kernel/qmetatypeswitcher_p.h kernel/qmimedata.cpp kernel/qmimedata.h - kernel/qobject.cpp kernel/qobject.h kernel/qobject_p.h kernel/qobject_impl.h kernel/qobjectcleanuphandler.cpp kernel/qobjectcleanuphandler.h kernel/qobjectdefs.h @@ -229,6 +226,8 @@ add_qt_module(Core tools/qvector.h tools/qversionnumber.cpp tools/qversionnumber.h tools/qvsnprintf.cpp + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_BINARY_DIR}/global # For qconfig.cpp LIBRARIES WrapDoubleConversion WrapRt @@ -240,6 +239,28 @@ add_qt_module(Core QT_NO_FOREACH ) +# Handle QObject: Automoc does not work for this as it would +# require to spill internals into users: +add_library(Core_qobject OBJECT) +qt_manual_moc(qobject_moc_files kernel/qobject.h global/qnamespace.h) +set_source_files_properties(${qobject_moc_files} PROPERTIES HEADER_FILE_ONLY ON) +target_sources(Core_qobject PRIVATE + global/qnamespace.h + kernel/qobject.cpp kernel/qobject.h kernel/qobject_p.h ${qobject_moc_files}) +target_include_directories(Core_qobject PRIVATE + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_CURRENT_BINARY_DIR}/global" + "${CMAKE_CURRENT_BINARY_DIR}/kernel" + "${PROJECT_BINARY_DIR}/include" + "${PROJECT_BINARY_DIR}/include/QtCore" + "${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}" + "${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore") +target_link_libraries(Core_qobject PRIVATE Qt::Platform) +target_link_libraries(Core PRIVATE Core_qobject) + +# Comments trigger moc for these, so skip automoc: +set_source_files_properties( tools/qsharedpointer.cpp PROPERTIES SKIP_AUTOMOC ON) + set_property(TARGET Core APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") set_property(TARGET Core APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") @@ -738,6 +759,7 @@ extend_target(Core CONDITION QT_FEATURE_statemachine statemachine/qsignaltransition.cpp statemachine/qsignaltransition.h statemachine/qsignaltransition_p.h statemachine/qstate.cpp statemachine/qstate.h statemachine/qstate_p.h statemachine/qstatemachine.cpp statemachine/qstatemachine.h statemachine/qstatemachine_p.h + INCLUDE_DIRECTORIES statemachine ) # qeventtransition: @@ -756,6 +778,7 @@ extend_target(Core CONDITION QT_FEATURE_mimetype mimetypes/qmimeprovider.cpp mimetypes/qmimeprovider_p.h mimetypes/qmimetype.cpp mimetypes/qmimetype.h mimetypes/qmimetype_p.h mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h + INCLUDE_DIRECTORIES mimetypes ) # Enable Evaluation based on QT_EVAL variable being set from the outside: diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 0b4c3f387f0..b362601f782 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -4215,8 +4215,8 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p) If the QVariant contains a pointer to a type derived from QObject then \c{T} may be any QObject type. If the pointer stored in the QVariant can be qobject_cast to T, then that result is returned. Otherwise a null pointer is - returned. Note that this only works for QObject subclasses which use the - Q_OBJECT macro. + returned. Note that this only works for QObject subclasses which use + the Q_OBJECT macro. If the QVariant contains a sequential container and \c{T} is QVariantList, the elements of the container will be converted into \l {QVariant}s and returned as a QVariantList. diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 69f5d31af72..dd2b101689a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -235,6 +235,14 @@ add_qt_module(Gui Qt::Core ) +set_source_files_properties( + # Comment triggering moc: + opengl/qopenglfunctions.cpp + PROPERTIES + SKIP_AUTOMOC ON + SKIP_AUTOUIC ON + SKIP_AUTORCC ON) + ## Scopes: ##################################################################### diff --git a/src/gui/util/qshaderlanguage_p.h b/src/gui/util/qshaderlanguage_p.h index e392a6c7bbf..e31dcd3a9bf 100644 --- a/src/gui/util/qshaderlanguage_p.h +++ b/src/gui/util/qshaderlanguage_p.h @@ -59,7 +59,8 @@ QT_BEGIN_NAMESPACE namespace QShaderLanguage { - Q_GUI_EXPORT Q_NAMESPACE + Q_GUI_EXPORT + Q_NAMESPACE enum StorageQualifier : char { Const = 1, diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index fd684c7eb2f..48ae64bb28e 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -58,6 +58,14 @@ add_qt_module(Network Qt::CorePrivate ) +set_source_files_properties( + # Comment triggering moc: + access/qnetworkaccessdebugpipebackend_p.h + PROPERTIES + SKIP_AUTOMOC ON + SKIP_AUTOUIC ON + SKIP_AUTORCC ON) + ## Scopes: ##################################################################### diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index f67fea4d160..14750f3a3f0 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -31,6 +31,12 @@ add_qt_module(OpenGL Qt::GuiPrivate Qt::WidgetsPrivate ) +set_source_files_properties(qglfunctions.cpp qgraphicsshadereffect.cpp PROPERTIES + SKIP_AUTOMOC ON + SKIP_AUTOUIC ON + SKIP_AUTORCC ON +) + ## Scopes: ##################################################################### diff --git a/src/platformheaders/CMakeLists.txt b/src/platformheaders/CMakeLists.txt index 493cb9f17a8..431aade79b8 100644 --- a/src/platformheaders/CMakeLists.txt +++ b/src/platformheaders/CMakeLists.txt @@ -1,6 +1,11 @@ # FIXME Add the rest of the stuff add_qt_module(PlatformHeaders SOURCES fake.cpp) +set_source_files_properties(fake.cpp PROPERTIES + SKIP_AUTOMOC ON + SKIP_AUTOUIC ON + SKIP_AUTORCC ON +) extend_target(PlatformHeaders CONDITION APPLE SOURCES cocoafunctions/qcocoawindowfunctions.h) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index ca54c419153..7033af1737b 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -20,6 +20,11 @@ add_qt_module(FontDatabaseSupport Qt::CorePrivate Qt::GuiPrivate ) +set_source_files_properties(fake.cpp PROPERTIES + SKIP_AUTOMOC ON + SKIP_AUTOUIC ON + SKIP_AUTORCC ON +) extend_target(FontDatabaseSupport CONDITION APPLE SOURCES diff --git a/src/tools/qmocscanner/CMakeLists.txt b/src/tools/qmocscanner/CMakeLists.txt deleted file mode 100644 index fd0190dc6e0..00000000000 --- a/src/tools/qmocscanner/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -set(_mocscanner "${PROJECT_BINARY_DIR}/${INSTALL_BINDIR}/qmocscanner${CMAKE_EXECUTABLE_SUFFIX}") -try_compile(mocscanner_built "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp" COPY_FILE "${_mocscanner}") - -add_executable(qmocscanner IMPORTED GLOBAL) -set_target_properties(qmocscanner PROPERTIES IMPORTED_LOCATION "${_mocscanner}") - -install(PROGRAMS "${_mocscanner}" DESTINATION "${INSTALL_BINDIR}") -add_executable("Qt::qmocscanner" ALIAS "qmocscanner") - -# FIXME: This should get exported to ToolsTargets! diff --git a/src/tools/qmocscanner/main.cpp b/src/tools/qmocscanner/main.cpp deleted file mode 100644 index 3509820c619..00000000000 --- a/src/tools/qmocscanner/main.cpp +++ /dev/null @@ -1,623 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Copyright (C) 2016 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmocscanner application of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct ScanResult -{ - std::string fileName; - bool foundMocRelevantMacro = false; - std::vector includedMocFiles; -}; - -struct Option -{ - static int debug_level; -}; -int Option::debug_level = 0; - -static void debug_msg(int level, const char *fmt, ...) -{ - if (level < 3) - return; - va_list ap; - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); -} - -#define qmake_endOfLine(c) (c == '\r' || c == '\n') - -static int skipEscapedLineEnds(const char *buffer, int buffer_len, int offset, int *lines) -{ - // Join physical lines to make logical lines, as in the C preprocessor - while (offset + 1 < buffer_len - && buffer[offset] == '\\' - && qmake_endOfLine(buffer[offset + 1])) { - offset += 2; - ++*lines; - if (offset < buffer_len - && buffer[offset - 1] == '\r' - && buffer[offset] == '\n') // CRLF - offset++; - } - return offset; -} - -static bool matchWhileUnsplitting(const char *buffer, int buffer_len, int start, - const char *needle, int needle_len, - int *matchlen, int *lines) -{ - int x = start; - for (int n = 0; n < needle_len; - n++, x = skipEscapedLineEnds(buffer, buffer_len, x + 1, lines)) { - if (x >= buffer_len || buffer[x] != needle[n]) - return false; - } - // That also skipped any remaining BSNLs immediately after the match. - - // Tell caller how long the match was: - *matchlen = x - start; - - return true; -} - -/* Advance from an opening quote at buffer[offset] to the matching close quote. */ -static int scanPastString(char *buffer, int buffer_len, int offset, int *lines) -{ - // http://en.cppreference.com/w/cpp/language/string_literal - // It might be a C++11 raw string. - bool israw = false; - if (buffer[offset] == '"' && offset > 0) { - int explore = offset - 1; - bool prefix = false; // One of L, U, u or u8 may appear before R - bool saw8 = false; // Partial scan of u8 - while (explore >= 0) { - // Cope with backslash-newline interruptions of the prefix: - if (explore > 0 - && qmake_endOfLine(buffer[explore]) - && buffer[explore - 1] == '\\') { - explore -= 2; - } else if (explore > 1 - && buffer[explore] == '\n' - && buffer[explore - 1] == '\r' - && buffer[explore - 2] == '\\') { - explore -= 3; - // Remaining cases can only decrement explore by one at a time: - } else if (saw8 && buffer[explore] == 'u') { - explore--; - saw8 = false; - prefix = true; - } else if (saw8 || prefix) { - break; - } else if (explore > 1 && buffer[explore] == '8') { - explore--; - saw8 = true; - } else if (buffer[explore] == 'L' - || buffer[explore] == 'U' - || buffer[explore] == 'u') { - explore--; - prefix = true; - } else if (buffer[explore] == 'R') { - if (israw) - break; - explore--; - israw = true; - } else { - break; - } - } - // Check the R (with possible prefix) isn't just part of an identifier: - if (israw && explore >= 0 - && (isalnum(buffer[explore]) || buffer[explore] == '_')) { - israw = false; - } - } - - if (israw) { -#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), lines) - - offset = SKIP_BSNL(offset + 1); - const char *const delim = buffer + offset; - int clean = offset; - while (offset < buffer_len && buffer[offset] != '(') { - if (clean < offset) - buffer[clean++] = buffer[offset]; - else - clean++; - - offset = SKIP_BSNL(offset + 1); - } - /* - Not checking correctness (trust real compiler to do that): - - no controls, spaces, '(', ')', '\\' or (presumably) '"' in delim; - - at most 16 bytes in delim - - Raw strings are surely defined after phase 2, when BSNLs are resolved; - so the delimiter's exclusion of '\\' and space (including newlines) - applies too late to save us the need to cope with BSNLs in it. - */ - - const int delimlen = buffer + clean - delim; - int matchlen = delimlen, extralines = 0; - while ((offset = SKIP_BSNL(offset + 1)) < buffer_len - && (buffer[offset] != ')' - || (delimlen > 0 && - !matchWhileUnsplitting(buffer, buffer_len, - offset + 1, delim, delimlen, - &matchlen, &extralines)) - || buffer[offset + 1 + matchlen] != '"')) { - // skip, but keep track of lines - if (qmake_endOfLine(buffer[offset])) - ++*lines; - extralines = 0; - } - *lines += extralines; // from the match - // buffer[offset] is ')' - offset += 1 + matchlen; // 1 for ')', then delim - // buffer[offset] is '"' - -#undef SKIP_BSNL - } else { // Traditional string or char literal: - const char term = buffer[offset]; - while (++offset < buffer_len && buffer[offset] != term) { - if (buffer[offset] == '\\') - ++offset; - else if (qmake_endOfLine(buffer[offset])) - ++*lines; - } - } - - return offset; -} - -static std::vector findIncludes(const char *fileName, char *buffer, int buffer_len) -{ - std::vector includes; - int line_count = 1; - enum { - /* - States of C preprocessing (for TYPE_C only), after backslash-newline - elimination and skipping comments and spaces (i.e. in ANSI X3.159-1989 - section 2.1.1.2's phase 4). We're about to study buffer[x] to decide - on which transition to do. - */ - AtStart, // start of logical line; a # may start a preprocessor directive - HadHash, // saw a # at start, looking for preprocessor keyword - WantName, // saw #include or #import, waiting for name - InCode // after directive, parsing non-#include directive or in actual code - } cpp_state = AtStart; - - int x = 0; - if (buffer_len >= 3) { - const unsigned char *p = (unsigned char *)buffer; - // skip UTF-8 BOM, if present - if (p[0] == 0xEF && p[1] == 0xBB && p[2] == 0xBF) - x += 3; - } - for (; x < buffer_len; ++x) { - bool try_local = true; - char *inc = nullptr; - // We've studied all buffer[i] for i < x - for (; x < buffer_len; ++x) { - // How to handle backslash-newline (BSNL) pairs: -#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count) - - // Seek code or directive, skipping comments and space: - for (; (x = SKIP_BSNL(x)) < buffer_len; ++x) { - if (buffer[x] == ' ' || buffer[x] == '\t') { - // keep going - } else if (buffer[x] == '/') { - int extralines = 0; - int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines); - if (y >= buffer_len) { - x = y; - break; - } else if (buffer[y] == '/') { // C++-style comment - line_count += extralines; - x = SKIP_BSNL(y + 1); - while (x < buffer_len && !qmake_endOfLine(buffer[x])) - x = SKIP_BSNL(x + 1); // skip - - cpp_state = AtStart; - ++line_count; - } else if (buffer[y] == '*') { // C-style comment - line_count += extralines; - x = y; - while ((x = SKIP_BSNL(++x)) < buffer_len) { - if (buffer[x] == '*') { - extralines = 0; - y = skipEscapedLineEnds(buffer, buffer_len, - x + 1, &extralines); - if (y < buffer_len && buffer[y] == '/') { - line_count += extralines; - x = y; // for loop shall step past this - break; - } - } else if (qmake_endOfLine(buffer[x])) { - ++line_count; - } - } - } else { - // buffer[x] is the division operator - break; - } - } else if (qmake_endOfLine(buffer[x])) { - ++line_count; - cpp_state = AtStart; - } else { - /* Drop out of phases 1, 2, 3, into phase 4 */ - break; - } - } - // Phase 4 study of buffer[x]: - - if (x >= buffer_len) - break; - - switch (cpp_state) { - case HadHash: - { - // Read keyword; buffer[x] starts first preprocessing token after # - const char *const keyword = buffer + x; - int clean = x; - while (x < buffer_len && buffer[x] >= 'a' && buffer[x] <= 'z') { - // skip over keyword, consolidating it if it contains BSNLs - // (see WantName's similar code consolidating inc, below) - if (clean < x) - buffer[clean++] = buffer[x]; - else - clean++; - - x = SKIP_BSNL(x + 1); - } - const int keyword_len = buffer + clean - keyword; - x--; // Still need to study buffer[x] next time round for loop. - - cpp_state = - ((keyword_len == 7 && !strncmp(keyword, "include", 7)) // C & Obj-C - || (keyword_len == 6 && !strncmp(keyword, "import", 6))) // Obj-C - ? WantName : InCode; - break; - } - - case WantName: - { - char term = buffer[x]; - if (term == '<') { - try_local = false; - term = '>'; - } else if (term != '"') { - /* - Possibly malformed, but this may be something like: - #include IDENTIFIER - which does work, if #define IDENTIFIER "filename" is - in effect. This is beyond this noddy preprocessor's - powers of tracking. So give up and resume searching - for a directive. We haven't made sense of buffer[x], - so back up to ensure we do study it (now as code) next - time round the loop. - */ - x--; - cpp_state = InCode; - continue; - } - - x = SKIP_BSNL(x + 1); - inc = buffer + x; - int clean = x; // offset if we need to clear \-newlines - for (; x < buffer_len && buffer[x] != term; x = SKIP_BSNL(x + 1)) { - if (qmake_endOfLine(buffer[x])) { // malformed - cpp_state = AtStart; - ++line_count; - break; - } - - /* - If we do skip any BSNLs, we need to consolidate the - surviving text by copying to lower indices. For that - to be possible, we also have to keep 'clean' advanced - in step with x even when we've yet to see any BSNLs. - */ - if (clean < x) - buffer[clean++] = buffer[x]; - else - clean++; - } - if (cpp_state == WantName) - buffer[clean] = '\0'; - else // i.e. malformed - inc = nullptr; - - cpp_state = InCode; // hereafter - break; - } - - case AtStart: - // Preprocessor directive? - if (buffer[x] == '#') { - cpp_state = HadHash; - break; - } - cpp_state = InCode; - // ... and fall through to handle buffer[x] as such. - case InCode: - // matching quotes (string literals and character literals) - if (buffer[x] == '\'' || buffer[x] == '"') { - x = scanPastString(buffer, buffer_len, x, &line_count); - // for loop's ++x shall step over the closing quote. - } - // else: buffer[x] is just some code; move on. - break; - } - - if (inc) // We were in WantName and found a name. - break; -#undef SKIP_BSNL - } - if (x >= buffer_len) - break; - - if (inc) { - includes.push_back(inc); - } - } - return includes; -} - -static bool isCWordChar(char c) { - return c == '_' - || (c >= 'a' && c <= 'z') - || (c >= 'A' && c <= 'Z') - || (c >= '0' && c <= '9'); -} - -static bool scanBufferForMocRelevantMacros(const char *fileName, char *buffer, int buffer_len) -{ - int line_count = 1; - bool ignore[3] = { false, false, false }; // [0] for Q_OBJECT, [1] for Q_GADGET, [2] for Q_NAMESPACE - /* qmake ignore Q_GADGET */ - /* qmake ignore Q_OBJECT */ - /* qmake ignore Q_NAMESPACE */ - for (int x = 0; x < buffer_len; x++) { -#define SKIP_BSNL(pos) skipEscapedLineEnds(buffer, buffer_len, (pos), &line_count) - x = SKIP_BSNL(x); - if (buffer[x] == '/') { - int extralines = 0; - int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines); - if (buffer_len > y) { - // If comment, advance to the character that ends it: - if (buffer[y] == '/') { // C++-style comment - line_count += extralines; - x = y; - do { - x = SKIP_BSNL(x + 1); - } while (x < buffer_len && !qmake_endOfLine(buffer[x])); - - } else if (buffer[y] == '*') { // C-style comment - line_count += extralines; - x = SKIP_BSNL(y + 1); - for (; x < buffer_len; x = SKIP_BSNL(x + 1)) { - if (buffer[x] == 't' || buffer[x] == 'q') { // ignore - if (buffer_len >= (x + 20) && - !strncmp(buffer + x + 1, "make ignore Q_OBJECT", 20)) { - debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_OBJECT\"", - fileName, line_count); - x += 20; - ignore[0] = true; - } else if (buffer_len >= (x + 20) && - !strncmp(buffer + x + 1, "make ignore Q_GADGET", 20)) { - debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_GADGET\"", - fileName, line_count); - x += 20; - ignore[1] = true; - } else if (buffer_len >= (x + 23) && - !strncmp(buffer + x + 1, "make ignore Q_NAMESPACE", 23)) { - debug_msg(2, "Mocgen: %s:%d Found \"qmake ignore Q_NAMESPACE\"", - fileName, line_count); - x += 23; - ignore[2] = true; - } - } else if (buffer[x] == '*') { - extralines = 0; - y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &extralines); - if (buffer_len > y && buffer[y] == '/') { - line_count += extralines; - x = y; - break; - } - } else if (Option::debug_level && qmake_endOfLine(buffer[x])) { - ++line_count; - } - } - } - // else: don't update x, buffer[x] is just the division operator. - } - } else if (buffer[x] == '\'' || buffer[x] == '"') { - x = scanPastString(buffer, buffer_len, x, &line_count); - // Leaves us on closing quote; for loop's x++ steps us past it. - } - - if (x < buffer_len && Option::debug_level && qmake_endOfLine(buffer[x])) - ++line_count; - if (buffer_len > x + 8 && !isCWordChar(buffer[x])) { - int morelines = 0; - int y = skipEscapedLineEnds(buffer, buffer_len, x + 1, &morelines); - if (buffer[y] == 'Q') { - static const char interesting[][12] = { "Q_OBJECT", "Q_GADGET", "Q_NAMESPACE"}; - for (int interest = 0; interest < 3; ++interest) { - if (ignore[interest]) - continue; - - int matchlen = 0, extralines = 0; - size_t needle_len = strlen(interesting[interest]); - assert(needle_len <= INT_MAX); - if (matchWhileUnsplitting(buffer, buffer_len, y, - interesting[interest], - static_cast(needle_len), - &matchlen, &extralines) - && y + matchlen < buffer_len - && !isCWordChar(buffer[y + matchlen])) { - if (Option::debug_level) { - buffer[y + matchlen] = '\0'; - debug_msg(2, "Mocgen: %s:%d Found MOC symbol %s", - fileName, - line_count + morelines, buffer + y); - } - return true; - } - } - } - } -#undef SKIP_BSNL - } - return false; -} - -static bool startsWith(const std::string &str, const char *needle) -{ - return str.find(needle) == 0; -} - -static bool endsWith(const std::string &str, const char *needle) -{ - return str.rfind(needle) == str.size() - strlen(needle); -} - -static std::string fileNameFromPath(const std::string &path) -{ - int separatorIndex = path.rfind("/"); - if (separatorIndex == -1) - return path; - return path.substr(separatorIndex + 1); -} - -static ScanResult scanFile(const std::string &fileName) -{ - ScanResult result; - result.fileName = fileName; - - std::ifstream file(fileName, std::ios::binary); - if (!file.is_open()) - return result; - - file.seekg(0, std::ios_base::end); - auto size = file.tellg(); - if (size == 0) - return result; - file.seekg(0, std::ios_base::beg); - - std::vector buffer; - buffer.resize(size); - char *bufferPtr = &(*buffer.begin()); - file.read(bufferPtr, size); - - file.close(); - - result.foundMocRelevantMacro = scanBufferForMocRelevantMacros(fileName.c_str(), bufferPtr, size); - - for (const auto &include: findIncludes(fileName.c_str(), bufferPtr, size)) { - if (startsWith(include, "moc_") && endsWith(include, ".cpp")) { - std::string mocHeader = include.substr(strlen("moc_"), - include.size() - strlen("moc_") - strlen(".cpp")); - mocHeader.append(".h"); - result.includedMocFiles.push_back(mocHeader); - } else if (endsWith(include, ".moc")) { - std::string mocHeader = include.substr(0, include.size() - strlen(".moc")); - mocHeader.append(".cpp"); - result.includedMocFiles.push_back(mocHeader); - } - } - - return result; -} - -static void writeSetToFile(const char *fileName, const std::set &content) -{ - std::ofstream file(fileName, std::ios::binary); - for (const auto &entry: content) { - const std::string &fileName = entry; - file << fileName << std::endl; - } -} - -int main(int argc, char **argv) -{ - if (argc != 4) { - fprintf(stderr, "usage: %s \n", argv[0]); - return EXIT_FAILURE; - } - - std::vector sourcesAndHeaders; - { - std::ifstream file(argv[1]); - if (!file.is_open()) { - std::cerr << "failed to open input file " << argv[1] << std::endl; - return EXIT_FAILURE; - } - for (std::string line; std::getline(file, line);) - sourcesAndHeaders.push_back(line); - } - - std::unordered_set mocCandidates; - std::unordered_set mocFilesInIncludeStatements; - - for (const auto &sourceOrHeader: sourcesAndHeaders) { - auto result = scanFile(sourceOrHeader); - if (result.foundMocRelevantMacro) - mocCandidates.insert(result.fileName); - for (const auto &header: result.includedMocFiles) - mocFilesInIncludeStatements.insert(header); - } - - std::set mocFilesToInclude; - std::set mocFilesToBuild; - - for (const auto &candidate: mocCandidates) { - std::string fileName = fileNameFromPath(candidate); - if (mocFilesInIncludeStatements.find(fileName) != mocFilesInIncludeStatements.end()) - mocFilesToInclude.insert(candidate); - else - mocFilesToBuild.insert(candidate); - } - - writeSetToFile(argv[2], mocFilesToInclude); - writeSetToFile(argv[3], mocFilesToBuild); - - return EXIT_SUCCESS; -} diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index 423c6fe8846..e1c4a4dc598 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -49,7 +49,7 @@ if (TARGET Qt::Widgets) add_subdirectory(widgets) endif() if (TARGET Qt::PrintSupport) -# add_subdirectory(printsupport) + add_subdirectory(printsupport) endif() # add_subdirectory(cmake) ## FIXME: Does this still make sense in this form? # add_subdirectory(installed_cmake) ## FIXME: Does this still make sense in this form? From 99315c21291e72c1280093c0d8f47241818df57a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 14 Dec 2018 13:10:36 +0100 Subject: [PATCH 0053/1322] CMake: Build PrintSupport module and tests Change-Id: I7ac14f5214619f547af7221d213ac7e338a05bfc Reviewed-by: Simon Hausmann --- src/printsupport/CMakeLists.txt | 98 +++++++++++++++++++ src/printsupport/configure.cmake | 57 +++++++++++ tests/auto/printsupport/CMakeLists.txt | 5 + .../auto/printsupport/dialogs/CMakeLists.txt | 3 + .../qabstractprintdialog/CMakeLists.txt | 13 +++ tests/auto/printsupport/kernel/CMakeLists.txt | 5 + .../kernel/qprintdevice/CMakeLists.txt | 14 +++ .../kernel/qprinter/CMakeLists.txt | 13 +++ .../kernel/qprinterinfo/CMakeLists.txt | 14 +++ 9 files changed, 222 insertions(+) create mode 100644 src/printsupport/CMakeLists.txt create mode 100644 src/printsupport/configure.cmake create mode 100644 tests/auto/printsupport/CMakeLists.txt create mode 100644 tests/auto/printsupport/dialogs/CMakeLists.txt create mode 100644 tests/auto/printsupport/dialogs/qabstractprintdialog/CMakeLists.txt create mode 100644 tests/auto/printsupport/kernel/CMakeLists.txt create mode 100644 tests/auto/printsupport/kernel/qprintdevice/CMakeLists.txt create mode 100644 tests/auto/printsupport/kernel/qprinter/CMakeLists.txt create mode 100644 tests/auto/printsupport/kernel/qprinterinfo/CMakeLists.txt diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt new file mode 100644 index 00000000000..7a46c061d21 --- /dev/null +++ b/src/printsupport/CMakeLists.txt @@ -0,0 +1,98 @@ +# Generated from printsupport.pro. + +##################################################################### +## PrintSupport Module: +##################################################################### + +add_qt_module(PrintSupport + SOURCES + kernel/qpaintengine_alpha.cpp kernel/qpaintengine_alpha_p.h + kernel/qplatformprintdevice.cpp kernel/qplatformprintdevice.h + kernel/qplatformprintersupport.cpp kernel/qplatformprintersupport.h + kernel/qplatformprintplugin.cpp kernel/qplatformprintplugin.h + kernel/qprint_p.h + kernel/qprintdevice.cpp kernel/qprintdevice_p.h + kernel/qprintengine.h + kernel/qprintengine_pdf.cpp + kernel/qprinter.cpp kernel/qprinter.h kernel/qprinter_p.h + kernel/qprinterinfo.cpp kernel/qprinterinfo.h kernel/qprinterinfo_p.h + kernel/qtprintsupportglobal.h kernel/qtprintsupportglobal_p.h + DEFINES + QT_NO_USING_NAMESPACE + QT_NO_FOREACH + INCLUDE_DIRECTORIES widgets dialogs + LIBRARIES Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate + PUBLIC_LIBRARIES Qt::Gui # for QPageSize +) + +## Scopes: +##################################################################### + +extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewwidget + SOURCES + kernel/qpaintengine_preview.cpp kernel/qpaintengine_preview_p.h +) + +extend_target(PrintSupport CONDITION WIN32 + SOURCES + kernel/qprintengine_win.cpp kernel/qprintengine_win_p.h +) + +extend_target(PrintSupport CONDITION WIN32 AND NOT WINRT + LIBRARIES winspool comdlg32 gdi32 user32 +) + +extend_target(PrintSupport CONDITION (UNIX AND NOT APPLE) AND QT_FEATURE_cups + SOURCES + kernel/qcups.cpp kernel/qcups_p.h +) + +extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewwidget + SOURCES + widgets/qprintpreviewwidget.cpp widgets/qprintpreviewwidget.h +) + +extend_target(PrintSupport CONDITION (UNIX AND NOT APPLE) AND QT_FEATURE_cupsjobwidget + SOURCES + widgets/qcupsjobwidget.cpp widgets/qcupsjobwidget.ui widgets/qcupsjobwidget_p.h +) + +extend_target(PrintSupport CONDITION QT_FEATURE_printdialog + SOURCES + dialogs/qabstractprintdialog.cpp dialogs/qabstractprintdialog.h dialogs/qabstractprintdialog_p.h + dialogs/qpagesetupdialog.cpp dialogs/qpagesetupdialog.h dialogs/qpagesetupdialog_p.h + dialogs/qpagesetupwidget.ui + dialogs/qprintdialog.h dialogs/qprintdialog.qrc +) + +extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND macos + SOURCES + dialogs/qpagesetupdialog_mac.mm + dialogs/qprintdialog_mac.mm + LIBRARIES + ${FWAppKit} +) + +extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND WIN32 + SOURCES + dialogs/qpagesetupdialog_win.cpp + dialogs/qprintdialog_win.cpp +) + +extend_target(PrintSupport CONDITION (QT_FEATURE_printdialog AND UNIX) AND NOT APPLE + SOURCES + dialogs/qpagesetupdialog_unix.cpp dialogs/qpagesetupdialog_unix_p.h + dialogs/qprintdialog_unix.cpp + dialogs/qprintpropertieswidget.ui + dialogs/qprintsettingsoutput.ui + dialogs/qprintwidget.ui + INCLUDE_DIRECTORIES + ${PROJECT_SOURCE_DIR}/src/plugins/printsupport/cups +) + +extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewdialog + SOURCES + dialogs/qprintpreviewdialog.cpp dialogs/qprintpreviewdialog.h +) + +add_qt_docs(./doc/qtprintsupport.qdocconf) diff --git a/src/printsupport/configure.cmake b/src/printsupport/configure.cmake new file mode 100644 index 00000000000..a443e333fc9 --- /dev/null +++ b/src/printsupport/configure.cmake @@ -0,0 +1,57 @@ + + +#### Inputs + + + +#### Libraries + + + +#### Tests + + + +#### Features + +qt_feature("cups" PUBLIC PRIVATE + SECTION "Painting" + LABEL "CUPS" + PURPOSE "Provides support for the Common Unix Printing System." + CONDITION libs.cups AND QT_FEATURE_printer AND QT_FEATURE_datestring OR FIXME +) +qt_feature_definition("cups" "QT_NO_CUPS" NEGATE VALUE "1") +qt_feature("cupsjobwidget" PUBLIC PRIVATE + SECTION "Widgets" + LABEL "CUPS job control widget" + CONDITION ( QT_FEATURE_buttongroup ) AND ( QT_FEATURE_calendarwidget ) AND ( QT_FEATURE_checkbox ) AND ( QT_FEATURE_combobox ) AND ( QT_FEATURE_cups ) AND ( QT_FEATURE_datetimeedit ) AND ( QT_FEATURE_groupbox ) AND ( QT_FEATURE_tablewidget ) +) +qt_feature_definition("cupsjobwidget" "QT_NO_CUPSJOBWIDGET" NEGATE VALUE "1") +qt_feature("printer" PUBLIC + SECTION "Painting" + LABEL "QPrinter" + PURPOSE "Provides a printer backend of QPainter." + CONDITION NOT APPLE_UIKIT AND NOT WINRT AND QT_FEATURE_picture AND QT_FEATURE_temporaryfile AND QT_FEATURE_pdf +) +qt_feature_definition("printer" "QT_NO_PRINTER" NEGATE VALUE "1") +qt_feature("printpreviewwidget" PUBLIC + SECTION "Widgets" + LABEL "QPrintPreviewWidget" + PURPOSE "Provides a widget for previewing page layouts for printer output." + CONDITION QT_FEATURE_graphicsview AND QT_FEATURE_printer AND QT_FEATURE_mainwindow +) +qt_feature_definition("printpreviewwidget" "QT_NO_PRINTPREVIEWWIDGET" NEGATE VALUE "1") +qt_feature("printdialog" PUBLIC + SECTION "Dialogs" + LABEL "QPrintDialog" + PURPOSE "Provides a dialog widget for specifying printer configuration." + CONDITION ( QT_FEATURE_buttongroup ) AND ( QT_FEATURE_checkbox ) AND ( QT_FEATURE_combobox ) AND ( QT_FEATURE_dialog ) AND ( QT_FEATURE_datetimeedit ) AND ( QT_FEATURE_dialogbuttonbox ) AND ( QT_FEATURE_printer ) AND ( QT_FEATURE_radiobutton ) AND ( QT_FEATURE_spinbox ) AND ( QT_FEATURE_tabwidget ) AND ( QT_FEATURE_treeview ) +) +qt_feature_definition("printdialog" "QT_NO_PRINTDIALOG" NEGATE VALUE "1") +qt_feature("printpreviewdialog" PUBLIC + SECTION "Dialogs" + LABEL "QPrintPreviewDialog" + PURPOSE "Provides a dialog for previewing and configuring page layouts for printer output." + CONDITION QT_FEATURE_printpreviewwidget AND QT_FEATURE_printdialog AND QT_FEATURE_toolbar AND QT_FEATURE_formlayout +) +qt_feature_definition("printpreviewdialog" "QT_NO_PRINTPREVIEWDIALOG" NEGATE VALUE "1") diff --git a/tests/auto/printsupport/CMakeLists.txt b/tests/auto/printsupport/CMakeLists.txt new file mode 100644 index 00000000000..3908a297dd4 --- /dev/null +++ b/tests/auto/printsupport/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from printsupport.pro. + +qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::PrintSupport) +add_subdirectory(dialogs) +add_subdirectory(kernel) diff --git a/tests/auto/printsupport/dialogs/CMakeLists.txt b/tests/auto/printsupport/dialogs/CMakeLists.txt new file mode 100644 index 00000000000..548ddc8577a --- /dev/null +++ b/tests/auto/printsupport/dialogs/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from dialogs.pro. + +add_subdirectory(qabstractprintdialog) diff --git a/tests/auto/printsupport/dialogs/qabstractprintdialog/CMakeLists.txt b/tests/auto/printsupport/dialogs/qabstractprintdialog/CMakeLists.txt new file mode 100644 index 00000000000..1297d0138d4 --- /dev/null +++ b/tests/auto/printsupport/dialogs/qabstractprintdialog/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qabstractprintdialog.pro. + +##################################################################### +## tst_qabstractprintdialog Test: +##################################################################### + +add_qt_test(tst_qabstractprintdialog + SOURCES + tst_qabstractprintdialog.cpp + LIBRARIES + Qt::Widgets + Qt::PrintSupport +) diff --git a/tests/auto/printsupport/kernel/CMakeLists.txt b/tests/auto/printsupport/kernel/CMakeLists.txt new file mode 100644 index 00000000000..8154d5e868f --- /dev/null +++ b/tests/auto/printsupport/kernel/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from kernel.pro. + +add_subdirectory(qprintdevice) +add_subdirectory(qprinter) +add_subdirectory(qprinterinfo) diff --git a/tests/auto/printsupport/kernel/qprintdevice/CMakeLists.txt b/tests/auto/printsupport/kernel/qprintdevice/CMakeLists.txt new file mode 100644 index 00000000000..ce0e6d96a98 --- /dev/null +++ b/tests/auto/printsupport/kernel/qprintdevice/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qprintdevice.pro. + +##################################################################### +## tst_qprintdevice Test: +##################################################################### + +add_qt_test(tst_qprintdevice + SOURCES + tst_qprintdevice.cpp + DEFINES + QT_USE_USING_NAMESPACE + LIBRARIES + Qt::PrintSupportPrivate +) diff --git a/tests/auto/printsupport/kernel/qprinter/CMakeLists.txt b/tests/auto/printsupport/kernel/qprinter/CMakeLists.txt new file mode 100644 index 00000000000..800e6933210 --- /dev/null +++ b/tests/auto/printsupport/kernel/qprinter/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from qprinter.pro. + +##################################################################### +## tst_qprinter Test: +##################################################################### + +add_qt_test(tst_qprinter + SOURCES + tst_qprinter.cpp + LIBRARIES + Qt::PrintSupport + Qt::Widgets +) diff --git a/tests/auto/printsupport/kernel/qprinterinfo/CMakeLists.txt b/tests/auto/printsupport/kernel/qprinterinfo/CMakeLists.txt new file mode 100644 index 00000000000..482891d85b4 --- /dev/null +++ b/tests/auto/printsupport/kernel/qprinterinfo/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from qprinterinfo.pro. + +##################################################################### +## tst_qprinterinfo Test: +##################################################################### + +add_qt_test(tst_qprinterinfo + SOURCES + tst_qprinterinfo.cpp + DEFINES + QT_USE_USING_NAMESPACE + LIBRARIES + Qt::PrintSupport +) From f0aa8fa48e3fbd601d983d809a38945f2814665e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 20 Dec 2018 10:41:56 +0100 Subject: [PATCH 0054/1322] pro2cmake: Handle VPATH Change-Id: Ia72f55489129c50ca730c42b75bbc2bda926b82f Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 40043d15d54..f740b4353f9 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -81,7 +81,7 @@ def map_to_file(f: str, top_dir: str, current_dir: str, return f -def map_source_to_cmake(source: str) -> typing.Optional[str]: +def map_source_to_cmake(source: str, base_dir: str, vpath: List[str]) -> typing.Optional[str]: if not source or source == '$$NO_PCH_SOURCES': return None if source.startswith('$$PWD/'): @@ -90,7 +90,19 @@ def map_source_to_cmake(source: str) -> typing.Optional[str]: return "${CMAKE_CURRENT_SOURCE_DIR}" if source.startswith('$$QT_SOURCE_TREE/'): return "${PROJECT_SOURCE_DIR}/" + source[17:] - return source + + if os.path.exists(os.path.join(base_dir, source)): + return source + + + for v in vpath: + fullpath = os.path.join(v, source) + if os.path.exists(fullpath): + relpath = os.path.relpath(fullpath, base_dir) + return relpath + + print(' XXXX: Source {}: Not found.'.format(source)) + return '{}-NOTFOUND'.format(source) def map_source_to_fs(base_dir: str, file: str, source: str) -> typing.Optional[str]: @@ -492,7 +504,9 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, else: sources += resources - sources = [map_source_to_cmake(s) for s in sources] + vpath = scope.get('VPATH') + + sources = [map_source_to_cmake(s, scope.basedir(), vpath) for s in sources] if sources: cm_fh.write('{} SOURCES\n'.format(ind)) for l in sort_sources(sources): From 19874e2381df0b6831b365fc4932b3c19a5290a9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 20 Dec 2018 16:15:10 +0100 Subject: [PATCH 0055/1322] pro2cmake: Be more faithful in the representation of operations Do a better approximation of =, +=, *= and -=. Change-Id: I94765532f278deaac330b27cd5a3f41f319c6477 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 238 ++++++++++++++++++++++++---------------- 1 file changed, 146 insertions(+), 92 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index f740b4353f9..402e763dc5f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -119,9 +119,74 @@ def map_source_to_fs(base_dir: str, file: str, source: str) -> typing.Optional[s return os.path.join(base_dir, source) +class Operation: + def __init__(self, value): + if isinstance(value, list): + self._value = value + else: + self._value = [str(value),] + + def process(self, input): + assert(False) + + def __str__(self): + assert(False) + + +class AddOperation(Operation): + def process(self, input): + return input + self._value + + def __str__(self): + return '+({})'.format(self._value) + + +class UniqueAddOperation(Operation): + def process(self, input): + result = input + for v in self._value: + if not v in result: + result += [v,] + return result + + def __str__(self): + return '*({})'.format(self._value) + + +class SetOperation(Operation): + def process(self, input): + return self._value + + def __str__(self): + return '=({})'.format(self._value) + + +class RemoveOperation(Operation): + def __init__(self, value): + super().__init__(value) + + def process(self, input): + input_set = set(input) + result = [] + for v in self._value: + if v in input_set: + continue + else: + result += ['-{}'.format(v),] + return result + + def __str__(self): + return '-({})'.format(self._value) + + class Scope: - def __init__(self, file: typing.Optional[str]=None, condition: str='', base_dir: str='') -> None: - self._parent = None # type: Scope + def __init__(self, parent_scope: typing.Optional['Scope'], + file: typing.Optional[str]=None, condition: str='', base_dir: str='') -> None: + if parent_scope: + parent_scope._add_child(self) + else: + self._parent = None + self._basedir = base_dir if file: self._currentdir = os.path.dirname(file) @@ -133,27 +198,14 @@ class Scope: self._file = file self._condition = map_condition(condition) self._children = [] # type: List[Scope] - self._values = {} # type: Dict[str, List[str]] + self._operations = {} # type: Dict[str] def merge(self, other: 'Scope') -> None: for c in other._children: - self.add_child(c) - other.set_basedir(self._basedir) + self._add_child(c) - for k in self._values.keys(): - if k == 'TEMPLATE': - assert other.get(k, []) == self.get(k, []) - else: - self.append_value(k, other.get(k, [])) - - for k in other._values.keys(): - if k not in self._values: - self.set_value(k, other.get(k)) - - def set_basedir(self, dir: str) -> None: - self._basedir = dir - for c in self._children: - c.set_basedir(dir) + for k in other._operations.keys(): + self._operations[key] = other._operations[k] def basedir(self) -> str: return self._basedir @@ -161,9 +213,27 @@ class Scope: def currentdir(self) -> str: return self._currentdir + def diff(self, key: str, default: typing.Optional[List[str]]=[]) -> List[str]: + mine = self.get(key, default) + + if self._parent: + parent = self._parent.get(key, default) + if (parent == mine): + return [] + + parent_set = set(parent) + mine_set = set(mine) + + added = [x for x in mine if not x in parent_set] + removed = [x for x in parent if not x in mine_set] + + return added + list('# {}'.format(x) for x in removed) + return mine + @staticmethod - def FromDict(file: str, statements, cond: str = '', base_dir: str = ''): - scope = Scope(file, cond, base_dir) + def FromDict(parent_scope: typing.Optional['Scope'], + file: str, statements, cond: str = '', base_dir: str = ''): + scope = Scope(parent_scope, file, cond, base_dir) for statement in statements: if isinstance(statement, list): # Handle skipped parts... assert not statement @@ -174,16 +244,19 @@ class Scope: key = statement.get('key', '') value = statement.get('value', []) assert key != '' + print('#### {}: {} = {}.'.format(operation, key, value)) if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH') or key.endswith('_HEADERS') or key.endswith('_SOURCES'): value = [map_to_file(v, scope.basedir(), scope.currentdir()) for v in value] if operation == '=': - scope.set_value(key, value) + scope._append_operation(key, SetOperation(value)) elif operation == '-=': - scope.substract_value(key, value) - elif operation == '+=' or operation == '*=': - scope.append_value(key, value) + scope._append_operation(key, RemoveOperation(value)) + elif operation == '+=': + scope._append_operation(key, AddOperation(value)) + elif operation == '*=': + scope._append_operation(key, UniqueAddOperation(value)) else: print('Unexpected operation "{}" in scope with condition {}.'.format(operation, cond)) assert(False) @@ -192,33 +265,36 @@ class Scope: condition = statement.get('condition', None) if condition: - child = Scope.FromDict(file, statement.get('statements'), condition, scope.basedir()) - scope.add_child(child) + child = Scope.FromDict(scope, file, statement.get('statements'), condition, scope.basedir()) else_statements = statement.get('else_statements') if else_statements: - child = Scope.FromDict(file, else_statements, 'NOT ' + condition, scope.basedir()) - scope.add_child(child) + child = Scope.FromDict(scope, file, else_statements, 'NOT ' + condition, scope.basedir()) continue - loaded = statement.get('loaded', None) + loaded = statement.get('loaded') if loaded: - scope.append_value('_LOADED', loaded) + scope._append_operation('_LOADED', UniqueAddOperation(loaded)) continue option = statement.get('option', None) if option: - scope.append_value('_OPTION', option) + scope._append_operation('_OPTION', UniqueAddOperation(option)) continue included = statement.get('included', None) if included: - scope.append_value('_INCLUDED', - map_to_file(included, scope.basedir(), scope.currentdir())) + scope.append_operation('_INCLUDED', UniqueAddOperation(map_to_file(included, scope.basedir(), scope.currentdir()))) continue return scope + def _append_operation(self, key: str, op: Operation) -> None: + if key in self._operations: + self._operations[key].append(op) + else: + self._operations[key] = [op,] + def file(self) -> str: return self._file or '' @@ -228,38 +304,10 @@ class Scope: def condition(self) -> str: return self._condition - def _push_down_TEMPLATE(self, template: str) -> None: - self.set_value('TEMPLATE', [template, ]) - for c in self._children: - c._push_down_TEMPLATE(template) - - def add_child(self, scope: 'Scope') -> None: + def _add_child(self, scope: 'Scope') -> None: scope._parent = self - if not scope._rawTemplate(): - scope._push_down_TEMPLATE(self.getTemplate()) self._children.append(scope) - def set_value(self, key: str, value: List[str]) -> None: - self._values[key] = value - - def append_value(self, key: str, value: Union[str, List[str]]) -> None: - array = self._values.get(key, []) - if isinstance(value, str): - array.append(value) - elif isinstance(value, list): - array += value - else: - assert False - self._values[key] = array - - def substract_value(self, key: str, value: Union[str, List[str]]) -> None: - if isinstance(value, str): - to_remove = [value, ] - if isinstance(value, list): - to_remove = value - - self.append_value(key, ['-{}'.format(v) for v in to_remove]) - def children(self) -> List['Scope']: return self._children @@ -270,28 +318,34 @@ class Scope: else: print('{}Scope {} in {} with condition: {}.'.format(ind, self._file, self._basedir, self._condition)) print('{}Keys:'.format(ind)) - for k in sorted(self._values.keys()): - print('{} {} = "{}"'.format(ind, k, self._values[k])) + for k in sorted(self._operations.keys()): + print('{} {} = "{}"'.format(ind, k, self._operations.get(k, []))) print('{}Children:'.format(ind)) for c in self._children: c.dump(indent=indent + 1) def get(self, key: str, default=None) -> List[str]: - default = default or [] - return self._values.get(key, default) + result = [] + + if self._parent: + result = self._parent.get(key, default) + else: + if default: + if isinstance(default, list): + result = default + else: + result = [str(default),] + + for op in self._operations.get(key, []): + result = op.process(result) + return result def getString(self, key: str, default: str = '') -> str: - v = self.get(key) - if isinstance(v, list): - if len(v) == 0: - return default - assert len(v) == 1 - return v[0] - elif isinstance(v, str): - return v - else: - assert False - return default + v = self.get(key, default) + if len(v) == 0: + return default + assert len(v) == 1 + return v[0] def getTemplate(self) -> str: return self.getString('TEMPLATE', 'app') @@ -425,7 +479,7 @@ def handle_subdir(scope: Scope, cm_fh: IO[str], *, indent: int = 0) -> None: cm_fh.write('{}add_subdirectory({})\n'.format(ind, sd)) elif os.path.isfile(full_sd): subdir_result = parseProFile(full_sd, debug=False) - subdir_scope = Scope.FromDict(full_sd, subdir_result.asDict().get('statements'), + subdir_scope = Scope.FromDict(scope, full_sd, subdir_result.asDict().get('statements'), '', scope.basedir()) cmakeify_scope(subdir_scope, cm_fh, indent=indent + 1) @@ -490,8 +544,8 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) - sources = scope.get('SOURCES') + scope.get('HEADERS') + scope.get('OBJECTIVE_SOURCES') + scope.get('NO_PCH_SOURCES') + scope.get('FORMS') - resources = scope.get('RESOURCES') + sources = scope.diff('SOURCES') + scope.diff('HEADERS') + scope.diff('OBJECTIVE_SOURCES') + scope.diff('NO_PCH_SOURCES') + scope.diff('FORMS') + resources = scope.diff('RESOURCES') if resources: qrc_only = True for r in resources: @@ -512,19 +566,21 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, for l in sort_sources(sources): cm_fh.write('{} {}\n'.format(ind, l)) - if scope.get('DEFINES'): + defines = scope.diff('DEFINES') + if defines: cm_fh.write('{} DEFINES\n'.format(ind)) - for d in scope.get('DEFINES'): + for d in defines: d = d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') cm_fh.write('{} {}\n'.format(ind, d)) - if scope.get('INCLUDEPATH'): + includes = scope.diff('INCLUDEPATH') + if includes: cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) - for i in scope.get('INCLUDEPATH'): + for i in includes: cm_fh.write('{} {}\n'.format(ind, i)) - dependencies = [map_qt_library(q) for q in scope.get('QT') if map_qt_library(q) not in known_libraries] - dependencies += [map_qt_library(q) for q in scope.get('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] - dependencies += scope.get('QMAKE_USE_PRIVATE') + scope.get('LIBS_PRIVATE') + scope.get('LIBS') + dependencies = [map_qt_library(q) for q in scope.diff('QT') if map_qt_library(q) not in known_libraries] + dependencies += [map_qt_library(q) for q in scope.diff('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] + dependencies += scope.diff('QMAKE_USE_PRIVATE') + scope.diff('LIBS_PRIVATE') + scope.diff('LIBS') if dependencies: cm_fh.write('{} LIBRARIES\n'.format(ind)) is_framework = False @@ -714,10 +770,8 @@ def do_include(scope: Scope, *, debug: bool=False) -> None: continue include_result = parseProFile(include_file, debug=debug) - include_scope = Scope.FromDict(include_file, include_result.asDict().get('statements'), + include_scope = Scope.FromDict(scope, include_file, include_result.asDict().get('statements'), '', dir) - if not include_scope._rawTemplate(): - include_scope._push_down_TEMPLATE(scope.getTemplate()) do_include(include_scope) @@ -744,7 +798,7 @@ def main() -> None: print(parseresult.asDict()) print('\n#### End of parser result dictionary.\n') - file_scope = Scope.FromDict(file, parseresult.asDict().get('statements')) + file_scope = Scope.FromDict(None, file, parseresult.asDict().get('statements')) if args.debug_pro_structure or args.debug: print('\n\n#### .pro/.pri file structure:') From 54d372ea67584d57b8c819ff7e221a23a8b34cd2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 21 Dec 2018 12:13:38 +0100 Subject: [PATCH 0056/1322] pro2cmake: Clean up linter and pypi issues Also remove one stray line of debug output Change-Id: If3d2e0b31e5e1b1c05c321d63e8762b23f55bb66 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 356 ++++++++++++++++++++++++++-------------- 1 file changed, 229 insertions(+), 127 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 402e763dc5f..a1c73fcd5fa 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -30,32 +30,38 @@ from argparse import ArgumentParser import os.path import re -import sys import io -from typing import IO, List, Dict, Union import typing import pyparsing as pp -from helper import map_qt_library, map_qt_base_library, featureName, substitute_platform, substitute_libs +from helper import map_qt_library, map_qt_base_library, featureName, \ + substitute_platform, substitute_libs def _parse_commandline(): - parser = ArgumentParser(description='Generate CMakeLists.txt files from .pro files.') + parser = ArgumentParser(description='Generate CMakeLists.txt files from .' + 'pro files.') parser.add_argument('--debug', dest='debug', action='store_true', help='Turn on all debug output') - parser.add_argument('--debug-parser', dest='debug_parser', action='store_true', + parser.add_argument('--debug-parser', dest='debug_parser', + action='store_true', help='Print debug output from qmake parser.') - parser.add_argument('--debug-parse-result', dest='debug_parse_result', action='store_true', + parser.add_argument('--debug-parse-result', dest='debug_parse_result', + action='store_true', help='Dump the qmake parser result.') - parser.add_argument('--debug-parse-dictionary', dest='debug_parse_dictionary', action='store_true', + parser.add_argument('--debug-parse-dictionary', + dest='debug_parse_dictionary', action='store_true', help='Dump the qmake parser result as dictionary.') - parser.add_argument('--debug-pro-structure', dest='debug_pro_structure', action='store_true', + parser.add_argument('--debug-pro-structure', dest='debug_pro_structure', + action='store_true', help='Dump the structure of the qmake .pro-file.') - parser.add_argument('--debug-full-pro-structure', dest='debug_full_pro_structure', action='store_true', - help='Dump the full structure of the qmake .pro-file (with includes).') - parser.add_argument('files', metavar='<.pro/.pri file>', type=str, nargs='+', - help='The .pro/.pri file to process') + parser.add_argument('--debug-full-pro-structure', + dest='debug_full_pro_structure', action='store_true', + help='Dump the full structure of the qmake .pro-file ' + '(with includes).') + parser.add_argument('files', metavar='<.pro/.pri file>', type=str, + nargs='+', help='The .pro/.pri file to process') return parser.parse_args() @@ -81,9 +87,10 @@ def map_to_file(f: str, top_dir: str, current_dir: str, return f -def map_source_to_cmake(source: str, base_dir: str, vpath: List[str]) -> typing.Optional[str]: +def map_source_to_cmake(source: str, base_dir: str, + vpath: typing.List[str]) -> str: if not source or source == '$$NO_PCH_SOURCES': - return None + return '' if source.startswith('$$PWD/'): return source[6:] if source == '.': @@ -94,7 +101,6 @@ def map_source_to_cmake(source: str, base_dir: str, vpath: List[str]) -> typing. if os.path.exists(os.path.join(base_dir, source)): return source - for v in vpath: fullpath = os.path.join(v, source) if os.path.exists(fullpath): @@ -105,9 +111,10 @@ def map_source_to_cmake(source: str, base_dir: str, vpath: List[str]) -> typing. return '{}-NOTFOUND'.format(source) -def map_source_to_fs(base_dir: str, file: str, source: str) -> typing.Optional[str]: +def map_source_to_fs(base_dir: str, file: str, + source: str) -> str: if source is None or source == '$$NO_PCH_SOURCES': - return None + return '' if source.startswith('$$PWD/'): return os.path.join(os.path.dirname(file), source[6:]) if source.startswith('$$QT_SOURCE_TREE/'): @@ -124,7 +131,7 @@ class Operation: if isinstance(value, list): self._value = value else: - self._value = [str(value),] + self._value = [str(value), ] def process(self, input): assert(False) @@ -145,8 +152,8 @@ class UniqueAddOperation(Operation): def process(self, input): result = input for v in self._value: - if not v in result: - result += [v,] + if v not in result: + result += [v, ] return result def __str__(self): @@ -172,7 +179,7 @@ class RemoveOperation(Operation): if v in input_set: continue else: - result += ['-{}'.format(v),] + result += ['-{}'.format(v), ] return result def __str__(self): @@ -181,11 +188,12 @@ class RemoveOperation(Operation): class Scope: def __init__(self, parent_scope: typing.Optional['Scope'], - file: typing.Optional[str]=None, condition: str='', base_dir: str='') -> None: + file: typing.Optional[str] = None, condition: str = '', + base_dir: str = '') -> None: if parent_scope: parent_scope._add_child(self) else: - self._parent = None + self._parent = None # type: typing.Optional[Scope] self._basedir = base_dir if file: @@ -197,15 +205,15 @@ class Scope: self._file = file self._condition = map_condition(condition) - self._children = [] # type: List[Scope] - self._operations = {} # type: Dict[str] + self._children = [] # type: typing.List[Scope] + self._operations = {} # type: typing.Dict[str, typing.List[Operation]] def merge(self, other: 'Scope') -> None: for c in other._children: self._add_child(c) - for k in other._operations.keys(): - self._operations[key] = other._operations[k] + for key in other._operations.keys(): + self._operations[key] = other._operations[key] def basedir(self) -> str: return self._basedir @@ -213,7 +221,9 @@ class Scope: def currentdir(self) -> str: return self._currentdir - def diff(self, key: str, default: typing.Optional[List[str]]=[]) -> List[str]: + def diff(self, key: str, + default: typing.Optional[typing.List[str]] = []) \ + -> typing.List[str]: mine = self.get(key, default) if self._parent: @@ -224,8 +234,8 @@ class Scope: parent_set = set(parent) mine_set = set(mine) - added = [x for x in mine if not x in parent_set] - removed = [x for x in parent if not x in mine_set] + added = [x for x in mine if x not in parent_set] + removed = [x for x in parent if x not in mine_set] return added + list('# {}'.format(x) for x in removed) return mine @@ -244,10 +254,12 @@ class Scope: key = statement.get('key', '') value = statement.get('value', []) assert key != '' - print('#### {}: {} = {}.'.format(operation, key, value)) - if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH') or key.endswith('_HEADERS') or key.endswith('_SOURCES'): - value = [map_to_file(v, scope.basedir(), scope.currentdir()) for v in value] + if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH') \ + or key.endswith('_HEADERS') \ + or key.endswith('_SOURCES'): + value = [map_to_file(v, scope.basedir(), + scope.currentdir()) for v in value] if operation == '=': scope._append_operation(key, SetOperation(value)) @@ -258,18 +270,22 @@ class Scope: elif operation == '*=': scope._append_operation(key, UniqueAddOperation(value)) else: - print('Unexpected operation "{}" in scope with condition {}.'.format(operation, cond)) + print('Unexpected operation "{}" in scope with ' + 'condition {}.'.format(operation, cond)) assert(False) continue condition = statement.get('condition', None) if condition: - child = Scope.FromDict(scope, file, statement.get('statements'), condition, scope.basedir()) + Scope.FromDict(scope, file, + statement.get('statements'), condition, + scope.basedir()) else_statements = statement.get('else_statements') if else_statements: - child = Scope.FromDict(scope, file, else_statements, 'NOT ' + condition, scope.basedir()) + Scope.FromDict(scope, file, else_statements, + 'NOT ' + condition, scope.basedir()) continue loaded = statement.get('loaded') @@ -284,7 +300,11 @@ class Scope: included = statement.get('included', None) if included: - scope.append_operation('_INCLUDED', UniqueAddOperation(map_to_file(included, scope.basedir(), scope.currentdir()))) + scope._append_operation('_INCLUDED', + UniqueAddOperation( + map_to_file(included, + scope.basedir(), + scope.currentdir()))) continue return scope @@ -293,7 +313,7 @@ class Scope: if key in self._operations: self._operations[key].append(op) else: - self._operations[key] = [op,] + self._operations[key] = [op, ] def file(self) -> str: return self._file or '' @@ -308,7 +328,7 @@ class Scope: scope._parent = self self._children.append(scope) - def children(self) -> List['Scope']: + def children(self) -> typing.List['Scope']: return self._children def dump(self, *, indent: int = 0) -> None: @@ -316,7 +336,8 @@ class Scope: if self._condition == '': print('{}Scope {} in {}.'.format(ind, self._file, self._basedir)) else: - print('{}Scope {} in {} with condition: {}.'.format(ind, self._file, self._basedir, self._condition)) + print('{}Scope {} in {} with condition: {}.' + .format(ind, self._file, self._basedir, self._condition)) print('{}Keys:'.format(ind)) for k in sorted(self._operations.keys()): print('{} {} = "{}"'.format(ind, k, self._operations.get(k, []))) @@ -324,8 +345,8 @@ class Scope: for c in self._children: c.dump(indent=indent + 1) - def get(self, key: str, default=None) -> List[str]: - result = [] + def get(self, key: str, default=None) -> typing.List[str]: + result = [] # type: typing.List[str] if self._parent: result = self._parent.get(key, default) @@ -334,7 +355,7 @@ class Scope: if isinstance(default, list): result = default else: - result = [str(default),] + result = [str(default), ] for op in self._operations.get(key, []): result = op.process(result) @@ -354,7 +375,8 @@ class Scope: return self.getString('TEMPLATE') def getTarget(self) -> str: - return self.getString('TARGET') or os.path.splitext(os.path.basename(self.file()))[0] + return self.getString('TARGET') \ + or os.path.splitext(os.path.basename(self.file()))[0] class QmakeParser: @@ -369,35 +391,54 @@ class QmakeParser: EOL = pp.Suppress(pp.Optional(pp.pythonStyleComment()) + pp.LineEnd()) Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') - Substitution = pp.Combine(pp.Literal('$') - + (((pp.Literal('$') + Identifier + pp.Optional(pp.nestedExpr())) - | (pp.Literal('(') + Identifier + pp.Literal(')')) - | (pp.Literal('{') + Identifier + pp.Literal('}')) - | (pp.Literal('$') + pp.Literal('{') + Identifier + pp.Optional(pp.nestedExpr()) + pp.Literal('}')) - | (pp.Literal('$') + pp.Literal('[') + Identifier + pp.Literal(']')) - ))) - # Do not match word ending in '\' since that breaks line continuation:-/ + Substitution \ + = pp.Combine(pp.Literal('$') + + (((pp.Literal('$') + Identifier + + pp.Optional(pp.nestedExpr())) + | (pp.Literal('(') + Identifier + pp.Literal(')')) + | (pp.Literal('{') + Identifier + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('{') + + Identifier + pp.Optional(pp.nestedExpr()) + + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('[') + Identifier + + pp.Literal(']')) + ))) + # Do not match word ending in '\' since that breaks line + # continuation:-/ LiteralValuePart = pp.Word(pp.printables, excludeChars='$#{}()') - SubstitutionValue = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart | pp.Literal('$'))) - Value = (pp.QuotedString(quoteChar='"', escChar='\\') | SubstitutionValue) + SubstitutionValue \ + = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart + | pp.Literal('$'))) + Value = (pp.QuotedString(quoteChar='"', escChar='\\') + | SubstitutionValue) Values = pp.ZeroOrMore(Value)('value') - Op = pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') | pp.Literal('*=') + Op = pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') \ + | pp.Literal('*=') - Operation = Identifier('key') + Op('operation') + Values('value') - Load = pp.Keyword('load') + pp.Suppress('(') + Identifier('loaded') + pp.Suppress(')') - Include = pp.Keyword('include') + pp.Suppress('(') + pp.CharsNotIn(':{=}#)\n')('included') + pp.Suppress(')') - Option = pp.Keyword('option') + pp.Suppress('(') + Identifier('option') + pp.Suppress(')') - DefineTest = pp.Suppress(pp.Keyword('defineTest') + pp.Suppress('(') + Identifier + pp.Suppress(')') - + pp.nestedExpr(opener='{', closer='}') + pp.LineEnd()) # ignore the whole thing... + Operation = Identifier('key') + Op('operation') + Values('value') + Load = pp.Keyword('load') + pp.Suppress('(') \ + + Identifier('loaded') + pp.Suppress(')') + Include = pp.Keyword('include') + pp.Suppress('(') \ + + pp.CharsNotIn(':{=}#)\n')('included') + pp.Suppress(')') + Option = pp.Keyword('option') + pp.Suppress('(') \ + + Identifier('option') + pp.Suppress(')') + DefineTest = pp.Suppress(pp.Keyword('defineTest') + + pp.Suppress('(') + Identifier + + pp.Suppress(')') + + pp.nestedExpr(opener='{', closer='}') + + pp.LineEnd()) # ignore the whole thing... ForLoop = pp.Suppress(pp.Keyword('for') + pp.nestedExpr() - + pp.nestedExpr(opener='{', closer='}', ignoreExpr=None) + pp.LineEnd()) # ignore the whole thing... + + pp.nestedExpr(opener='{', closer='}', + ignoreExpr=None) + + pp.LineEnd()) # ignore the whole thing... FunctionCall = pp.Suppress(Identifier + pp.nestedExpr()) Scope = pp.Forward() - Statement = pp.Group(Load | Include | Option | DefineTest | ForLoop | FunctionCall | Operation) + Statement = pp.Group(Load | Include | Option | DefineTest + | ForLoop | FunctionCall | Operation) StatementLine = Statement + EOL StatementGroup = pp.ZeroOrMore(StatementLine | Scope | EOL) @@ -409,16 +450,26 @@ class QmakeParser: Condition = pp.Optional(pp.White()) + pp.CharsNotIn(':{=}#\\\n') Condition.setParseAction(lambda x: ' '.join(x).strip()) - SingleLineScope = pp.Suppress(pp.Literal(':')) + pp.Group(Scope | Block | StatementLine)('statements') + SingleLineScope = pp.Suppress(pp.Literal(':')) \ + + pp.Group(Scope | Block | StatementLine)('statements') MultiLineScope = Block('statements') - SingleLineElse = pp.Suppress(pp.Literal(':')) + pp.Group(Scope | StatementLine)('else_statements') - MultiLineElse = pp.Group(Block)('else_statements') - Else = pp.Suppress(pp.Keyword('else')) + (SingleLineElse | MultiLineElse) - Scope <<= pp.Group(Condition('condition') + (SingleLineScope | MultiLineScope) + pp.Optional(Else)) + SingleLineElse = pp.Suppress(pp.Literal(':')) \ + + pp.Group(Scope | StatementLine)('else_statements') + MultiLineElse = pp.Group(Block)('else_statements') + Else = pp.Suppress(pp.Keyword('else')) \ + + (SingleLineElse | MultiLineElse) + Scope <<= pp.Group(Condition('condition') + + (SingleLineScope | MultiLineScope) + + pp.Optional(Else)) if debug: - for ename in "EOL Identifier Substitution SubstitutionValue LiteralValuePart Value Values SingleLineScope MultiLineScope Scope SingleLineElse MultiLineElse Else Condition Block StatementGroup Statement Load Include Option DefineTest ForLoop FunctionCall Operation".split(): + for ename in 'EOL Identifier Substitution SubstitutionValue ' \ + 'LiteralValuePart Value Values SingleLineScope ' \ + 'MultiLineScope Scope SingleLineElse ' \ + 'MultiLineElse Else Condition Block ' \ + 'StatementGroup Statement Load Include Option ' \ + 'DefineTest ForLoop FunctionCall Operation'.split(): expr = locals()[ename] expr.setName(ename) expr.setDebug() @@ -453,11 +504,14 @@ def map_condition(condition: str) -> str: cmake_condition = '' for part in condition.split(): - # some features contain e.g. linux, that should not be turned upper case - feature = re.match(r"(qtConfig|qtHaveModule)\(([a-zA-Z0-9_-]+)\)", part) + # some features contain e.g. linux, that should not be + # turned upper case + feature = re.match(r"(qtConfig|qtHaveModule)\(([a-zA-Z0-9_-]+)\)", + part) if feature: if (feature.group(1) == "qtHaveModule"): - part = 'TARGET {}'.format(map_qt_base_library(feature.group(2))) + part = 'TARGET {}'.format(map_qt_base_library( + feature.group(2))) else: part = 'QT_FEATURE_' + featureName(feature.group(2)) else: @@ -470,7 +524,8 @@ def map_condition(condition: str) -> str: return cmake_condition.strip() -def handle_subdir(scope: Scope, cm_fh: IO[str], *, indent: int = 0) -> None: +def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, + indent: int = 0) -> None: assert scope.getTemplate() == 'subdirs' ind = ' ' * indent for sd in scope.get('SUBDIRS', []): @@ -479,14 +534,18 @@ def handle_subdir(scope: Scope, cm_fh: IO[str], *, indent: int = 0) -> None: cm_fh.write('{}add_subdirectory({})\n'.format(ind, sd)) elif os.path.isfile(full_sd): subdir_result = parseProFile(full_sd, debug=False) - subdir_scope = Scope.FromDict(scope, full_sd, subdir_result.asDict().get('statements'), - '', scope.basedir()) + subdir_scope \ + = Scope.FromDict(scope, full_sd, + subdir_result.asDict().get('statements'), + '', scope.basedir()) cmakeify_scope(subdir_scope, cm_fh, indent=indent + 1) elif sd.startswith('-'): - cm_fh.write('{}### remove_subdirectory("{}")\n'.format(ind, sd[1:])) + cm_fh.write('{}### remove_subdirectory' + '("{}")\n'.format(ind, sd[1:])) else: - print(' XXXX: SUBDIR {} in {}: Not found.'.format(sd, scope.file())) + print(' XXXX: SUBDIR {} in {}: ' + 'Not found.'.format(sd, scope.file())) for c in scope.children(): cond = c.condition() @@ -501,8 +560,8 @@ def handle_subdir(scope: Scope, cm_fh: IO[str], *, indent: int = 0) -> None: cm_fh.write('{}endif()\n'.format(ind)) -def sort_sources(sources) -> List[str]: - to_sort = {} # type: Dict[str, List[str]] +def sort_sources(sources) -> typing.List[str]: + to_sort = {} # type: typing.Dict[str, typing.List[str]] for s in sources: if s is None: continue @@ -525,26 +584,32 @@ def sort_sources(sources) -> List[str]: return lines -def write_header(cm_fh: IO[str], name: str, typename: str, *, indent: int=0): - cm_fh.write('{}#####################################################################\n'.format(spaces(indent))) +def write_header(cm_fh: typing.IO[str], name: str, + typename: str, *, indent: int = 0): + cm_fh.write('{}###########################################' + '##########################\n'.format(spaces(indent))) cm_fh.write('{}## {} {}:\n'.format(spaces(indent), name, typename)) - cm_fh.write('{}#####################################################################\n\n'.format(spaces(indent))) + cm_fh.write('{}###########################################' + '##########################\n\n'.format(spaces(indent))) -def write_scope_header(cm_fh: IO[str], *, indent: int=0): +def write_scope_header(cm_fh: typing.IO[str], *, indent: int = 0): cm_fh.write('\n{}## Scopes:\n'.format(spaces(indent))) - cm_fh.write('{}#####################################################################\n'.format(spaces(indent))) + cm_fh.write('{}###########################################' + '##########################\n'.format(spaces(indent))) -def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, - known_libraries=set()) -> None: +def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, + indent: int = 0, known_libraries=set()) -> None: ind = spaces(indent) plugin_type = scope.get('PLUGIN_TYPE') if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) - sources = scope.diff('SOURCES') + scope.diff('HEADERS') + scope.diff('OBJECTIVE_SOURCES') + scope.diff('NO_PCH_SOURCES') + scope.diff('FORMS') + sources = scope.diff('SOURCES') + scope.diff('HEADERS') \ + + scope.diff('OBJECTIVE_SOURCES') + scope.diff('NO_PCH_SOURCES') \ + + scope.diff('FORMS') resources = scope.diff('RESOURCES') if resources: qrc_only = True @@ -570,7 +635,8 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, if defines: cm_fh.write('{} DEFINES\n'.format(ind)) for d in defines: - d = d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') + d = d.replace('=\\\\\\"$$PWD/\\\\\\"', + '="${CMAKE_CURRENT_SOURCE_DIR}/"') cm_fh.write('{} {}\n'.format(ind, d)) includes = scope.diff('INCLUDEPATH') if includes: @@ -578,9 +644,12 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, for i in includes: cm_fh.write('{} {}\n'.format(ind, i)) - dependencies = [map_qt_library(q) for q in scope.diff('QT') if map_qt_library(q) not in known_libraries] - dependencies += [map_qt_library(q) for q in scope.diff('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] - dependencies += scope.diff('QMAKE_USE_PRIVATE') + scope.diff('LIBS_PRIVATE') + scope.diff('LIBS') + dependencies = [map_qt_library(q) for q in scope.diff('QT') + if map_qt_library(q) not in known_libraries] + dependencies += [map_qt_library(q) for q in scope.diff('QT_FOR_PRIVATE') + if map_qt_library(q) not in known_libraries] + dependencies += scope.diff('QMAKE_USE_PRIVATE') \ + + scope.diff('LIBS_PRIVATE') + scope.diff('LIBS') if dependencies: cm_fh.write('{} LIBRARIES\n'.format(ind)) is_framework = False @@ -601,40 +670,50 @@ def write_sources_section(cm_fh: IO[str], scope: Scope, *, indent: int=0, is_framework = False -def write_extend_target(cm_fh: IO[str], target: str, scope: Scope, parent_condition: str='', - previous_conditon: str='', *, indent: int=0) -> str: +def write_extend_target(cm_fh: typing.IO[str], target: str, + scope: Scope, parent_condition: str = '', + previous_conditon: str = '', *, + indent: int = 0) -> str: total_condition = scope.condition() if total_condition == 'else': - assert previous_conditon, "Else branch without previous condition in: %s" % scope.file() + assert previous_conditon, \ + "Else branch without previous condition in: %s" % scope.file() total_condition = 'NOT ({})'.format(previous_conditon) if parent_condition: - total_condition = '({}) AND ({})'.format(parent_condition, total_condition) + total_condition = '({}) AND ({})'.format(parent_condition, + total_condition) extend_qt_io_string = io.StringIO() write_sources_section(extend_qt_io_string, scope) extend_qt_string = extend_qt_io_string.getvalue() - extend_scope = '\n{}extend_target({} CONDITION {}\n{})\n'.format(spaces(indent), target, total_condition, extend_qt_string) + extend_scope = '\n{}extend_target({} CONDITION {}\n' \ + '{})\n'.format(spaces(indent), target, total_condition, + extend_qt_string) if not extend_qt_string: - # Comment out the generated extend_target call because there no sources were found, but keep it commented - # for informational purposes. - extend_scope = ''.join(['#' + line for line in extend_scope.splitlines(keepends=True)]) + # Comment out the generated extend_target call because there + # no sources were found, but keep it commented for + # informational purposes. + extend_scope = ''.join(['#' + line for line in + extend_scope.splitlines(keepends=True)]) cm_fh.write(extend_scope) children = scope.children() if children: prev_condition = '' for c in children: - prev_condition = write_extend_target(cm_fh, target, c, total_condition, prev_condition) + prev_condition = write_extend_target(cm_fh, target, c, + total_condition, + prev_condition) return total_condition -def write_main_part(cm_fh: IO[str], name: str, typename: str, +def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cmake_function: str, scope: Scope, *, extra_lines: typing.List[str] = [], - indent: int=0, + indent: int = 0, **kwargs: typing.Any): write_header(cm_fh, name, typename, indent=indent) @@ -657,8 +736,8 @@ def write_main_part(cm_fh: IO[str], name: str, typename: str, write_extend_target(cm_fh, name, c, '', indent=indent) - -def write_module(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: +def write_module(cm_fh: typing.IO[str], scope: Scope, *, + indent: int = 0) -> None: module_name = scope.getTarget() assert module_name.startswith('Qt') @@ -669,22 +748,26 @@ def write_module(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: extra.append('NO_MODULE_HEADERS') write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, - extra_lines=extra, indent=indent, known_libraries={'Qt::Core', }) - + extra_lines=extra, indent=indent, + known_libraries={'Qt::Core', }) if 'qt_tracepoints' in scope.get('CONFIG'): - tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), scope.basedir(), scope.currentdir()) - cm_fh.write('\n\n{}qt_create_tracepoints({} {})\n'.format(spaces(indent), module_name[2:], tracepoints)) + tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), + scope.basedir(), scope.currentdir()) + cm_fh.write('\n\n{}qt_create_tracepoints({} {})\n' + .format(spaces(indent), module_name[2:], tracepoints)) -def write_tool(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: +def write_tool(cm_fh: typing.IO[str], scope: Scope, *, + indent: int = 0) -> None: tool_name = scope.getTarget() write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope, indent=indent, known_libraries={'Qt::Core', }) -def write_test(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: +def write_test(cm_fh: typing.IO[str], scope: Scope, *, + indent: int = 0) -> None: test_name = scope.getTarget() assert test_name @@ -692,16 +775,18 @@ def write_test(cm_fh: IO[str], scope: Scope, *, indent: int=0) -> None: indent=indent, known_libraries={'Qt::Core', 'Qt::Test', }) -def write_binary(cm_fh: IO[str], scope: Scope, gui: bool=False, *, indent: int=0) -> None: +def write_binary(cm_fh: typing.IO[str], scope: Scope, + gui: bool = False, *, indent: int = 0) -> None: binary_name = scope.getTarget() assert binary_name - extra = ['GUI',] if gui else [] + extra = ['GUI', ] if gui else [] write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope, - extra_lines=extra, indent=indent, known_libraries={'Qt::Core', }) + extra_lines=extra, indent=indent, + known_libraries={'Qt::Core', }) -def write_plugin(cm_fh, scope, *, indent: int=0): +def write_plugin(cm_fh, scope, *, indent: int = 0): plugin_name = scope.getTarget() assert plugin_name @@ -709,7 +794,8 @@ def write_plugin(cm_fh, scope, *, indent: int=0): indent=indent, known_libraries={'QtCore', }) -def handle_app_or_lib(scope: Scope, cm_fh: IO[str], *, indent=0) -> None: +def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, + indent: int = 0) -> None: assert scope.getTemplate() in ('app', 'lib') is_lib = scope.getTemplate() == 'lib' @@ -722,7 +808,8 @@ def handle_app_or_lib(scope: Scope, cm_fh: IO[str], *, indent=0) -> None: elif 'qt_tool' in scope.get('_LOADED', []): write_tool(cm_fh, scope, indent=indent) else: - if 'testcase' in scope.get('CONFIG') or 'testlib' in scope.get('CONFIG'): + if 'testcase' in scope.get('CONFIG') \ + or 'testlib' in scope.get('CONFIG'): write_test(cm_fh, scope, indent=indent) else: gui = 'console' not in scope.get('CONFIG') @@ -730,19 +817,27 @@ def handle_app_or_lib(scope: Scope, cm_fh: IO[str], *, indent=0) -> None: docs = scope.getString("QMAKE_DOCS") if docs: - cm_fh.write("\n{}add_qt_docs({})\n".format(spaces(indent), map_to_file(docs, scope.basedir(), scope.currentdir()))) + cm_fh.write("\n{}add_qt_docs({})\n" + .format(spaces(indent), + map_to_file(docs, scope.basedir(), + scope.currentdir()))) -def handle_qt_for_config(scope: Scope, cm_fh: IO[str], *, indent: int=0) -> None: +def handle_qt_for_config(scope: Scope, cm_fh: typing.IO[str], *, + indent: int = 0) -> None: for config in scope.get("QT_FOR_CONFIG") or []: lib = map_qt_library(config) if lib.endswith("Private"): - cm_fh.write('{}qt_pull_features_into_current_scope(PRIVATE_FEATURES {})\n'.format(spaces(indent), lib[:-len("Private")])) + cm_fh.write('{}qt_pull_features_into_current_scope' + '(PRIVATE_FEATURES {})\n' + .format(spaces(indent), lib[:-len("Private")])) else: - cm_fh.write('{}qt_pull_features_into_current_scope(PUBLIC_FEATURES {})\n'.format(spaces(indent), lib)) + cm_fh.write('{}qt_pull_features_into_current_scope' + '(PUBLIC_FEATURES {})\n'.format(spaces(indent), lib)) -def cmakeify_scope(scope: Scope, cm_fh: IO[str], *, indent: int=0) -> None: +def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, + indent: int = 0) -> None: template = scope.getTemplate() handle_qt_for_config(scope, cm_fh) if template == 'subdirs': @@ -757,21 +852,27 @@ def cmakeify_scope(scope: Scope, cm_fh: IO[str], *, indent: int=0) -> None: def generate_cmakelists(scope: Scope) -> None: with open(scope.cMakeListsFile(), 'w') as cm_fh: assert scope.file() - cm_fh.write('# Generated from {}.\n\n'.format(os.path.basename(scope.file()))) + cm_fh.write('# Generated from {}.\n\n' + .format(os.path.basename(scope.file()))) cmakeify_scope(scope, cm_fh) -def do_include(scope: Scope, *, debug: bool=False) -> None: +def do_include(scope: Scope, *, debug: bool = False) -> None: for i in scope.get('_INCLUDED', []): dir = scope.basedir() - include_file = map_to_file(i, dir, scope.currentdir(), want_absolute_path=True) + include_file = map_to_file(i, dir, scope.currentdir(), + want_absolute_path=True) + if not include_file: + continue if not os.path.isfile(include_file): print(' XXXX: Failed to include {}.'.format(include_file)) continue include_result = parseProFile(include_file, debug=debug) - include_scope = Scope.FromDict(scope, include_file, include_result.asDict().get('statements'), - '', dir) + include_scope \ + = Scope.FromDict(scope, include_file, + include_result.asDict().get('statements'), + '', dir) do_include(include_scope) @@ -798,7 +899,8 @@ def main() -> None: print(parseresult.asDict()) print('\n#### End of parser result dictionary.\n') - file_scope = Scope.FromDict(None, file, parseresult.asDict().get('statements')) + file_scope = Scope.FromDict(None, file, + parseresult.asDict().get('statements')) if args.debug_pro_structure or args.debug: print('\n\n#### .pro/.pri file structure:') From 7bc03bca7196701cce4c209c5ff337dcecc746a4 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Tue, 8 Jan 2019 12:35:46 +0100 Subject: [PATCH 0057/1322] CMake: Use WrapRt instead of rt Change-Id: I98f50a5ee7c3f1707589214df816ed03e0cfa249 Reviewed-by: Tobias Hunger --- src/corelib/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 66cdf1ef1f4..d0f13c8615a 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -230,7 +230,6 @@ add_qt_module(Core ${CMAKE_CURRENT_BINARY_DIR}/global # For qconfig.cpp LIBRARIES WrapDoubleConversion - WrapRt tinycbor Threads::Threads ZLIB::ZLIB QtHarfBuzz PUBLIC_LIBRARIES Qt::Platform @@ -537,7 +536,7 @@ extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps ## clock_gettime: extend_target(Core CONDITION UNIX AND QT_FEATURE_clock_gettime - LIBRARIES rt + LIBRARIES WrapRt ) ## glib: From ff693d664b736b6d4f5692cfe9276ef8742290fe Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 10 Jan 2019 15:52:32 +0100 Subject: [PATCH 0058/1322] CMake: Remove one unnecessary feature push into parent scope During qt_feature_begin_module no features are changed, so there is no need to push features. Change-Id: Id7ebcfad373caa284e790b7eb0a178eaa72216e5 Reviewed-by: Frederik Gladhorn --- cmake/QtFeature.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 416c7fc397c..039412fd6f2 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -21,8 +21,6 @@ function(qt_feature_module_begin) set(__QtFeature_private_extra "" PARENT_SCOPE) set(__QtFeature_public_extra "" PARENT_SCOPE) - - qt_push_features_into_parent_scope() endfunction() function(qt_feature feature) From 3552323049f54f2ddd8cb9f8f35c1e34c18d1e51 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 15 Jan 2019 13:18:35 +0100 Subject: [PATCH 0059/1322] CMake: update README.md Because AUTOMOC/AUTOUIC/AUTORCC got merged into master. Change-Id: I0ddfd4443a9892fae1dca54d75b97af4c69ad7ef Reviewed-by: Frederik Gladhorn --- cmake/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 5a548d06517..b32e64aa9e1 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -4,8 +4,9 @@ Initial port is on-going. Some modules of QtBase are ported, incl. some of the p Basic functionality is there (moc, uic, etc.), but documentation, translations, qdbusxml2cpp, etc. are missing. -NOTE: YOU WILL NEED CMAKE 3.14 or later (if that is not released yet you will need to have -https://gitlab.kitware.com/cmake/cmake/merge_requests/2679 applied). +NOTE: YOU WILL NEED CMAKE 3.14 or later (for example, master branch, +after a1b3d79f728f2c626d3aac2e68dbab524baa4634, for more details see +https://gitlab.kitware.com/cmake/cmake/merge_requests/2679 ). # Intro From b705021b4eaed1e61d39dc481fd5373722c6f460 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 14 Jan 2019 11:01:06 +0100 Subject: [PATCH 0060/1322] CMake: Check for visibility once Change-Id: I5c729f4509eed16409df5eb048afb7f60c5ca57c Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 039412fd6f2..380626b35a2 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -412,12 +412,13 @@ function(qt_pull_features_into_current_scope) else() set(property_prefix "") endif() - foreach(visibility PUBLIC PRIVATE) + foreach(visibility IN ITEMS PUBLIC PRIVATE) + if(NOT ${arg_${visibility}_FEATURES}) + continue() + endif() + set(value ON) - foreach(state ENABLED DISABLED) - if(NOT ${arg_${visibility}_FEATURES}) - continue() - endif() + foreach(state IN ITEMS ENABLED DISABLED) get_target_property(features "${target}" ${property_prefix}QT_${arg_FEATURE_PROPERTY_INFIX}${state}_${visibility}_FEATURES) if("${features}" STREQUAL "features-NOTFOUND") continue() From 4f26758978e84f959a28d90b2ff336bae32a2d3f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 10 Jan 2019 10:50:38 +0100 Subject: [PATCH 0061/1322] CMake: Introduce Qt::GlobalConfig to hold the global features This simplifies the handling of features a bit as it removes the special code to store two sets of features in Qt::Core. Change-Id: I536d41cfc76a02af054e3cfbad6bda50b1e9e49a Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 29 ++++++++++++++++++++++++----- cmake/QtBuild.cmake | 9 ++------- cmake/QtFeature.cmake | 15 ++++++++------- cmake/tests/features/CMakeLists.txt | 6 +++--- src/corelib/CMakeLists.txt | 22 +++++----------------- 5 files changed, 42 insertions(+), 39 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index b53fd0f3680..714508ec7ce 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -15,8 +15,6 @@ target_include_directories("${name}" ) target_compile_definitions("${name}" INTERFACE ${QT_PLATFORM_DEFINITIONS}) set(config_install_dir "${INSTALL_LIBDIR}/cmake/${name}${PROJECT_VERSION_MAJOR}") -install(TARGETS "${name}" EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets") -install(EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}") configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" @@ -37,15 +35,36 @@ install(FILES ## Library to hold global features: -add_library(Qt_global_Config INTERFACE) - +## These features are stored and accessed via Qt::GlobalConfig, but the +## files always lived in Qt::Core, so we keep it that way +add_library(GlobalConfig INTERFACE) +target_include_directories(GlobalConfig INTERFACE + $ + $ + $ + $ +) qt_feature_module_begin(LIBRARY Core PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") -qt_feature_module_end(Qt_global_Config) +qt_feature_module_end(GlobalConfig) +add_library(Qt::GlobalConfig ALIAS GlobalConfig) + +add_library(GlobalConfigPrivate INTERFACE) +target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig) +target_include_directories(GlobalConfigPrivate INTERFACE + $ + $ + $ + $ +) +add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) + +install(TARGETS "${name}" GlobalConfig GlobalConfigPrivate EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets") +install(EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}") ## Install some QtBase specific CMake files: install(FILES diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 446746c0116..d35254c48f1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -272,11 +272,6 @@ function(extend_target target) list(APPEND dbus_sources "${sources}") endforeach() - # Import features - if(NOT "${target}" STREQUAL "Core") - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) - endif() - foreach(dep ${arg_FEATURE_DEPENDENCIES} ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") if (${CMAKE_MATCH_COUNT} EQUAL 3) @@ -292,9 +287,9 @@ function(extend_target target) endif() if("x${CMAKE_MATCH_3}" STREQUAL "xPrivate") - qt_pull_features_into_current_scope(PRIVATE_FEATURES ${depTarget}) + qt_pull_features_into_current_scope(PRIVATE_FEATURES "Qt::${depTarget}") endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES ${depTarget}) + qt_pull_features_into_current_scope(PUBLIC_FEATURES "Qt::${depTarget}") endif() endforeach() diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 380626b35a2..ba4ca41c5ba 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -401,11 +401,12 @@ function(qt_config_compile_test_x86simd extension label) endfunction() function(qt_pull_features_into_current_scope) - cmake_parse_arguments(arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "FEATURE_PROPERTY_INFIX" "" ${ARGN}) + cmake_parse_arguments(arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "" "" ${ARGN}) foreach(target IN ITEMS ${arg_UNPARSED_ARGUMENTS}) if(NOT TARGET ${target}) continue() endif() + get_target_property(target_type "${target}" TYPE) if("${target_type}" STREQUAL "INTERFACE_LIBRARY") set(property_prefix "INTERFACE_") @@ -419,11 +420,11 @@ function(qt_pull_features_into_current_scope) set(value ON) foreach(state IN ITEMS ENABLED DISABLED) - get_target_property(features "${target}" ${property_prefix}QT_${arg_FEATURE_PROPERTY_INFIX}${state}_${visibility}_FEATURES) + get_target_property(features "${target}" ${property_prefix}QT_${state}_${visibility}_FEATURES) if("${features}" STREQUAL "features-NOTFOUND") continue() endif() - foreach(feature ${features}) + foreach(feature IN ITEMS ${features}) set(QT_FEATURE_${feature} ${value} PARENT_SCOPE) endforeach() set(value OFF) @@ -437,7 +438,7 @@ macro(qt_push_features_into_parent_scope) list (SORT _variableNames) list(REMOVE_DUPLICATES _variableNames) - foreach(_var ${_variableNames}) + foreach(_var IN ITEMS ${_variableNames}) if(_var MATCHES "^QT_FEATURE_[a-z][a-z0-9_]*$") set("${_var}" "${${_var}}" PARENT_SCOPE) endif() @@ -445,8 +446,8 @@ macro(qt_push_features_into_parent_scope) endmacro() macro(qt_load_global_features) - if(NOT TARGET Qt::Core) - find_package(Qt${PROJECT_VERSION_MAJOR}Core QUIET) + if(NOT TARGET Qt::GlobalConfig) + find_package(Qt${PROJECT_VERSION_MAJOR}GlobalConfig QUIET) endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES FEATURE_PROPERTY_INFIX "GLOBAL_" Qt::Core) + qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES Qt::GlobalConfig) endmacro() diff --git a/cmake/tests/features/CMakeLists.txt b/cmake/tests/features/CMakeLists.txt index 32cff572bd1..0fff2b8be98 100644 --- a/cmake/tests/features/CMakeLists.txt +++ b/cmake/tests/features/CMakeLists.txt @@ -14,14 +14,14 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../;${CMAKE_CURREN include(QtSetup) ## Library to hold global features: -add_library(Qt_global_Config INTERFACE) +add_library(GlobalConfig INTERFACE) -qt_feature_module_begin(LIBRARY Core +qt_feature_module_begin(LIBRARY GlobalConfig PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") -qt_feature_module_end(Qt_global_Config) +qt_feature_module_end(GlobalConfig) assert(QT_FEATURE_top_a STREQUAL "ON") assert(QT_FEATURE_top_b STREQUAL "OFF") diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index d0f13c8615a..26292a7c75b 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -232,12 +232,15 @@ add_qt_module(Core WrapDoubleConversion tinycbor Threads::Threads ZLIB::ZLIB QtHarfBuzz + Qt::GlobalConfigPrivate PUBLIC_LIBRARIES Qt::Platform DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH ) +configure_file(global/qconfig.cpp.in global/qconfig.cpp) + # Handle QObject: Automoc does not work for this as it would # require to spill internals into users: add_library(Core_qobject OBJECT) @@ -254,30 +257,15 @@ target_include_directories(Core_qobject PRIVATE "${PROJECT_BINARY_DIR}/include/QtCore" "${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}" "${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore") -target_link_libraries(Core_qobject PRIVATE Qt::Platform) +target_link_libraries(Core_qobject PRIVATE Qt::Platform Qt::GlobalConfig) target_link_libraries(Core PRIVATE Core_qobject) # Comments trigger moc for these, so skip automoc: -set_source_files_properties( tools/qsharedpointer.cpp PROPERTIES SKIP_AUTOMOC ON) +set_source_files_properties(tools/qsharedpointer.cpp PROPERTIES SKIP_AUTOMOC ON) set_property(TARGET Core APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") set_property(TARGET Core APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") -# As a special feature, the global features are attached to QtCore as -# custom properties. That's symmetric to qconfig.cpp/h being part of -# QtCore and not of a QtGlobal library. - -foreach(visibility PUBLIC PRIVATE) - foreach(state ENABLED DISABLED) - get_target_property(props Qt_global_Config INTERFACE_QT_${state}_${visibility}_FEATURES) - set(propertyName "QT_GLOBAL_${state}_${visibility}_FEATURES") - set_property(TARGET Core PROPERTY ${propertyName} "${props}") - set_property(TARGET Core APPEND PROPERTY EXPORT_PROPERTIES "${propertyName}") - endforeach() -endforeach() - -configure_file(global/qconfig.cpp.in global/qconfig.cpp) - # FIXME: tools still have a lot of special stuff that is not ported! # FIXME: qmake condition: (linux*|hurd*):!cross_compile:!static:!*-armcc* From 235769d56b38647b196d0d61099aae3c6dcc023f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 10 Jan 2019 13:47:25 +0100 Subject: [PATCH 0062/1322] CMake: Error out on mis-use of qt_pull_features_into_current_scope Make it a bit harder to mis-use qt_pull_features_into_current_scope. Change-Id: I2a6be28d7c0e6207217cb1908ec22cc757acd01a Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index ba4ca41c5ba..4af38e20e35 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -403,8 +403,11 @@ endfunction() function(qt_pull_features_into_current_scope) cmake_parse_arguments(arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "" "" ${ARGN}) foreach(target IN ITEMS ${arg_UNPARSED_ARGUMENTS}) + if(NOT "${target}" MATCHES "^Qt::[a-zA-z][a-zA-Z0-9_]*$") + message(FATAL_ERROR "${target} does not match Qt::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") + endif() if(NOT TARGET ${target}) - continue() + message(FATAL_ERROR "${target} not found.") endif() get_target_property(target_type "${target}" TYPE) From 3ec578020c9e088c7356da07d9112ece37bbf496 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 10 Jan 2019 11:28:51 +0100 Subject: [PATCH 0063/1322] CMake: QtFeature optimization Remove some unnecessary sorting, speeding up cmake by about 10s on my machine Change-Id: Ieafbd16f6dd8cfe6d1af3c739bfe58e8bf724441 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 4af38e20e35..7b8f11e896f 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -438,8 +438,6 @@ endfunction() macro(qt_push_features_into_parent_scope) get_cmake_property(_variableNames VARIABLES) - list (SORT _variableNames) - list(REMOVE_DUPLICATES _variableNames) foreach(_var IN ITEMS ${_variableNames}) if(_var MATCHES "^QT_FEATURE_[a-z][a-z0-9_]*$") From 6a1ee4de07cbaaeb0583b191fee6258e0a4003e4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 14 Jan 2019 11:35:53 +0100 Subject: [PATCH 0064/1322] CMake: Store Qt features in CMake Cache This is less self-contained than what we have, but significantly speeds up cmake configure/generate runs. This patch also warns when a feature is already defined. Change-Id: I8cab63e208ba98756b47d362a39b462f5ec55e20 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 33 --------- cmake/QtFeature.cmake | 73 +++++++------------ cmake/QtModuleConfig.cmake.in | 10 ++- src/CMakeLists.txt | 1 - src/gui/CMakeLists.txt | 2 - src/platformsupport/CMakeLists.txt | 1 - src/plugins/platforms/CMakeLists.txt | 2 - tests/auto/printsupport/CMakeLists.txt | 3 - .../widgets/widgets/qmdiarea/CMakeLists.txt | 3 - util/cmake/pro2cmake.py | 14 ---- 10 files changed, 34 insertions(+), 108 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index d35254c48f1..c94117dda79 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -272,27 +272,6 @@ function(extend_target target) list(APPEND dbus_sources "${sources}") endforeach() - foreach(dep ${arg_FEATURE_DEPENDENCIES} ${arg_LIBRARIES} ${arg_PUBLIC_LIBRARIES}) - if("${dep}" MATCHES "^Qt::((.+)(Private)|(.+))$") - if (${CMAKE_MATCH_COUNT} EQUAL 3) - set(depTarget ${CMAKE_MATCH_2}) - else() - set(depTarget ${CMAKE_MATCH_4}) - endif() - - # Fetch features from dependencies and make them available to the - # caller as well as to the local scope for configure.cmake evaluation. - if(NOT TARGET "${dep}") - find_package(Qt${PROJECT_VERSION_MAJOR}${depTarget} REQUIRED) - endif() - - if("x${CMAKE_MATCH_3}" STREQUAL "xPrivate") - qt_pull_features_into_current_scope(PRIVATE_FEATURES "Qt::${depTarget}") - endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES "Qt::${depTarget}") - endif() - endforeach() - set_target_properties("${target}" PROPERTIES AUTOMOC ON AUTOMOC_EXECUTABLE "$" @@ -309,8 +288,6 @@ function(extend_target target) target_include_directories("${target}" PUBLIC ${arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${arg_INCLUDE_DIRECTORIES}) target_compile_definitions("${target}" PUBLIC ${arg_PUBLIC_DEFINES} PRIVATE ${arg_DEFINES}) target_link_libraries("${target}" PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE ${arg_LIBRARIES}) - - qt_push_features_into_parent_scope() endif() endfunction() @@ -545,8 +522,6 @@ function(add_qt_module target) $ $ ) - - qt_push_features_into_parent_scope() endfunction() @@ -611,8 +586,6 @@ function(add_qt_plugin target) endif() qt_internal_add_linker_version_script(${target}) - - qt_push_features_into_parent_scope() endfunction() @@ -645,8 +618,6 @@ function(add_qt_executable name) WIN32_EXECUTABLE "${arg_GUI}" MACOSX_BUNDLE "${arg_GUI}" ) - - qt_push_features_into_parent_scope() endfunction() @@ -671,8 +642,6 @@ function(add_qt_test name) set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${arg_RUN_SERIAL}") set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}") set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${PROJECT_BINARY_DIR}/${INSTALL_PLUGINSDIR}") - - qt_push_features_into_parent_scope() endfunction() @@ -680,7 +649,6 @@ endfunction() # tests launch separate programs to test certainly input/output behavior. function(add_qt_test_helper name) add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ${ARGN}) - qt_push_features_into_parent_scope() endfunction() @@ -706,7 +674,6 @@ function(add_qt_tool name) qt_internal_add_target_aliases("${name}") install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) - qt_push_features_into_parent_scope() endfunction() diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 7b8f11e896f..aa18b380a65 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -180,7 +180,10 @@ macro(qt_feature_set_value feature cache emit_if condition label) message(SEND_ERROR "Feature \"${feature}\": Forcing to \"${cache}\" breaks its condition.") endif() - set(QT_FEATURE_${feature} "${result}" PARENT_SCOPE) + if (DEFINED "QT_FEATURE_${feature}") + message(FATAL_ERROR "Feature ${feature} is already defined when evaluating configure.cmake features for ${target}.") + endif() + set(QT_FEATURE_${feature} "${result}" CACHE INTERNAL "Qt feature: ${feature}") endmacro() function(qt_evaluate_feature feature) @@ -379,8 +382,6 @@ function(qt_feature_module_end target) unset(__QtFeature_private_extra PARENT_SCOPE) unset(__QtFeature_public_extra PARENT_SCOPE) - - qt_push_features_into_parent_scope() endfunction() function(qt_config_compile_test name) @@ -400,55 +401,35 @@ function(qt_config_compile_test_x86simd extension label) set(TEST_subarch_${extension} "${TEST_X86SIMD_${extension}}" CACHE INTERNAL "${label}" ) endfunction() -function(qt_pull_features_into_current_scope) - cmake_parse_arguments(arg "PUBLIC_FEATURES;PRIVATE_FEATURES" "" "" ${ARGN}) - foreach(target IN ITEMS ${arg_UNPARSED_ARGUMENTS}) - if(NOT "${target}" MATCHES "^Qt::[a-zA-z][a-zA-Z0-9_]*$") - message(FATAL_ERROR "${target} does not match Qt::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") - endif() - if(NOT TARGET ${target}) - message(FATAL_ERROR "${target} not found.") - endif() +function(qt_make_features_available target) + if(NOT "${target}" MATCHES "^Qt::[a-zA-z][a-zA-Z0-9_]*$") + message(FATAL_ERROR "${target} does not match Qt::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") + endif() + if(NOT TARGET ${target}) + message(FATAL_ERROR "${target} not found.") + endif() - get_target_property(target_type "${target}" TYPE) - if("${target_type}" STREQUAL "INTERFACE_LIBRARY") - set(property_prefix "INTERFACE_") - else() - set(property_prefix "") - endif() - foreach(visibility IN ITEMS PUBLIC PRIVATE) - if(NOT ${arg_${visibility}_FEATURES}) + get_target_property(target_type "${target}" TYPE) + if("${target_type}" STREQUAL "INTERFACE_LIBRARY") + set(property_prefix "INTERFACE_") + else() + set(property_prefix "") + endif() + foreach(visibility IN ITEMS PUBLIC PRIVATE) + set(value ON) + foreach(state IN ITEMS ENABLED DISABLED) + get_target_property(features "${target}" ${property_prefix}QT_${state}_${visibility}_FEATURES) + if("${features}" STREQUAL "features-NOTFOUND") continue() endif() - - set(value ON) - foreach(state IN ITEMS ENABLED DISABLED) - get_target_property(features "${target}" ${property_prefix}QT_${state}_${visibility}_FEATURES) - if("${features}" STREQUAL "features-NOTFOUND") - continue() + foreach(feature IN ITEMS ${features}) + if (DEFINED "QT_FEATURE_${feature}") + message(FATAL_ERROR "Feature ${feature} is already defined when importing features from ${target}.") endif() - foreach(feature IN ITEMS ${features}) - set(QT_FEATURE_${feature} ${value} PARENT_SCOPE) - endforeach() - set(value OFF) + set(QT_FEATURE_${feature} "${value}" CACHE INTERNAL "Qt feature: ${feature}") endforeach() + set(value OFF) endforeach() endforeach() endfunction() -macro(qt_push_features_into_parent_scope) - get_cmake_property(_variableNames VARIABLES) - - foreach(_var IN ITEMS ${_variableNames}) - if(_var MATCHES "^QT_FEATURE_[a-z][a-z0-9_]*$") - set("${_var}" "${${_var}}" PARENT_SCOPE) - endif() - endforeach() -endmacro() - -macro(qt_load_global_features) - if(NOT TARGET Qt::GlobalConfig) - find_package(Qt${PROJECT_VERSION_MAJOR}GlobalConfig QUIET) - endif() - qt_pull_features_into_current_scope(PUBLIC_FEATURES PRIVATE_FEATURES Qt::GlobalConfig) -endmacro() diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 32f30fed7ee..e08c4ff87f8 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -2,8 +2,12 @@ find_package(Qt@PROJECT_VERSION_MAJOR@ QUIET) -include("${CMAKE_CURRENT_LIST_DIR}/@versioned_module_name@Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/@module_versioned@Targets.cmake") -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@versioned_module_name@Macros.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@versioned_module_name@Macros.cmake") +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@module_versioned@Macros.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@module_versioned@Macros.cmake") endif() + +include QtFeature + +qt_make_features_available(Qt::@module@) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 375b102f58e..503d7717fab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -58,7 +58,6 @@ add_subdirectory(tools) if(QT_FEATURE_gui) add_subdirectory(gui) - qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::Gui) if(QT_FEATURE_widgets) add_subdirectory(widgets) if(QT_FEATURE_opengl) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index dd2b101689a..81ef8b1b665 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -6,8 +6,6 @@ find_library(FWCoreGraphics CoreGraphics) ## Gui Module: ##################################################################### -qt_load_global_features() - if (QT_FEATURE_gui) if (WINRT) set(_default_platform "winrt") diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index c571f940c81..e298eb4bc55 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -1,6 +1,5 @@ # Generated from platformsupport.pro. -qt_pull_features_into_current_scope(PRIVATE_FEATURES Qt::Gui) add_subdirectory(themes) add_subdirectory(edid) add_subdirectory(eventdispatchers) diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index f0ac297d17b..0a01b80bc87 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -1,5 +1,3 @@ -qt_pull_features_into_current_scope(PRIVATE_FEATURES Qt::Gui) - if(QT_FEATURE_xcb) add_subdirectory(xcb) endif() diff --git a/tests/auto/printsupport/CMakeLists.txt b/tests/auto/printsupport/CMakeLists.txt index 3908a297dd4..791d6e48075 100644 --- a/tests/auto/printsupport/CMakeLists.txt +++ b/tests/auto/printsupport/CMakeLists.txt @@ -1,5 +1,2 @@ -# Generated from printsupport.pro. - -qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::PrintSupport) add_subdirectory(dialogs) add_subdirectory(kernel) diff --git a/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt b/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt index b14730c5889..ca3bf2afa1e 100644 --- a/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt @@ -1,5 +1,3 @@ -qt_pull_features_into_current_scope(PUBLIC_FEATURES Qt::Gui) - add_qt_test("tst_qmdiarea" RUN_SERIAL SOURCES tst_qmdiarea.cpp DEFINES QT_NO_CAST_TO_ASCII @@ -10,5 +8,4 @@ add_qt_test("tst_qmdiarea" RUN_SERIAL SOURCES tst_qmdiarea.cpp ) extend_target("tst_qmdiarea" CONDITION TARGET Qt::OpenGL LIBRARIES Qt::OpenGL) - extend_target("tst_qmdiarea" CONDITION APPLE_OSX LIBRARIES FWSecurity) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index a1c73fcd5fa..80a10bd944a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -823,23 +823,9 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, scope.currentdir()))) -def handle_qt_for_config(scope: Scope, cm_fh: typing.IO[str], *, - indent: int = 0) -> None: - for config in scope.get("QT_FOR_CONFIG") or []: - lib = map_qt_library(config) - if lib.endswith("Private"): - cm_fh.write('{}qt_pull_features_into_current_scope' - '(PRIVATE_FEATURES {})\n' - .format(spaces(indent), lib[:-len("Private")])) - else: - cm_fh.write('{}qt_pull_features_into_current_scope' - '(PUBLIC_FEATURES {})\n'.format(spaces(indent), lib)) - - def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, indent: int = 0) -> None: template = scope.getTemplate() - handle_qt_for_config(scope, cm_fh) if template == 'subdirs': handle_subdir(scope, cm_fh, indent=indent) elif template in ('app', 'lib'): From 448ca92053d62b7fd3f820f00098702c3c4bd09f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 10:22:59 +0100 Subject: [PATCH 0065/1322] CMake: Add "BUILD_EXAMPLES" option to disable examples BUILD_EXAMPLES defaults to "ON". Change-Id: I5dfe926d8a23b610b45a5243deeb82483d998b90 Reviewed-by: Liang Qi Reviewed-by: Simon Hausmann Reviewed-by: Mikhail Svetkin --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f00d333dc0..7a4b451b75a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,11 @@ if (BUILD_TESTING) endif() add_subdirectory(qmake) -add_subdirectory(examples) + +option(BUILD_EXAMPLES "Build Qt examples" ON) +if (BUILD_EXAMPLES) + add_subdirectory(examples) +endif() ## Delayed actions on some of the Qt targets: include(QtPostProcess) From 9162aa5da9cd29d1231bf268dcee349b6bc25dd3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 13:41:17 +0100 Subject: [PATCH 0066/1322] CMake: pro2cmake: fix include file handling Do not include the same file over and over again... Change-Id: Ia0748b9ebe58388549ba23ec7e24ce3d9b738987 Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 80a10bd944a..33b8ffb6c09 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -346,6 +346,7 @@ class Scope: c.dump(indent=indent + 1) def get(self, key: str, default=None) -> typing.List[str]: + assert key != '_INCLUDED' # Special case things that may not recurse! result = [] # type: typing.List[str] if self._parent: @@ -378,6 +379,12 @@ class Scope: return self.getString('TARGET') \ or os.path.splitext(os.path.basename(self.file()))[0] + def getIncludes(self) -> typing.List[str]: + result = [] + for op in self._operations.get('_INCLUDED', []): + result = op.process(result) + return result + class QmakeParser: def __init__(self, *, debug: bool = False) -> None: @@ -844,7 +851,7 @@ def generate_cmakelists(scope: Scope) -> None: def do_include(scope: Scope, *, debug: bool = False) -> None: - for i in scope.get('_INCLUDED', []): + for i in scope.getIncludes(): dir = scope.basedir() include_file = map_to_file(i, dir, scope.currentdir(), want_absolute_path=True) From db3cc891852823ae022f7c16587187df8573f98f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 15:23:30 +0100 Subject: [PATCH 0067/1322] CMake: Fix include path handling in pro2cmake.py Change-Id: Ice9db97db5bf1fb347bff07bcaf91daac87fa983 Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 33b8ffb6c09..71664869a4c 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -853,8 +853,7 @@ def generate_cmakelists(scope: Scope) -> None: def do_include(scope: Scope, *, debug: bool = False) -> None: for i in scope.getIncludes(): dir = scope.basedir() - include_file = map_to_file(i, dir, scope.currentdir(), - want_absolute_path=True) + include_file = i if not include_file: continue if not os.path.isfile(include_file): From d73b06fc3526498a94b46ec6102888556137d08a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 15:30:56 +0100 Subject: [PATCH 0068/1322] CMake: pro2cmake.py: Fix merging of scopes Set new keys in the parent scope instead of just appending to existing scopes. Change-Id: I901c3f418429d8aed56acb39b1dbe566c5468920 Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 71664869a4c..6401e52051f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -213,7 +213,10 @@ class Scope: self._add_child(c) for key in other._operations.keys(): - self._operations[key] = other._operations[key] + if key in self._operations: + self._operations[key] += other._operations[key] + else: + self._operations[key] = other._operations[key] def basedir(self) -> str: return self._basedir From 1d7e724e395bf6bf7f6213edb3794d4c8b34ce80 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 17:10:17 +0100 Subject: [PATCH 0069/1322] CMake: pro2cmake: Fix printing of the different operations Change-Id: Ieb33141601c29ec2f3c30c6725179f1fb234e53a Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6401e52051f..69c6f1fb81a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -136,7 +136,7 @@ class Operation: def process(self, input): assert(False) - def __str__(self): + def __repr__(self): assert(False) @@ -144,8 +144,8 @@ class AddOperation(Operation): def process(self, input): return input + self._value - def __str__(self): - return '+({})'.format(self._value) + def __repr__(self): + return '+({})'.format(','.join(self._value)) class UniqueAddOperation(Operation): @@ -156,7 +156,7 @@ class UniqueAddOperation(Operation): result += [v, ] return result - def __str__(self): + def __repr__(self): return '*({})'.format(self._value) @@ -164,7 +164,7 @@ class SetOperation(Operation): def process(self, input): return self._value - def __str__(self): + def __repr__(self): return '=({})'.format(self._value) @@ -182,7 +182,7 @@ class RemoveOperation(Operation): result += ['-{}'.format(v), ] return result - def __str__(self): + def __repr__(self): return '-({})'.format(self._value) From e5bee377620de0ca0d80acdd396bbd5804bc2e61 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 17:10:57 +0100 Subject: [PATCH 0070/1322] CMake: pro2cmake.py: Improve debugging dump Make the output of the project structure debug dump more readable. Change-Id: Ib80b41f7fdb8e14ff878284c46f3760d84f4f004 Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 69c6f1fb81a..f95ac43ea87 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -337,16 +337,23 @@ class Scope: def dump(self, *, indent: int = 0) -> None: ind = ' ' * indent if self._condition == '': - print('{}Scope {} in {}.'.format(ind, self._file, self._basedir)) + print('{}Scope {} in "{}".'.format(ind, self._file, self._basedir)) else: - print('{}Scope {} in {} with condition: {}.' + print('{}Scope {} in "{}" with condition: "{}".' .format(ind, self._file, self._basedir, self._condition)) print('{}Keys:'.format(ind)) - for k in sorted(self._operations.keys()): - print('{} {} = "{}"'.format(ind, k, self._operations.get(k, []))) + keys = self._operations.keys() + if not keys: + print('{} -- NONE --'.format(ind)) + else: + for k in sorted(keys): + print('{} {} = "{}"'.format(ind, k, self._operations.get(k, []))) print('{}Children:'.format(ind)) - for c in self._children: - c.dump(indent=indent + 1) + if not self._children: + print('{} -- NONE --'.format(ind)) + else: + for c in self._children: + c.dump(indent=indent + 1) def get(self, key: str, default=None) -> typing.List[str]: assert key != '_INCLUDED' # Special case things that may not recurse! From 23e3aaf2cdcae292034b57e437d3a9744a3c9468 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 17:11:52 +0100 Subject: [PATCH 0071/1322] CMake: pro2cmake.py: Nicer printing of conditions Do not needlessly add () and NOT all over the conditions. Change-Id: If907357306eb3f8ab5b2878bcad5902171a90476 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index f95ac43ea87..8c24ef43f6a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -519,6 +519,8 @@ def map_condition(condition: str) -> str: condition = condition.replace('|', ' OR ') condition = condition.replace('==', ' STREQUAL ') + condition = condition.replace('NOT NOT', '') # remove double negation + cmake_condition = '' for part in condition.split(): # some features contain e.g. linux, that should not be @@ -686,19 +688,40 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, cm_fh.write('{} {}\n'.format(ind, d)) is_framework = False + return set(scope.keys()) - scope.visited_keys() + + +def is_simple_condition(condition: str) -> bool: + return ' ' not in condition or (condition.startswith('NOT ') and ' ' not in condition[4:]) + def write_extend_target(cm_fh: typing.IO[str], target: str, scope: Scope, parent_condition: str = '', - previous_conditon: str = '', *, + previous_condition: str = '', *, indent: int = 0) -> str: total_condition = scope.condition() if total_condition == 'else': - assert previous_conditon, \ + assert previous_condition, \ "Else branch without previous condition in: %s" % scope.file() - total_condition = 'NOT ({})'.format(previous_conditon) + if previous_condition.startswith('NOT '): + total_condition = previous_condition[4:] + elif is_simple_condition(previous_condition): + total_condition = 'NOT {}'.format(previous_condition) + else: + total_condition = 'NOT ({})'.format(previous_condition) if parent_condition: - total_condition = '({}) AND ({})'.format(parent_condition, - total_condition) + if not total_condition: + total_condition = parent_condition + else: + if is_simple_condition(parent_condition) and is_simple_condition(total_condition): + total_condition = '{} AND {}'.format(parent_condition, + total_condition) + elif is_simple_condition(total_condition): + total_condition = '({}) AND {}'.format(parent_condition, total_condition) + elif is_simple_condition(parent_condition): + total_condition = '{} AND ({})'.format(parent_condition, total_condition) + else: + total_condition = '({}) AND ({})'.format(parent_condition, total_condition) extend_qt_io_string = io.StringIO() write_sources_section(extend_qt_io_string, scope) From 3f3517923e979a06cb01e999a7be12d32a14e2b2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 17:12:58 +0100 Subject: [PATCH 0072/1322] CMake: pro2cmake.py: Ignore 3rdparty code that gets included Ignore include files that go into 3rdparty code. Qt 6 should work with external libraries, so there is no need to drag in 3rdparty include directories, etc. Change-Id: I990f3a8a4983e1458843b4122420b9daec763ccb Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 8c24ef43f6a..d99863cbcc3 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -889,6 +889,9 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: include_file = i if not include_file: continue + if '/3rdparty/' in include_file: + print(' ****: Ignoring include file in 3rdparty: {}.'.format(include_file)) + continue if not os.path.isfile(include_file): print(' XXXX: Failed to include {}.'.format(include_file)) continue From 6e9a2dd3c6994d83f1a24dadba0ecc1350e441dd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 17 Jan 2019 17:14:19 +0100 Subject: [PATCH 0073/1322] CMake: pro2cmake.py: Visit scopes depth-first for include resolution This avoids some includes being done several times: We used to generate scopes for the include files, add them to our current scope and then traverse the children of the current scope. Switch the order to avoid traversing the newly added scopes twice. Change-Id: Icb9c53c9f54772d3305e0fb121824c23d5469e09 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index d99863cbcc3..e37c765f7ae 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -884,6 +884,9 @@ def generate_cmakelists(scope: Scope) -> None: def do_include(scope: Scope, *, debug: bool = False) -> None: + for c in scope.children(): + do_include(c) + for i in scope.getIncludes(): dir = scope.basedir() include_file = i @@ -906,9 +909,6 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: scope.merge(include_scope) - for c in scope.children(): - do_include(c) - def main() -> None: args = _parse_commandline() From cc593426eb26b441285b75708cd3374075a31270 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 18 Jan 2019 12:40:29 +0100 Subject: [PATCH 0074/1322] CMake: pro2cmake.py: Better indentation in debug dump Indent the individual parts of a scope relative to the scope itself. This makes things a bit more readable. Change-Id: Iffbffd69bc960118f9657a1b7fb488da3c7b48dd Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index e37c765f7ae..78c75683a22 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -341,14 +341,14 @@ class Scope: else: print('{}Scope {} in "{}" with condition: "{}".' .format(ind, self._file, self._basedir, self._condition)) - print('{}Keys:'.format(ind)) + print('{} Keys:'.format(ind)) keys = self._operations.keys() if not keys: print('{} -- NONE --'.format(ind)) else: for k in sorted(keys): print('{} {} = "{}"'.format(ind, k, self._operations.get(k, []))) - print('{}Children:'.format(ind)) + print('{} Children:'.format(ind)) if not self._children: print('{} -- NONE --'.format(ind)) else: From 29ff5f77ee9dbdd5a4aac292fee2599e2ea9cfc1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 18 Jan 2019 12:44:15 +0100 Subject: [PATCH 0075/1322] CMake: pro2cmake.py: Do not double-report include files Do not add scopes that are going to get merged into their parent scope as a child of the parent scope. This leads to the information of the child scope being duplicated. Change-Id: If4d6a83b9c9eac477959e7774e9cf65fd4df98e6 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 78c75683a22..9b819e58ec6 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -901,9 +901,9 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: include_result = parseProFile(include_file, debug=debug) include_scope \ - = Scope.FromDict(scope, include_file, + = Scope.FromDict(None, include_file, include_result.asDict().get('statements'), - '', dir) + '', dir) # This scope will be merged into scope, so no parent_scope! do_include(include_scope) From 6ad93525445e258b76cc0376387a0f93dcb9b76f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 18 Jan 2019 12:02:04 +0100 Subject: [PATCH 0076/1322] CMake: pro2cmake.py: Do not print trailing / in directory names Change-Id: I3da83b8908791e033cf33221631d2fe988f83957 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9b819e58ec6..ede2a325b96 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -661,6 +661,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, if includes: cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) for i in includes: + i = i.rstrip('/') or ('/') cm_fh.write('{} {}\n'.format(ind, i)) dependencies = [map_qt_library(q) for q in scope.diff('QT') From 024edf4bfdd8652f0a87a90044127dc582239590 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 18 Jan 2019 12:43:11 +0100 Subject: [PATCH 0077/1322] CMake: pro2cmake.py: Report keys that were not converted in each scope This makes it easier to see what is still missing. Change-Id: I186abd609f20be680ac0943ac89068f764142a79 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 56 +++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ede2a325b96..f4d929ab0ce 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -207,6 +207,10 @@ class Scope: self._condition = map_condition(condition) self._children = [] # type: typing.List[Scope] self._operations = {} # type: typing.Dict[str, typing.List[Operation]] + self._visited_keys = set() # type: typing.Set[str] + + def reset_visited_keys(self): + self._visited_keys = set() def merge(self, other: 'Scope') -> None: for c in other._children: @@ -355,8 +359,15 @@ class Scope: for c in self._children: c.dump(indent=indent + 1) + def keys(self): + return self._operations.keys() + + def visited_keys(self): + return self._visited_keys; + def get(self, key: str, default=None) -> typing.List[str]: assert key != '_INCLUDED' # Special case things that may not recurse! + self._visited_keys.add(key) result = [] # type: typing.List[str] if self._parent: @@ -619,10 +630,12 @@ def write_scope_header(cm_fh: typing.IO[str], *, indent: int = 0): def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, - indent: int = 0, known_libraries=set()) -> None: + indent: int = 0, known_libraries=set()) -> typing.Set[str]: ind = spaces(indent) + scope.reset_visited_keys(); plugin_type = scope.get('PLUGIN_TYPE') + if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) @@ -696,6 +709,18 @@ def is_simple_condition(condition: str) -> bool: return ' ' not in condition or (condition.startswith('NOT ') and ' ' not in condition[4:]) +def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: + result = '' + for k in sorted(ignored_keys): + if k == '_INCLUDED' or k == 'TARGET' or k == 'QMAKE_DOCS': + # All these keys are actually reported using "non-standard" means:-) + continue + values = scope.get(k) + value_string = '' if not values else '"' + '" "'.join(scope.get(k)) + '"' + result += '{}# {} = {}\n'.format(indent, k, value_string) + return result + + def write_extend_target(cm_fh: typing.IO[str], target: str, scope: Scope, parent_condition: str = '', previous_condition: str = '', *, @@ -725,19 +750,27 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, total_condition = '({}) AND ({})'.format(parent_condition, total_condition) extend_qt_io_string = io.StringIO() - write_sources_section(extend_qt_io_string, scope) + ignored_keys = write_sources_section(extend_qt_io_string, scope) extend_qt_string = extend_qt_io_string.getvalue() + ignored_keys_report = write_ignored_keys(scope, ignored_keys, spaces(indent + 1)) + if extend_qt_string and ignored_keys_report: + ignored_keys_report = '\n' + ignored_keys_report + extend_scope = '\n{}extend_target({} CONDITION {}\n' \ - '{})\n'.format(spaces(indent), target, total_condition, - extend_qt_string) + '{}{})\n'.format(spaces(indent), target, total_condition, + extend_qt_string, ignored_keys_report) if not extend_qt_string: - # Comment out the generated extend_target call because there - # no sources were found, but keep it commented for - # informational purposes. - extend_scope = ''.join(['#' + line for line in - extend_scope.splitlines(keepends=True)]) + if ignored_keys_report: + # Comment out the generated extend_target call because there + # no sources were found, but keep it commented for + # informational purposes. + extend_scope = ''.join(['#' + line for line in + extend_scope.splitlines(keepends=True)]) + else: + extend_scope = '' # Nothing to report, so don't! + cm_fh.write(extend_scope) children = scope.children() @@ -762,7 +795,10 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, for extra_line in extra_lines: cm_fh.write('{} {}\n'.format(spaces(indent), extra_line)) - write_sources_section(cm_fh, scope, indent=indent, **kwargs) + ignored_keys = write_sources_section(cm_fh, scope, indent=indent, **kwargs) + ignored_keys_report = write_ignored_keys(scope, ignored_keys, spaces(indent + 1)) + if ignored_keys_report: + cm_fh.write(ignored_keys_report) # Footer: cm_fh.write('{})\n'.format(spaces(indent))) From 2f504669951e3d5538b55ce4dbad2e05f466ff19 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 18 Jan 2019 12:46:08 +0100 Subject: [PATCH 0078/1322] CMake: pro2cmake.py: Give up on faithful representation of -=, +=, *= and = Having a good representation is nice, but unfortunately very hard: pro2cmake.py sees just a small part of the entire qmake build system at a time, so the information it has is incomplete to start with. It is not worthwhile to pass the supposedly full information around -- which will then need to get de-duplicated again -- considering that the information is not complete in the first place. So go back to the simplistic approach we used earsier. That is good enough and does not suffer from the problem of having multi-part arguments getting messed up when the scopes get de-duplicated. Change-Id: I553329650d6b8046f7ad8b1282e3d0c961293a28 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 54 +++++++++-------------------------------- 1 file changed, 11 insertions(+), 43 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index f4d929ab0ce..ca53234f068 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -228,25 +228,6 @@ class Scope: def currentdir(self) -> str: return self._currentdir - def diff(self, key: str, - default: typing.Optional[typing.List[str]] = []) \ - -> typing.List[str]: - mine = self.get(key, default) - - if self._parent: - parent = self._parent.get(key, default) - if (parent == mine): - return [] - - parent_set = set(parent) - mine_set = set(mine) - - added = [x for x in mine if x not in parent_set] - removed = [x for x in parent if x not in mine_set] - - return added + list('# {}'.format(x) for x in removed) - return mine - @staticmethod def FromDict(parent_scope: typing.Optional['Scope'], file: str, statements, cond: str = '', base_dir: str = ''): @@ -366,19 +347,9 @@ class Scope: return self._visited_keys; def get(self, key: str, default=None) -> typing.List[str]: - assert key != '_INCLUDED' # Special case things that may not recurse! self._visited_keys.add(key) result = [] # type: typing.List[str] - if self._parent: - result = self._parent.get(key, default) - else: - if default: - if isinstance(default, list): - result = default - else: - result = [str(default), ] - for op in self._operations.get(key, []): result = op.process(result) return result @@ -401,10 +372,7 @@ class Scope: or os.path.splitext(os.path.basename(self.file()))[0] def getIncludes(self) -> typing.List[str]: - result = [] - for op in self._operations.get('_INCLUDED', []): - result = op.process(result) - return result + return self.get('_INCLUDED', []) class QmakeParser: @@ -639,10 +607,10 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) - sources = scope.diff('SOURCES') + scope.diff('HEADERS') \ - + scope.diff('OBJECTIVE_SOURCES') + scope.diff('NO_PCH_SOURCES') \ - + scope.diff('FORMS') - resources = scope.diff('RESOURCES') + sources = scope.get('SOURCES') + scope.get('HEADERS') \ + + scope.get('OBJECTIVE_SOURCES') + scope.get('NO_PCH_SOURCES') \ + + scope.get('FORMS') + resources = scope.get('RESOURCES') if resources: qrc_only = True for r in resources: @@ -663,26 +631,26 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, for l in sort_sources(sources): cm_fh.write('{} {}\n'.format(ind, l)) - defines = scope.diff('DEFINES') + defines = scope.get('DEFINES') if defines: cm_fh.write('{} DEFINES\n'.format(ind)) for d in defines: d = d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') cm_fh.write('{} {}\n'.format(ind, d)) - includes = scope.diff('INCLUDEPATH') + includes = scope.get('INCLUDEPATH') if includes: cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) for i in includes: i = i.rstrip('/') or ('/') cm_fh.write('{} {}\n'.format(ind, i)) - dependencies = [map_qt_library(q) for q in scope.diff('QT') + dependencies = [map_qt_library(q) for q in scope.get('QT') if map_qt_library(q) not in known_libraries] - dependencies += [map_qt_library(q) for q in scope.diff('QT_FOR_PRIVATE') + dependencies += [map_qt_library(q) for q in scope.get('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] - dependencies += scope.diff('QMAKE_USE_PRIVATE') \ - + scope.diff('LIBS_PRIVATE') + scope.diff('LIBS') + dependencies += scope.get('QMAKE_USE_PRIVATE') \ + + scope.get('LIBS_PRIVATE') + scope.get('LIBS') if dependencies: cm_fh.write('{} LIBRARIES\n'.format(ind)) is_framework = False From 0690c145db99da66dd3e2dc936848862661a161b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jan 2019 14:16:41 +0100 Subject: [PATCH 0079/1322] CMake: pro2cmake.py: Better output in debug dumps Report more error conditions in debug dump and make the output easier to read in the non-error case by wrapping all strings in "". Change-Id: I3c99deda3dfa27dcc0c9ce2800bfb891747e6934 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ca53234f068..ff814efcf2a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -139,13 +139,27 @@ class Operation: def __repr__(self): assert(False) + def _dump(self): + if not self._value: + return '' + + if not isinstance(self._value, list): + return '' + + result = [] + for i in self._value: + if not i: + result.append('') + else: + result.append(str(i)) + return '"' + '", "'.join(result) + '"' class AddOperation(Operation): def process(self, input): return input + self._value def __repr__(self): - return '+({})'.format(','.join(self._value)) + return '+({})'.format(self._dump()) class UniqueAddOperation(Operation): @@ -157,7 +171,7 @@ class UniqueAddOperation(Operation): return result def __repr__(self): - return '*({})'.format(self._value) + return '*({})'.format(self._dump()) class SetOperation(Operation): @@ -165,7 +179,7 @@ class SetOperation(Operation): return self._value def __repr__(self): - return '=({})'.format(self._value) + return '=({})'.format(self._dump()) class RemoveOperation(Operation): @@ -183,7 +197,7 @@ class RemoveOperation(Operation): return result def __repr__(self): - return '-({})'.format(self._value) + return '-({})'.format(self._dump()) class Scope: From e2ff9e3b9957f844d6530cc92096bed3c16fa46a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jan 2019 10:00:34 +0100 Subject: [PATCH 0080/1322] CMake: Introduce Q_OBJECT qdoc macro CMake's moc file scanning is rather primitive: It will run moc on any file containing a line that starts with Q_OBJECT (and similar macros). We have four files in QtBase that contain such a macro at the start of the line in a qdoc comment. These four files were excluded from automatic moc handling by cmake, which is not ideal, since this will silently fail when somebody actually adds a Q_OBJECT macro in code. This patch introduces a macro Q_OBJECT for qdoc. This macro will be replaced with Q_OBJECT in the generated documentation. While not nice, at least a failure to use \Q_OBJECT is noticeable: Moc will warn about the file. Change-Id: I829893c1166eee306fe30058d4ea0256affd45ea Reviewed-by: Simon Hausmann Reviewed-by: Paul Wicking --- doc/global/macros.qdocconf | 1 + src/corelib/CMakeLists.txt | 3 --- src/corelib/tools/qsharedpointer.cpp | 2 +- src/gui/CMakeLists.txt | 9 --------- src/gui/opengl/qopenglfunctions.cpp | 2 +- src/network/CMakeLists.txt | 8 -------- src/opengl/CMakeLists.txt | 6 ------ src/opengl/qglfunctions.cpp | 2 +- src/opengl/qgraphicsshadereffect.cpp | 2 +- 9 files changed, 5 insertions(+), 30 deletions(-) diff --git a/doc/global/macros.qdocconf b/doc/global/macros.qdocconf index 704b1da277e..0eaaf2cd2f7 100644 --- a/doc/global/macros.qdocconf +++ b/doc/global/macros.qdocconf @@ -17,6 +17,7 @@ macro.ouml.HTML = "ö" macro.QA = "\\e{Qt Assistant}" macro.QD = "\\e{Qt Designer}" macro.QL = "\\e{Qt Linguist}" +macro.Q_OBJECT = "Q_OBJECT" macro.QQV = "\\e{Qt QML Viewer}" macro.QtVersion = "$QT_VERSION" macro.QtVer = "$QT_VER" diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 26292a7c75b..a847d07adef 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -260,9 +260,6 @@ target_include_directories(Core_qobject PRIVATE target_link_libraries(Core_qobject PRIVATE Qt::Platform Qt::GlobalConfig) target_link_libraries(Core PRIVATE Core_qobject) -# Comments trigger moc for these, so skip automoc: -set_source_files_properties(tools/qsharedpointer.cpp PROPERTIES SKIP_AUTOMOC ON) - set_property(TARGET Core APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") set_property(TARGET Core APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 2d5fd2a00ef..be8b6a7aab0 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -414,7 +414,7 @@ \code class ScriptInterface : public QObject { - Q_OBJECT + \Q_OBJECT // ... diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 81ef8b1b665..60b5dec2df0 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -233,15 +233,6 @@ add_qt_module(Gui Qt::Core ) -set_source_files_properties( - # Comment triggering moc: - opengl/qopenglfunctions.cpp - PROPERTIES - SKIP_AUTOMOC ON - SKIP_AUTOUIC ON - SKIP_AUTORCC ON) - - ## Scopes: ##################################################################### diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 4f48604a889..700fb77ad71 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -93,7 +93,7 @@ void CLASS::init(QOpenGLContext *context) \ \code class MyGLWindow : public QWindow, protected QOpenGLFunctions { - Q_OBJECT + \Q_OBJECT public: MyGLWindow(QScreen *screen = 0); diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 48ae64bb28e..fd684c7eb2f 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -58,14 +58,6 @@ add_qt_module(Network Qt::CorePrivate ) -set_source_files_properties( - # Comment triggering moc: - access/qnetworkaccessdebugpipebackend_p.h - PROPERTIES - SKIP_AUTOMOC ON - SKIP_AUTOUIC ON - SKIP_AUTORCC ON) - ## Scopes: ##################################################################### diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 14750f3a3f0..f67fea4d160 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -31,12 +31,6 @@ add_qt_module(OpenGL Qt::GuiPrivate Qt::WidgetsPrivate ) -set_source_files_properties(qglfunctions.cpp qgraphicsshadereffect.cpp PROPERTIES - SKIP_AUTOMOC ON - SKIP_AUTOUIC ON - SKIP_AUTORCC ON -) - ## Scopes: ##################################################################### diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index 07e11943421..aa1854dd3dd 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE \code class MyGLWidget : public QGLWidget, protected QGLFunctions { - Q_OBJECT + \Q_OBJECT public: MyGLWidget(QWidget *parent = 0) : QGLWidget(parent) {} diff --git a/src/opengl/qgraphicsshadereffect.cpp b/src/opengl/qgraphicsshadereffect.cpp index cf3d307d719..4959c804b8c 100644 --- a/src/opengl/qgraphicsshadereffect.cpp +++ b/src/opengl/qgraphicsshadereffect.cpp @@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE \code class ColorizeEffect : public QGraphicsShaderEffect { - Q_OBJECT + \Q_OBJECT public: ColorizeEffect(QObject *parent = 0) : QGraphicsShaderEffect(parent), color(Qt::black) From 1c1bb53c5508c3015d7d24262af53647cca62622 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 25 Jan 2019 15:41:02 +0100 Subject: [PATCH 0081/1322] CMake: pro2cmake.py: Fix pyls warnings Fix pyls warnings in pro2cmake.py as well as its tests. Change-Id: Ib8ee1daa9b97735d13c0fde43616daa46de9e171 Reviewed-by: Frederik Gladhorn Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 54 +++++++++++++++++++------------- util/cmake/tests/test_parsing.py | 16 +++++++++- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ff814efcf2a..b87b20a8c2e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -154,6 +154,7 @@ class Operation: result.append(str(i)) return '"' + '", "'.join(result) + '"' + class AddOperation(Operation): def process(self, input): return input + self._value @@ -346,7 +347,8 @@ class Scope: print('{} -- NONE --'.format(ind)) else: for k in sorted(keys): - print('{} {} = "{}"'.format(ind, k, self._operations.get(k, []))) + print('{} {} = "{}"' + .format(ind, k, self._operations.get(k, []))) print('{} Children:'.format(ind)) if not self._children: print('{} -- NONE --'.format(ind)) @@ -358,7 +360,7 @@ class Scope: return self._operations.keys() def visited_keys(self): - return self._visited_keys; + return self._visited_keys def get(self, key: str, default=None) -> typing.List[str]: self._visited_keys.add(key) @@ -404,13 +406,13 @@ class QmakeParser: Substitution \ = pp.Combine(pp.Literal('$') + (((pp.Literal('$') + Identifier - + pp.Optional(pp.nestedExpr())) - | (pp.Literal('(') + Identifier + pp.Literal(')')) - | (pp.Literal('{') + Identifier + pp.Literal('}')) - | (pp.Literal('$') + pp.Literal('{') + + pp.Optional(pp.nestedExpr())) + | (pp.Literal('(') + Identifier + pp.Literal(')')) + | (pp.Literal('{') + Identifier + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('{') + Identifier + pp.Optional(pp.nestedExpr()) + pp.Literal('}')) - | (pp.Literal('$') + pp.Literal('[') + Identifier + | (pp.Literal('$') + pp.Literal('[') + Identifier + pp.Literal(']')) ))) # Do not match word ending in '\' since that breaks line @@ -612,9 +614,10 @@ def write_scope_header(cm_fh: typing.IO[str], *, indent: int = 0): def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, - indent: int = 0, known_libraries=set()) -> typing.Set[str]: + indent: int = 0, known_libraries=set()) \ + -> typing.Set[str]: ind = spaces(indent) - scope.reset_visited_keys(); + scope.reset_visited_keys() plugin_type = scope.get('PLUGIN_TYPE') @@ -688,17 +691,19 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, def is_simple_condition(condition: str) -> bool: - return ' ' not in condition or (condition.startswith('NOT ') and ' ' not in condition[4:]) + return ' ' not in condition \ + or (condition.startswith('NOT ') and ' ' not in condition[4:]) def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: result = '' for k in sorted(ignored_keys): if k == '_INCLUDED' or k == 'TARGET' or k == 'QMAKE_DOCS': - # All these keys are actually reported using "non-standard" means:-) + # All these keys are actually reported already continue values = scope.get(k) - value_string = '' if not values else '"' + '" "'.join(scope.get(k)) + '"' + value_string = '' if not values \ + else '"' + '" "'.join(scope.get(k)) + '"' result += '{}# {} = {}\n'.format(indent, k, value_string) return result @@ -721,27 +726,32 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, if not total_condition: total_condition = parent_condition else: - if is_simple_condition(parent_condition) and is_simple_condition(total_condition): + if is_simple_condition(parent_condition) \ + and is_simple_condition(total_condition): total_condition = '{} AND {}'.format(parent_condition, total_condition) elif is_simple_condition(total_condition): - total_condition = '({}) AND {}'.format(parent_condition, total_condition) + total_condition = '({}) AND {}'.format(parent_condition, + total_condition) elif is_simple_condition(parent_condition): - total_condition = '{} AND ({})'.format(parent_condition, total_condition) + total_condition = '{} AND ({})'.format(parent_condition, + total_condition) else: - total_condition = '({}) AND ({})'.format(parent_condition, total_condition) + total_condition = '({}) AND ({})'.format(parent_condition, + total_condition) extend_qt_io_string = io.StringIO() ignored_keys = write_sources_section(extend_qt_io_string, scope) extend_qt_string = extend_qt_io_string.getvalue() - ignored_keys_report = write_ignored_keys(scope, ignored_keys, spaces(indent + 1)) + ignored_keys_report = write_ignored_keys(scope, ignored_keys, + spaces(indent + 1)) if extend_qt_string and ignored_keys_report: ignored_keys_report = '\n' + ignored_keys_report extend_scope = '\n{}extend_target({} CONDITION {}\n' \ '{}{})\n'.format(spaces(indent), target, total_condition, - extend_qt_string, ignored_keys_report) + extend_qt_string, ignored_keys_report) if not extend_qt_string: if ignored_keys_report: @@ -778,7 +788,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cm_fh.write('{} {}\n'.format(spaces(indent), extra_line)) ignored_keys = write_sources_section(cm_fh, scope, indent=indent, **kwargs) - ignored_keys_report = write_ignored_keys(scope, ignored_keys, spaces(indent + 1)) + ignored_keys_report = write_ignored_keys(scope, ignored_keys, + spaces(indent + 1)) if ignored_keys_report: cm_fh.write(ignored_keys_report) @@ -912,7 +923,8 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: if not include_file: continue if '/3rdparty/' in include_file: - print(' ****: Ignoring include file in 3rdparty: {}.'.format(include_file)) + print(' ****: Ignoring include file in 3rdparty: {}.' + .format(include_file)) continue if not os.path.isfile(include_file): print(' XXXX: Failed to include {}.'.format(include_file)) @@ -922,7 +934,7 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: include_scope \ = Scope.FromDict(None, include_file, include_result.asDict().get('statements'), - '', dir) # This scope will be merged into scope, so no parent_scope! + '', dir) # This scope will be merged into scope! do_include(include_scope) diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 78ac7fed266..0802fe47422 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -49,7 +49,9 @@ def evaluate_condition(to_validate): assert 'condition' in to_validate assert 'statements' in to_validate - return (to_validate['condition'], to_validate['statements'], to_validate.get('else_statements', {})) + return (to_validate['condition'], + to_validate['statements'], + to_validate.get('else_statements', {})) def validate_default_else_test(file_name): @@ -105,22 +107,28 @@ def test_else2(): def test_else3(): validate_default_else_test(_tests_path + '/data/else3.pro') + def test_else4(): validate_default_else_test(_tests_path + '/data/else4.pro') + def test_else5(): validate_default_else_test(_tests_path + '/data/else5.pro') + def test_else6(): validate_default_else_test(_tests_path + '/data/else6.pro') + def test_else7(): result = parse_file(_tests_path + '/data/else7.pro') assert len(result) == 1 + def test_else8(): validate_default_else_test(_tests_path + '/data/else8.pro') + def test_include(): result = parse_file(_tests_path + '/data/include.pro') assert len(result) == 3 @@ -130,6 +138,7 @@ def test_include(): assert include.get('included', '') == 'foo' validate_op('B', '=', ['23'], result[2]) + def test_load(): result = parse_file(_tests_path + '/data/load.pro') assert len(result) == 3 @@ -139,24 +148,29 @@ def test_load(): assert load.get('loaded', '') == 'foo' validate_op('B', '=', ['23'], result[2]) + def test_definetest(): result = parse_file(_tests_path + '/data/definetest.pro') assert len(result) == 1 assert result[0] == [] + def test_unset(): result = parse_file(_tests_path + '/data/unset.pro') assert len(result) == 1 assert result[0] == [] + def test_quoted(): result = parse_file(_tests_path + '/data/quoted.pro') assert len(result) == 1 + def test_complex_values(): result = parse_file(_tests_path + '/data/complex_values.pro') assert len(result) == 1 + def test_function_if(): result = parse_file(_tests_path + '/data/function_if.pro') assert len(result) == 1 From 0e2762651ccbec541f59c7af5078fa69bd23d130 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jan 2019 14:20:47 +0100 Subject: [PATCH 0082/1322] CMake: pro2cmake.py: merge extend_targets with identical conditions This should somewhat simplify the generated CMakeLists.txt files, especially in complex cases like corelib or network. Change-Id: I208c8f99a64cbb6c97d51dd3ae428bb234982202 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 76 +++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 14 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index b87b20a8c2e..3130aeea02a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -223,6 +223,7 @@ class Scope: self._children = [] # type: typing.List[Scope] self._operations = {} # type: typing.Dict[str, typing.List[Operation]] self._visited_keys = set() # type: typing.Set[str] + self._total_condition = None # type: typing.Optional[str] def reset_visited_keys(self): self._visited_keys = set() @@ -322,11 +323,18 @@ class Scope: return self._file or '' def cMakeListsFile(self) -> str: + assert self.basedir() return os.path.join(self.basedir(), 'CMakeLists.txt') def condition(self) -> str: return self._condition + def set_total_condition(self, condition: str) -> None: + self._total_condition = condition + + def total_condition(self) -> typing.Optional[str]: + return self._total_condition + def _add_child(self, scope: 'Scope') -> None: scope._parent = self self._children.append(scope) @@ -708,10 +716,8 @@ def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: return result -def write_extend_target(cm_fh: typing.IO[str], target: str, - scope: Scope, parent_condition: str = '', - previous_condition: str = '', *, - indent: int = 0) -> str: +def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', + previous_condition: str = '') -> str: total_condition = scope.condition() if total_condition == 'else': assert previous_condition, \ @@ -740,6 +746,18 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, total_condition = '({}) AND ({})'.format(parent_condition, total_condition) + scope.set_total_condition(total_condition) + + prev_condition = '' + for c in scope.children(): + prev_condition = recursive_evaluate_scope(c, total_condition, + prev_condition) + + return total_condition + + +def write_extend_target(cm_fh: typing.IO[str], target: str, + scope: Scope, indent: int = 0): extend_qt_io_string = io.StringIO() ignored_keys = write_sources_section(extend_qt_io_string, scope) extend_qt_string = extend_qt_io_string.getvalue() @@ -750,7 +768,8 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, ignored_keys_report = '\n' + ignored_keys_report extend_scope = '\n{}extend_target({} CONDITION {}\n' \ - '{}{})\n'.format(spaces(indent), target, total_condition, + '{}{})\n'.format(spaces(indent), target, + scope.total_condition(), extend_qt_string, ignored_keys_report) if not extend_qt_string: @@ -765,15 +784,30 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, cm_fh.write(extend_scope) - children = scope.children() - if children: - prev_condition = '' - for c in children: - prev_condition = write_extend_target(cm_fh, target, c, - total_condition, - prev_condition) - return total_condition +def flatten_scopes(scope: Scope) -> typing.List[Scope]: + result = [] # type: typing.List[Scope] + for c in scope.children(): + result.append(c) + result += flatten_scopes(c) + return result + + +def merge_scopes(scopes: typing.List[Scope]) -> typing.List[Scope]: + result = [] # type: typing.List[Scope] + + current_scope = None + for scope in scopes: + if not current_scope \ + or scope.total_condition() != current_scope.total_condition(): + if current_scope: + result.append(current_scope) + current_scope = scope + continue + + current_scope.merge(scope) + + return result def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, @@ -802,8 +836,22 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, write_scope_header(cm_fh, indent=indent) + # Evaluate total condition of all scopes: for c in scope.children(): - write_extend_target(cm_fh, name, c, '', indent=indent) + recursive_evaluate_scope(c) + + # Get a flat list of all scopes but the main one: + scopes = flatten_scopes(scope) + + scopes = sorted(scopes, key=lambda x: x.total_condition()) + print("xxxxxx Sorted to {} scopes!".format(len(scopes))) + + # Merge scopes with identical conditions: + scopes = merge_scopes(scopes) + print("xxxxxx Merged to {} scopes!".format(len(scopes))) + + for c in scopes: + write_extend_target(cm_fh, name, c, indent=indent) def write_module(cm_fh: typing.IO[str], scope: Scope, *, From 0a9e5e139a2c23553f4046897c3be4b1df3dfdfa Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Jan 2019 14:23:59 +0100 Subject: [PATCH 0083/1322] CMake: pro2cmake.py: Fix handling of complex else branches Return the current scope's condition, not the total condition from recursive_evaluate_scope. That is the part the "else" referrs to. The parent_condition stays identical for all branches, so that should not get negated. Change-Id: I0da91483d4d748d01a29ac16890d709d8d659843 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 3130aeea02a..114677e86e4 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -718,7 +718,8 @@ def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', previous_condition: str = '') -> str: - total_condition = scope.condition() + current_condition = scope.condition() + total_condition = current_condition if total_condition == 'else': assert previous_condition, \ "Else branch without previous condition in: %s" % scope.file() @@ -753,7 +754,7 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', prev_condition = recursive_evaluate_scope(c, total_condition, prev_condition) - return total_condition + return current_condition def write_extend_target(cm_fh: typing.IO[str], target: str, From 404d0b59754a4568264c285e7bf517d1c01d8228 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 23 Jan 2019 12:56:11 +0100 Subject: [PATCH 0084/1322] CMake: pro2cmake.py: Resolve file names for RESOURCES Change-Id: I821cdc88c7f45260997e118ab2abfd7ba6526b75 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 114677e86e4..0e4ed743622 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -259,7 +259,7 @@ class Scope: value = statement.get('value', []) assert key != '' - if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH') \ + if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH', 'RESOURCES',) \ or key.endswith('_HEADERS') \ or key.endswith('_SOURCES'): value = [map_to_file(v, scope.basedir(), From aee1d1e96b100c503344d86779ece72325ac17e9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 23 Jan 2019 12:57:06 +0100 Subject: [PATCH 0085/1322] CMake: pro2cmake.py: Work on mapping of conditions to cmake Make sure complex things in qmake (e.g. function calls, etc.) are mapped better to cmake. When there is no way to properly map the qmake construct, then make sure to map everything into one identifier. This is to keep the structure of the condition simple. Change-Id: I6d88e0cb85fce1041bbfdc96604dab7bd4e65856 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0e4ed743622..52e67e482d1 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -517,6 +517,14 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: + re.sub(r"\bif\s*\((.*?)\)", r"\1", condition) + re.sub(r"\bisEmpty\s*\((.*?)\)", r"\1 STREQUAL \"\"", condition) + re.sub(r"\bcontains\s*\((.*?), (.*)?\)", r"\1___contains___\2", condition) + + condition = condition.replace('*', '_x_') + condition = condition.replace('.$$', '__ss_') + condition = condition.replace('$$', '_ss_') + condition = condition.replace('!', 'NOT ') condition = condition.replace('&&', ' AND ') condition = condition.replace('|', ' OR ') From 2cdef0f5278d49fd868ed358c240c47fe43bcbe2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 23 Jan 2019 16:38:07 +0100 Subject: [PATCH 0086/1322] CMake: pro2cmake.py: More mappings! Add some more mappings from qmake to CMake equivalents conditions. Change-Id: I57b7bea9d6628e1c2b8d6ae88f799219942b571e Reviewed-by: Simon Hausmann --- util/cmake/helper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 2ddeee98c1e..1998defefff 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -183,11 +183,18 @@ platform_mapping = { 'msvc': 'MSVC', 'clang': 'CLANG', 'gcc': 'GCC', + 'icc': 'ICC', 'osx': 'APPLE_OSX', + 'ios': 'APPLE_IOS', 'freebsd': 'FREEBSD', + 'openbsd': 'OPENBSD', + 'netbsd': 'NETBSD', 'haiku': 'HAIKU', 'netbsd': 'NETBSD', 'mac': 'APPLE_OSX', + 'macx': 'APPLE_OSX', + 'macos': 'APPLE_OSX', + 'macx-icc': '(APPLE_OSX AND ICC)', } From 4a2562e5db1605ba2d99445e6ea2bda69867a4d7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 23 Jan 2019 16:40:23 +0100 Subject: [PATCH 0087/1322] CMake: pro2cmake.py: Simplify conditions Use pysym to simplify conditions in extend_target. Do some manual changes to the condition based on domain knowledge. Change-Id: I7fbb9ebc93b620a483c6a3a796d84c9bc0e36ef7 Reviewed-by: Simon Hausmann --- util/cmake/Pipfile | 1 + util/cmake/pro2cmake.py | 156 +++++++++++++++++++++-- util/cmake/tests/test_logic_mapping.py | 165 +++++++++++++++++++++++++ 3 files changed, 314 insertions(+), 8 deletions(-) create mode 100755 util/cmake/tests/test_logic_mapping.py diff --git a/util/cmake/Pipfile b/util/cmake/Pipfile index d7e1905378d..7fbf716eb8d 100644 --- a/util/cmake/Pipfile +++ b/util/cmake/Pipfile @@ -7,6 +7,7 @@ name = "pypi" pytest = "*" mypy = "*" pyparsing = "*" +sympy = "*" [dev-packages] diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 52e67e482d1..fb55988600c 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -33,6 +33,8 @@ import re import io import typing +from sympy.logic import (simplify_logic, And, Or, Not,) +from sympy.core import SympifyError import pyparsing as pp from helper import map_qt_library, map_qt_base_library, featureName, \ @@ -517,9 +519,13 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: - re.sub(r"\bif\s*\((.*?)\)", r"\1", condition) - re.sub(r"\bisEmpty\s*\((.*?)\)", r"\1 STREQUAL \"\"", condition) - re.sub(r"\bcontains\s*\((.*?), (.*)?\)", r"\1___contains___\2", condition) + print('##### Mapping condition: {}.'.format(condition)) + re.sub(r'if\s*\((.*?)\)', r'\1', condition) + re.sub(r'(^|[^a-zA-Z0-9_])isEmpty\s*\((.*?)\)', r'\2_ISEMPTY', condition) + re.sub(r'(^|[^a-zA-Z0-9_])contains\s*\((.*?), (.*)?\)', + r'\2___contains___\3', condition) + re.sub(r'\s*==\s*', '___STREQUAL___', condition) + print(' # after regexp: {}.'.format(condition)) condition = condition.replace('*', '_x_') condition = condition.replace('.$$', '__ss_') @@ -528,9 +534,6 @@ def map_condition(condition: str) -> str: condition = condition.replace('!', 'NOT ') condition = condition.replace('&&', ' AND ') condition = condition.replace('|', ' OR ') - condition = condition.replace('==', ' STREQUAL ') - - condition = condition.replace('NOT NOT', '') # remove double negation cmake_condition = '' for part in condition.split(): @@ -550,7 +553,6 @@ def map_condition(condition: str) -> str: part = part.replace('true', 'ON') part = part.replace('false', 'OFF') cmake_condition += ' ' + part - return cmake_condition.strip() @@ -724,6 +726,144 @@ def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: return result +def _iterate_expr_tree(expr, op, matches): + assert expr.func == op + keepers = () + for arg in expr.args: + if arg in matches: + matches = tuple(x for x in matches if x != arg) + elif arg == op: + (matches, extra_keepers) = _iterate_expr_tree(arg, op, matches) + keepers = (*keepers, *extra_keepers) + else: + keepers = (*keepers, arg) + return (matches, keepers) + + +def _simplify_expressions(expr, op, matches, replacement): + args = expr.args + for arg in args: + expr = expr.subs(arg, _simplify_expressions(arg, op, matches, + replacement)) + + if expr.func == op: + (to_match, keepers) = tuple(_iterate_expr_tree(expr, op, matches)) + if len(to_match) == 0: + # build expression with keepers and replacement: + if keepers: + start = replacement + current_expr = None + last_expr = keepers[-1] + for repl_arg in keepers[:-1]: + current_expr = op(start, repl_arg) + start = current_expr + top_expr = op(start, last_expr) + else: + top_expr = replacement + + expr = expr.subs(expr, top_expr) + + return expr + + +def _simplify_flavors_in_condition(base: str, flavors, expr): + ''' Simplify conditions based on the knownledge of which flavors + belong to which OS. ''' + base_expr = simplify_logic(base) + false_expr = simplify_logic('false') + for flavor in flavors: + flavor_expr = simplify_logic(flavor) + expr = _simplify_expressions(expr, And, (base_expr, flavor_expr,), + flavor_expr) + expr = _simplify_expressions(expr, Or, (base_expr, flavor_expr), + base_expr) + expr = _simplify_expressions(expr, And, (Not(base_expr), flavor_expr,), + false_expr) + return expr + + +def _recursive_simplify(expr): + ''' Simplify the expression as much as possible based on + domain knowledge. ''' + input_expr = expr + + # Simplify even further, based on domain knowledge: + apples = ('APPLE_OSX', 'APPLE_UIKIT', 'APPLE_IOS', + 'APPLE_TVOS', 'APPLE_WATCHOS',) + bsds = ('APPLE', 'FREEBSD', 'OPENBSD', 'NETBSD',) + unixes = ('APPLE', *apples, 'BSD', *bsds, 'LINUX', + 'ANDROID', 'ANDROID_EMBEDDED', + 'INTEGRITY', 'VXWORKS', 'QNX', 'WASM') + + unix_expr = simplify_logic('UNIX') + win_expr = simplify_logic('WIN32') + false_expr = simplify_logic('false') + true_expr = simplify_logic('true') + + expr = expr.subs(Not(unix_expr), win_expr) # NOT UNIX -> WIN32 + expr = expr.subs(Not(win_expr), unix_expr) # NOT WIN32 -> UNIX + + # UNIX [OR foo ]OR WIN32 -> ON [OR foo] + expr = _simplify_expressions(expr, Or, (unix_expr, win_expr,), true_expr) + # UNIX [AND foo ]AND WIN32 -> OFF [AND foo] + expr = _simplify_expressions(expr, And, (unix_expr, win_expr,), false_expr) + for unix_flavor in unixes: + # unix_flavor [AND foo ] AND WIN32 -> FALSE [AND foo] + flavor_expr = simplify_logic(unix_flavor) + expr = _simplify_expressions(expr, And, (win_expr, flavor_expr,), + false_expr) + + expr = _simplify_flavors_in_condition('WIN32', ('WINRT',), expr) + expr = _simplify_flavors_in_condition('APPLE', apples, expr) + expr = _simplify_flavors_in_condition('BSD', bsds, expr) + expr = _simplify_flavors_in_condition('UNIX', unixes, expr) + + # Now simplify further: + expr = simplify_logic(expr) + + while expr != input_expr: + input_expr = expr + expr = _recursive_simplify(expr) + + return expr + + +def simplify_condition(condition: str) -> str: + input_condition = condition.strip() + + # Map to sympy syntax: + condition = ' ' + input_condition + ' ' + condition = condition.replace('(', ' ( ') + condition = condition.replace(')', ' ) ') + + tmp = '' + while tmp != condition: + tmp = condition + + condition = condition.replace(' NOT ', ' ~ ') + condition = condition.replace(' AND ', ' & ') + condition = condition.replace(' OR ', ' | ') + condition = condition.replace(' ON ', 'true') + condition = condition.replace(' OFF ', 'false') + + try: + # Generate and simplify condition using sympy: + condition_expr = simplify_logic(condition) + condition = str(_recursive_simplify(condition_expr)) + + # Map back to CMake syntax: + condition = condition.replace('~', 'NOT ') + condition = condition.replace('&', 'AND') + condition = condition.replace('|', 'OR') + condition = condition.replace('True', 'ON') + condition = condition.replace('False', 'OFF') + except: + # sympy did not like our input, so leave this condition alone: + condition = input_condition + + return condition + + def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', previous_condition: str = '') -> str: current_condition = scope.condition() @@ -755,7 +895,7 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', total_condition = '({}) AND ({})'.format(parent_condition, total_condition) - scope.set_total_condition(total_condition) + scope.set_total_condition(simplify_condition(total_condition)) prev_condition = '' for c in scope.children(): diff --git a/util/cmake/tests/test_logic_mapping.py b/util/cmake/tests/test_logic_mapping.py new file mode 100755 index 00000000000..cf7913a6e47 --- /dev/null +++ b/util/cmake/tests/test_logic_mapping.py @@ -0,0 +1,165 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from pro2cmake import simplify_condition + + +def validate_simplify(input: str, expected: str) -> None: + output = simplify_condition(input) + assert output == expected + + +def validate_simplify_unchanged(input: str) -> None: + validate_simplify(input, input) + + +def test_simplify_on(): + validate_simplify_unchanged('ON') + + +def test_simplify_off(): + validate_simplify_unchanged('OFF') + + +def test_simplify_isEmpty(): + validate_simplify_unchanged('isEmpty(foo)') + + +def test_simplify_not_isEmpty(): + validate_simplify_unchanged('NOT isEmpty(foo)') + + +def test_simplify_simple_and(): + validate_simplify_unchanged('QT_FEATURE_bar AND QT_FEATURE_foo') + + +def test_simplify_simple_or(): + validate_simplify_unchanged('QT_FEATURE_bar OR QT_FEATURE_foo') + + +def test_simplify_simple_not(): + validate_simplify_unchanged('NOT QT_FEATURE_foo') + + +def test_simplify_simple_and_reorder(): + validate_simplify('QT_FEATURE_foo AND QT_FEATURE_bar', 'QT_FEATURE_bar AND QT_FEATURE_foo') + + +def test_simplify_simple_or_reorder(): + validate_simplify('QT_FEATURE_foo OR QT_FEATURE_bar', 'QT_FEATURE_bar OR QT_FEATURE_foo') + + +def test_simplify_unix_or_win32(): + validate_simplify('WIN32 OR UNIX', 'ON') + + +def test_simplify_unix_or_win32_or_foobar_or_barfoo(): + validate_simplify('WIN32 OR UNIX OR foobar OR barfoo', 'ON') + + +def test_simplify_not_not_bar(): + validate_simplify(' NOT NOT bar ', 'bar') + + +def test_simplify_not_unix(): + validate_simplify('NOT UNIX', 'WIN32') + + +def test_simplify_not_win32(): + validate_simplify('NOT WIN32', 'UNIX') + + +def test_simplify_unix_and_win32(): + validate_simplify('WIN32 AND UNIX', 'OFF') + + +def test_simplify_unix_and_win32_or_foobar_or_barfoo(): + validate_simplify('WIN32 AND foobar AND UNIX AND barfoo', 'OFF') + + +def test_simplify_watchos_and_win32(): + validate_simplify('WIN32 AND APPLE_WATCHOS', 'OFF') + + +def test_simplify_apple_and_appleosx(): + validate_simplify('APPLE AND APPLE_OSX', 'APPLE_OSX') + + +def test_simplify_apple_or_appleosx(): + validate_simplify('APPLE OR APPLE_OSX', 'APPLE') + + +def test_simplify_apple_or_appleosx_level1(): + validate_simplify('foobar AND (APPLE OR APPLE_OSX )', 'APPLE AND foobar') + + +def test_simplify_apple_or_appleosx_level1_double(): + validate_simplify('foobar AND (APPLE OR APPLE_OSX )', 'APPLE AND foobar') + + +def test_simplify_apple_or_appleosx_level1_double_with_extra_spaces(): + validate_simplify('foobar AND (APPLE OR APPLE_OSX ) ' + 'AND ( APPLE_OSX OR APPLE )', 'APPLE AND foobar') + + +def test_simplify_apple_or_appleosx_level2(): + validate_simplify('foobar AND ( ( APPLE OR APPLE_WATCHOS ) ' + 'OR APPLE_OSX ) AND ( APPLE_OSX OR APPLE ) ' + 'AND ( (WIN32 OR WINRT) OR UNIX) ', 'APPLE AND foobar') + + +def test_simplify_not_apple_and_appleosx(): + validate_simplify('NOT APPLE AND APPLE_OSX', 'OFF') + + +def test_simplify_unix_and_bar_or_win32(): + validate_simplify('WIN32 AND bar AND UNIX', 'OFF') + + +def test_simplify_unix_or_bar_or_win32(): + validate_simplify('WIN32 OR bar OR UNIX', 'ON') + + +def test_simplify_complex_true(): + validate_simplify('WIN32 OR ( APPLE OR UNIX)', 'ON') + + +def test_simplify_apple_unix_freebsd(): + validate_simplify('( APPLE OR ( UNIX OR FREEBSD ))', 'UNIX') + + +def test_simplify_apple_unix_freebsd_foobar(): + validate_simplify('( APPLE OR ( UNIX OR FREEBSD ) OR foobar)', + 'UNIX OR foobar') + + +def test_simplify_complex_false(): + validate_simplify('WIN32 AND foobar AND ( ' + 'APPLE OR ( UNIX OR FREEBSD ))', + 'OFF') From 0c43850687fa3b56f40b03a1bef8a54cda38ac14 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 24 Jan 2019 15:43:13 +0100 Subject: [PATCH 0088/1322] CMake: pro2cmake.py: Better printing of scopes Change-Id: Ibeb77a23c90d3a47c78d17c4683e4af3c64449fc Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fb55988600c..6883a117e0a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -227,6 +227,10 @@ class Scope: self._visited_keys = set() # type: typing.Set[str] self._total_condition = None # type: typing.Optional[str] + def __repr__(self): + return '{}:{}:{}'.format(self._basedir, self._file, + self._condition or '') + def reset_visited_keys(self): self._visited_keys = set() @@ -276,8 +280,8 @@ class Scope: elif operation == '*=': scope._append_operation(key, UniqueAddOperation(value)) else: - print('Unexpected operation "{}" in scope with ' - 'condition {}.'.format(operation, cond)) + print('Unexpected operation "{}" in scope "{}".' + .format(operation, scope)) assert(False) continue @@ -346,11 +350,7 @@ class Scope: def dump(self, *, indent: int = 0) -> None: ind = ' ' * indent - if self._condition == '': - print('{}Scope {} in "{}".'.format(ind, self._file, self._basedir)) - else: - print('{}Scope {} in "{}" with condition: "{}".' - .format(ind, self._file, self._basedir, self._condition)) + print('{}Scope "{}":'.format(ind, self)) print('{} Keys:'.format(ind)) keys = self._operations.keys() if not keys: @@ -576,8 +576,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, cm_fh.write('{}### remove_subdirectory' '("{}")\n'.format(ind, sd[1:])) else: - print(' XXXX: SUBDIR {} in {}: ' - 'Not found.'.format(sd, scope.file())) + print(' XXXX: SUBDIR {} in {}: Not found.'.format(sd, scope)) for c in scope.children(): cond = c.condition() From 4bb44a17f659465d817bafa820c5a3d0293c1541 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 17 Jan 2019 09:44:53 +0100 Subject: [PATCH 0089/1322] CMake: fix build for QtNetwork on macOS Change-Id: I32e4550d67e9d72b56de4aafaddec5e2f80792b8 Reviewed-by: Tobias Hunger --- src/network/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index fd684c7eb2f..576424386d2 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -204,6 +204,12 @@ extend_target(Network CONDITION (UNIX) AND (NOT ((UNIX) AND (QT_FEATURE_linux_ne SOURCES kernel/qnetworkinterface_unix.cpp ) + +# TODO: how to merge to above +extend_target(Network CONDITION APPLE_OSX + SOURCES + kernel/qnetworkinterface_unix.cpp +) # #extend_target(Network CONDITION ANDROID #) @@ -305,6 +311,7 @@ extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_securetransport ssl/qsslkey_qt.cpp ssl/qsslsocket_mac.cpp ssl/qsslsocket_mac_p.h ssl/qsslsocket_mac_shared.cpp + ssl/qsslsocket_qt.cpp ) extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_dtls) From 5e339a0f97710fc79518354124d7a8ab2738e632 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 29 Jan 2019 15:06:45 +0100 Subject: [PATCH 0090/1322] cmake: Add trivial FindLibproxy.cmake And fix link to it Change-Id: Ie4f29a35a83d19ab83933faf3bcd7d62cffa68b8 Reviewed-by: Simon Hausmann --- cmake/FindLibproxy.cmake | 3 +++ src/network/CMakeLists.txt | 2 +- src/network/configure.cmake | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 cmake/FindLibproxy.cmake diff --git a/cmake/FindLibproxy.cmake b/cmake/FindLibproxy.cmake new file mode 100644 index 00000000000..611a8bd7d56 --- /dev/null +++ b/cmake/FindLibproxy.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) + +pkg_check_modules(Libproxy libproxy-1.0 IMPORTED_TARGET) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 576424386d2..ce7e5ed77c9 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -133,7 +133,7 @@ elseif(WIN32 AND NOT WINRT) set(proxy_sources kernel/qnetworkproxy_win.cpp) elseif(QT_FEATURE_libproxy) set(proxy_sources kernel/qnetworkproxy_libproxy.cpp) - set(proxy_libs libproxy libdl) + set(proxy_libs PkgConfig::Libproxy dl) else() set(proxy_sources kernel/qnetworkproxy_generic.cpp) endif() diff --git a/src/network/configure.cmake b/src/network/configure.cmake index dd7f487fc55..3bc73701da1 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -6,8 +6,8 @@ #### Libraries -find_package(libproxy) -set_package_properties(libproxy PROPERTIES TYPE OPTIONAL) +find_package(Libproxy) +set_package_properties(Libproxy PROPERTIES TYPE OPTIONAL) find_package(OpenSSL) set_package_properties(OpenSSL PROPERTIES TYPE OPTIONAL) @@ -146,7 +146,7 @@ qt_feature_definition("ipv6ifname" "QT_NO_IPV6IFNAME" NEGATE VALUE "1") qt_feature("libproxy" PRIVATE LABEL "libproxy" AUTODETECT OFF - CONDITION libproxy_FOUND + CONDITION Libproxy_FOUND ) qt_feature("linux_netlink" PRIVATE LABEL "Linux AF_NETLINK" From 404a2a56c67ffe0bf3ee4b36e090eadb6a992dec Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 11:12:21 +0100 Subject: [PATCH 0091/1322] cmake: Silence CMP0083 warnings until we can depend on cmake 3.14 Change-Id: Idbbe325bf088a68f875ab0e7b2eeb30badf864a7 Reviewed-by: Simon Hausmann --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a4b451b75a..17566c330d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 3.13.0) +CMAKE_POLICY(SET CMP0083 NEW) ## TODO Remove when we start requiring 3.14 in the line above + project(QtBase VERSION 5.12.0 DESCRIPTION "Qt Base Libraries" From 4db3faef6bf41688ad9630fe3e0104fb69255c9f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 10:29:46 +0100 Subject: [PATCH 0092/1322] Change the FIXME for selftests/alive It isn't being built in the current qmake build either (maybe because it doesn't build because uses sleep()) Change-Id: Ie97287c6e45d1fcc32063bd9eb37ff2907dfa891 Reviewed-by: Tobias Hunger --- tests/auto/testlib/selftests/CMakeLists.txt | 2 +- tests/auto/testlib/selftests/alive/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index ff5aa8f3116..ee1efa53fc7 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -1,4 +1,4 @@ -# add_subdirectory(alive) # FIXME: Needs widgets +# add_subdirectory(alive) # TODO is commented in selftests.pri too. Investigate if should be readded add_subdirectory(assert) add_subdirectory(badxml) add_subdirectory(benchlibcallgrind) diff --git a/tests/auto/testlib/selftests/alive/CMakeLists.txt b/tests/auto/testlib/selftests/alive/CMakeLists.txt index 3523c5b11e1..610fa3006ce 100644 --- a/tests/auto/testlib/selftests/alive/CMakeLists.txt +++ b/tests/auto/testlib/selftests/alive/CMakeLists.txt @@ -1 +1,2 @@ -add_qt_test(alive SOURCES tst_alive.cpp) +add_qt_test(alive SOURCES tst_alive.cpp + LIBRARIES Widgets) From 1e4ab2a02a9dd3cccb085ca96bc0ab4721badb41 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 11:22:43 +0100 Subject: [PATCH 0093/1322] test: fix if to depend on QT_FEATURE_style_fusion Change-Id: I3a7eadea8133af9853caf0c059c610de6e267af9 Reviewed-by: Tobias Hunger --- tests/auto/widgets/graphicsview/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/graphicsview/CMakeLists.txt b/tests/auto/widgets/graphicsview/CMakeLists.txt index 8007ac18a05..5d6650db4ac 100644 --- a/tests/auto/widgets/graphicsview/CMakeLists.txt +++ b/tests/auto/widgets/graphicsview/CMakeLists.txt @@ -19,7 +19,7 @@ if (NOT WINRT) add_subdirectory(qgraphicsview) endif() -if(FALSE) # FIXME: How to test for fusion style?! +if(QT_FEATURE_style_fusion) add_subdirectory(qgraphicsproxywidget) add_subdirectory(qgraphicswidget) endif() From 23b3100c562f2747fd4a2c6ac5ab6ab32a70db4a Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 11:31:43 +0100 Subject: [PATCH 0094/1322] cmake: test: Enable qdbusxmlparser Change-Id: Ieb3640a00b6f00fcbef5d42fee028b1edca12782 Reviewed-by: Tobias Hunger --- tests/auto/dbus/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/auto/dbus/CMakeLists.txt b/tests/auto/dbus/CMakeLists.txt index 6371c52ceb8..e1e23a72475 100644 --- a/tests/auto/dbus/CMakeLists.txt +++ b/tests/auto/dbus/CMakeLists.txt @@ -27,7 +27,6 @@ if(QT_FEATURE_process) endif() endif() -### FIXME -# if(QT_FEATURE_xml) -# add_subdirectory(qdbusxmlparser) -# endif() +if(QT_FEATURE_xml) + add_subdirectory(qdbusxmlparser) +endif() From 7d5978df7c22749cd11ce00bb36042a7decd9ad1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 12:01:00 +0100 Subject: [PATCH 0095/1322] cmake: test: Fix qdbusabstractadaptor Change-Id: Ibe3e64bd68df1f1f46308f6f622822cb9caa99e5 Reviewed-by: Tobias Hunger --- tests/auto/dbus/CMakeLists.txt | 2 +- .../auto/dbus/qdbusabstractadaptor/CMakeLists.txt | 10 +++++++++- .../qdbusabstractadaptor/CMakeLists.txt | 14 -------------- .../qdbusabstractadaptor/qmyserver/CMakeLists.txt | 1 + 4 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt diff --git a/tests/auto/dbus/CMakeLists.txt b/tests/auto/dbus/CMakeLists.txt index e1e23a72475..996304127b0 100644 --- a/tests/auto/dbus/CMakeLists.txt +++ b/tests/auto/dbus/CMakeLists.txt @@ -18,7 +18,7 @@ add_subdirectory(qdbustype) add_subdirectory(qdbusthreading) if(QT_FEATURE_process) - # missing add_qt_binary: add_subdirectory("qdbusabstractadaptor") + add_subdirectory(qdbusabstractadaptor) # missing add_qt_binary: add_subdirectory("qdbusabstractinterface") # missing add_qt_binary: add_subdirectory("qdbusinterface") diff --git a/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt index 9a8132d1150..08bfb51234a 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractadaptor/CMakeLists.txt @@ -1,4 +1,12 @@ # Generated from qdbusabstractadaptor.pro. add_subdirectory(qmyserver) -add_subdirectory(qdbusabstractadaptor) + +add_qt_test(tst_qdbusabstractadaptor + SOURCES + myobject.h + tst_qdbusabstractadaptor.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBus +) diff --git a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt deleted file mode 100644 index 953eeb4fa45..00000000000 --- a/tests/auto/dbus/qdbusabstractadaptor/qdbusabstractadaptor/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# Generated from qdbusabstractadaptor.pro. - -##################################################################### -## ../tst_qdbusabstractadaptor Test: -##################################################################### - -add_qt_test(../tst_qdbusabstractadaptor - SOURCES - ../myobject.h - ../tst_qdbusabstractadaptor.cpp - LIBRARIES - Qt::CorePrivate - Qt::DBus -) diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt index 627b29ff422..e8d542056c0 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt @@ -9,5 +9,6 @@ add_qt_executable(qmyserver ../myobject.h qmyserver.cpp LIBRARIES + Qt::Core Qt::DBus ) From e2dc030ac025cbc98ae95b588550ae974d0deca0 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 14:06:48 +0100 Subject: [PATCH 0096/1322] cmake: test: Enable the build of qdbusabstractinterface Since the code wants pinger_interface.h as include name and the qt_create_qdbusxml2cpp_command function was using the filename as source for the next filename i introduced a new option DBUS_ADAPTOR_BASENAME/DBUS_INTERFACE_BASENAME to set the name of the resulting file Change-Id: I582d578b68275e4530e91a88631ae43fd1ae06fd Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 22 ++++++++++++------- tests/auto/dbus/CMakeLists.txt | 2 +- .../qdbusabstractinterface/CMakeLists.txt | 19 +++++++++++++++- .../qdbusabstractinterface/CMakeLists.txt | 13 ----------- .../qpinger/CMakeLists.txt | 1 + 5 files changed, 34 insertions(+), 23 deletions(-) delete mode 100644 tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c94117dda79..2896ad1e7a5 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -243,7 +243,7 @@ function(qt_internal_module_info result target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES") @@ -263,12 +263,12 @@ function(extend_target target) if (${result}) set(dbus_sources "") foreach(adaptor ${arg_DBUS_ADAPTOR_SOURCES}) - qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR FLAGS "${arg_DBUS_ADAPTOR_FLAGS}") + qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR BASENAME "${arg_DBUS_ADAPTOR_BASENAME}" FLAGS "${arg_DBUS_ADAPTOR_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() foreach(interface ${arg_DBUS_INTERFACE_SOURCES}) - qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE FLAGS "${arg_DBUS_INTERFACE_FLAGS}") + qt_create_qdbusxml2cpp_command("${target}" "${interface}" INTERFACE BASENAME "${arg_DBUS_INTERFACE_BASENAME}" FLAGS "${arg_DBUS_INTERFACE_FLAGS}") list(APPEND dbus_sources "${sources}") endforeach() @@ -772,7 +772,7 @@ endfunction() # helper to set up a qdbusxml2cpp rule function(qt_create_qdbusxml2cpp_command target infile) - qt_parse_all_arguments(arg "qt_create_qdbusxml2cpp_command" "ADAPTOR;INTERFACE" "" "FLAGS" ${ARGN}) + qt_parse_all_arguments(arg "qt_create_qdbusxml2cpp_command" "ADAPTOR;INTERFACE" "BASENAME" "FLAGS" ${ARGN}) if((arg_ADAPTOR AND arg_INTERFACE) OR (NOT arg_ADAPTOR AND NOT arg_INTERFACE)) message(FATAL_ERROR "qt_create_dbusxml2cpp_command needs either ADAPTOR or INTERFACE.") endif() @@ -784,11 +784,17 @@ function(qt_create_qdbusxml2cpp_command target infile) set(type "interface") endif() - get_filename_component(file_name "${infile}" NAME_WE) - string(TOLOWER "${file_name}" file_name) + if ("${arg_BASENAME}" STREQUAL "") + get_filename_component(file_name "${infile}" NAME_WE) + string(TOLOWER "${file_name}" file_name) + set(file_name "${file_name}_${type}") + else() + set(file_name ${arg_BASENAME}) + endif() - set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${type}.h") - set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}_${type}.cpp") + + set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.h") + set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.cpp") add_custom_command(OUTPUT "${header_file}" "${source_file}" COMMAND Qt::qdbusxml2cpp ${arg_FLAGS} "${option}" "${header_file}:${source_file}" "${infile}" diff --git a/tests/auto/dbus/CMakeLists.txt b/tests/auto/dbus/CMakeLists.txt index 996304127b0..348c9c461c8 100644 --- a/tests/auto/dbus/CMakeLists.txt +++ b/tests/auto/dbus/CMakeLists.txt @@ -19,7 +19,7 @@ add_subdirectory(qdbusthreading) if(QT_FEATURE_process) add_subdirectory(qdbusabstractadaptor) - # missing add_qt_binary: add_subdirectory("qdbusabstractinterface") + add_subdirectory(qdbusabstractinterface) # missing add_qt_binary: add_subdirectory("qdbusinterface") if(QT_FEATURE_private_tests) diff --git a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt index 111012aba91..facac1a7fc5 100644 --- a/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractinterface/CMakeLists.txt @@ -1,4 +1,21 @@ # Generated from qdbusabstractinterface.pro. add_subdirectory(qpinger) -add_subdirectory(qdbusabstractinterface) + +add_qt_test(tst_qdbusabstractinterface + SOURCES + interface.cpp + tst_qdbusabstractinterface.cpp + LIBRARIES + Qt::Core + Qt::DBus +) + +extend_target(tst_qdbusabstractinterface + DBUS_INTERFACE_SOURCES + org.qtproject.QtDBus.Pinger.xml + DBUS_INTERFACE_BASENAME + pinger_interface + DBUS_INTERFACE_FLAGS + -i interface.h +) diff --git a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt deleted file mode 100644 index 5bbd2ebbaad..00000000000 --- a/tests/auto/dbus/qdbusabstractinterface/qdbusabstractinterface/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Generated from qdbusabstractinterface.pro. - -##################################################################### -## ../tst_qdbusabstractinterface Test: -##################################################################### - -add_qt_test(../tst_qdbusabstractinterface - SOURCES - ../interface.cpp ../interface.h - ../tst_qdbusabstractinterface.cpp - LIBRARIES - Qt::DBus -) diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt index 91427dacabf..c2bf6ea3e3b 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt @@ -9,5 +9,6 @@ add_qt_executable(qpinger ../interface.cpp ../interface.h qpinger.cpp LIBRARIES + Qt::Core Qt::DBus ) From b6408318de6d82261cdc9ad18caee46a0b79fc15 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:39:09 +0100 Subject: [PATCH 0097/1322] CMake: configure2cmake.py: Handle Libproxy and corewlan Update to cover more libraries Change-Id: I32a26b0fa0a79531fcb55e7a4646a2e63fec1d5b Reviewed-by: Frederik Gladhorn --- util/cmake/configurejson2cmake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index ad80146b9f0..0a30e74d6f7 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -48,6 +48,7 @@ class LibraryMapping: def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: libmap = { 'atspi': 'ATSPI2', + 'corewlan': None, # Framework 'double-conversion': 'WrapDoubleConversion', 'drm': 'Libdrm', 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), @@ -66,7 +67,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'libjpeg': 'JPEG', 'libpng': 'PNG', 'libpng': 'PNG', - 'libproxy': 'libproxy', + 'libproxy': 'Libproxy', 'librt': 'WrapRt', 'libudev': 'Libudev', 'lttng-ust': LibraryMapping(package='LTTngUST', resultVariable="LTTNGUST"), From 9cee04ac9464af82da9f7b54844509b7bb8a62e8 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 24 Jan 2019 16:01:17 +0100 Subject: [PATCH 0098/1322] CMake: pro2cmake.py: Merge more scopes * Remove scopes with condition 'OFF' * Merge scopes with identical conditions This e.g. merges children with a condition that simplifies to 'ON' with their parent scope. Change-Id: Ieb3d60e1234f189ac45869853555ca8c0cfb5c76 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 86 ++++---- util/cmake/tests/test_scope_handling.py | 282 ++++++++++++++++++++++++ 2 files changed, 328 insertions(+), 40 deletions(-) create mode 100755 util/cmake/tests/test_scope_handling.py diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6883a117e0a..d4d352d4f66 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -27,14 +27,17 @@ ## ############################################################################# + +from __future__ import annotations + from argparse import ArgumentParser +import copy import os.path import re import io import typing from sympy.logic import (simplify_logic, And, Or, Not,) -from sympy.core import SympifyError import pyparsing as pp from helper import map_qt_library, map_qt_base_library, featureName, \ @@ -204,9 +207,11 @@ class RemoveOperation(Operation): class Scope: - def __init__(self, parent_scope: typing.Optional['Scope'], + def __init__(self, *, + parent_scope: typing.Optional[Scope], file: typing.Optional[str] = None, condition: str = '', - base_dir: str = '') -> None: + base_dir: str = '', + operations: typing.Mapping[str, typing.List[Operation]] = {}) -> None: if parent_scope: parent_scope._add_child(self) else: @@ -223,7 +228,7 @@ class Scope: self._file = file self._condition = map_condition(condition) self._children = [] # type: typing.List[Scope] - self._operations = {} # type: typing.Dict[str, typing.List[Operation]] + self._operations = copy.deepcopy(operations) self._visited_keys = set() # type: typing.Set[str] self._total_condition = None # type: typing.Optional[str] @@ -244,6 +249,9 @@ class Scope: else: self._operations[key] = other._operations[key] + def parent(self) -> typing.Optional[Scope]: + return self._parent + def basedir(self) -> str: return self._basedir @@ -253,7 +261,7 @@ class Scope: @staticmethod def FromDict(parent_scope: typing.Optional['Scope'], file: str, statements, cond: str = '', base_dir: str = ''): - scope = Scope(parent_scope, file, cond, base_dir) + scope = Scope(parent_scope=parent_scope, file=file, condition=cond, base_dir=base_dir) for statement in statements: if isinstance(statement, list): # Handle skipped parts... assert not statement @@ -519,13 +527,11 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: - print('##### Mapping condition: {}.'.format(condition)) re.sub(r'if\s*\((.*?)\)', r'\1', condition) re.sub(r'(^|[^a-zA-Z0-9_])isEmpty\s*\((.*?)\)', r'\2_ISEMPTY', condition) re.sub(r'(^|[^a-zA-Z0-9_])contains\s*\((.*?), (.*)?\)', r'\2___contains___\3', condition) re.sub(r'\s*==\s*', '___STREQUAL___', condition) - print(' # after regexp: {}.'.format(condition)) condition = condition.replace('*', '_x_') condition = condition.replace('.$$', '__ss_') @@ -860,6 +866,8 @@ def simplify_condition(condition: str) -> str: # sympy did not like our input, so leave this condition alone: condition = input_condition + if condition == '': + condition = 'ON' return condition @@ -934,9 +942,8 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, def flatten_scopes(scope: Scope) -> typing.List[Scope]: - result = [] # type: typing.List[Scope] + result = [scope] # type: typing.List[Scope] for c in scope.children(): - result.append(c) result += flatten_scopes(c) return result @@ -944,16 +951,19 @@ def flatten_scopes(scope: Scope) -> typing.List[Scope]: def merge_scopes(scopes: typing.List[Scope]) -> typing.List[Scope]: result = [] # type: typing.List[Scope] - current_scope = None + # Merge scopes with their parents: + known_scopes = {} # type: typing.Mapping[str, Scope] for scope in scopes: - if not current_scope \ - or scope.total_condition() != current_scope.total_condition(): - if current_scope: - result.append(current_scope) - current_scope = scope - continue - - current_scope.merge(scope) + total_condition = scope.total_condition() + if total_condition == 'OFF': + # ignore this scope entirely! + pass + elif total_condition in known_scopes: + known_scopes[total_condition].merge(scope) + else: + # Keep everything else: + result.append(scope) + known_scopes[total_condition] = scope return result @@ -963,14 +973,28 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, extra_lines: typing.List[str] = [], indent: int = 0, **kwargs: typing.Any): + # Evaluate total condition of all scopes: + recursive_evaluate_scope(scope) + + # Get a flat list of all scopes but the main one: + scopes = flatten_scopes(scope) + total_scopes = len(scopes) + # Merge scopes based on their conditions: + scopes = merge_scopes(scopes) + print("xxxxxx {} scopes, {} after merging!".format(total_scopes, len(scopes))) + + assert len(scopes) + assert scopes[0].total_condition() == 'ON' + + # Now write out the scopes: write_header(cm_fh, name, typename, indent=indent) cm_fh.write('{}{}({}\n'.format(spaces(indent), cmake_function, name)) for extra_line in extra_lines: cm_fh.write('{} {}\n'.format(spaces(indent), extra_line)) - ignored_keys = write_sources_section(cm_fh, scope, indent=indent, **kwargs) - ignored_keys_report = write_ignored_keys(scope, ignored_keys, + ignored_keys = write_sources_section(cm_fh, scopes[0], indent=indent, **kwargs) + ignored_keys_report = write_ignored_keys(scopes[0], ignored_keys, spaces(indent + 1)) if ignored_keys_report: cm_fh.write(ignored_keys_report) @@ -979,26 +1003,12 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cm_fh.write('{})\n'.format(spaces(indent))) # Scopes: - if not scope.children(): + if len(scopes) == 1: return write_scope_header(cm_fh, indent=indent) - # Evaluate total condition of all scopes: - for c in scope.children(): - recursive_evaluate_scope(c) - - # Get a flat list of all scopes but the main one: - scopes = flatten_scopes(scope) - - scopes = sorted(scopes, key=lambda x: x.total_condition()) - print("xxxxxx Sorted to {} scopes!".format(len(scopes))) - - # Merge scopes with identical conditions: - scopes = merge_scopes(scopes) - print("xxxxxx Merged to {} scopes!".format(len(scopes))) - - for c in scopes: + for c in scopes[1:]: write_extend_target(cm_fh, name, c, indent=indent) @@ -1118,10 +1128,6 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: include_file = i if not include_file: continue - if '/3rdparty/' in include_file: - print(' ****: Ignoring include file in 3rdparty: {}.' - .format(include_file)) - continue if not os.path.isfile(include_file): print(' XXXX: Failed to include {}.'.format(include_file)) continue diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py new file mode 100755 index 00000000000..3977f2291f2 --- /dev/null +++ b/util/cmake/tests/test_scope_handling.py @@ -0,0 +1,282 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from pro2cmake import Scope, SetOperation, merge_scopes, recursive_evaluate_scope + +import pytest +import typing + +ScopeList = typing.List[Scope] + +def _map_to_operation(**kwargs): + result = {} # type: typing.Mapping[str, typing.List[SetOperation]] + for (key, value) in kwargs.items(): + result[key] = [SetOperation(value)] + return result + + +def _new_scope(*, parent_scope=None, condition='', **kwargs) -> Scope: + return Scope(parent_scope=parent_scope, + file='file1', condition=condition, operations=_map_to_operation(**kwargs)) + + +def _evaluate_scopes(scopes: ScopeList) -> ScopeList: + for s in scopes: + if not s.parent(): + recursive_evaluate_scope(s) + return scopes + + +def _validate(input_scopes: ScopeList, output_scopes: ScopeList): + merged_scopes = merge_scopes(input_scopes) + assert merged_scopes == output_scopes + + +def test_evaluate_one_scope(): + scope = _new_scope(condition='QT_FEATURE_foo', test1='bar') + + input_scope = scope + recursive_evaluate_scope(scope) + assert scope == input_scope + + +def test_evaluate_child_scope(): + scope = _new_scope(condition='QT_FEATURE_foo', test1='bar') + _new_scope(parent_scope=scope, condition='QT_FEATURE_bar', test2='bar') + + input_scope = scope + recursive_evaluate_scope(scope) + + assert scope.total_condition() == 'QT_FEATURE_foo' + assert len(scope.children()) == 1 + assert scope.getString('test1') == 'bar' + assert scope.getString('test2', 'not found') == 'not found' + + child = scope.children()[0] + assert child.total_condition() == 'QT_FEATURE_bar AND QT_FEATURE_foo' + assert child.getString('test1', 'not found') == 'not found' + assert child.getString('test2') == 'bar' + + +def test_evaluate_two_child_scopes(): + scope = _new_scope(condition='QT_FEATURE_foo', test1='bar') + _new_scope(parent_scope=scope, condition='QT_FEATURE_bar', test2='bar') + _new_scope(parent_scope=scope, condition='QT_FEATURE_buz', test3='buz') + + input_scope = scope + recursive_evaluate_scope(scope) + + assert scope.total_condition() == 'QT_FEATURE_foo' + assert len(scope.children()) == 2 + assert scope.getString('test1') == 'bar' + assert scope.getString('test2', 'not found') == 'not found' + assert scope.getString('test3', 'not found') == 'not found' + + child1 = scope.children()[0] + assert child1.total_condition() == 'QT_FEATURE_bar AND QT_FEATURE_foo' + assert child1.getString('test1', 'not found') == 'not found' + assert child1.getString('test2') == 'bar' + assert child1.getString('test3', 'not found') == 'not found' + + child2 = scope.children()[1] + assert child2.total_condition() == 'QT_FEATURE_buz AND QT_FEATURE_foo' + assert child2.getString('test1', 'not found') == 'not found' + assert child2.getString('test2') == '' + assert child2.getString('test3', 'not found') == 'buz' + + +def test_evaluate_else_child_scopes(): + scope = _new_scope(condition='QT_FEATURE_foo', test1='bar') + _new_scope(parent_scope=scope, condition='QT_FEATURE_bar', test2='bar') + _new_scope(parent_scope=scope, condition='else', test3='buz') + + input_scope = scope + recursive_evaluate_scope(scope) + + assert scope.total_condition() == 'QT_FEATURE_foo' + assert len(scope.children()) == 2 + assert scope.getString('test1') == 'bar' + assert scope.getString('test2', 'not found') == 'not found' + assert scope.getString('test3', 'not found') == 'not found' + + child1 = scope.children()[0] + assert child1.total_condition() == 'QT_FEATURE_bar AND QT_FEATURE_foo' + assert child1.getString('test1', 'not found') == 'not found' + assert child1.getString('test2') == 'bar' + assert child1.getString('test3', 'not found') == 'not found' + + child2 = scope.children()[1] + assert child2.total_condition() == 'QT_FEATURE_foo AND NOT QT_FEATURE_bar' + assert child2.getString('test1', 'not found') == 'not found' + assert child2.getString('test2') == '' + assert child2.getString('test3', 'not found') == 'buz' + + +def test_evaluate_invalid_else_child_scopes(): + scope = _new_scope(condition='QT_FEATURE_foo', test1='bar') + _new_scope(parent_scope=scope, condition='else', test3='buz') + _new_scope(parent_scope=scope, condition='QT_FEATURE_bar', test2='bar') + + input_scope = scope + with pytest.raises(AssertionError): + recursive_evaluate_scope(scope) + + +def test_merge_empty_scope_list(): + _validate([], []) + + +def test_merge_one_scope(): + scopes = [_new_scope(test='foo')] + + recursive_evaluate_scope(scopes[0]) + + _validate(scopes, scopes) + + +def test_merge_one_on_scope(): + scopes = [_new_scope(condition='ON', test='foo')] + + recursive_evaluate_scope(scopes[0]) + + _validate(scopes, scopes) + + +def test_merge_one_off_scope(): + scopes = [_new_scope(condition='OFF', test='foo')] + + recursive_evaluate_scope(scopes[0]) + + _validate(scopes, []) + + +def test_merge_one_conditioned_scope(): + scopes = [_new_scope(condition='QT_FEATURE_foo', test='foo')] + + recursive_evaluate_scope(scopes[0]) + + _validate(scopes, scopes) + + +def test_merge_two_scopes_with_same_condition(): + scopes = [_new_scope(condition='QT_FEATURE_bar', test='foo'), + _new_scope(condition='QT_FEATURE_bar', test2='bar')] + + recursive_evaluate_scope(scopes[0]) + recursive_evaluate_scope(scopes[1]) + + result = merge_scopes(scopes) + + assert len(result) == 1 + r0 = result[0] + assert r0.total_condition() == 'QT_FEATURE_bar' + assert r0.getString('test') == 'foo' + assert r0.getString('test2') == 'bar' + + +def test_merge_three_scopes_two_with_same_condition(): + scopes = [_new_scope(condition='QT_FEATURE_bar', test='foo'), + _new_scope(condition='QT_FEATURE_baz', test1='buz'), + _new_scope(condition='QT_FEATURE_bar', test2='bar')] + + recursive_evaluate_scope(scopes[0]) + recursive_evaluate_scope(scopes[1]) + recursive_evaluate_scope(scopes[2]) + + result = merge_scopes(scopes) + + assert len(result) == 2 + r0 = result[0] + assert r0.total_condition() == 'QT_FEATURE_bar' + assert r0.getString('test') == 'foo' + assert r0.getString('test2') == 'bar' + + assert result[1] == scopes[1] + + +def test_merge_two_unrelated_on_off_scopes(): + scopes = [_new_scope(condition='ON', test='foo'), + _new_scope(condition='OFF', test2='bar')] + + recursive_evaluate_scope(scopes[0]) + recursive_evaluate_scope(scopes[1]) + + _validate(scopes, [scopes[0]]) + + +def test_merge_two_unrelated_on_off_scopes(): + scopes = [_new_scope(condition='OFF', test='foo'), + _new_scope(condition='ON', test2='bar')] + + recursive_evaluate_scope(scopes[0]) + recursive_evaluate_scope(scopes[1]) + + _validate(scopes, [scopes[1]]) + + +def test_merge_parent_child_scopes_with_different_conditions(): + scope = _new_scope(condition='FOO', test1='parent') + scopes = [scope, _new_scope(parent_scope=scope, condition='bar', test2='child')] + + recursive_evaluate_scope(scope) + + _validate(scopes, scopes) + + +def test_merge_parent_child_scopes_with_same_conditions(): + scope = _new_scope(condition='FOO AND bar', test1='parent') + scopes = [scope, _new_scope(parent_scope=scope, condition='FOO AND bar', test2='child')] + + recursive_evaluate_scope(scope) + + result = merge_scopes(scopes) + + assert len(result) == 1 + r0 = result[0] + assert r0.parent() == None + assert r0.total_condition() == 'FOO AND bar' + assert r0.getString('test1') == 'parent' + assert r0.getString('test2') == 'child' + + +def test_merge_parent_child_scopes_with_on_child_condition(): + scope = _new_scope(condition='FOO AND bar', test1='parent') + scopes = [scope, _new_scope(parent_scope=scope, condition='ON', test2='child')] + + recursive_evaluate_scope(scope) + + result = merge_scopes(scopes) + + assert len(result) == 1 + r0 = result[0] + assert r0.parent() == None + assert r0.total_condition() == 'FOO AND bar' + assert r0.getString('test1') == 'parent' + assert r0.getString('test2') == 'child' + From 328de7aab92abbaa6e25b8ad3d55f6841504bfee Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 28 Jan 2019 15:06:44 +0100 Subject: [PATCH 0099/1322] CMake: pro2cmake: default QT_FEATURE_system_* to "ON" Qt 6 will use external libraries for everything, so default all QT_FEATURE_system_foo to "ON". Change-Id: I884a4293c64487271be08de5fab82e6858d0a2ed Reviewed-by: Albert Astals Cid Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index d4d352d4f66..3e2e5e13b0e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -552,7 +552,12 @@ def map_condition(condition: str) -> str: part = 'TARGET {}'.format(map_qt_base_library( feature.group(2))) else: - part = 'QT_FEATURE_' + featureName(feature.group(2)) + feature = featureName(feature.group(2)) + if feature.startswith('system_') and substitute_libs(feature[7:]) != feature[7:]: + # Qt6 always uses system libraries! + part = 'ON' + else: + part = 'QT_FEATURE_' + feature else: part = substitute_platform(part) From 194022d3a60598aa44119c0c92cc796b5746c32a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 29 Jan 2019 10:18:21 +0100 Subject: [PATCH 0100/1322] CMake: pro2cmake.py: Use properties Make use of @property to make code a bit nicer. Change-Id: Iff0bfed57874cf13b7e5f85acde2660a397933d7 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 110 +++++++++++++----------- util/cmake/tests/test_scope_handling.py | 46 +++++----- 2 files changed, 85 insertions(+), 71 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 3e2e5e13b0e..6aab8ddd709 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -206,7 +206,7 @@ class RemoveOperation(Operation): return '-({})'.format(self._dump()) -class Scope: +class Scope(object): def __init__(self, *, parent_scope: typing.Optional[Scope], file: typing.Optional[str] = None, condition: str = '', @@ -249,12 +249,15 @@ class Scope: else: self._operations[key] = other._operations[key] + @property def parent(self) -> typing.Optional[Scope]: return self._parent + @property def basedir(self) -> str: return self._basedir + @property def currentdir(self) -> str: return self._currentdir @@ -276,8 +279,8 @@ class Scope: if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH', 'RESOURCES',) \ or key.endswith('_HEADERS') \ or key.endswith('_SOURCES'): - value = [map_to_file(v, scope.basedir(), - scope.currentdir()) for v in value] + value = [map_to_file(v, scope.basedir, + scope.currentdir) for v in value] if operation == '=': scope._append_operation(key, SetOperation(value)) @@ -298,12 +301,12 @@ class Scope: if condition: Scope.FromDict(scope, file, statement.get('statements'), condition, - scope.basedir()) + scope.basedir) else_statements = statement.get('else_statements') if else_statements: Scope.FromDict(scope, file, else_statements, - 'NOT ' + condition, scope.basedir()) + 'NOT ' + condition, scope.basedir) continue loaded = statement.get('loaded') @@ -321,8 +324,8 @@ class Scope: scope._append_operation('_INCLUDED', UniqueAddOperation( map_to_file(included, - scope.basedir(), - scope.currentdir()))) + scope.basedir, + scope.currentdir))) continue return scope @@ -333,26 +336,32 @@ class Scope: else: self._operations[key] = [op, ] + @property def file(self) -> str: return self._file or '' + @property def cMakeListsFile(self) -> str: - assert self.basedir() - return os.path.join(self.basedir(), 'CMakeLists.txt') + assert self.basedir + return os.path.join(self.basedir, 'CMakeLists.txt') + @property def condition(self) -> str: return self._condition - def set_total_condition(self, condition: str) -> None: - self._total_condition = condition - + @property def total_condition(self) -> typing.Optional[str]: return self._total_condition + @total_condition.setter + def total_condition(self, condition: str) -> None: + self._total_condition = condition + def _add_child(self, scope: 'Scope') -> None: scope._parent = self self._children.append(scope) + @property def children(self) -> typing.List['Scope']: return self._children @@ -374,9 +383,11 @@ class Scope: for c in self._children: c.dump(indent=indent + 1) + @property def keys(self): return self._operations.keys() + @property def visited_keys(self): return self._visited_keys @@ -395,17 +406,20 @@ class Scope: assert len(v) == 1 return v[0] - def getTemplate(self) -> str: + @property + def TEMPLATE(self) -> str: return self.getString('TEMPLATE', 'app') def _rawTemplate(self) -> str: return self.getString('TEMPLATE') - def getTarget(self) -> str: + @property + def TARGET(self) -> str: return self.getString('TARGET') \ - or os.path.splitext(os.path.basename(self.file()))[0] + or os.path.splitext(os.path.basename(self.file))[0] - def getIncludes(self) -> typing.List[str]: + @property + def _INCLUDED(self) -> typing.List[str]: return self.get('_INCLUDED', []) @@ -569,10 +583,10 @@ def map_condition(condition: str) -> str: def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, indent: int = 0) -> None: - assert scope.getTemplate() == 'subdirs' + assert scope.TEMPLATE == 'subdirs' ind = ' ' * indent for sd in scope.get('SUBDIRS', []): - full_sd = os.path.join(scope.basedir(), sd) + full_sd = os.path.join(scope.basedir, sd) if os.path.isdir(full_sd): cm_fh.write('{}add_subdirectory({})\n'.format(ind, sd)) elif os.path.isfile(full_sd): @@ -580,7 +594,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, subdir_scope \ = Scope.FromDict(scope, full_sd, subdir_result.asDict().get('statements'), - '', scope.basedir()) + '', scope.basedir) cmakeify_scope(subdir_scope, cm_fh, indent=indent + 1) elif sd.startswith('-'): @@ -590,7 +604,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, print(' XXXX: SUBDIR {} in {}: Not found.'.format(sd, scope)) for c in scope.children(): - cond = c.condition() + cond = c.condition if cond == 'else': cm_fh.write('\n{}else()\n'.format(ind)) elif cond: @@ -670,7 +684,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, vpath = scope.get('VPATH') - sources = [map_source_to_cmake(s, scope.basedir(), vpath) for s in sources] + sources = [map_source_to_cmake(s, scope.basedir, vpath) for s in sources] if sources: cm_fh.write('{} SOURCES\n'.format(ind)) for l in sort_sources(sources): @@ -715,7 +729,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, cm_fh.write('{} {}\n'.format(ind, d)) is_framework = False - return set(scope.keys()) - scope.visited_keys() + return set(scope.keys) - scope.visited_keys def is_simple_condition(condition: str) -> bool: @@ -878,11 +892,11 @@ def simplify_condition(condition: str) -> str: def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', previous_condition: str = '') -> str: - current_condition = scope.condition() + current_condition = scope.condition total_condition = current_condition if total_condition == 'else': assert previous_condition, \ - "Else branch without previous condition in: %s" % scope.file() + "Else branch without previous condition in: %s" % scope.file if previous_condition.startswith('NOT '): total_condition = previous_condition[4:] elif is_simple_condition(previous_condition): @@ -907,10 +921,10 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', total_condition = '({}) AND ({})'.format(parent_condition, total_condition) - scope.set_total_condition(simplify_condition(total_condition)) + scope.total_condition = simplify_condition(total_condition) prev_condition = '' - for c in scope.children(): + for c in scope.children: prev_condition = recursive_evaluate_scope(c, total_condition, prev_condition) @@ -930,7 +944,7 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, extend_scope = '\n{}extend_target({} CONDITION {}\n' \ '{}{})\n'.format(spaces(indent), target, - scope.total_condition(), + scope.total_condition, extend_qt_string, ignored_keys_report) if not extend_qt_string: @@ -948,7 +962,7 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, def flatten_scopes(scope: Scope) -> typing.List[Scope]: result = [scope] # type: typing.List[Scope] - for c in scope.children(): + for c in scope.children: result += flatten_scopes(c) return result @@ -959,7 +973,7 @@ def merge_scopes(scopes: typing.List[Scope]) -> typing.List[Scope]: # Merge scopes with their parents: known_scopes = {} # type: typing.Mapping[str, Scope] for scope in scopes: - total_condition = scope.total_condition() + total_condition = scope.total_condition if total_condition == 'OFF': # ignore this scope entirely! pass @@ -989,7 +1003,7 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, print("xxxxxx {} scopes, {} after merging!".format(total_scopes, len(scopes))) assert len(scopes) - assert scopes[0].total_condition() == 'ON' + assert scopes[0].total_condition == 'ON' # Now write out the scopes: write_header(cm_fh, name, typename, indent=indent) @@ -1019,7 +1033,7 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, def write_module(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0) -> None: - module_name = scope.getTarget() + module_name = scope.TARGET assert module_name.startswith('Qt') extra = [] @@ -1034,14 +1048,14 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, if 'qt_tracepoints' in scope.get('CONFIG'): tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), - scope.basedir(), scope.currentdir()) + scope.basedir, scope.currentdir) cm_fh.write('\n\n{}qt_create_tracepoints({} {})\n' .format(spaces(indent), module_name[2:], tracepoints)) def write_tool(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0) -> None: - tool_name = scope.getTarget() + tool_name = scope.TARGET write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope, indent=indent, known_libraries={'Qt::Core', }) @@ -1049,7 +1063,7 @@ def write_tool(cm_fh: typing.IO[str], scope: Scope, *, def write_test(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0) -> None: - test_name = scope.getTarget() + test_name = scope.TARGET assert test_name write_main_part(cm_fh, test_name, 'Test', 'add_qt_test', scope, @@ -1058,7 +1072,7 @@ def write_test(cm_fh: typing.IO[str], scope: Scope, *, def write_binary(cm_fh: typing.IO[str], scope: Scope, gui: bool = False, *, indent: int = 0) -> None: - binary_name = scope.getTarget() + binary_name = scope.TARGET assert binary_name extra = ['GUI', ] if gui else [] @@ -1068,7 +1082,7 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, def write_plugin(cm_fh, scope, *, indent: int = 0): - plugin_name = scope.getTarget() + plugin_name = scope.TARGET assert plugin_name write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope, @@ -1077,9 +1091,9 @@ def write_plugin(cm_fh, scope, *, indent: int = 0): def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, indent: int = 0) -> None: - assert scope.getTemplate() in ('app', 'lib') + assert scope.TEMPLATE in ('app', 'lib') - is_lib = scope.getTemplate() == 'lib' + is_lib = scope.TEMPLATE == 'lib' is_plugin = any('qt_plugin' == s for s in scope.get('_LOADED', [])) if is_lib or 'qt_module' in scope.get('_LOADED', []): @@ -1100,36 +1114,36 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, if docs: cm_fh.write("\n{}add_qt_docs({})\n" .format(spaces(indent), - map_to_file(docs, scope.basedir(), - scope.currentdir()))) + map_to_file(docs, scope.basedir, + scope.currentdir))) def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, indent: int = 0) -> None: - template = scope.getTemplate() + template = scope.TEMPLATE if template == 'subdirs': handle_subdir(scope, cm_fh, indent=indent) elif template in ('app', 'lib'): handle_app_or_lib(scope, cm_fh, indent=indent) else: print(' XXXX: {}: Template type {} not yet supported.' - .format(scope.file(), template)) + .format(scope.file, template)) def generate_cmakelists(scope: Scope) -> None: - with open(scope.cMakeListsFile(), 'w') as cm_fh: - assert scope.file() + with open(scope.cMakeListsFile, 'w') as cm_fh: + assert scope.file cm_fh.write('# Generated from {}.\n\n' - .format(os.path.basename(scope.file()))) + .format(os.path.basename(scope.file))) cmakeify_scope(scope, cm_fh) def do_include(scope: Scope, *, debug: bool = False) -> None: - for c in scope.children(): + for c in scope.children: do_include(c) - for i in scope.getIncludes(): - dir = scope.basedir() + for i in scope._INCLUDED: + dir = scope.basedir include_file = i if not include_file: continue diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py index 3977f2291f2..2d4bc183d74 100755 --- a/util/cmake/tests/test_scope_handling.py +++ b/util/cmake/tests/test_scope_handling.py @@ -48,7 +48,7 @@ def _new_scope(*, parent_scope=None, condition='', **kwargs) -> Scope: def _evaluate_scopes(scopes: ScopeList) -> ScopeList: for s in scopes: - if not s.parent(): + if not s.parent: recursive_evaluate_scope(s) return scopes @@ -73,13 +73,13 @@ def test_evaluate_child_scope(): input_scope = scope recursive_evaluate_scope(scope) - assert scope.total_condition() == 'QT_FEATURE_foo' - assert len(scope.children()) == 1 + assert scope.total_condition == 'QT_FEATURE_foo' + assert len(scope.children) == 1 assert scope.getString('test1') == 'bar' assert scope.getString('test2', 'not found') == 'not found' - child = scope.children()[0] - assert child.total_condition() == 'QT_FEATURE_bar AND QT_FEATURE_foo' + child = scope.children[0] + assert child.total_condition == 'QT_FEATURE_bar AND QT_FEATURE_foo' assert child.getString('test1', 'not found') == 'not found' assert child.getString('test2') == 'bar' @@ -92,20 +92,20 @@ def test_evaluate_two_child_scopes(): input_scope = scope recursive_evaluate_scope(scope) - assert scope.total_condition() == 'QT_FEATURE_foo' - assert len(scope.children()) == 2 + assert scope.total_condition == 'QT_FEATURE_foo' + assert len(scope.children) == 2 assert scope.getString('test1') == 'bar' assert scope.getString('test2', 'not found') == 'not found' assert scope.getString('test3', 'not found') == 'not found' - child1 = scope.children()[0] - assert child1.total_condition() == 'QT_FEATURE_bar AND QT_FEATURE_foo' + child1 = scope.children[0] + assert child1.total_condition == 'QT_FEATURE_bar AND QT_FEATURE_foo' assert child1.getString('test1', 'not found') == 'not found' assert child1.getString('test2') == 'bar' assert child1.getString('test3', 'not found') == 'not found' - child2 = scope.children()[1] - assert child2.total_condition() == 'QT_FEATURE_buz AND QT_FEATURE_foo' + child2 = scope.children[1] + assert child2.total_condition == 'QT_FEATURE_buz AND QT_FEATURE_foo' assert child2.getString('test1', 'not found') == 'not found' assert child2.getString('test2') == '' assert child2.getString('test3', 'not found') == 'buz' @@ -119,20 +119,20 @@ def test_evaluate_else_child_scopes(): input_scope = scope recursive_evaluate_scope(scope) - assert scope.total_condition() == 'QT_FEATURE_foo' - assert len(scope.children()) == 2 + assert scope.total_condition == 'QT_FEATURE_foo' + assert len(scope.children) == 2 assert scope.getString('test1') == 'bar' assert scope.getString('test2', 'not found') == 'not found' assert scope.getString('test3', 'not found') == 'not found' - child1 = scope.children()[0] - assert child1.total_condition() == 'QT_FEATURE_bar AND QT_FEATURE_foo' + child1 = scope.children[0] + assert child1.total_condition == 'QT_FEATURE_bar AND QT_FEATURE_foo' assert child1.getString('test1', 'not found') == 'not found' assert child1.getString('test2') == 'bar' assert child1.getString('test3', 'not found') == 'not found' - child2 = scope.children()[1] - assert child2.total_condition() == 'QT_FEATURE_foo AND NOT QT_FEATURE_bar' + child2 = scope.children[1] + assert child2.total_condition == 'QT_FEATURE_foo AND NOT QT_FEATURE_bar' assert child2.getString('test1', 'not found') == 'not found' assert child2.getString('test2') == '' assert child2.getString('test3', 'not found') == 'buz' @@ -195,7 +195,7 @@ def test_merge_two_scopes_with_same_condition(): assert len(result) == 1 r0 = result[0] - assert r0.total_condition() == 'QT_FEATURE_bar' + assert r0.total_condition == 'QT_FEATURE_bar' assert r0.getString('test') == 'foo' assert r0.getString('test2') == 'bar' @@ -213,7 +213,7 @@ def test_merge_three_scopes_two_with_same_condition(): assert len(result) == 2 r0 = result[0] - assert r0.total_condition() == 'QT_FEATURE_bar' + assert r0.total_condition == 'QT_FEATURE_bar' assert r0.getString('test') == 'foo' assert r0.getString('test2') == 'bar' @@ -259,8 +259,8 @@ def test_merge_parent_child_scopes_with_same_conditions(): assert len(result) == 1 r0 = result[0] - assert r0.parent() == None - assert r0.total_condition() == 'FOO AND bar' + assert r0.parent == None + assert r0.total_condition == 'FOO AND bar' assert r0.getString('test1') == 'parent' assert r0.getString('test2') == 'child' @@ -275,8 +275,8 @@ def test_merge_parent_child_scopes_with_on_child_condition(): assert len(result) == 1 r0 = result[0] - assert r0.parent() == None - assert r0.total_condition() == 'FOO AND bar' + assert r0.parent == None + assert r0.total_condition == 'FOO AND bar' assert r0.getString('test1') == 'parent' assert r0.getString('test2') == 'child' From af285274b650b559308bb8cde4028f8a92173e20 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 29 Jan 2019 13:04:36 +0100 Subject: [PATCH 0101/1322] CMake: Find common frameworks on apple in one place Change-Id: I38bc631568b438970465a7616464e2b998a74607 Reviewed-by: Simon Hausmann --- src/CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 503d7717fab..f6720c99bd9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,17 @@ +if(APPLE) + find_library(FWAppKit AppKit) + find_library(FWApplicationServices ApplicationServices) + find_library(FWCoreFoundation CoreFoundation) + find_library(FWCoreServices CoreServices) + find_library(FWDiskArbitration DiskArbitration) + find_library(FWFoundation Foundation) + find_library(FWIOKit IOKit) + find_library(FWMobileCoreServices MobileCoreServices) + find_library(FWSecurity Security) + find_library(FWUIKit UIKit) + find_library(FWWatchKit WatchKit) +endif() + add_subdirectory(3rdparty) function(find_or_build_bootstrap_names) From f705b32acbe608fb1851cd374f00cacf0d03e91f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 10:57:27 +0100 Subject: [PATCH 0102/1322] cmake: Add fixme mentioning we need a newer cmake Change-Id: Ie2227e1c5d8357b979436bd5997b1458bf9efef9 Reviewed-by: Tobias Hunger --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17566c330d9..c7128d0d1ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.13.0) +cmake_minimum_required(VERSION 3.13.0) ## FIXME This is wrong we actually need pre-relase 3.14 CMAKE_POLICY(SET CMP0083 NEW) ## TODO Remove when we start requiring 3.14 in the line above From 743b3d86734b314df9665a7e64adc387b4506594 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 10:20:33 +0100 Subject: [PATCH 0103/1322] Add qabstractitemmodeltester back to the build Change-Id: I75dcfaa692465d1a96b92c81111187c4b3aeed6b Reviewed-by: Mikhail Svetkin Reviewed-by: Tobias Hunger --- tests/auto/testlib/CMakeLists.txt | 2 +- tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auto/testlib/CMakeLists.txt b/tests/auto/testlib/CMakeLists.txt index ff2e0d6d8c2..a87e2203f92 100644 --- a/tests/auto/testlib/CMakeLists.txt +++ b/tests/auto/testlib/CMakeLists.txt @@ -1,4 +1,4 @@ -## add_subdirectory(qabstractitemmodeltester) # FIXME: Needs GUI +add_subdirectory(qabstractitemmodeltester) add_subdirectory(qsignalspy) add_subdirectory(selftests) diff --git a/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt b/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt index f99b57a1fda..bcb975d8463 100644 --- a/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt +++ b/tests/auto/testlib/qabstractitemmodeltester/CMakeLists.txt @@ -3,6 +3,6 @@ add_qt_test(tst_qabstractitemmodeltester SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../../other/qabstractitemmodelutils/dynamictreemodel.cpp INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../../other/qabstractitemmodelutils - INCLUDED_MOC - tst_qabstractitemmodeltester.cpp + LIBRARIES + Qt::Widgets ) From f80a37dcca2d2ef4d238e248e3fb267e679317fd Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 31 Jan 2019 10:22:33 +0100 Subject: [PATCH 0104/1322] cmake: Enable qdbusinterface test Change-Id: Ia25911216790abdf463306cdb2e9aecb7dcd276e Reviewed-by: Mikhail Svetkin Reviewed-by: Tobias Hunger --- tests/auto/dbus/CMakeLists.txt | 2 +- tests/auto/dbus/qdbusinterface/CMakeLists.txt | 24 +++++++++++++++- .../qdbusinterface/CMakeLists.txt | 28 ------------------- .../qdbusinterface/qmyserver/CMakeLists.txt | 8 +++++- 4 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt diff --git a/tests/auto/dbus/CMakeLists.txt b/tests/auto/dbus/CMakeLists.txt index 348c9c461c8..ed61a5be9e7 100644 --- a/tests/auto/dbus/CMakeLists.txt +++ b/tests/auto/dbus/CMakeLists.txt @@ -20,7 +20,7 @@ add_subdirectory(qdbusthreading) if(QT_FEATURE_process) add_subdirectory(qdbusabstractadaptor) add_subdirectory(qdbusabstractinterface) - # missing add_qt_binary: add_subdirectory("qdbusinterface") + add_subdirectory(qdbusinterface) if(QT_FEATURE_private_tests) add_subdirectory(qdbusmarshall) diff --git a/tests/auto/dbus/qdbusinterface/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/CMakeLists.txt index ae79490a833..bb1debd590b 100644 --- a/tests/auto/dbus/qdbusinterface/CMakeLists.txt +++ b/tests/auto/dbus/qdbusinterface/CMakeLists.txt @@ -1,4 +1,26 @@ # Generated from qdbusinterface.pro. add_subdirectory(qmyserver) -add_subdirectory(qdbusinterface) + +add_qt_test(tst_qdbusinterface + SOURCES + myobject.h + tst_qdbusinterface.cpp + LIBRARIES + Qt::CorePrivate + Qt::DBus + Qt::DBusPrivate +) + +## Scopes: +##################################################################### + +extend_target(tst_qdbusinterface CONDITION QT_FEATURE_dbus_linked + DEFINES + QT_LINKED_LIBDBUS +) + +extend_target(tst_qdbusinterface CONDITION NOT QT_FEATURE_dbus_linked + SOURCES + ../../../../src/dbus/qdbus_symbols.cpp +) diff --git a/tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt deleted file mode 100644 index 624ec00bd11..00000000000 --- a/tests/auto/dbus/qdbusinterface/qdbusinterface/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Generated from qdbusinterface.pro. - -##################################################################### -## ../tst_qdbusinterface Test: -##################################################################### - -add_qt_test(../tst_qdbusinterface - SOURCES - ../myobject.h - ../tst_qdbusinterface.cpp - LIBRARIES - Qt::CorePrivate - Qt::DBus - Qt::DBusPrivate -) - -## Scopes: -##################################################################### - -extend_target(../tst_qdbusinterface CONDITION QT_FEATURE_dbus_linked - DEFINES - QT_LINKED_LIBDBUS -) - -extend_target(../tst_qdbusinterface CONDITION NOT QT_FEATURE_dbus_linked - SOURCES - ../../../../../src/dbus/qdbus_symbols.cpp -) diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt index 627b29ff422..bbbe1e86335 100644 --- a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt +++ b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt @@ -4,10 +4,16 @@ ## qmyserver Binary: ##################################################################### -add_qt_executable(qmyserver +# Can't be called qmyserver since the qdbusabstractadaptor test +# already has a executable target named like that, so use +# a different target name and then rename the binary +add_qt_executable(qmyserver_qdbusinterface SOURCES ../myobject.h qmyserver.cpp LIBRARIES + Qt::Core Qt::DBus ) + +set_target_properties(qmyserver_qdbusinterface PROPERTIES OUTPUT_NAME qmyserver) From 4d4bf61f9fbd10a48f43a99d43a667b0ac3323f0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 29 Jan 2019 12:07:24 +0100 Subject: [PATCH 0105/1322] CMake: pro2cmake.py: Convert more settings from .pro-file to CMake Convert QMAKE_USE, QMAKE_CXX_FLAGS and QMAKE_LFLAGS into CMake. Change-Id: I53a5b91664b6ab71892d4381c00f8d744d7d7abd Reviewed-by: Albert Astals Cid --- cmake/QtBuild.cmake | 20 ++++++++++++++++++-- util/cmake/pro2cmake.py | 14 +++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 2896ad1e7a5..8ed231df7c8 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -243,8 +243,8 @@ function(qt_internal_module_info result target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES") -set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS") +set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES;PUBLIC_COMPILE_OPTIONS;PUBLIC_LINK_OPTIONS") # This function can be used to add sources/libraries/etc. to the specified CMake target @@ -288,6 +288,8 @@ function(extend_target target) target_include_directories("${target}" PUBLIC ${arg_PUBLIC_INCLUDE_DIRECTORIES} PRIVATE ${arg_INCLUDE_DIRECTORIES}) target_compile_definitions("${target}" PUBLIC ${arg_PUBLIC_DEFINES} PRIVATE ${arg_DEFINES}) target_link_libraries("${target}" PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE ${arg_LIBRARIES}) + target_compile_options("${target}" PUBLIC ${arg_PUBLIC_COMPILE_OPTIONS} PRIVATE ${arg_COMPILE_OPTIONS}) + target_link_options("${target}" PUBLIC ${arg_PUBLIC_LINK_OPTIONS} PRIVATE ${arg_LINK_OPTIONS}) endif() endfunction() @@ -440,6 +442,10 @@ function(add_qt_module target) DBUS_ADAPTOR_FLAGS ${arg_DBUS_ADAPTOR_FLAGS} DBUS_INTERFACE_SOURCES ${arg_DBUS_INTERFACE_SOURCES} DBUS_INTERFACE_FLAGS ${arg_DBUS_INTERFACE_FLAGS} + COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} + PUBLIC_COMPILE_OPTIONS ${arg_PUBLIC_COMPILE_OPTIONS} + LINK_OPTIONS ${arg_LINK_OPTIONS} + PUBLIC_LINK_OPTIONS ${arg_PUBLIC_LINK_OPTIONS} ) set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") @@ -571,6 +577,10 @@ function(add_qt_plugin target) DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" + COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} + PUBLIC_COMPILE_OPTIONS ${arg_PUBLIC_COMPILE_OPTIONS} + LINK_OPTIONS ${arg_LINK_OPTIONS} + PUBLIC_LINK_OPTIONS ${arg_PUBLIC_LINK_OPTIONS} ) install(TARGETS "${target}" EXPORT "${target}Targets" @@ -612,6 +622,8 @@ function(add_qt_executable name) DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" + COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} + LINK_OPTIONS ${arg_LINK_OPTIONS} ) set_target_properties("${name}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" @@ -635,6 +647,8 @@ function(add_qt_test name) "${arg_INCLUDE_DIRECTORIES}" DEFINES "${arg_DEFINES}" LIBRARIES Qt::Core Qt::Test ${arg_LIBRARIES} + COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} + LINK_OPTIONS ${arg_LINK_OPTIONS} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") @@ -670,6 +684,8 @@ function(add_qt_tool name) ${arg_INCLUDE_DIRECTORIES} DEFINES ${arg_DEFINES} LIBRARIES ${corelib} ${arg_LIBRARIES} + COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} + LINK_OPTIONS ${arg_LINK_OPTIONS} ) qt_internal_add_target_aliases("${name}") diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6aab8ddd709..fc5bda6854d 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -708,7 +708,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, if map_qt_library(q) not in known_libraries] dependencies += [map_qt_library(q) for q in scope.get('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] - dependencies += scope.get('QMAKE_USE_PRIVATE') \ + dependencies += scope.get('QMAKE_USE_PRIVATE') + scope.get('QMAKE_USE') \ + scope.get('LIBS_PRIVATE') + scope.get('LIBS') if dependencies: cm_fh.write('{} LIBRARIES\n'.format(ind)) @@ -729,6 +729,18 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, cm_fh.write('{} {}\n'.format(ind, d)) is_framework = False + compile_options = scope.get('QMAKE_CXXFLAGS') + if compile_options: + cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind)) + for co in compile_options: + cm_fh.write('{} "{}"\n'.format(ind, co)) + + link_options = scope.get('QMAKE_LFLAGS') + if link_options: + cm_fh.write('{} LINK_OPTIONS\n'.format(ind)) + for lo in link_options: + cm_fh.write('{} "{}"\n'.format(ind, lo)) + return set(scope.keys) - scope.visited_keys From 210762ae461c972c2fdfbe73f20e016ea20452e5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:43:11 +0100 Subject: [PATCH 0106/1322] CMake: pro2cmake.py: Pass QMAKE_MOC_OPTIONS on to CMake Change-Id: I39c1b0aedbffaa29a34253e0c1c4bb4a4dddbe98 Reviewed-by: Albert Astals Cid --- cmake/QtBuild.cmake | 8 +++++++- util/cmake/pro2cmake.py | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8ed231df7c8..4f23dd1c2c4 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -243,7 +243,7 @@ function(qt_internal_module_info result target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES;PUBLIC_COMPILE_OPTIONS;PUBLIC_LINK_OPTIONS") @@ -290,6 +290,7 @@ function(extend_target target) target_link_libraries("${target}" PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE ${arg_LIBRARIES}) target_compile_options("${target}" PUBLIC ${arg_PUBLIC_COMPILE_OPTIONS} PRIVATE ${arg_COMPILE_OPTIONS}) target_link_options("${target}" PUBLIC ${arg_PUBLIC_LINK_OPTIONS} PRIVATE ${arg_LINK_OPTIONS}) + set_target_properties("${target}" PROPERTIES AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}") endif() endfunction() @@ -446,6 +447,7 @@ function(add_qt_module target) PUBLIC_COMPILE_OPTIONS ${arg_PUBLIC_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} PUBLIC_LINK_OPTIONS ${arg_PUBLIC_LINK_OPTIONS} + MOC_OPTIONS ${arg_MOC_OPTIONS} ) set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") @@ -581,6 +583,7 @@ function(add_qt_plugin target) PUBLIC_COMPILE_OPTIONS ${arg_PUBLIC_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} PUBLIC_LINK_OPTIONS ${arg_PUBLIC_LINK_OPTIONS} + MOC_OPTIONS ${arg_MOC_OPTIONS} ) install(TARGETS "${target}" EXPORT "${target}Targets" @@ -624,6 +627,7 @@ function(add_qt_executable name) DBUS_INTERFACE_FLAGS "${arg_DBUS_INTERFACE_FLAGS}" COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} + MOC_OPTIONS ${arg_MOC_OPTIONS} ) set_target_properties("${name}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" @@ -649,6 +653,7 @@ function(add_qt_test name) LIBRARIES Qt::Core Qt::Test ${arg_LIBRARIES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} + MOC_OPTIONS ${arg_MOC_OPTIONS} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") @@ -686,6 +691,7 @@ function(add_qt_tool name) LIBRARIES ${corelib} ${arg_LIBRARIES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} + MOC_OPTIONS ${arg_MOC_OPTIONS} ) qt_internal_add_target_aliases("${name}") diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fc5bda6854d..aa993f5a62a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -741,6 +741,12 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, for lo in link_options: cm_fh.write('{} "{}"\n'.format(ind, lo)) + moc_options = scope.get('QMAKE_MOC_OPTIONS') + if moc_options: + cm_fh.write('{} MOC_OPTIONS\n'.format(ind)) + for mo in moc_options: + cm_fh.write('{} "{}"\n'.format(ind, mo)) + return set(scope.keys) - scope.visited_keys From 06e8dd31e90ad76bacde9e6ea0492df202c736ea Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:36:30 +0100 Subject: [PATCH 0107/1322] CMake: Add debugging support for extend_target(...) calls Enable a flag so that cmake documents which extend_target calls it acts upon and which ones are skipped. Change-Id: I1e2d4da47b93d6b5d7b7ec25b7bc6341f38b3dca Reviewed-by: Albert Astals Cid --- cmake/QtBuild.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 4f23dd1c2c4..96d187559b4 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -247,6 +247,8 @@ set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_A set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES;PUBLIC_COMPILE_OPTIONS;PUBLIC_LINK_OPTIONS") +option(QT_CMAKE_DEBUG_EXTEND_TARGET "Debug extend_target calls in Qt's build system" OFF) + # This function can be used to add sources/libraries/etc. to the specified CMake target # if the provided CONDITION evaluates to true. function(extend_target target) @@ -261,6 +263,9 @@ function(extend_target target) qt_evaluate_config_expression(result ${arg_CONDITION}) if (${result}) + if(QT_CMAKE_DEBUG_EXTEND_TARGET) + message("extend_target(${target} CONDITION ${arg_CONDITION} ...): Evaluated") + endif() set(dbus_sources "") foreach(adaptor ${arg_DBUS_ADAPTOR_SOURCES}) qt_create_qdbusxml2cpp_command("${target}" "${adaptor}" ADAPTOR BASENAME "${arg_DBUS_ADAPTOR_BASENAME}" FLAGS "${arg_DBUS_ADAPTOR_FLAGS}") @@ -291,6 +296,10 @@ function(extend_target target) target_compile_options("${target}" PUBLIC ${arg_PUBLIC_COMPILE_OPTIONS} PRIVATE ${arg_COMPILE_OPTIONS}) target_link_options("${target}" PUBLIC ${arg_PUBLIC_LINK_OPTIONS} PRIVATE ${arg_LINK_OPTIONS}) set_target_properties("${target}" PROPERTIES AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}") + else() + if(QT_CMAKE_DEBUG_EXTEND_TARGET) + message("extend_target(${target} CONDITION ${arg_CONDITION} ...): Skipped") + endif() endif() endfunction() From 1218d8a9f0bcacf4dee3795c3172c9ce05b8baa8 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 29 Jan 2019 12:53:24 +0100 Subject: [PATCH 0108/1322] CMake: Use FindGLIB2 from cmake-extra-modules Use FindGLIB2 from cmake-extra-modules over hand-rolled own version. Change-Id: I1f8e055bc12dd728c033fd88480690643d90159a Reviewed-by: Frederik Gladhorn --- .../find-modules/FindGLIB2.cmake | 101 ++++++++++++++++++ cmake/FindGLib.cmake | 3 - util/cmake/configurejson2cmake.py | 2 +- util/cmake/helper.py | 3 +- 4 files changed, 104 insertions(+), 5 deletions(-) create mode 100644 cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake delete mode 100644 cmake/FindGLib.cmake diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake new file mode 100644 index 00000000000..993535123a4 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindGLIB2.cmake @@ -0,0 +1,101 @@ +#.rst: +# FindGLIB2 +# --------- +# +# Try to locate the GLib2 library. +# If found, this will define the following variables: +# +# ``GLIB2_FOUND`` +# True if the GLib2 library is available +# ``GLIB2_INCLUDE_DIRS`` +# The GLib2 include directories +# ``GLIB2_LIBRARIES`` +# The GLib2 libraries for linking +# ``GLIB2_INCLUDE_DIR`` +# Deprecated, use ``GLIB2_INCLUDE_DIRS`` +# ``GLIB2_LIBRARY`` +# Deprecated, use ``GLIB2_LIBRARIES`` +# +# If ``GLIB2_FOUND`` is TRUE, it will also define the following +# imported target: +# +# ``GLIB2::GLIB2`` +# The GLIB2 library +# +# Since 5.41.0. + +#============================================================================= +# Copyright (c) 2008 Laurent Montel, +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +find_package(PkgConfig) +pkg_check_modules(PC_GLIB2 QUIET glib-2.0) + +find_path(GLIB2_INCLUDE_DIRS + NAMES glib.h + HINTS ${PC_GLIB2_INCLUDEDIR} + PATH_SUFFIXES glib-2.0) + +find_library(GLIB2_LIBRARIES + NAMES glib-2.0 + HINTS ${PC_GLIB2_LIBDIR} +) + +# search the glibconfig.h include dir under the same root where the library is found +get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH) + +find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h + PATH_SUFFIXES glib-2.0/include + HINTS ${PC_GLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}) + +# not sure if this include dir is optional or required +# for now it is optional +if(GLIB2_INTERNAL_INCLUDE_DIR) + list(APPEND GLIB2_INCLUDE_DIRS "${GLIB2_INTERNAL_INCLUDE_DIR}") +endif() + +# Deprecated synonyms +set(GLIB2_INCLUDE_DIR "${GLIB2_INCLUDE_DIRS}") +set(GLIB2_LIBRARY "${GLIB2_LIBRARIES}") + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_INCLUDE_DIRS) + +if(GLIB2_FOUND AND NOT TARGET GLIB2::GLIB2) + add_library(GLIB2::GLIB2 UNKNOWN IMPORTED) + set_target_properties(GLIB2::GLIB2 PROPERTIES + IMPORTED_LOCATION "${GLIB2_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${GLIB2_INCLUDE_DIRS}") +endif() + +mark_as_advanced(GLIB2_INCLUDE_DIRS GLIB2_INCLUDE_DIR + GLIB2_LIBRARIES GLIB2_LIBRARY) + +include(FeatureSummary) +set_package_properties(GLIB2 PROPERTIES + URL "https://wiki.gnome.org/Projects/GLib" + DESCRIPTION "Event loop and utility library") + diff --git a/cmake/FindGLib.cmake b/cmake/FindGLib.cmake deleted file mode 100644 index 461564122a9..00000000000 --- a/cmake/FindGLib.cmake +++ /dev/null @@ -1,3 +0,0 @@ -find_package(PkgConfig) - -pkg_check_modules(GLib glib-2.0 IMPORTED_TARGET) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 0a30e74d6f7..312f0cc54d1 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -55,7 +55,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), 'freetype': 'Freetype', 'gbm': 'gbm', - 'glib': 'GLib', + 'glib': 'GLIB2', 'gnu_iconv': None, 'harfbuzz': 'harfbuzz', 'host_dbus': None, diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 1998defefff..759f61a3833 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -184,6 +184,7 @@ platform_mapping = { 'clang': 'CLANG', 'gcc': 'GCC', 'icc': 'ICC', + 'intel_icc': 'ICC', 'osx': 'APPLE_OSX', 'ios': 'APPLE_IOS', 'freebsd': 'FREEBSD', @@ -205,7 +206,7 @@ def substitute_platform(platform: str) -> str: libray_mapping = { 'zlib': 'ZLIB::ZLIB', - 'glib': 'PkgConfig::GLib', + 'glib': 'GLIB2::GLIB2', } From e7e793555ff4ee6dca0d9da581fa019bf9f93a24 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:53:40 +0100 Subject: [PATCH 0109/1322] CMake: Add FindZSTD.cmake and wire it up in configurejson2cmake.py Zstd is used in the dev branch, so prepare for it. Change-Id: I130d98e3888a1eb4c7444728fc5088c5dae9d911 Reviewed-by: Frederik Gladhorn --- cmake/FindZSTD.cmake | 49 +++++++++++++++++++++++++++++++ util/cmake/configurejson2cmake.py | 1 + 2 files changed, 50 insertions(+) create mode 100644 cmake/FindZSTD.cmake diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake new file mode 100644 index 00000000000..040e8c1642a --- /dev/null +++ b/cmake/FindZSTD.cmake @@ -0,0 +1,49 @@ +#.rst: +# FindZstd +# --------- +# +# Try to locate the Zstd library. +# If found, this will define the following variables: +# +# ``ZSTD_FOUND`` +# True if the zstd library is available +# ``ZSTD_INCLUDE_DIRS`` +# The zstd include directories +# ``ZSTD_LIBRARIES`` +# The zstd libraries for linking +# +# If ``ZSTD_FOUND`` is TRUE, it will also define the following +# imported target: +# +# ``ZSTD::ZSTD`` +# The zstd library + +find_package(PkgConfig) +pkg_check_modules(PC_ZSTD QUIET libzstd) + +find_path(ZSTD_INCLUDE_DIRS + NAMES zstd.h + HINTS ${PC_ZSTD_INCLUDEDIR} + PATH_SUFFIXES zstd) + +find_library(ZSTD_LIBRARIES + NAMES zstd + HINTS ${PC_ZSTD_LIBDIR} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS) + +if(ZSTD_FOUND AND NOT TARGET ZSTD::ZSTD) + add_library(ZSTD::ZSTD UNKNOWN IMPORTED) + set_target_properties(ZSTD::ZSTD PROPERTIES + IMPORTED_LOCATION "${ZSTD_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIRS}") +endif() + +mark_as_advanced(ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES) + +set_package_properties(ZSTD PROPERTIES + URL "https://github.com/facebook/zstd" + DESCRIPTION "ZSTD compression library") + diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 312f0cc54d1..03625da1a5c 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -92,6 +92,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'xlib': 'X11', 'xrender': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), 'zlib': 'ZLIB', + 'zstd': 'ZSTD', } # type: Dict[str, Union[str, List[str], LibraryMapping]] if lib not in libmap: raise Exception(' XXXX Unknown library "{}".'.format(lib)) From 3e36bcdca02e551ddebc0bf34a5b706afba4eba2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:31:06 +0100 Subject: [PATCH 0110/1322] CMake: Introduce QT_HAS_NAMESPACE This makes testing for Qt with namespace builds easier in extend_target. Change-Id: I58ab985a2ed39859fb65d35f8f69065fed2a5c9b Reviewed-by: Frederik Gladhorn --- cmake/QtBuild.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 96d187559b4..ec14ad652dc 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -66,6 +66,11 @@ set(QT_PLATFORM_DEFINITIONS ${QT_DEFAULT_PLATFORM_DEFINITIONS} set(QT_PLATFORM_DEFINITION_DIR ${QT_DEFAULT_PLATFORM_DEFINITION_DIR} CACHE PATH "Path to directory that contains qplatformdefs.h") set(QT_NAMESPACE "" CACHE STRING "Qt Namespace") +if(QT_NAMESPACE STREQUAL "") + set(QT_HAS_NAMESPACE OFF) +else() + set(QT_HAS_NAMESPACE ON) +endif() macro(qt_internal_set_known_qt_modules) set(KNOWN_QT_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) From 645002cd43eb24051504d7dc60ea3ac961d16121 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:41:45 +0100 Subject: [PATCH 0111/1322] CMake: pro2cmake.py: Handle more libraries Change-Id: I561b619c4dbc56a1f6ad383a68ce4b82858a031c Reviewed-by: Tobias Hunger --- util/cmake/helper.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 759f61a3833..872f968ba14 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -205,8 +205,16 @@ def substitute_platform(platform: str) -> str: libray_mapping = { - 'zlib': 'ZLIB::ZLIB', + 'libdl': '${CMAKE_DL_LIBS}', + 'doubleconversion': 'double-conversion', 'glib': 'GLIB2::GLIB2', + 'icu': 'ICU::i18n ICU::uc ICU::data', + 'libatomic': 'Atomic', + 'libproxy': 'LibProxy::LibProxy', + 'pcre2': 'PCRE2', + 'librt': 'WrapRt', + 'zlib': 'ZLIB::ZLIB', + 'zstd': 'ZSTD::ZSTD', } From ca4edbec6616b30256dcbc81a2d5d8e2e82cc202 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 10:18:14 +0100 Subject: [PATCH 0112/1322] CMake: pro2cmake.py: Add a way to debug merges of scopes Generate debug output whenever a qmake scope with a variable 'PRO2CMAKE_MERGE_DEBUG' is involved in a scope merge. Change-Id: I0ad94b881db9930de689c199adbac084efe6c03b Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index aa993f5a62a..88869a83461 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -233,13 +233,22 @@ class Scope(object): self._total_condition = None # type: typing.Optional[str] def __repr__(self): - return '{}:{}:{}'.format(self._basedir, self._file, - self._condition or '') + debug_mark = ' [MERGE_DEBUG]' if self.merge_debug else '' + return '{}:{}:{}{}'.format(self._basedir, self._file, + self._condition or '', debug_mark) def reset_visited_keys(self): self._visited_keys = set() def merge(self, other: 'Scope') -> None: + assert self != other + merge_debug = self.merge_debug or other.merge_debug + if merge_debug: + print('..... [MERGE_DEBUG]: Merging scope {}:'.format(other)) + other.dump(indent=1) + print('..... [MERGE_DEBUG]: ... into scope {}:'.format(self)) + self.dump(indent=1) + for c in other._children: self._add_child(c) @@ -249,6 +258,15 @@ class Scope(object): else: self._operations[key] = other._operations[key] + if merge_debug: + print('..... [MERGE_DEBUG]: Result scope {}:'.format(self)) + self.dump(indent=1) + print('..... [MERGE_DEBUG]: <>') + + @property + def merge_debug(self) -> bool: + return self.getString('PRO2CMAKE_MERGE_DEBUG', None) != None + @property def parent(self) -> typing.Optional[Scope]: return self._parent From 0efd241d200e4080d80bc8336514a656583e2d18 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 11:54:55 +0100 Subject: [PATCH 0113/1322] CMake: pro2cmake.py: report total condition when dumping a scope Show the total_condition (if set) when dumping a scope. Change-Id: I9dfe98c2251f1d28881771042f17d723cedc8907 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 88869a83461..15c35ac9ae7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -386,6 +386,8 @@ class Scope(object): def dump(self, *, indent: int = 0) -> None: ind = ' ' * indent print('{}Scope "{}":'.format(ind, self)) + if self.total_condition: + print('{} Total condition = {}'.format(ind, self.total_condition)) print('{} Keys:'.format(ind)) keys = self._operations.keys() if not keys: From cfbb110abe3f3ac9c85c9e2cf0bbe587f1082af5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 12:17:27 +0100 Subject: [PATCH 0114/1322] CMake: pro2cmake.py: Assign a unique id to each scope This makes scopes much simpler to destinguish from each other. Change-Id: I1af42f181b5899aba749bcf9267a345385149f90 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 15c35ac9ae7..dd1ed59255e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -207,6 +207,9 @@ class RemoveOperation(Operation): class Scope(object): + + SCOPE_ID: int = 1 + def __init__(self, *, parent_scope: typing.Optional[Scope], file: typing.Optional[str] = None, condition: str = '', @@ -225,6 +228,8 @@ class Scope(object): if not self._basedir: self._basedir = self._currentdir + self._scope_id = Scope.SCOPE_ID + Scope.SCOPE_ID += 1 self._file = file self._condition = map_condition(condition) self._children = [] # type: typing.List[Scope] @@ -234,8 +239,8 @@ class Scope(object): def __repr__(self): debug_mark = ' [MERGE_DEBUG]' if self.merge_debug else '' - return '{}:{}:{}{}'.format(self._basedir, self._file, - self._condition or '', debug_mark) + return '{}:{}:{}:{}{}'.format(self._scope_id, self._basedir, self._file, + self._condition or '', debug_mark) def reset_visited_keys(self): self._visited_keys = set() From 6dd989fe6163ce24324a35816803fb36730ac42c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 14:23:57 +0100 Subject: [PATCH 0115/1322] CMake: pro2cmake.py: Add scope debugging support Dump scope trees for all scopes that contain a variable 'PRO2CMAKE_SCOPE_DEBUG' (set to any value). Change-Id: If17bb1697a32ccaa427a858c2330ab2b019d0fa8 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index dd1ed59255e..215ee21b100 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -272,6 +272,10 @@ class Scope(object): def merge_debug(self) -> bool: return self.getString('PRO2CMAKE_MERGE_DEBUG', None) != None + @property + def scope_debug(self) -> bool: + return self.getString('PRO2CMAKE_SCOPE_DEBUG', None) != None + @property def parent(self) -> typing.Optional[Scope]: return self._parent @@ -351,6 +355,10 @@ class Scope(object): scope.currentdir))) continue + if scope.scope_debug: + print('..... [SCOPE_DEBUG]: Created scope {}:'.format(scope)) + scope.dump(indent=1) + print('..... [SCOPE_DEBUG]: <>') return scope def _append_operation(self, key: str, op: Operation) -> None: From e616976fdf5d3912bbcbced0394330805fec462a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 14:25:32 +0100 Subject: [PATCH 0116/1322] CMake: pro2cmake.py: Small fix to type markup Change-Id: I2f7dc94f379d51c3816649849aa7365b17334ab5 Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 215ee21b100..6d63461e0da 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -290,7 +290,7 @@ class Scope(object): @staticmethod def FromDict(parent_scope: typing.Optional['Scope'], - file: str, statements, cond: str = '', base_dir: str = ''): + file: str, statements, cond: str = '', base_dir: str = '') -> Scope: scope = Scope(parent_scope=parent_scope, file=file, condition=cond, base_dir=base_dir) for statement in statements: if isinstance(statement, list): # Handle skipped parts... From 773999816ee250a50f93a6716ef3ea940583b762 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 31 Jan 2019 16:31:05 +0100 Subject: [PATCH 0117/1322] cmake: glib changed name to glib2 Change-Id: I4a86bd3b01e1fe307e9802182df943245a7fce4c Reviewed-by: Tobias Hunger --- src/corelib/CMakeLists.txt | 2 +- src/corelib/configure.cmake | 6 +++--- src/platformsupport/eventdispatchers/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index a847d07adef..2ade76d2f56 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -528,7 +528,7 @@ extend_target(Core CONDITION UNIX AND QT_FEATURE_clock_gettime extend_target(Core CONDITION QT_FEATURE_glib SOURCES kernel/qeventdispatcher_glib.cpp kernel/qeventdispatcher_glib_p.h - LIBRARIES PkgConfig::GLib + LIBRARIES GLIB2::GLIB2 ) ## poll_select: diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index a30f8d1bca1..4c40aa1c281 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -10,8 +10,8 @@ set_property(CACHE INPUT_iconv PROPERTY STRINGS undefined no yes posix sun gnu) #### Libraries -find_package(GLib) -set_package_properties(GLib PROPERTIES TYPE OPTIONAL) +find_package(GLIB2) +set_package_properties(GLIB2 PROPERTIES TYPE OPTIONAL) find_package(ICU COMPONENTS i18n uc data) set_package_properties(ICU PROPERTIES TYPE OPTIONAL) find_package(Libsystemd) @@ -383,7 +383,7 @@ qt_feature("getentropy" PRIVATE qt_feature("glib" PUBLIC PRIVATE LABEL "GLib" AUTODETECT NOT WIN32 - CONDITION GLib_FOUND + CONDITION GLIB2_FOUND ) qt_feature_definition("glib" "QT_NO_GLIB" NEGATE VALUE "1") qt_feature("iconv" PUBLIC PRIVATE diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt index 54a4287ccc4..f8898ea6725 100644 --- a/src/platformsupport/eventdispatchers/CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from eventdispatchers.pro. -find_package(GLib) +find_package(GLIB2) set_package_properties(GLib PROPERTIES TYPE OPTIONAL) ##################################################################### @@ -35,5 +35,5 @@ extend_target(EventDispatcherSupport CONDITION QT_FEATURE_glib SOURCES qeventdispatcher_glib.cpp qeventdispatcher_glib_p.h LIBRARIES - PkgConfig::GLib + GLIB2::GLIB2 ) From b6306cb06675cdab2c1a6d68dcad5201bae5db87 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 31 Jan 2019 15:32:18 +0100 Subject: [PATCH 0118/1322] cmake: Only use the doubleconversion cmake config if "valid" And by "valid" i mean if it returns the double-conversion::double-conversion target that we are going to use later. Fedora rawhide has a doubleconversion cmake config file but it doesn't define any target Change-Id: Ib0360bc9fdf593a14510c9a2d59b47b32bc4b356 Reviewed-by: Tobias Hunger --- cmake/Finddouble-conversion.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Finddouble-conversion.cmake b/cmake/Finddouble-conversion.cmake index 77785696b9e..43d20762899 100644 --- a/cmake/Finddouble-conversion.cmake +++ b/cmake/Finddouble-conversion.cmake @@ -4,7 +4,9 @@ find_package(double-conversion CONFIG) if (double-conversion_FOUND) - return() + if(TARGET double-conversion::double-conversion) + return() + endif() endif() find_path(DOUBLE_CONVERSION_INCLUDE_DIR From 70419e31f9a8de172459a6e1cce67e816c7ddbed Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 31 Jan 2019 11:43:51 +0100 Subject: [PATCH 0119/1322] cmake: Fix build of xcb platform plugin when vulkan is available Change-Id: I79760aa0cb08752cfc20aabc1a890f60c91c9dfd Reviewed-by: Tobias Hunger --- src/platformsupport/CMakeLists.txt | 4 ++++ src/platformsupport/vkconvenience/CMakeLists.txt | 16 ++++++++++++++++ src/plugins/platforms/xcb/CMakeLists.txt | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/platformsupport/vkconvenience/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index e298eb4bc55..a86b958c105 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -19,6 +19,10 @@ if(QT_FEATURE_accessibility) endif() endif() +if(QT_FEATURE_vulkan) + add_subdirectory(vkconvenience) +endif() + if(APPLE) add_subdirectory(clipboard) add_subdirectory(graphics) diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt new file mode 100644 index 00000000000..b9504f2b941 --- /dev/null +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from vkconvenience.pro. + +##################################################################### +## VulkanSupport Module: +##################################################################### + +add_qt_module(VulkanSupport + STATIC + SOURCES + qbasicvulkanplatforminstance.cpp qbasicvulkanplatforminstance_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index d1fff8bf25d..5540822875d 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -75,7 +75,7 @@ extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate extend_target(XcbQpa CONDITION QT_FEATURE_vulkan LIBRARIES - vulkan_supportPrivate + VulkanSupportPrivate ) extend_target(XcbQpa CONDITION QT_FEATURE_draganddrop From 6d51f69bbf3d88f7da46586a01c26034850ce897 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 31 Jan 2019 17:36:49 +0100 Subject: [PATCH 0120/1322] cmake: Build src/plugins/imageformats Change-Id: I4bf09c50eebf71255590e9b17e637ce621d3cd40 Reviewed-by: Frederik Gladhorn Reviewed-by: Tobias Hunger --- src/plugins/CMakeLists.txt | 1 + src/plugins/imageformats/CMakeLists.txt | 11 +++++++++++ src/plugins/imageformats/gif/CMakeLists.txt | 14 ++++++++++++++ src/plugins/imageformats/ico/CMakeLists.txt | 15 +++++++++++++++ src/plugins/imageformats/jpeg/CMakeLists.txt | 19 +++++++++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 src/plugins/imageformats/CMakeLists.txt create mode 100644 src/plugins/imageformats/gif/CMakeLists.txt create mode 100644 src/plugins/imageformats/ico/CMakeLists.txt create mode 100644 src/plugins/imageformats/jpeg/CMakeLists.txt diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index ff9afb9c89b..3d830bf979a 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,3 +1,4 @@ if(QT_FEATURE_gui) + add_subdirectory(imageformats) add_subdirectory(platforms) endif() diff --git a/src/plugins/imageformats/CMakeLists.txt b/src/plugins/imageformats/CMakeLists.txt new file mode 100644 index 00000000000..cd5c0347e53 --- /dev/null +++ b/src/plugins/imageformats/CMakeLists.txt @@ -0,0 +1,11 @@ +if(QT_FEATURE_gif) + add_subdirectory(gif) +endif() +if(QT_FEATURE_ico) + add_subdirectory(ico) +endif() +if(QT_FEATURE_jpeg) + add_subdirectory(jpeg) +endif() + + diff --git a/src/plugins/imageformats/gif/CMakeLists.txt b/src/plugins/imageformats/gif/CMakeLists.txt new file mode 100644 index 00000000000..efd910c3ffd --- /dev/null +++ b/src/plugins/imageformats/gif/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from gif.pro. + +##################################################################### +## qgif Plugin: +##################################################################### + +add_qt_plugin(qgif + TYPE imageformats + SOURCES + main.cpp main.h + qgifhandler.cpp qgifhandler_p.h + LIBRARIES + Qt::Gui +) diff --git a/src/plugins/imageformats/ico/CMakeLists.txt b/src/plugins/imageformats/ico/CMakeLists.txt new file mode 100644 index 00000000000..52550eab60e --- /dev/null +++ b/src/plugins/imageformats/ico/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from ico.pro. + +##################################################################### +## qico Plugin: +##################################################################### + +add_qt_plugin(qico + TYPE imageformats + SOURCES + main.cpp main.h + qicohandler.cpp qicohandler.h + LIBRARIES + Qt::Gui + Qt::CorePrivate +) diff --git a/src/plugins/imageformats/jpeg/CMakeLists.txt b/src/plugins/imageformats/jpeg/CMakeLists.txt new file mode 100644 index 00000000000..f70c72b9927 --- /dev/null +++ b/src/plugins/imageformats/jpeg/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from jpeg.pro. + +##################################################################### +## qjpeg Plugin: +##################################################################### + +find_package(JPEG) + +add_qt_plugin(qjpeg + TYPE imageformats + SOURCES + main.cpp main.h + qjpeghandler.cpp qjpeghandler_p.h + LIBRARIES + Qt::Gui + Qt::CorePrivate + Qt::GuiPrivate + JPEG::JPEG +) From bb0deccf19116735db3724734b79b89d8dbdf2e3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 29 Jan 2019 17:49:04 +0100 Subject: [PATCH 0121/1322] cmake: Make sure moc/rcc/uic are built when needed This way you can run cmake, go directly into src/widgets and it will build moc and rcc before QtCore (because they are needed there) and uic before QtWidgets but not before QtCore because it's not used there. Without this it would get stuck creating the mocs since cmake is not expecting the moc executable to just not be there Change-Id: Ibcb6057bfab7a4bf823544e8f7bd128ea93d1986 Reviewed-by: Tobias Hunger --- src/corelib/CMakeLists.txt | 3 +++ src/widgets/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 2ade76d2f56..7e1a788e228 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -239,6 +239,9 @@ add_qt_module(Core QT_NO_FOREACH ) +add_dependencies(Core Qt::moc) +add_dependencies(Core Qt::rcc) + configure_file(global/qconfig.cpp.in global/qconfig.cpp) # Handle QObject: Automoc does not work for this as it would diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 22f6ec4d349..7e02d7e19b3 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -65,6 +65,8 @@ add_qt_module(Widgets Qt::Gui ) +add_dependencies(Widgets Qt::uic) + ## Scopes: ##################################################################### # From 2ce3f440f9e53fc63c0dff63e2b6950a735f7cb1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Feb 2019 17:04:20 +0100 Subject: [PATCH 0122/1322] Allow passing libraries to qt_config_compile_test Fixes cxx11_future and ipc_posix tests Change-Id: I0f3a7b1a0452724c07198a87c2fc25344e7451eb Reviewed-by: Frederik Gladhorn Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 7 +++++-- src/corelib/configure.cmake | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index aa18b380a65..f13f8d477a5 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -385,9 +385,12 @@ function(qt_feature_module_end target) endfunction() function(qt_config_compile_test name) - cmake_parse_arguments(arg "" "LABEL" "" ${ARGN}) + cmake_parse_arguments(arg "" "LABEL" "LIBRARIES;CODE" ${ARGN}) - check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS}" HAVE_${name}) + set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}") + check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name}) + set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}") endfunction() diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 4c40aa1c281..2f5c543e56d 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -112,8 +112,13 @@ int pipes[2]; ") # cxx11_future +if (UNIX) + set(CXX11_FUTURE_TEST_LIBRARIES pthread) +endif() qt_config_compile_test(cxx11_future LABEL "C++11 " + LIBRARIES ${CXX11_FUTURE_TEST_LIBRARIES} + CODE " #include @@ -126,7 +131,7 @@ std::future f = std::async([]() { return 42; }); /* END TEST: */ return 0; } -"# FIXME: qmake: unix:LIBS += -lpthread +" ) # eventfd @@ -190,8 +195,13 @@ shmctl(0, 0, (struct shmid_ds *)(0)); ") # ipc_posix +if (LINUX) + set(IPC_POSIX_TEST_LIBRARIES pthread rt) +endif() qt_config_compile_test(ipc_posix LABEL "POSIX IPC" + LIBRARIES ${IPC_POSIX_TEST_LIBRARIES} + CODE " #include #include @@ -208,7 +218,7 @@ shm_unlink(\"test\"); /* END TEST: */ return 0; } -"# FIXME: qmake: linux: LIBS += -lpthread -lrt +" ) # linkat From 487adb4d7d527c0a7ba49c5d4d9c3d150af017c0 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Feb 2019 16:10:21 +0100 Subject: [PATCH 0123/1322] Add devicediscovery and fbconvenience Generated by pro2cmake.py Change-Id: I405430c622824aab9a7bf6839b2271a494856c24 Reviewed-by: Frederik Gladhorn --- src/platformsupport/CMakeLists.txt | 2 ++ .../devicediscovery/CMakeLists.txt | 35 +++++++++++++++++++ .../fbconvenience/CMakeLists.txt | 20 +++++++++++ 3 files changed, 57 insertions(+) create mode 100644 src/platformsupport/devicediscovery/CMakeLists.txt create mode 100644 src/platformsupport/fbconvenience/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index a86b958c105..eb5e81c3529 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -3,6 +3,8 @@ add_subdirectory(themes) add_subdirectory(edid) add_subdirectory(eventdispatchers) +add_subdirectory(devicediscovery) +add_subdirectory(fbconvenience) if(QT_FEATURE_freetype OR APPLE OR WIN32) add_subdirectory(fontdatabases) diff --git a/src/platformsupport/devicediscovery/CMakeLists.txt b/src/platformsupport/devicediscovery/CMakeLists.txt new file mode 100644 index 00000000000..3d419d084fa --- /dev/null +++ b/src/platformsupport/devicediscovery/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from devicediscovery.pro. + +##################################################################### +## DeviceDiscoverySupport Module: +##################################################################### + +add_qt_module(DeviceDiscoverySupport + STATIC + SOURCES + qdevicediscovery_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate +) + +## Scopes: +##################################################################### + +extend_target(DeviceDiscoverySupport CONDITION QT_FEATURE_libudev + SOURCES + qdevicediscovery_udev.cpp qdevicediscovery_udev_p.h + LIBRARIES + libudev +) + +extend_target(DeviceDiscoverySupport CONDITION QT_FEATURE_evdev AND NOT QT_FEATURE_libudev + SOURCES + qdevicediscovery_static.cpp qdevicediscovery_static_p.h +) + +extend_target(DeviceDiscoverySupport CONDITION NOT QT_FEATURE_evdev AND NOT QT_FEATURE_libudev + SOURCES + qdevicediscovery_dummy.cpp qdevicediscovery_dummy_p.h +) diff --git a/src/platformsupport/fbconvenience/CMakeLists.txt b/src/platformsupport/fbconvenience/CMakeLists.txt new file mode 100644 index 00000000000..ddb6dc99e30 --- /dev/null +++ b/src/platformsupport/fbconvenience/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from fbconvenience.pro. + +##################################################################### +## FbSupport Module: +##################################################################### + +add_qt_module(FbSupport + STATIC + SOURCES + qfbbackingstore.cpp qfbbackingstore_p.h + qfbcursor.cpp qfbcursor_p.h + qfbscreen.cpp qfbscreen_p.h + qfbvthandler.cpp qfbvthandler_p.h + qfbwindow.cpp qfbwindow_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) From c2511b629a8a90a63291aafc10bcf8d525dbcd37 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Feb 2019 17:14:14 +0100 Subject: [PATCH 0124/1322] Fix xlib compile test Change-Id: Ib7d58484ef2bd0f38d3954940e7e527b4f848c4b Reviewed-by: Frederik Gladhorn --- src/gui/configure.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 002d46c2728..dc23714de3e 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -411,6 +411,8 @@ glProgramUniform1i(0, 0, 0); # xlib qt_config_compile_test(xlib LABEL "XLib" + LIBRARIES X11::X11 + CODE " #include @@ -423,7 +425,7 @@ XCloseDisplay(d); /* END TEST: */ return 0; } -"# FIXME: qmake: CONFIG += x11 +" ) From 810c5be5be78a4e1960483c3f10c18df0e57367c Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Feb 2019 17:32:02 +0100 Subject: [PATCH 0125/1322] Fix xcb platform linking when compiling the nativepainting code Change-Id: I9bc435d27bf4abf1ff4cbfebb981ab701a5d17ec Reviewed-by: Frederik Gladhorn --- src/plugins/platforms/xcb/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 5540822875d..d0ec55c05bd 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -141,13 +141,15 @@ extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting INCLUDE_DIRECTORIES nativepainting/ ) -# -#extend_target(XcbQpa CONDITION (QT_FEATURE_xcb_native_painting) AND (QT_FEATURE_xrender) -#) + +extend_target(XcbQpa CONDITION (QT_FEATURE_xcb_native_painting) AND (QT_FEATURE_xrender) + LIBRARIES + X11::Xrender +) extend_target(XcbQpa CONDITION (QT_FEATURE_xcb_native_painting) AND (QT_FEATURE_fontconfig) LIBRARIES - freetype + Freetype::Freetype ) add_qt_plugin(qxcb From 25457f29db8b0321202afba25c3168c5ac9f9bbb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 16:18:06 +0100 Subject: [PATCH 0126/1322] CMake: pro2cmake.py: Add XCB and X11 libraries Add all the XCB and X11 libraries needed for the XCB plugin. Change-Id: I772b99c68521cd46cbba736912c8d8594d9d2ad8 Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/helper.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 872f968ba14..948392d925b 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -205,14 +205,34 @@ def substitute_platform(platform: str) -> str: libray_mapping = { - 'libdl': '${CMAKE_DL_LIBS}', 'doubleconversion': 'double-conversion', + 'freetype': 'Freetype::Freetype', 'glib': 'GLIB2::GLIB2', 'icu': 'ICU::i18n ICU::uc ICU::data', 'libatomic': 'Atomic', + 'libdl': '${CMAKE_DL_LIBS}', 'libproxy': 'LibProxy::LibProxy', - 'pcre2': 'PCRE2', 'librt': 'WrapRt', + 'pcre2': 'PCRE2', + 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', + 'xcb_icccm': 'XCB::ICCCM', + 'xcb_image': 'XCB::IMAGE', + 'xcb_keysyms': 'XCB::KEYSYMS', + 'xcb_randr': 'XCB::RANDR', + 'xcb_renderutil': 'XCB::RENDERUTIL', + 'xcb_render': 'XCB::RENDER', + 'xcb_shape': 'XCB::SHAPE', + 'xcb_shm': 'XCB::SHM', + 'xcb_sync': 'XCB::SYNC', + 'xcb': 'XCB::XCB', + 'xcb_xfixes': 'XCB::XFIXES', + 'xcb_xinerama': 'XCB::XINERAMA', + 'xcb_xinput': 'XCB::XINPUT', + 'xcb_xkb': 'XCB::XKB', + 'xcb_xlib': 'X11::XCB', + 'xkbcommon_x11': 'XKB::XKB', + 'xkbcommon': 'XKB::XKB', + 'xrender': 'XCB::RENDER', 'zlib': 'ZLIB::ZLIB', 'zstd': 'ZSTD::ZSTD', } From 73f5036be58c52ab0c8a101e5e34ea6de12b9a29 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 16:20:32 +0100 Subject: [PATCH 0127/1322] CMake: Map dlopen feature to 'ON' Map the dlopen feature to 'ON'. The effect is that cmake will figure out whether or not linking to 'dl' is necessary or not. The user-visible feature is 'library' anyway: That enables dynamic library loading -- and will link in 'dl' as needed. Change-Id: I0d68275a7234efba7f926150f120bb37b4a1163f Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/configurejson2cmake.py | 2 +- util/cmake/pro2cmake.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 03625da1a5c..770f7588a3e 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -276,7 +276,7 @@ def map_condition(condition): assert isinstance(condition, str) mapped_features = { - "dlopen": "UNIX", + "dlopen": "ON", 'gbm': 'gbm_FOUND', "system-xcb": "ON", "system-freetype": "ON", diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6d63461e0da..4f4303e3d18 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -603,6 +603,8 @@ def map_condition(condition: str) -> str: if feature.startswith('system_') and substitute_libs(feature[7:]) != feature[7:]: # Qt6 always uses system libraries! part = 'ON' + elif feature == 'dlopen': + part = 'ON' else: part = 'QT_FEATURE_' + feature else: From 64e3c8bb190b95ab4da581dc5667864d8f4a176c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 31 Jan 2019 14:26:06 +0100 Subject: [PATCH 0128/1322] CMake: pro2cmake: Fix handling of chained scopes with else branches Fix handling of things like: foo:bar:buz: { do something } else: wat { do something else } The else relates to foo AND bar AND buz, not just to buz in this case. Change-Id: I40d1fa295b4d6dd95ae5e1ce2d58372edc807b86 Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 4f4303e3d18..891e42003a8 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -288,6 +288,31 @@ class Scope(object): def currentdir(self) -> str: return self._currentdir + def can_merge_condition(self): + if self._condition == 'else': + return False + if self._operations: + return False + + child_count = len(self._children) + if child_count == 0 or child_count > 2: + return False + assert child_count != 1 or self._children[0]._condition != 'else' + return child_count == 1 or self._children[1]._condition == 'else' + + def settle_condition(self): + new_children: typing.List[scope] = [] + for c in self._children: + c.settle_condition() + + if c.can_merge_condition(): + child = c._children[0] + child._condition = '({}) AND ({})'.format(c._condition, child._condition) + new_children += c._children + else: + new_children.append(c) + self._children = new_children + @staticmethod def FromDict(parent_scope: typing.Optional['Scope'], file: str, statements, cond: str = '', base_dir: str = '') -> Scope: @@ -333,7 +358,7 @@ class Scope(object): else_statements = statement.get('else_statements') if else_statements: Scope.FromDict(scope, file, else_statements, - 'NOT ' + condition, scope.basedir) + 'else', scope.basedir) continue loaded = statement.get('loaded') @@ -355,6 +380,8 @@ class Scope(object): scope.currentdir))) continue + scope.settle_condition() + if scope.scope_debug: print('..... [SCOPE_DEBUG]: Created scope {}:'.format(scope)) scope.dump(indent=1) From 6104643db05607898f660bcbf84cebad440deef5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Feb 2019 15:26:31 +0100 Subject: [PATCH 0129/1322] CMake: pro2cmake.py: Remove leading ./ in paths Remove leading './' from paths before writing them into CMakeLists.txt. Change-Id: I5680a3470cf491a8805b559197f94f8e6a6ce9b7 Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 891e42003a8..5e93a21a029 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -86,7 +86,7 @@ def map_to_file(f: str, top_dir: str, current_dir: str, if f.startswith('$$QT_SOURCE_TREE'): return "${PROJECT_SOURCE_DIR}/" + f[17:] if f.startswith("./"): - return os.path.join(current_dir, f) + return os.path.join(current_dir, f) if current_dir != '.' else f[2:] if want_absolute_path and not os.path.isabs(f): return os.path.join(current_dir, f) return f @@ -98,6 +98,8 @@ def map_source_to_cmake(source: str, base_dir: str, return '' if source.startswith('$$PWD/'): return source[6:] + if source.startswith('./'): + return source[2:] if source == '.': return "${CMAKE_CURRENT_SOURCE_DIR}" if source.startswith('$$QT_SOURCE_TREE/'): From d796410045404436eb35cc14da6c36179d978cb5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Feb 2019 15:28:10 +0100 Subject: [PATCH 0130/1322] CMake: pro2cmake.py: Remove some dead code Change-Id: I8e3e7e4c4ef9747e0749734bdf875baccc4646bd Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5e93a21a029..da81294e3af 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -118,21 +118,6 @@ def map_source_to_cmake(source: str, base_dir: str, return '{}-NOTFOUND'.format(source) -def map_source_to_fs(base_dir: str, file: str, - source: str) -> str: - if source is None or source == '$$NO_PCH_SOURCES': - return '' - if source.startswith('$$PWD/'): - return os.path.join(os.path.dirname(file), source[6:]) - if source.startswith('$$QT_SOURCE_TREE/'): - return os.path.join('.', source[17:]) - if source.startswith('${PROJECT_SOURCE_DIR}/'): - return os.path.join('.', source[22:]) - if source.startswith('${CMAKE_CURRENT_SOURCE_DIR}/'): - return os.path.join(base_dir, source[28:]) - return os.path.join(base_dir, source) - - class Operation: def __init__(self, value): if isinstance(value, list): From 199cce0c20108e657d3b3555cdeacb76412fa28f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Feb 2019 15:28:49 +0100 Subject: [PATCH 0131/1322] CMake: pro2cmake.py: Better mapping of complex conditions .pro-files support things like contains(Foo, bar), etc. Map that in such a way that only one identifier will be visible to CMake to unconfuse the logic handling on that side. These conditions will need manual fixup later! Change-Id: Id4946e694a9adccf9f54bcce26a6c227cd921007 Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index da81294e3af..5c804826c42 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -588,11 +588,11 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: - re.sub(r'if\s*\((.*?)\)', r'\1', condition) - re.sub(r'(^|[^a-zA-Z0-9_])isEmpty\s*\((.*?)\)', r'\2_ISEMPTY', condition) - re.sub(r'(^|[^a-zA-Z0-9_])contains\s*\((.*?), (.*)?\)', - r'\2___contains___\3', condition) - re.sub(r'\s*==\s*', '___STREQUAL___', condition) + condition = re.sub(r'\bif\s*\((.*?)\)', r'\1', condition) + condition = re.sub(r'\bisEmpty\s*\((.*?)\)', r'\1_ISEMPTY', condition) + condition = re.sub(r'\bcontains\s*\((.*?), (.*)?\)', + r'\1___contains___\2', condition) + condition = re.sub(r'\s*==\s*', '___STREQUAL___', condition) condition = condition.replace('*', '_x_') condition = condition.replace('.$$', '__ss_') From 35a30c7ebbd50e8b5b1fad7c00bd6c36b0dca8b9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Feb 2019 15:30:44 +0100 Subject: [PATCH 0132/1322] CMake: pro2cmake.py: Expand qmake values in file names, etc. Expand qmake values when dealing with source file names, include directories and more. This handles cases where variables are used to refer to sources (e.g. $$VERSIONTAGGING_SOURCES in corelib) as well as things like $$QT_SOURCE_TREE and friends. Note that $$PWD and $$OUT_PWD are still need hand-holding since they refer to the scopes directory relative to the top level directory -- which pro2cmake.py does not know. Change-Id: I011ef55416ff820053d5f844b3008836849f5075 Reviewed-by: Albert Astals Cid Reviewed-by: Frederik Gladhorn --- util/cmake/pro2cmake.py | 64 +++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5c804826c42..9cd1b7a5424 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -77,14 +77,10 @@ def spaces(indent: int) -> str: def map_to_file(f: str, top_dir: str, current_dir: str, want_absolute_path: bool = False) -> typing.Optional[str]: - if f == '$$NO_PCH_SOURCES': - return None if f.startswith('$$PWD/') or f == '$$PWD': # INCLUDEPATH += $$PWD return os.path.join(os.path.relpath(current_dir, top_dir), f[6:]) if f.startswith('$$OUT_PWD/'): return "${CMAKE_CURRENT_BUILD_DIR}/" + f[10:] - if f.startswith('$$QT_SOURCE_TREE'): - return "${PROJECT_SOURCE_DIR}/" + f[17:] if f.startswith("./"): return os.path.join(current_dir, f) if current_dir != '.' else f[2:] if want_absolute_path and not os.path.isabs(f): @@ -102,8 +98,6 @@ def map_source_to_cmake(source: str, base_dir: str, return source[2:] if source == '.': return "${CMAKE_CURRENT_SOURCE_DIR}" - if source.startswith('$$QT_SOURCE_TREE/'): - return "${PROJECT_SOURCE_DIR}/" + source[17:] if os.path.exists(os.path.join(base_dir, source)): return source @@ -201,7 +195,10 @@ class Scope(object): parent_scope: typing.Optional[Scope], file: typing.Optional[str] = None, condition: str = '', base_dir: str = '', - operations: typing.Mapping[str, typing.List[Operation]] = {}) -> None: + operations: typing.Mapping[str, typing.List[Operation]] = { + 'QT_SOURCE_TREE': [SetOperation('${PROJECT_SOURCE_DIR}')], + 'QT_BUILD_TREE': [SetOperation('${PROJECT_BUILD_DIR}')], + }) -> None: if parent_scope: parent_scope._add_child(self) else: @@ -453,6 +450,33 @@ class Scope(object): assert len(v) == 1 return v[0] + def _expand_value(self, value: str) -> typing.List[str]: + result = value + pattern = re.compile(r'\$\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?') + match = re.search(pattern, result) + while match: + if match.group(0) == value: + return self.expand(match.group(1), '') + else: + result = result[:match.start()] \ + + self.expandString(match.group(1)) \ + + result[match.end():] + match = re.search(pattern, result) + return [result] + + def expand(self, key: str, default=None) -> typing.List[str]: + value = self.get(key, default) + result: typing.List[str] = [] + assert isinstance(value, list) + for v in value: + result += self._expand_value(v) + return result + + def expandString(self, key: str) -> str: + result = self._expand_value(self.getString(key)) + assert len(result) == 1 + return result[0] + @property def TEMPLATE(self) -> str: return self.getString('TEMPLATE', 'app') @@ -715,10 +739,10 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) - sources = scope.get('SOURCES') + scope.get('HEADERS') \ - + scope.get('OBJECTIVE_SOURCES') + scope.get('NO_PCH_SOURCES') \ - + scope.get('FORMS') - resources = scope.get('RESOURCES') + sources = scope.expand('SOURCES') + scope.expand('HEADERS') \ + + scope.expand('OBJECTIVE_SOURCES') + scope.expand('NO_PCH_SOURCES') \ + + scope.expand('FORMS') + resources = scope.expand('RESOURCES') if resources: qrc_only = True for r in resources: @@ -731,7 +755,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, else: sources += resources - vpath = scope.get('VPATH') + vpath = scope.expand('VPATH') sources = [map_source_to_cmake(s, scope.basedir, vpath) for s in sources] if sources: @@ -739,26 +763,27 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, for l in sort_sources(sources): cm_fh.write('{} {}\n'.format(ind, l)) - defines = scope.get('DEFINES') + defines = scope.expand('DEFINES') if defines: cm_fh.write('{} DEFINES\n'.format(ind)) for d in defines: d = d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') cm_fh.write('{} {}\n'.format(ind, d)) - includes = scope.get('INCLUDEPATH') + includes = scope.expand('INCLUDEPATH') if includes: cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) for i in includes: i = i.rstrip('/') or ('/') + i = map_source_to_cmake(i, scope.basedir, vpath) cm_fh.write('{} {}\n'.format(ind, i)) - dependencies = [map_qt_library(q) for q in scope.get('QT') + dependencies = [map_qt_library(q) for q in scope.expand('QT') if map_qt_library(q) not in known_libraries] - dependencies += [map_qt_library(q) for q in scope.get('QT_FOR_PRIVATE') + dependencies += [map_qt_library(q) for q in scope.expand('QT_FOR_PRIVATE') if map_qt_library(q) not in known_libraries] - dependencies += scope.get('QMAKE_USE_PRIVATE') + scope.get('QMAKE_USE') \ - + scope.get('LIBS_PRIVATE') + scope.get('LIBS') + dependencies += scope.expand('QMAKE_USE_PRIVATE') + scope.expand('QMAKE_USE') \ + + scope.expand('LIBS_PRIVATE') + scope.expand('LIBS') if dependencies: cm_fh.write('{} LIBRARIES\n'.format(ind)) is_framework = False @@ -807,7 +832,8 @@ def is_simple_condition(condition: str) -> bool: def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: result = '' for k in sorted(ignored_keys): - if k == '_INCLUDED' or k == 'TARGET' or k == 'QMAKE_DOCS': + if k == '_INCLUDED' or k == 'TARGET' or k == 'QMAKE_DOCS' or k == 'QT_SOURCE_TREE' \ + or k == 'QT_BUILD_TREE': # All these keys are actually reported already continue values = scope.get(k) From f88e78fd198c8bbc527da2e7426a010580f18c9f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 30 Jan 2019 10:36:45 +0100 Subject: [PATCH 0133/1322] test: Make qheaderview test build it's using deprecated reset() model that we don't support anymore since "this is Qt6", so include the 2 lines in the code. This makes for bad code but since it's a test and it used to work i guess it's good enough Change-Id: Ia906fe40359ddc0defb10795cf12a17498124983 Reviewed-by: Frederik Gladhorn --- tests/auto/widgets/itemviews/CMakeLists.txt | 2 +- .../auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/widgets/itemviews/CMakeLists.txt b/tests/auto/widgets/itemviews/CMakeLists.txt index a1bbf052e84..e7dc78b18c8 100644 --- a/tests/auto/widgets/itemviews/CMakeLists.txt +++ b/tests/auto/widgets/itemviews/CMakeLists.txt @@ -4,7 +4,7 @@ add_subdirectory(qabstractitemview) add_subdirectory(qdatawidgetmapper) add_subdirectory(qdirmodel) add_subdirectory(qfileiconprovider) -# add_subdirectory(qheaderview) ## FIXME: Fails to build! +add_subdirectory(qheaderview) add_subdirectory(qitemdelegate) add_subdirectory(qitemeditorfactory) add_subdirectory(qitemview) diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index b6932d48921..e51a9154011 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -85,7 +85,8 @@ class XResetModel : public QStandardItemModel blockSignals(true); bool r = QStandardItemModel::removeRows(row, count, parent); blockSignals(false); - emit reset(); + beginResetModel(); + endResetModel(); return r; } virtual bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) @@ -93,7 +94,8 @@ class XResetModel : public QStandardItemModel blockSignals(true); bool r = QStandardItemModel::insertRows(row, count, parent); blockSignals(false); - emit reset(); + beginResetModel(); + endResetModel(); return r; } }; From 622816499d964fb9214a7c3e5820526788b4c124 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Feb 2019 17:45:36 +0100 Subject: [PATCH 0134/1322] Add moc dependency also to CorePrivate Otherwise if you start a make -j14 in src/sql without having built anything it would hang because sql only depends on CorePrivate and not Core and thus moc would not be build at the right time Change-Id: I916242782e6aea4a0491d870391f91182959ca7c Reviewed-by: Tobias Hunger --- src/corelib/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 7e1a788e228..ce341ff811e 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -241,6 +241,8 @@ add_qt_module(Core add_dependencies(Core Qt::moc) add_dependencies(Core Qt::rcc) +add_dependencies(CorePrivate Qt::moc) +add_dependencies(CorePrivate Qt::rcc) configure_file(global/qconfig.cpp.in global/qconfig.cpp) From 9afca46e378ecee3a85e99086a89921f9d253f25 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 10:51:41 +0100 Subject: [PATCH 0135/1322] cmake: Fix linking of the egl_x11 test Change-Id: Id350e1cf85de67d1f27f6bfc94316bed115b377f Reviewed-by: Tobias Hunger --- src/gui/configure.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index dc23714de3e..f83ea7c3766 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -129,6 +129,8 @@ drmModeAtomicReq *request; # egl-x11 qt_config_compile_test(egl_x11 LABEL "EGL on X11" + LIBRARIES X11::X11 +CODE "// Check if EGL is compatible with X. Some EGL implementations, typically on // embedded devices, are not intended to be used together with X. EGL support // has to be disabled in plugins like xcb in this case since the native display, From 337ab23665752a6eb1437346adc40c6a68a31696 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 10:58:45 +0100 Subject: [PATCH 0136/1322] cmake: Fix linking of the libinput_axis_api test Change-Id: I7b70643e013b01d48f347bd5b3db9506793e46a4 Reviewed-by: Tobias Hunger --- src/gui/configure.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index f83ea7c3766..94801ba41ee 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -333,6 +333,8 @@ FBDriver *driver = 0; # libinput_axis_api qt_config_compile_test(libinput_axis_api LABEL "axis API in libinput" + LIBRARIES Libinput::Libinput + CODE " #include From ab2265cad7d3df48c73b02de33a9ddc8726d05b0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 09:57:59 +0100 Subject: [PATCH 0137/1322] Ignore cmake build directories that are typically in place Change-Id: Icc31c4ac348bd55af383626ff86cae91e695d274 Reviewed-by: Tobias Hunger --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 9461e0bb7b1..ebee7b81ab6 100644 --- a/.gitignore +++ b/.gitignore @@ -326,3 +326,6 @@ wrapper.bat # Generated by qt.prf *_plugin_import.cpp + +# Typical cmake build directories +/build* From 5682ca156c66032a605bee021319d49d7667aec0 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 11:19:15 +0100 Subject: [PATCH 0138/1322] cmake: Fix linking of the opengles tests The FindOpenGL.cmake file in cmake has a comment that is not very reassuring this should work, but it actually works for me Change-Id: I05b0ac6ec551252f8c58ab7abf4254d2d09a069c Reviewed-by: Simon Hausmann --- src/gui/configure.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 94801ba41ee..162e00ed1d8 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -373,6 +373,8 @@ ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); # opengles3 qt_config_compile_test(opengles3 LABEL "OpenGL ES 3.0" + LIBRARIES OpenGL::OpenGL + CODE "#ifdef __APPLE__ # include #else @@ -398,6 +400,8 @@ glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); # opengles31 qt_config_compile_test(opengles31 LABEL "OpenGL ES 3.1" + LIBRARIES OpenGL::OpenGL + CODE " #include From 6a4c7a82f87872c5dfc98881afc8c500d8afca03 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 11:16:16 +0100 Subject: [PATCH 0139/1322] Require cmake 3.14 proper It appears that the latest cmake provides 3.14 as a proper version. Change-Id: Ib0f0a1bbdd11e2129f25618b412015a2456aaba1 Reviewed-by: Albert Astals Cid --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7128d0d1ca..8975c090ed7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,4 @@ -cmake_minimum_required(VERSION 3.13.0) ## FIXME This is wrong we actually need pre-relase 3.14 - -CMAKE_POLICY(SET CMP0083 NEW) ## TODO Remove when we start requiring 3.14 in the line above +cmake_minimum_required(VERSION 3.14.0) project(QtBase VERSION 5.12.0 From 4a9d96cd919493f2cac1d370f77ded2aad0d006e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 11:20:58 +0100 Subject: [PATCH 0140/1322] Fix make install Pick up mkspecs/ from the top-level project (qtbase) directory Change-Id: I78c69f31219484cc7eaa408b0a7e3eeaa0ac6cf2 Reviewed-by: Albert Astals Cid --- qmake/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 0582613d82a..eb966b8018a 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,2 +1,2 @@ ## FIXME: Actually build something... -install(DIRECTORY mkspecs DESTINATION ${INSTALL_DATADIR}) +install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${INSTALL_DATADIR}) From b388bc7e770439d3842034010f41ff2f20326d40 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Feb 2019 11:36:00 +0100 Subject: [PATCH 0141/1322] CMake: pro2cmake.py: Handle equals(foo, bar) in conditions This adds an overly simplistic mapping -- just like it does for the rest of the qmake test functions. Change-Id: I0c9e3b70c1c3d0c68a245706a141aa7b7cb4d8bf Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9cd1b7a5424..04e76635c06 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -616,6 +616,8 @@ def map_condition(condition: str) -> str: condition = re.sub(r'\bisEmpty\s*\((.*?)\)', r'\1_ISEMPTY', condition) condition = re.sub(r'\bcontains\s*\((.*?), (.*)?\)', r'\1___contains___\2', condition) + condition = re.sub(r'\bequals\s*\((.*?), (.*)?\)', + r'\1___equals___\2', condition) condition = re.sub(r'\s*==\s*', '___STREQUAL___', condition) condition = condition.replace('*', '_x_') From 04ff8b5b6a5e8b940d1535a1302e47e2f6a0377c Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 11 Feb 2019 00:20:34 +0100 Subject: [PATCH 0142/1322] cmake: Do not rerun try_compile invocations Change-Id: I5eccf9f810d7ee55a311884bd5cf483f8086bae6 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index f13f8d477a5..7a0df69f9f1 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -396,6 +396,10 @@ endfunction() function(qt_config_compile_test_x86simd extension label) string(TOUPPER ${extension} extension_uppercase) + if (DEFINED TEST_X86SIMD_${extension}) + return() + endif() + try_compile(TEST_X86SIMD_${extension} "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/x86_simd/main.cpp" COMPILE_DEFINITIONS -DQT_COMPILER_SUPPORTS_${extension_uppercase} From 99e14037e2438a95c6ee332e76583bc9b91c19bc Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Sun, 10 Feb 2019 22:34:42 +0100 Subject: [PATCH 0143/1322] cmake: QtFeature add debugging aid Persist the target name in the CMake cache description Change-Id: I124a8b89e5845d12301993b0546c8d5c91b8d8bb Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 7a0df69f9f1..3d0f277b0eb 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -433,7 +433,7 @@ function(qt_make_features_available target) if (DEFINED "QT_FEATURE_${feature}") message(FATAL_ERROR "Feature ${feature} is already defined when importing features from ${target}.") endif() - set(QT_FEATURE_${feature} "${value}" CACHE INTERNAL "Qt feature: ${feature}") + set(QT_FEATURE_${feature} "${value}" CACHE INTERNAL "Qt feature: ${feature} (from target ${target})") endforeach() set(value OFF) endforeach() From 3e784f2be02ca868999597647ea9f6c2f1c36193 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 11:51:47 +0100 Subject: [PATCH 0144/1322] cmake: we need two different qmyserver names All the binaries now end up in bin/ and since the two qmyservers used for testing dbus have slightly different implementations we need both, so rename one to qmyserver_qdbusinterface Change-Id: I1db1aa8f96f35c6ca41254295e2477c35f915850 Reviewed-by: Kevin Funk --- tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt | 2 -- tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt index bbbe1e86335..81427017bd3 100644 --- a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt +++ b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt @@ -15,5 +15,3 @@ add_qt_executable(qmyserver_qdbusinterface Qt::Core Qt::DBus ) - -set_target_properties(qmyserver_qdbusinterface PROPERTIES OUTPUT_NAME qmyserver) diff --git a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp index 05480c6dd23..ca3b779fea1 100644 --- a/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp +++ b/tests/auto/dbus/qdbusinterface/tst_qdbusinterface.cpp @@ -270,7 +270,7 @@ void tst_QDBusInterface::initTestCase() # define EXE "" #endif proc.setProcessChannelMode(QProcess::ForwardedErrorChannel); - proc.start(QFINDTESTDATA("qmyserver/qmyserver" EXE)); + proc.start(QFINDTESTDATA("qmyserver/qmyserver_qdbusinterface" EXE)); // FIXME CMake: This is most probably wrong now since the binary ends up in bin/ not in the build tree QVERIFY2(proc.waitForStarted(), qPrintable(proc.errorString())); QVERIFY(proc.waitForReadyRead()); From 5716bcf6f7605827a23c7a71b281abe5974506d1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:00:30 +0100 Subject: [PATCH 0145/1322] cmake: we need to find for libudev not udev Change-Id: I36bac8c01d8de2b151c3d4d89607d26ac8add3d2 Reviewed-by: Simon Hausmann --- cmake/FindLibudev.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindLibudev.cmake b/cmake/FindLibudev.cmake index a36c81ff4a8..7eeb800e093 100644 --- a/cmake/FindLibudev.cmake +++ b/cmake/FindLibudev.cmake @@ -1,3 +1,3 @@ find_package(PkgConfig) -pkg_check_modules(Libudev udev IMPORTED_TARGET) +pkg_check_modules(Libudev libudev IMPORTED_TARGET) From 03d096d11a3b7b21c4b636368ac1d22d9c4e3f21 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 12:21:33 +0100 Subject: [PATCH 0146/1322] cmake: enable src/platformsupport/input Change-Id: Iafe75f55c579779d3d25a0147d993904622161fa Reviewed-by: Simon Hausmann --- src/platformsupport/CMakeLists.txt | 4 + src/platformsupport/input/CMakeLists.txt | 104 +++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 src/platformsupport/input/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index eb5e81c3529..e4b156bbbd0 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -14,6 +14,10 @@ if((UNIX AND (NOT uikit)) OR QT_FEATURE_xcb) add_subdirectory(services) endif() +if(QT_FEATURE_evdev OR QT_FEATURE_tslib OR QT_FEATURE_libinput OR QT_FEATURE_integrityhid) + add_subdirectory(input) +endif() + if(QT_FEATURE_accessibility) add_subdirectory(accessibility) if(QT_FEATURE_accessibility_atspi_bridge) diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt new file mode 100644 index 00000000000..c4aa6e1ccf7 --- /dev/null +++ b/src/platformsupport/input/CMakeLists.txt @@ -0,0 +1,104 @@ +# Generated from input.pro. + +find_package(Libinput) +set_package_properties(Libinput PROPERTIES TYPE OPTIONAL) + +find_package(XKB) +set_package_properties(XKB PROPERTIES TYPE OPTIONAL) + +##################################################################### +## InputSupport Module: +##################################################################### + +add_qt_module(InputSupport + STATIC + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::DeviceDiscoverySupportPrivate + # CONFIG = "static" "internal_module" + # MODULE = "input_support" + # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" + # _LOADED = "qt_module" +) + +## Scopes: +##################################################################### + +extend_target(InputSupport CONDITION QT_FEATURE_evdev + SOURCES + evdevkeyboard/qevdevkeyboard_defaultmap_p.h + evdevkeyboard/qevdevkeyboardhandler.cpp evdevkeyboard/qevdevkeyboardhandler_p.h + evdevkeyboard/qevdevkeyboardmanager.cpp evdevkeyboard/qevdevkeyboardmanager_p.h + evdevmouse/qevdevmousehandler.cpp evdevmouse/qevdevmousehandler_p.h + evdevmouse/qevdevmousemanager.cpp evdevmouse/qevdevmousemanager_p.h + evdevtouch/qevdevtouchhandler.cpp evdevtouch/qevdevtouchhandler_p.h + evdevtouch/qevdevtouchmanager.cpp evdevtouch/qevdevtouchmanager_p.h + INCLUDE_DIRECTORIES + evdevtouch/../shared +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_tabletevent + SOURCES + evdevtablet/qevdevtablethandler.cpp evdevtablet/qevdevtablethandler_p.h + evdevtablet/qevdevtabletmanager.cpp evdevtablet/qevdevtabletmanager_p.h +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_libudev AND QT_FEATURE_tabletevent + LIBRARIES + PkgConfig::Libudev +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_libudev + LIBRARIES + PkgConfig::Libudev +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_mtdev + LIBRARIES + mtdev +) + +extend_target(InputSupport CONDITION QT_FEATURE_tslib + SOURCES + tslib/qtslib.cpp tslib/qtslib_p.h + LIBRARIES + tslib +) + +extend_target(InputSupport CONDITION QT_FEATURE_libinput + SOURCES + libinput/qlibinputhandler.cpp libinput/qlibinputhandler_p.h + libinput/qlibinputkeyboard.cpp libinput/qlibinputkeyboard_p.h + libinput/qlibinputpointer.cpp libinput/qlibinputpointer_p.h + libinput/qlibinputtouch.cpp libinput/qlibinputtouch_p.h + INCLUDE_DIRECTORIES + libinput/../shared + LIBRARIES + PkgConfig::Libudev + Libinput::Libinput +) + +extend_target(InputSupport CONDITION QT_FEATURE_libinput AND QT_FEATURE_xkbcommon_evdev + LIBRARIES + XKB::XKB +) + +extend_target(InputSupport CONDITION QT_FEATURE_libinput AND NOT QT_FEATURE_xkbcommon_evdev + DEFINES + QT_NO_XKBCOMMON_EVDEV +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev OR QT_FEATURE_libinput + SOURCES + shared/qtouchoutputmapping.cpp shared/qtouchoutputmapping_p.h +) + +extend_target(InputSupport CONDITION QT_FEATURE_integrityhid + SOURCES + integrityhid/qintegrityhidmanager.cpp integrityhid/qintegrityhidmanager.h + LIBRARIES + integrityhid +) From 6b637d1afe73c38cc5f20db6e4e5d6c7f9357349 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:02:11 +0100 Subject: [PATCH 0147/1322] cmake: Use the proper libudev library Change-Id: I884756473a8c26a4ef17472aaaceb94509d3c72f Reviewed-by: Simon Hausmann --- src/platformsupport/devicediscovery/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/devicediscovery/CMakeLists.txt b/src/platformsupport/devicediscovery/CMakeLists.txt index 3d419d084fa..9cfbb073ca0 100644 --- a/src/platformsupport/devicediscovery/CMakeLists.txt +++ b/src/platformsupport/devicediscovery/CMakeLists.txt @@ -21,7 +21,7 @@ extend_target(DeviceDiscoverySupport CONDITION QT_FEATURE_libudev SOURCES qdevicediscovery_udev.cpp qdevicediscovery_udev_p.h LIBRARIES - libudev + PkgConfig::Libudev ) extend_target(DeviceDiscoverySupport CONDITION QT_FEATURE_evdev AND NOT QT_FEATURE_libudev From 8a1110f38812fdc1fbcf3290f2b8fb7f58718972 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:02:50 +0100 Subject: [PATCH 0148/1322] cmake: build kmsconvenience Change-Id: I3e1cdb4b9dd26a74262a183d8137ed2011a6e52d Reviewed-by: Simon Hausmann --- src/platformsupport/CMakeLists.txt | 4 ++++ .../kmsconvenience/CMakeLists.txt | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/platformsupport/kmsconvenience/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index e4b156bbbd0..62a18f35ec4 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -29,6 +29,10 @@ if(QT_FEATURE_vulkan) add_subdirectory(vkconvenience) endif() +if(QT_FEATURE_kms) + add_subdirectory(kmsconvenience) +endif() + if(APPLE) add_subdirectory(clipboard) add_subdirectory(graphics) diff --git a/src/platformsupport/kmsconvenience/CMakeLists.txt b/src/platformsupport/kmsconvenience/CMakeLists.txt new file mode 100644 index 00000000000..62ea0dbc4b4 --- /dev/null +++ b/src/platformsupport/kmsconvenience/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from kmsconvenience.pro. + +##################################################################### +## KmsSupport Module: +##################################################################### + +find_package(Libdrm) + +add_qt_module(KmsSupport + STATIC + SOURCES + qkmsdevice.cpp qkmsdevice_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Libdrm::Libdrm +) From 324bf0f34465773a0e4be484394d1fc98a90dc16 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:03:38 +0100 Subject: [PATCH 0149/1322] cmake: build linuxfb platform plugin Change-Id: I74c84ca410bdcf9c46828c5da903e241b2fa5d0d Reviewed-by: Simon Hausmann --- src/plugins/platforms/CMakeLists.txt | 4 ++ src/plugins/platforms/linuxfb/CMakeLists.txt | 44 ++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/plugins/platforms/linuxfb/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 0a01b80bc87..6992bd07118 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -2,6 +2,10 @@ if(QT_FEATURE_xcb) add_subdirectory(xcb) endif() +if(QT_FEATURE_linuxfb) + add_subdirectory(linuxfb) +endif() + if(APPLE) add_subdirectory(cocoa) endif(APPLE) diff --git a/src/plugins/platforms/linuxfb/CMakeLists.txt b/src/plugins/platforms/linuxfb/CMakeLists.txt new file mode 100644 index 00000000000..6c800835038 --- /dev/null +++ b/src/plugins/platforms/linuxfb/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from linuxfb.pro. + +##################################################################### +## qlinuxfb Plugin: +##################################################################### + +add_qt_plugin(qlinuxfb + TYPE platforms + SOURCES + main.cpp + qlinuxfbintegration.cpp qlinuxfbintegration.h + qlinuxfbscreen.cpp qlinuxfbscreen.h + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::ServiceSupportPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::FbSupportPrivate + # OTHER_FILES = "linuxfb.json" + # PLUGIN_CLASS_NAME = "QLinuxFbIntegrationPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qlinuxfb CONDITION TARGET Qt::InputSupportPrivate + LIBRARIES + Qt::InputSupportPrivate +) + +extend_target(qlinuxfb CONDITION TARGET Qt::KmsSupportPrivate + SOURCES + qlinuxfbdrmscreen.cpp qlinuxfbdrmscreen.h + LIBRARIES + Qt::KmsSupportPrivate +) +# +#extend_target(qlinuxfb CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) From 553254ba506f2e93313eac0ca2b130bfe81a3c7a Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:18:32 +0100 Subject: [PATCH 0150/1322] cmake: build eglconvenience Change-Id: Iba578190feb06953bfcba62978d2ba5b7ff35cb7 Reviewed-by: Simon Hausmann --- src/platformsupport/CMakeLists.txt | 4 ++ .../eglconvenience/CMakeLists.txt | 37 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/platformsupport/eglconvenience/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index 62a18f35ec4..ff817f446ab 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -33,6 +33,10 @@ if(QT_FEATURE_kms) add_subdirectory(kmsconvenience) endif() +if(QT_FEATURE_egl) + add_subdirectory(eglconvenience) +endif() + if(APPLE) add_subdirectory(clipboard) add_subdirectory(graphics) diff --git a/src/platformsupport/eglconvenience/CMakeLists.txt b/src/platformsupport/eglconvenience/CMakeLists.txt new file mode 100644 index 00000000000..2b20a9cb351 --- /dev/null +++ b/src/platformsupport/eglconvenience/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from eglconvenience.pro. + +find_package(OpenGL) + +##################################################################### +## EglSupport Module: +##################################################################### + +add_qt_module(EglSupport + STATIC + SOURCES + qeglconvenience.cpp qeglconvenience_p.h + qeglstreamconvenience.cpp qeglstreamconvenience_p.h + qt_egl_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + QT_EGL_NO_X11 + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + OpenGL::EGL + ${CMAKE_DL_LIBS} +) + +## Scopes: +##################################################################### + +extend_target(EglSupport CONDITION QT_FEATURE_opengl + SOURCES + qeglpbuffer.cpp qeglpbuffer_p.h + qeglplatformcontext.cpp qeglplatformcontext_p.h +) + +extend_target(EglSupport CONDITION QT_FEATURE_xlib + SOURCES + qxlibeglintegration.cpp qxlibeglintegration_p.h +) From ad312879b5c37ddcf86fcc51b2af3e34f26f6b4c Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:21:25 +0100 Subject: [PATCH 0151/1322] cmake: Build platformcompositor Change-Id: Ib9855e8ce0abddf5dce3408f10d3c2d32a2df937 Reviewed-by: Simon Hausmann --- src/platformsupport/CMakeLists.txt | 4 ++++ .../platformcompositor/CMakeLists.txt | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/platformsupport/platformcompositor/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index ff817f446ab..b4b5c8a8dc2 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -37,6 +37,10 @@ if(QT_FEATURE_egl) add_subdirectory(eglconvenience) endif() +if(QT_FEATURE_opengl) + add_subdirectory(platformcompositor) +endif() + if(APPLE) add_subdirectory(clipboard) add_subdirectory(graphics) diff --git a/src/platformsupport/platformcompositor/CMakeLists.txt b/src/platformsupport/platformcompositor/CMakeLists.txt new file mode 100644 index 00000000000..e6b7ab1f933 --- /dev/null +++ b/src/platformsupport/platformcompositor/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from platformcompositor.pro. + +##################################################################### +## PlatformCompositorSupport Module: +##################################################################### + +add_qt_module(PlatformCompositorSupport + STATIC + SOURCES + qopenglcompositor.cpp qopenglcompositor_p.h + qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate +) From 7edcdd7ac0ccf9b0433c78938b590d4e4321752a Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:30:29 +0100 Subject: [PATCH 0152/1322] cmake: build minimal platform plugin Change-Id: Icd80b33e2840ab1d34d2502bfdc3cb9116bdfba4 Reviewed-by: Simon Hausmann --- src/plugins/platforms/CMakeLists.txt | 4 +++ src/plugins/platforms/minimal/CMakeLists.txt | 37 ++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/plugins/platforms/minimal/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 6992bd07118..78a7cd4075c 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -1,3 +1,7 @@ +if (NOT ANDROID) + add_subdirectory(minimal) +endif() + if(QT_FEATURE_xcb) add_subdirectory(xcb) endif() diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt new file mode 100644 index 00000000000..12d5bdeab1e --- /dev/null +++ b/src/plugins/platforms/minimal/CMakeLists.txt @@ -0,0 +1,37 @@ +# Generated from minimal.pro. + +find_package(Freetype) + +##################################################################### +## qminimal Plugin: +##################################################################### + +add_qt_plugin(qminimal + TYPE platforms + SOURCES + main.cpp + qminimalbackingstore.cpp qminimalbackingstore.h + qminimalintegration.cpp qminimalintegration.h + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + # OTHER_FILES = "minimal.json" + # PLUGIN_CLASS_NAME = "QMinimalIntegrationPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qminimal CONDITION QT_FEATURE_freetype + LIBRARIES + Freetype::Freetype +) +# +#extend_target(qminimal CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) From beace29a573df43b242d611f94bbd23af4232797 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:46:33 +0100 Subject: [PATCH 0153/1322] cmake: build the offscreen platform plugin Change-Id: I6ccd430a2779fb889329cd411221c29b2601acfb Reviewed-by: Simon Hausmann --- src/plugins/platforms/CMakeLists.txt | 4 ++ .../platforms/offscreen/CMakeLists.txt | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/plugins/platforms/offscreen/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 78a7cd4075c..c3a3baef44b 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -2,6 +2,10 @@ if (NOT ANDROID) add_subdirectory(minimal) endif() +if (NOT ANDROID AND QT_FEATURE_freetype) + add_subdirectory(offscreen) +endif() + if(QT_FEATURE_xcb) add_subdirectory(xcb) endif() diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt new file mode 100644 index 00000000000..2a6baeff421 --- /dev/null +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from offscreen.pro. + +find_package(X11) + +##################################################################### +## qoffscreen Plugin: +##################################################################### + +add_qt_plugin(qoffscreen + TYPE platforms + SOURCES + main.cpp + qoffscreencommon.cpp qoffscreencommon.h + qoffscreenintegration.cpp qoffscreenintegration.h + qoffscreenwindow.cpp qoffscreenwindow.h + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + # OTHER_FILES = "offscreen.json" + # PLUGIN_CLASS_NAME = "QOffscreenIntegrationPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND NOT QT_FEATURE_opengles2 + SOURCES + qoffscreenintegration_x11.cpp qoffscreenintegration_x11.h + LIBRARIES + Qt::GlxSupportPrivate +) + +extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 AND QT_FEATURE_xlib + SOURCES + qoffscreenintegration_dummy.cpp +) +# +#extend_target(qoffscreen CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) From 8ee0cb04bd2c455151dd34b02d1d8a830021efd1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:23:40 +0100 Subject: [PATCH 0154/1322] cmake: build glxconvenience Change-Id: Iad09a86d11565665bb06d8d5d5616fc1b35ad777 Reviewed-by: Simon Hausmann --- src/platformsupport/CMakeLists.txt | 4 ++++ .../glxconvenience/CMakeLists.txt | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/platformsupport/glxconvenience/CMakeLists.txt diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index b4b5c8a8dc2..826cda39032 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -41,6 +41,10 @@ if(QT_FEATURE_opengl) add_subdirectory(platformcompositor) endif() +if (QT_FEATURE_xlib AND QT_FEATURE_opengl AND (NOT QT_FEATURE_opengles2)) + add_subdirectory(glxconvenience) +endif() + if(APPLE) add_subdirectory(clipboard) add_subdirectory(graphics) diff --git a/src/platformsupport/glxconvenience/CMakeLists.txt b/src/platformsupport/glxconvenience/CMakeLists.txt new file mode 100644 index 00000000000..022b6068339 --- /dev/null +++ b/src/platformsupport/glxconvenience/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from glxconvenience.pro. + +find_package(X11) +find_package(OpenGL) + +##################################################################### +## GlxSupport Module: +##################################################################### + +add_qt_module(GlxSupport + STATIC + SOURCES + qglxconvenience.cpp qglxconvenience_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + X11::X11 + OpenGL::GLX + # CONFIG = "static" "internal_module" + # MODULE = "glx_support" + # _LOADED = "qt_module" +) From a372783f66e14383e7e4d77842c006b5bc1065b6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 15:55:00 +0100 Subject: [PATCH 0155/1322] Fix linkage against freetype Target "XcbQpa" links to target "Freetype::Freetype" but the target was not There was indeed a find_package(Freetype) missing Change-Id: I486adbcf3b4ed0ae849a11294e2b83d2dc45d66f Reviewed-by: Albert Astals Cid --- src/plugins/platforms/xcb/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index d0ec55c05bd..434fc5e3cac 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -8,6 +8,7 @@ find_package(X11) find_package(XCB) find_package(XKB) find_package(PkgConfig) +find_package(Freetype) pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) From 6c8fb8aad89d3dfdf131ad4bf0ed9ef36f7f7cf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=A1=D0=B2=D0=B5?= =?UTF-8?q?=D1=82=D0=BA=D0=B8=D0=BD?= Date: Mon, 11 Feb 2019 14:12:07 +0100 Subject: [PATCH 0156/1322] cmake: Fix build widgets on macOS Change-Id: I9c7b7e1677f665861f8a106244468bdc0e1386f2 Reviewed-by: Liang Qi --- src/widgets/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 7e02d7e19b3..b3847f430a5 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -79,13 +79,13 @@ add_dependencies(Widgets Qt::uic) #extend_target(Widgets CONDITION APPLE_OSX #) -extend_target(Widgets CONDITION (APPLE_OSX) AND (macos) +extend_target(Widgets CONDITION APPLE_OSX LIBRARIES ${FWAppKit} z ) -extend_target(Widgets CONDITION ((APPLE_OSX) AND (macos)) AND (*-mwerks) +extend_target(Widgets CONDITION APPLE_OSX AND (*-mwerks) INCLUDE_DIRECTORIES compat ) @@ -114,7 +114,7 @@ extend_target(Widgets CONDITION QT_FEATURE_graphicseffect #extend_target(Widgets CONDITION testcocoon #) -extend_target(Widgets CONDITION macx +extend_target(Widgets CONDITION APPLE_OSX SOURCES kernel/qmacgesturerecognizer.cpp kernel/qmacgesturerecognizer_p.h ) @@ -377,13 +377,13 @@ extend_target(Widgets CONDITION QT_FEATURE_widgettextcontrol widgets/qwidgettextcontrol_p_p.h ) -extend_target(Widgets CONDITION macx +extend_target(Widgets CONDITION APPLE_OSX SOURCES widgets/qmaccocoaviewcontainer_mac.h widgets/qmaccocoaviewcontainer_mac.mm widgets/qmacnativewidget_mac.h widgets/qmacnativewidget_mac.mm ) -extend_target(Widgets CONDITION (macx) AND (QT_FEATURE_menu OR QT_FEATURE_menubar) +extend_target(Widgets CONDITION (APPLE_OSX) AND (QT_FEATURE_menu OR QT_FEATURE_menubar) SOURCES widgets/qmenu_mac.mm ) From 5ad3803defbfbf0ad7fbf62eac35844a1e5ef566 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 11 Feb 2019 14:37:49 +0100 Subject: [PATCH 0157/1322] cmake: fix harfbuzz target If doesn't build with harfbuzz::harfbuzz, please check harfbuzz-config.cmake in system. Latest harfbuzz has it. Change-Id: Idaaa77dc748ba2228b4e67e72a495bed93bc0192 Reviewed-by: Mikhail Svetkin Reviewed-by: Albert Astals Cid --- src/gui/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 60b5dec2df0..2aa13debc87 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -287,7 +287,7 @@ extend_target(Gui CONDITION QT_FEATURE_png extend_target(Gui CONDITION QT_FEATURE_harfbuzz SOURCES text/qharfbuzzng.cpp text/qharfbuzzng_p.h - LIBRARIES harfbuzz + LIBRARIES harfbuzz::harfbuzz ) extend_target(Gui CONDITION QT_FEATURE_textodfwriter From 6a2577e04be804585b1f103f6b0878ff88a8dcc9 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 16:42:51 +0100 Subject: [PATCH 0158/1322] cmake: don't die when running on macOS still same result for me on Linux Change-Id: Icb74ffc5989c0b96f069f6ec33c2a707e012414b Reviewed-by: Liang Qi --- src/gui/configure.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 162e00ed1d8..98eb8bba9d9 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -373,7 +373,7 @@ ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); # opengles3 qt_config_compile_test(opengles3 LABEL "OpenGL ES 3.0" - LIBRARIES OpenGL::OpenGL + LIBRARIES OpenGL::GL CODE "#ifdef __APPLE__ # include @@ -400,7 +400,7 @@ glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); # opengles31 qt_config_compile_test(opengles31 LABEL "OpenGL ES 3.1" - LIBRARIES OpenGL::OpenGL + LIBRARIES OpenGL::GL CODE " #include From 7830b72fd5c564c7e27cedef9b8f249ba3418ce8 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 11 Feb 2019 16:29:23 +0100 Subject: [PATCH 0159/1322] cmake: gui/vulkan: Generate files in correct dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is where headers.pri expects them Change-Id: If518704ae7bfcae3e898a0da61f9b1e6ae6effbb Reviewed-by: Jean-MichaĂ«l Celerier Reviewed-by: Tobias Hunger --- src/gui/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 2aa13debc87..64d39288bcd 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -458,10 +458,11 @@ if (QT_FEATURE_vulkan) add_custom_command( OUTPUT "${vulkan_fun}" "${vulkan_fun_p}" "${vulkan_fun_p_cpp}" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/vulkan/" COMMAND "${qvkgen_command}" "${CMAKE_CURRENT_SOURCE_DIR}/vulkan/vk.xml" "${PROJECT_SOURCE_DIR}/header.LGPL" - "${CMAKE_CURRENT_BINARY_DIR}/qvulkanfunctions" + "${CMAKE_CURRENT_BINARY_DIR}/vulkan/qvulkanfunctions" DEPENDS vulkan/vk.xml WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" COMMENT "Generating vulkan data" From 4ac0afb8bac58b4007fb1519be78d50f31c1ab90 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 14:59:27 +0100 Subject: [PATCH 0160/1322] cmake: build the minimalegl platform plugin Change-Id: I5c509efa30257be6ccc3455dd40bef3882b7e1da Reviewed-by: Liang Qi --- src/plugins/platforms/CMakeLists.txt | 4 ++ .../platforms/minimalegl/CMakeLists.txt | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/plugins/platforms/minimalegl/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index c3a3baef44b..907bab64f3e 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -10,6 +10,10 @@ if(QT_FEATURE_xcb) add_subdirectory(xcb) endif() +if(QT_FEATURE_eglfs) + add_subdirectory(minimalegl) +endif() + if(QT_FEATURE_linuxfb) add_subdirectory(linuxfb) endif() diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt new file mode 100644 index 00000000000..a038d07df95 --- /dev/null +++ b/src/plugins/platforms/minimalegl/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from minimalegl.pro. + +##################################################################### +## qminimalegl Plugin: +##################################################################### + +add_qt_plugin(qminimalegl + TYPE platforms + SOURCES + main.cpp + qminimaleglintegration.cpp qminimaleglintegration.h + qminimaleglscreen.cpp qminimaleglscreen.h + qminimaleglwindow.cpp qminimaleglwindow.h + DEFINES + QT_EGL_NO_X11 + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::EglSupportPrivate + # CONFIG = "egl" + # OTHER_FILES = "minimalegl.json" + # PLUGIN_CLASS_NAME = "QMinimalEglIntegrationPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qminimalegl CONDITION QT_FEATURE_opengl + SOURCES + qminimaleglbackingstore.cpp qminimaleglbackingstore.h +) +# +#extend_target(qminimalegl CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) From 6f5e8c8e180ee3db6e81de4a8b305800bb331d7d Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:09:04 +0100 Subject: [PATCH 0161/1322] cmake: Enable evdevmouse plugin Change-Id: I5c213a946d6127d635cd76bc827201e379e75aa9 Reviewed-by: Liang Qi --- src/plugins/CMakeLists.txt | 4 +++ src/plugins/generic/CMakeLists.txt | 27 +++++++++++++++++++ src/plugins/generic/evdevmouse/CMakeLists.txt | 19 +++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/plugins/generic/CMakeLists.txt create mode 100644 src/plugins/generic/evdevmouse/CMakeLists.txt diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 3d830bf979a..6ff444a333e 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,4 +1,8 @@ if(QT_FEATURE_gui) add_subdirectory(imageformats) add_subdirectory(platforms) + + if (NOT ANDROID AND QT_FEATURE_library) + add_subdirectory(generic) + endif() endif() diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt new file mode 100644 index 00000000000..69250ac4e8e --- /dev/null +++ b/src/plugins/generic/CMakeLists.txt @@ -0,0 +1,27 @@ + +if(QT_FEATURE_evdev) + add_subdirectory(evdevmouse) +# TODO add_subdirectory(evdevtouch) +# TODO add_subdirectory(evdevkeyboard) + + if(QT_FEATURE_tabletevent) +# TODO add_subdirectory(evdevtablet) + endif() +endif() + +if(QT_FEATURE_tslib) +# TODO add_subdirectory(tslib) +endif() + +if(QT_FEATURE_tuiotouch) +# TODO add_subdirectory(tuiotouch) +endif() + +if(QT_FEATURE_libinput) +# TODO add_subdirectory(libinput) +endif() + +if(FREEBSD) +# TODO add_subdirectory(bsdkeyboard) +# TODO add_subdirectory(bsdmouse) +endif() diff --git a/src/plugins/generic/evdevmouse/CMakeLists.txt b/src/plugins/generic/evdevmouse/CMakeLists.txt new file mode 100644 index 00000000000..686c4ab2e3c --- /dev/null +++ b/src/plugins/generic/evdevmouse/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from evdevmouse.pro. + +##################################################################### +## qevdevmouseplugin Plugin: +##################################################################### + +add_qt_plugin(qevdevmouseplugin + TYPE generic + SOURCES + main.cpp + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::InputSupportPrivate + # OTHER_FILES = "evdevmouse.json" + # PLUGIN_CLASS_NAME = "QEvdevMousePlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From 3e18790103a2bf5c23fe3afcbb3edb0e991514fe Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:10:27 +0100 Subject: [PATCH 0162/1322] cmake: enable evdevtouch plugin Change-Id: I7c8a7bd6ce79ca6823c0e517ef80c9418b91e552 Reviewed-by: Liang Qi --- src/plugins/generic/CMakeLists.txt | 2 +- src/plugins/generic/evdevtouch/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/plugins/generic/evdevtouch/CMakeLists.txt diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt index 69250ac4e8e..2dbbd0b99b8 100644 --- a/src/plugins/generic/CMakeLists.txt +++ b/src/plugins/generic/CMakeLists.txt @@ -1,7 +1,7 @@ if(QT_FEATURE_evdev) add_subdirectory(evdevmouse) -# TODO add_subdirectory(evdevtouch) + add_subdirectory(evdevtouch) # TODO add_subdirectory(evdevkeyboard) if(QT_FEATURE_tabletevent) diff --git a/src/plugins/generic/evdevtouch/CMakeLists.txt b/src/plugins/generic/evdevtouch/CMakeLists.txt new file mode 100644 index 00000000000..d29b82b01c7 --- /dev/null +++ b/src/plugins/generic/evdevtouch/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from evdevtouch.pro. + +##################################################################### +## qevdevtouchplugin Plugin: +##################################################################### + +add_qt_plugin(qevdevtouchplugin + TYPE generic + SOURCES + main.cpp + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::InputSupportPrivate + # OTHER_FILES = "evdevtouch.json" + # PLUGIN_CLASS_NAME = "QEvdevTouchScreenPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From db8e4077d177a0402a921bf3e2259b154423fbc6 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:11:22 +0100 Subject: [PATCH 0163/1322] cmake: Enable evdevkeyboard plugin Change-Id: I74b000ce657dbc0573f97a095391902917fe8f80 Reviewed-by: Liang Qi --- src/plugins/generic/CMakeLists.txt | 2 +- .../generic/evdevkeyboard/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/plugins/generic/evdevkeyboard/CMakeLists.txt diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt index 2dbbd0b99b8..39af90fb9ae 100644 --- a/src/plugins/generic/CMakeLists.txt +++ b/src/plugins/generic/CMakeLists.txt @@ -2,7 +2,7 @@ if(QT_FEATURE_evdev) add_subdirectory(evdevmouse) add_subdirectory(evdevtouch) -# TODO add_subdirectory(evdevkeyboard) + add_subdirectory(evdevkeyboard) if(QT_FEATURE_tabletevent) # TODO add_subdirectory(evdevtablet) diff --git a/src/plugins/generic/evdevkeyboard/CMakeLists.txt b/src/plugins/generic/evdevkeyboard/CMakeLists.txt new file mode 100644 index 00000000000..6b63d8825ff --- /dev/null +++ b/src/plugins/generic/evdevkeyboard/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from evdevkeyboard.pro. + +##################################################################### +## qevdevkeyboardplugin Plugin: +##################################################################### + +add_qt_plugin(qevdevkeyboardplugin + TYPE generic + SOURCES + main.cpp + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::InputSupportPrivate + # OTHER_FILES = "evdevkeyboard.json" + # PLUGIN_CLASS_NAME = "QEvdevKeyboardPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From 9dbcbeb1de09ed6495ca393b6db27aead61a5ff5 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:13:17 +0100 Subject: [PATCH 0164/1322] cmake: enable evdevtablet plugin Change-Id: Ia2d8c88b4c36c7c6e71a49f42398ebd0378239c1 Reviewed-by: Liang Qi --- src/plugins/generic/CMakeLists.txt | 2 +- .../generic/evdevtablet/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/plugins/generic/evdevtablet/CMakeLists.txt diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt index 39af90fb9ae..a7fbd1381c5 100644 --- a/src/plugins/generic/CMakeLists.txt +++ b/src/plugins/generic/CMakeLists.txt @@ -5,7 +5,7 @@ if(QT_FEATURE_evdev) add_subdirectory(evdevkeyboard) if(QT_FEATURE_tabletevent) -# TODO add_subdirectory(evdevtablet) + add_subdirectory(evdevtablet) endif() endif() diff --git a/src/plugins/generic/evdevtablet/CMakeLists.txt b/src/plugins/generic/evdevtablet/CMakeLists.txt new file mode 100644 index 00000000000..a402023e47f --- /dev/null +++ b/src/plugins/generic/evdevtablet/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from evdevtablet.pro. + +##################################################################### +## qevdevtabletplugin Plugin: +##################################################################### + +add_qt_plugin(qevdevtabletplugin + TYPE generic + SOURCES + main.cpp + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::InputSupportPrivate + # OTHER_FILES = "evdevtablet.json" + # PLUGIN_CLASS_NAME = "QEvdevTabletPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From a3506fd4df9b5f12b575a054ced0b3f37cdc26c1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:15:39 +0100 Subject: [PATCH 0165/1322] cmake: build the tuiotouch plugin Change-Id: I3e448fa8c21651a31429a87ee0b209eaea0fe1b1 Reviewed-by: Liang Qi --- src/plugins/generic/CMakeLists.txt | 2 +- src/plugins/generic/tuiotouch/CMakeLists.txt | 26 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/plugins/generic/tuiotouch/CMakeLists.txt diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt index a7fbd1381c5..011d226ad21 100644 --- a/src/plugins/generic/CMakeLists.txt +++ b/src/plugins/generic/CMakeLists.txt @@ -14,7 +14,7 @@ if(QT_FEATURE_tslib) endif() if(QT_FEATURE_tuiotouch) -# TODO add_subdirectory(tuiotouch) + add_subdirectory(tuiotouch) endif() if(QT_FEATURE_libinput) diff --git a/src/plugins/generic/tuiotouch/CMakeLists.txt b/src/plugins/generic/tuiotouch/CMakeLists.txt new file mode 100644 index 00000000000..189ff9eed22 --- /dev/null +++ b/src/plugins/generic/tuiotouch/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from tuiotouch.pro. + +##################################################################### +## qtuiotouchplugin Plugin: +##################################################################### + +add_qt_plugin(qtuiotouchplugin + TYPE generic + SOURCES + main.cpp + qoscbundle.cpp qoscbundle_p.h + qoscmessage.cpp qoscmessage_p.h + qtuiocursor_p.h + qtuiohandler.cpp qtuiohandler_p.h + qtuiotoken_p.h + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::Network + # OTHER_FILES = "tuiotouch.json" + # PLUGIN_CLASS_NAME = "QTuioTouchPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From 391ceb1d76cf414bc474a4e931232bc078701f54 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:17:40 +0100 Subject: [PATCH 0166/1322] cmake: build libinput plugin Change-Id: If263e6fa212f5349ad5e75252ff77ce0c92c5b75 Reviewed-by: Liang Qi --- src/plugins/generic/CMakeLists.txt | 2 +- src/plugins/generic/libinput/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/plugins/generic/libinput/CMakeLists.txt diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt index 011d226ad21..616e9406933 100644 --- a/src/plugins/generic/CMakeLists.txt +++ b/src/plugins/generic/CMakeLists.txt @@ -18,7 +18,7 @@ if(QT_FEATURE_tuiotouch) endif() if(QT_FEATURE_libinput) -# TODO add_subdirectory(libinput) + add_subdirectory(libinput) endif() if(FREEBSD) diff --git a/src/plugins/generic/libinput/CMakeLists.txt b/src/plugins/generic/libinput/CMakeLists.txt new file mode 100644 index 00000000000..e83029d8671 --- /dev/null +++ b/src/plugins/generic/libinput/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from libinput.pro. + +##################################################################### +## qlibinputplugin Plugin: +##################################################################### + +add_qt_plugin(qlibinputplugin + TYPE generic + SOURCES + main.cpp + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::InputSupportPrivate + # OTHER_FILES = "libinput.json" + # PLUGIN_CLASS_NAME = "QLibInputPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From 08cefb6e6316d9e16381f90eda5aedd8d2673b74 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 11 Feb 2019 17:22:56 +0100 Subject: [PATCH 0167/1322] cmake: build the offscreen platform plugin on macOS This amends beace29a573df43b242d611f94bbd23af4232797. Change-Id: I38fef70687f36d3b2ab4ff9cd001dc35cc79942d Reviewed-by: Albert Astals Cid --- src/plugins/platforms/offscreen/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index 2a6baeff421..d5bff05451c 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -35,7 +35,7 @@ extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND NOT Qt::GlxSupportPrivate ) -extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 AND QT_FEATURE_xlib +extend_target(qoffscreen CONDITION NOT QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR NOT QT_FEATURE_xlib SOURCES qoffscreenintegration_dummy.cpp ) From 082a7c4655acce06baf4e2bce43b281875ef3f68 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 11 Feb 2019 17:09:03 +0100 Subject: [PATCH 0168/1322] cmake: Parse SYNCQT.INJECTIONS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows to install headers such as QtCore/qtconfig.h, QtGui/qvulkanfunctions.h, etc. Change-Id: I93f384cdc8bbee07fab316d7e232aae1d209f33e Reviewed-by: Jean-MichaĂ«l Celerier Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ec14ad652dc..398d58b13f8 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -321,6 +321,30 @@ function(qt_internal_library_deprecation_level result) endfunction() +function(qt_install_injections module) + set(injections ${ARGN}) + # examples: + # SYNCQT.INJECTIONS = src/corelib/global/qconfig.h:qconfig.h:QtConfig src/corelib/global/qconfig_p.h:5.12.0/QtCore/private/qconfig_p.h + # SYNCQT.INJECTIONS = src/gui/vulkan/qvulkanfunctions.h:^qvulkanfunctions.h:QVulkanFunctions:QVulkanDeviceFunctions src/gui/vulkan/qvulkanfunctions_p.h:^5.12.0/QtGui/private/qvulkanfunctions_p.h + separate_arguments(injections UNIX_COMMAND "${injections}") + foreach(injection ${injections}) + string(REPLACE ":" ";" injection ${injection}) + list(GET injection 0 file) + list(GET injection 1 destination) + string(REGEX REPLACE "^\\^" "" destination "${destination}") + list(REMOVE_AT injection 0 1) + set(fwd_hdrs ${injection}) + get_filename_component(destinationdir ${destination} DIRECTORY) + get_filename_component(destinationname ${destination} NAME) + install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir} RENAME ${destinationname}) + foreach(fwd_hdr ${fwd_hdrs}) + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" CONTENT "#include \"${destinationname}\"\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir}) + endforeach() + endforeach() +endfunction() + + function(qt_read_headers_pri target resultVarPrefix) qt_internal_module_info(module "${target}") file(STRINGS "${module_include_dir}/headers.pri" headers_pri_contents) @@ -337,7 +361,8 @@ function(qt_read_headers_pri target resultVarPrefix) foreach(generated_header ${generated_module_headers}) list(APPEND public_module_headers "${module_include_dir}/${generated_header}") endforeach() - # Ignore INJECTIONS! + elseif("${line}" MATCHES "SYNCQT.INJECTIONS = (.*)") + set(injections "${CMAKE_MATCH_1}") elseif("${line}" MATCHES "SYNCQT.([A-Z_]+)_HEADER_FILES = (.+)") set(prefix "${CMAKE_MATCH_1}") string(TOLOWER "${prefix}" prefix) @@ -348,6 +373,7 @@ function(qt_read_headers_pri target resultVarPrefix) endforeach() set(${resultVarPrefix}_public "${public_module_headers}" PARENT_SCOPE) set(${resultVarPrefix}_private "${private_module_headers}" PARENT_SCOPE) + set(${resultVarPrefix}_injections "${injections}" PARENT_SCOPE) endfunction() @@ -416,6 +442,7 @@ function(add_qt_module target) set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_include_dir}/${module}Depends") set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") + qt_install_injections("${module}" ${module_headers_injections}) endif() set_target_properties("${target}" PROPERTIES From 92087db8f85f5131e3ac33b70eeb28bd8f62f491 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 15:02:05 +0100 Subject: [PATCH 0169/1322] Fix build of neon accelerated drawing helpers We must instruct cmake that we're interested in providing input files for the assembler directly and the file name needs to be correct, too :) Change-Id: I7cccb6ac66d28261ee71869991b14ac20c63050e Reviewed-by: Liang Qi --- CMakeLists.txt | 2 +- src/gui/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8975c090ed7..8946d55d834 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(QtBase VERSION 5.12.0 DESCRIPTION "Qt Base Libraries" HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX C + LANGUAGES CXX C ASM ) ## Add some paths to check for cmake modules: diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 64d39288bcd..e81e31ed89e 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -424,7 +424,7 @@ extend_target(Gui CONDITION QT_FEATURE_neon image/qimage_neon.cpp painting/qdrawhelper_neon.cpp painting/qdrawhelper_neon_p.h painting/qdrawhelper_mips_dspr2_asm.S - painting/qimagescale_neon.cpp painting/qimagescale_neon_asm.S + painting/qimagescale_neon.cpp painting/qdrawhelper_neon_asm.S ../3rdparty/pixman/pixman-arm-neon-asm.S COMPILE_FLAGS ${QT_CFLAGS_NEON} ) From c5697c85971ed76f8f89c3214d0f9a874fdb7350 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 15:21:41 +0100 Subject: [PATCH 0170/1322] Fix ARM build Don't try to build the MIPS draw helpers ;) Change-Id: If569aa41871d7e484e664382d71b8ef2b4025dce Reviewed-by: Liang Qi --- src/gui/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index e81e31ed89e..848ee3bb9ee 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -423,7 +423,6 @@ extend_target(Gui CONDITION QT_FEATURE_neon SOURCES image/qimage_neon.cpp painting/qdrawhelper_neon.cpp painting/qdrawhelper_neon_p.h - painting/qdrawhelper_mips_dspr2_asm.S painting/qimagescale_neon.cpp painting/qdrawhelper_neon_asm.S ../3rdparty/pixman/pixman-arm-neon-asm.S COMPILE_FLAGS ${QT_CFLAGS_NEON} From c5e2838b642d2a50d951efe7b582d9261d55dfb7 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 11 Feb 2019 11:34:35 +0100 Subject: [PATCH 0171/1322] cmake: Make find_package(Qt5 ...) work properly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a new cached variable INSTALL_CMAKE_NAMESPACE for defining the prefix used for CMake config files (c.f. "${PREFIX}Core/${PREFIX}CoreConfig.cmake") Also make sure to `find_dependency(...)` the required packages inside the individual CMake config files. I.e. in Qt5WidgetsConfig.cmake, search for Qt5Core, etc. pp.. Change-Id: Idc027925fe9d5323091c4853803ad5ce44b1afc6 Reviewed-by: Jean-MichaĂ«l Celerier Reviewed-by: Tobias Hunger --- cmake/QtBaseGlobalTargets.cmake | 27 +++++++++++---------------- cmake/QtBuild.cmake | 27 +++++++++++++++++++-------- cmake/QtConfig.cmake.in | 30 +++++++++++++++--------------- cmake/QtModuleConfig.cmake.in | 33 +++++++++++++++++++++++++++------ 4 files changed, 72 insertions(+), 45 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 714508ec7ce..fdc5271c046 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -1,34 +1,29 @@ -# Where QtBuild.cmake can find QtModuleConfig.cmake.in -set(Qt${PROJECT_VERSION_MAJOR}_DIR "${PROJECT_SOURCE_DIR}/cmake") - - ## QtPlatform Target: -set(name "Qt") -add_library("${name}" INTERFACE) -add_library("Qt::Platform" ALIAS "${name}") -target_include_directories("${name}" +add_library(Platform INTERFACE) +add_library(Qt::Platform ALIAS Platform) +target_include_directories(Platform INTERFACE $ $ $ $ ) -target_compile_definitions("${name}" INTERFACE ${QT_PLATFORM_DEFINITIONS}) -set(config_install_dir "${INSTALL_LIBDIR}/cmake/${name}${PROJECT_VERSION_MAJOR}") +target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS}) +set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}") configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" INSTALL_DESTINATION "${config_install_dir}" ) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}ConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/Qt${PROJECT_VERSION_MAJOR}ConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake" DESTINATION "${config_install_dir}" COMPONENT Devel ) @@ -63,8 +58,8 @@ target_include_directories(GlobalConfigPrivate INTERFACE ) add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) -install(TARGETS "${name}" GlobalConfig GlobalConfigPrivate EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets") -install(EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}") +install(TARGETS Platform GlobalConfig GlobalConfigPrivate EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") +install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}") ## Install some QtBase specific CMake files: install(FILES diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 398d58b13f8..a90d09564e8 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -36,6 +36,8 @@ set(INSTALL_SYSCONFDIR "etc/xdg" CACHE PATH set(INSTALL_EXAMPLESDIR "examples" CACHE PATH "Examples [PREFIX/examples]") set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]") +set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]") + # Platform define path, etc. if(WIN32) set(QT_DEFAULT_PLATFORM_DEFINITIONS UNICODE _UNICODE WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE) @@ -520,28 +522,37 @@ function(add_qt_module target) PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/private ) - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${module_versioned}") + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") install(EXPORT "${module_versioned}Targets" NAMESPACE Qt:: DESTINATION ${config_install_dir}) + set(target_deps) + foreach(lib ${arg_PUBLIC_LIBRARIES}) + if ("${lib}" MATCHES "^Qt::(Platform|GlobalConfig)") + list(APPEND target_deps "Qt5\;${PROJECT_VERSION}") + elseif ("${lib}" MATCHES "^Qt::") + string(REGEX REPLACE "^Qt::" "${INSTALL_CMAKE_NAMESPACE}" dep "${lib}") + list(APPEND target_deps "${dep}\;${PROJECT_VERSION}") + endif() + endforeach() configure_package_config_file( - "${Qt${PROJECT_VERSION_MAJOR}_DIR}/QtModuleConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}Config.cmake" + "${PROJECT_SOURCE_DIR}/cmake/QtModuleConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" INSTALL_DESTINATION "${config_install_dir}" ) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}ConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) set(extra_cmake_files) - if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${module_versioned}Macros.cmake") - list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${module_versioned}Macros.cmake") + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") + list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") endif() install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${module_versioned}ConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" ${extra_cmake_files} DESTINATION "${config_install_dir}" COMPONENT Devel diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index ad618b7accb..a65f7bd2be7 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -5,27 +5,27 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0) message(FATAL_ERROR "Qt requires at least CMake version 3.1.0") endif() -get_filename_component(_qt5_install_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) +get_filename_component(_qt_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) -include("${CMAKE_CURRENT_LIST_DIR}/Qt5Targets.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/Qt5ToolsTargets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@ToolsTargets.cmake") -# if (NOT Qt_FIND_COMPONENTS) -# set(Qt_NOT_FOUND_MESSAGE "The Qt package requires at least one component") -# set(Qt_FOUND False) +# if (NOT @INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS) +# set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "The Qt package requires at least one component") +# set(@INSTALL_CMAKE_NAMESPACE@_FOUND False) # return() # endif() -foreach(module ${Qt_FIND_COMPONENTS}) - find_package(Qt${module} - ${_Qt_FIND_PARTS_QUIET} - ${_Qt_FIND_PARTS_REQUIRED} - PATHS ${_qt_install_prefix} NO_DEFAULT_PATH +foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) + find_package(@INSTALL_CMAKE_NAMESPACE@${module} + ${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_QUIET} + ${_@INSTALL_CMAKE_NAMESPACE@_FIND_PARTS_REQUIRED} + PATHS ${_qt_cmake_dir} NO_DEFAULT_PATH ) - if (NOT Qt${module}_FOUND) + if (NOT @INSTALL_CMAKE_NAMESPACE@${module}_FOUND) string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY) - if (Qt_FIND_REQUIRED_${module}) + if (@INSTALL_CMAKE_NAMESPACE@_FIND_REQUIRED_${module}) set(_Qt_NOTFOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}Failed to find Qt component \"${module}\" config file at \"${_expected_module_location}\"\n") elseif(NOT Qt_FIND_QUIETLY) message(WARNING "Failed to find Qt component \"${module}\" config file at \"${_expected_module_location}\"") @@ -38,6 +38,6 @@ endforeach() set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) if (_Qt_NOTFOUND_MESSAGE) - set(Qt_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}") - set(Qt_FOUND False) + set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}") + set(@INSTALL_CMAKE_NAMESPACE@_FOUND False) endif() diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index e08c4ff87f8..e6a2d339830 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -1,13 +1,34 @@ @PACKAGE_INIT@ -find_package(Qt@PROJECT_VERSION_MAJOR@ QUIET) +include(CMakeFindDependencyMacro) -include("${CMAKE_CURRENT_LIST_DIR}/@module_versioned@Targets.cmake") +get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_import_prefix "${_import_prefix}" REALPATH) -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@module_versioned@Macros.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@module_versioned@Macros.cmake") +# note: target_deps example: "Qt5Core\;5.12.0;Qt5Gui\;5.12.0" +set(_target_deps "@target_deps@") +foreach(_target_dep ${_target_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + + if (NOT ${pkg}_FOUND) + find_dependency(${pkg} ${version} + PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH + ) + endif() + + if (NOT ${pkg}_FOUND) + set(@target@_FOUND FALSE) + return() + endif() +endforeach() + +include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") + +if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Macros.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Macros.cmake") endif() -include QtFeature +include(${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/QtFeature.cmake) -qt_make_features_available(Qt::@module@) +qt_make_features_available(Qt::@target@) From 2635ab01d28da1d2770c2090aa68ac7a01c070fd Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 11 Feb 2019 10:55:07 +0100 Subject: [PATCH 0172/1322] cmake: QtFeature: Do not error out when using Qt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... outside of qtbase.git Change-Id: I1895ef07c881766e2b28839d0422916b6916e10e Reviewed-by: Jean-MichaĂ«l Celerier Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 3d0f277b0eb..e57d541898f 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -430,8 +430,8 @@ function(qt_make_features_available target) continue() endif() foreach(feature IN ITEMS ${features}) - if (DEFINED "QT_FEATURE_${feature}") - message(FATAL_ERROR "Feature ${feature} is already defined when importing features from ${target}.") + if (DEFINED "QT_FEATURE_${feature}" AND NOT "${QT_FEATURE_${feature}}" STREQUAL "${value}") + message(FATAL_ERROR "Feature ${feature} is already defined and has a different value when importing features from ${target}.") endif() set(QT_FEATURE_${feature} "${value}" CACHE INTERNAL "Qt feature: ${feature} (from target ${target})") endforeach() From fffc12cc34812ceb8104e78534bb0be338727765 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Feb 2019 17:45:35 +0100 Subject: [PATCH 0173/1322] CMake: helper.py: Map harfbuzz library Change-Id: I71daa9acf391c70c6cba99609c1f67ca5eeaa220 Reviewed-by: Kevin Funk --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 948392d925b..16502fd2745 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -208,6 +208,7 @@ libray_mapping = { 'doubleconversion': 'double-conversion', 'freetype': 'Freetype::Freetype', 'glib': 'GLIB2::GLIB2', + 'harfbuzz': 'harfbuzz::harfbuzz', 'icu': 'ICU::i18n ICU::uc ICU::data', 'libatomic': 'Atomic', 'libdl': '${CMAKE_DL_LIBS}', From fb33efd2743933211455048aa111e4fc12e1e6a7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Feb 2019 17:46:31 +0100 Subject: [PATCH 0174/1322] CMake: pro2cmake.py: Do not go into infinite loop Do not go into an infinite loop when replacing a variable with itself. Change-Id: I2765b1c0c567753f26ca75e0533c1d193362b456 Reviewed-by: Kevin Funk --- util/cmake/pro2cmake.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 04e76635c06..13ee97cf00c 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -455,17 +455,24 @@ class Scope(object): pattern = re.compile(r'\$\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?') match = re.search(pattern, result) while match: + old_result = result if match.group(0) == value: - return self.expand(match.group(1), '') - else: - result = result[:match.start()] \ - + self.expandString(match.group(1)) \ - + result[match.end():] + return self.get(match.group(1), []) + + replacement = self.expand(match.group(1)) + replacement_str = replacement[0] if replacement else '' + result = result[:match.start()] \ + + replacement_str \ + + result[match.end():] + + if result == old_result: + return result # Do not go into infinite loop + match = re.search(pattern, result) return [result] - def expand(self, key: str, default=None) -> typing.List[str]: - value = self.get(key, default) + def expand(self, key: str) -> typing.List[str]: + value = self.get(key, []) result: typing.List[str] = [] assert isinstance(value, list) for v in value: From 93564b3f8be7506dbd9941ebc4fbdbf575f4beb4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Feb 2019 17:52:39 +0100 Subject: [PATCH 0175/1322] CMake: pro2cmake.py: Treat ANDROID_EMBEDDED as ANDROID Treat ANDROID_EMBEDDED as ANDROID when simplifying conditions. Change-Id: I2cf0ea1e1a3e882e3a7b7276867dcee452866ade Reviewed-by: Kevin Funk --- util/cmake/pro2cmake.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 13ee97cf00c..f18abcc81fb 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -943,6 +943,7 @@ def _recursive_simplify(expr): expr = _simplify_flavors_in_condition('APPLE', apples, expr) expr = _simplify_flavors_in_condition('BSD', bsds, expr) expr = _simplify_flavors_in_condition('UNIX', unixes, expr) + expr = _simplify_flavors_in_condition('ANDROID', ('ANDROID_EMBEDDED',), expr) # Now simplify further: expr = simplify_logic(expr) From f18db41f8586e60460649b4032cc8b6c01700441 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 15:47:04 +0100 Subject: [PATCH 0176/1322] cmake: Find tslib and build the tslib plugin if found Change-Id: I7119ddf473a3ede29bbfef23cffb08a4fcbd5681 Reviewed-by: Tobias Hunger --- cmake/FindTslib.cmake | 3 +++ src/gui/configure.cmake | 6 +++--- src/platformsupport/input/CMakeLists.txt | 5 ++++- src/plugins/generic/CMakeLists.txt | 2 +- src/plugins/generic/tslib/CMakeLists.txt | 19 +++++++++++++++++++ util/cmake/configurejson2cmake.py | 1 + 6 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 cmake/FindTslib.cmake create mode 100644 src/plugins/generic/tslib/CMakeLists.txt diff --git a/cmake/FindTslib.cmake b/cmake/FindTslib.cmake new file mode 100644 index 00000000000..979291a5f62 --- /dev/null +++ b/cmake/FindTslib.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) + +pkg_check_modules(Tslib tslib IMPORTED_TARGET) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 98eb8bba9d9..3d5db4aa657 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -54,6 +54,8 @@ find_package(JPEG) set_package_properties(JPEG PROPERTIES TYPE OPTIONAL) find_package(PNG) set_package_properties(PNG PROPERTIES TYPE OPTIONAL) +find_package(Tslib) +set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) find_package(Vulkan) set_package_properties(Vulkan PROPERTIES TYPE OPTIONAL) find_package(Wayland) @@ -436,8 +438,6 @@ XCloseDisplay(d); " ) - - #### Features qt_feature("accessibility_atspi_bridge" PUBLIC PRIVATE @@ -691,7 +691,7 @@ qt_feature("sessionmanager" PUBLIC qt_feature_definition("sessionmanager" "QT_NO_SESSIONMANAGER" NEGATE VALUE "1") qt_feature("tslib" PRIVATE LABEL "tslib" - CONDITION libs.tslib OR FIXME + CONDITION Tslib_FOUND ) qt_feature("tuiotouch" PRIVATE LABEL "TuioTouch" diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt index c4aa6e1ccf7..dc5b25c9ce9 100644 --- a/src/platformsupport/input/CMakeLists.txt +++ b/src/platformsupport/input/CMakeLists.txt @@ -6,6 +6,9 @@ set_package_properties(Libinput PROPERTIES TYPE OPTIONAL) find_package(XKB) set_package_properties(XKB PROPERTIES TYPE OPTIONAL) +find_package(Tslib) +set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) + ##################################################################### ## InputSupport Module: ##################################################################### @@ -65,7 +68,7 @@ extend_target(InputSupport CONDITION QT_FEATURE_tslib SOURCES tslib/qtslib.cpp tslib/qtslib_p.h LIBRARIES - tslib + PkgConfig::Tslib ) extend_target(InputSupport CONDITION QT_FEATURE_libinput diff --git a/src/plugins/generic/CMakeLists.txt b/src/plugins/generic/CMakeLists.txt index 616e9406933..8fa648006ac 100644 --- a/src/plugins/generic/CMakeLists.txt +++ b/src/plugins/generic/CMakeLists.txt @@ -10,7 +10,7 @@ if(QT_FEATURE_evdev) endif() if(QT_FEATURE_tslib) -# TODO add_subdirectory(tslib) + add_subdirectory(tslib) endif() if(QT_FEATURE_tuiotouch) diff --git a/src/plugins/generic/tslib/CMakeLists.txt b/src/plugins/generic/tslib/CMakeLists.txt new file mode 100644 index 00000000000..33ee2a9564a --- /dev/null +++ b/src/plugins/generic/tslib/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from tslib.pro. + +##################################################################### +## qtslibplugin Plugin: +##################################################################### + +add_qt_plugin(qtslibplugin + TYPE generic + SOURCES + main.cpp + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::InputSupportPrivate + # OTHER_FILES = "tslib.json" + # PLUGIN_CLASS_NAME = "QTsLibPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 770f7588a3e..c26a90d4f59 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -78,6 +78,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'pps': 'PPS', 'slog2': 'Slog2', 'sun_iconv': None, + 'tslib': 'Tslib', 'udev': 'Libudev', 'vulkan': 'Vulkan', 'wayland_server': 'Wayland', From 3726b58d3b7c595291c8a3f22ee518dffc382950 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Feb 2019 17:53:54 +0100 Subject: [PATCH 0177/1322] CMake: pro2cmake.py: Simplify condition generation There is no need to try and avoid extra () and NOTs: Those will be removed by sympy later anyway. Change-Id: I39d3e4d1d829579e532bfbbf6c69e0f1e06e9a22 Reviewed-by: Kevin Funk --- util/cmake/pro2cmake.py | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index f18abcc81fb..90c36fc57c7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1000,29 +1000,13 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', if total_condition == 'else': assert previous_condition, \ "Else branch without previous condition in: %s" % scope.file - if previous_condition.startswith('NOT '): - total_condition = previous_condition[4:] - elif is_simple_condition(previous_condition): - total_condition = 'NOT {}'.format(previous_condition) - else: - total_condition = 'NOT ({})'.format(previous_condition) + total_condition = 'NOT ({})'.format(previous_condition) if parent_condition: if not total_condition: total_condition = parent_condition else: - if is_simple_condition(parent_condition) \ - and is_simple_condition(total_condition): - total_condition = '{} AND {}'.format(parent_condition, + total_condition = '({}) AND ({})'.format(parent_condition, total_condition) - elif is_simple_condition(total_condition): - total_condition = '({}) AND {}'.format(parent_condition, - total_condition) - elif is_simple_condition(parent_condition): - total_condition = '{} AND ({})'.format(parent_condition, - total_condition) - else: - total_condition = '({}) AND ({})'.format(parent_condition, - total_condition) scope.total_condition = simplify_condition(total_condition) From ac96d08b9d0900a8e368c2e72c86190335480911 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 16:27:26 +0100 Subject: [PATCH 0178/1322] cmake: find gtk3 and build the gtk3 platformtheme Change-Id: I7db7321a2fd5ea0eda1924f3dece3b1c86d87d10 Reviewed-by: Tobias Hunger --- cmake/FindGTK3.cmake | 3 ++ src/plugins/CMakeLists.txt | 1 + src/plugins/platformthemes/CMakeLists.txt | 10 +++++++ .../platformthemes/gtk3/CMakeLists.txt | 29 +++++++++++++++++++ src/widgets/configure.cmake | 4 ++- util/cmake/configurejson2cmake.py | 1 + 6 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 cmake/FindGTK3.cmake create mode 100644 src/plugins/platformthemes/CMakeLists.txt create mode 100644 src/plugins/platformthemes/gtk3/CMakeLists.txt diff --git a/cmake/FindGTK3.cmake b/cmake/FindGTK3.cmake new file mode 100644 index 00000000000..f4476c167b7 --- /dev/null +++ b/cmake/FindGTK3.cmake @@ -0,0 +1,3 @@ +include(FindPkgConfig) + +pkg_check_modules(GTK3 "gtk+-3.0 >= 3.6" IMPORTED_TARGET) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 6ff444a333e..49a3e45b963 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,6 +1,7 @@ if(QT_FEATURE_gui) add_subdirectory(imageformats) add_subdirectory(platforms) + add_subdirectory(platformthemes) if (NOT ANDROID AND QT_FEATURE_library) add_subdirectory(generic) diff --git a/src/plugins/platformthemes/CMakeLists.txt b/src/plugins/platformthemes/CMakeLists.txt new file mode 100644 index 00000000000..5c65be8ce73 --- /dev/null +++ b/src/plugins/platformthemes/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from platformthemes.pro. + +if (QT_FEATURE_dbus AND QT_FEATURE_regularexpression) +# TODO add_subdirectory(xdgdesktopportal) +endif() + +if (QT_FEATURE_widgets AND QT_FEATURE_gtk3) + add_subdirectory(gtk3) +endif() + diff --git a/src/plugins/platformthemes/gtk3/CMakeLists.txt b/src/plugins/platformthemes/gtk3/CMakeLists.txt new file mode 100644 index 00000000000..18bf5629701 --- /dev/null +++ b/src/plugins/platformthemes/gtk3/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from gtk3.pro. + +find_package(GTK3) +find_package(X11) + +##################################################################### +## qgtk3 Plugin: +##################################################################### + +add_qt_plugin(qgtk3 + TYPE platformthemes + SOURCES + main.cpp + qgtk3dialoghelpers.cpp qgtk3dialoghelpers.h + qgtk3menu.cpp qgtk3menu.h + qgtk3theme.cpp qgtk3theme.h + DEFINES + GDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_6 + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::ThemeSupportPrivate + PkgConfig::GTK3 + X11::X11 + # CONFIG = "X11" + # PLUGIN_CLASS_NAME = "QGtk3ThemePlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake index 2c828a67114..f703a03b79f 100644 --- a/src/widgets/configure.cmake +++ b/src/widgets/configure.cmake @@ -6,6 +6,8 @@ #### Libraries +find_package(GTK3) +set_package_properties(GTK3 PROPERTIES TYPE OPTIONAL) #### Tests @@ -17,7 +19,7 @@ qt_feature("gtk3" PRIVATE LABEL "GTK+" AUTODETECT NOT APPLE - CONDITION QT_FEATURE_glib AND libs.gtk3 OR FIXME + CONDITION QT_FEATURE_glib AND GTK3_FOUND ) qt_feature("style_fusion" PRIVATE LABEL "Fusion" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index c26a90d4f59..2d635e0c8a2 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -57,6 +57,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'gbm': 'gbm', 'glib': 'GLIB2', 'gnu_iconv': None, + 'gtk3': 'GTK3', 'harfbuzz': 'harfbuzz', 'host_dbus': None, 'icu': ['ICU', 'COMPONENTS', 'i18n', 'uc', 'data'], From 8927c4de7072741a8a602857e6e062aa35ae0ecb Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 16:30:17 +0100 Subject: [PATCH 0179/1322] cmake: enable the xdgdesktopportal plugin Change-Id: I97454ea918e3b34ca8a33bf221bcf9a0f5fa56f8 Reviewed-by: Liang Qi --- src/plugins/platformthemes/CMakeLists.txt | 2 +- .../xdgdesktopportal/CMakeLists.txt | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt diff --git a/src/plugins/platformthemes/CMakeLists.txt b/src/plugins/platformthemes/CMakeLists.txt index 5c65be8ce73..8550a806526 100644 --- a/src/plugins/platformthemes/CMakeLists.txt +++ b/src/plugins/platformthemes/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from platformthemes.pro. if (QT_FEATURE_dbus AND QT_FEATURE_regularexpression) -# TODO add_subdirectory(xdgdesktopportal) + add_subdirectory(xdgdesktopportal) endif() if (QT_FEATURE_widgets AND QT_FEATURE_gtk3) diff --git a/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt b/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt new file mode 100644 index 00000000000..59e555cde04 --- /dev/null +++ b/src/plugins/platformthemes/xdgdesktopportal/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from xdgdesktopportal.pro. + +##################################################################### +## qxdgdesktopportal Plugin: +##################################################################### + +add_qt_plugin(qxdgdesktopportal + TYPE platformthemes + SOURCES + main.cpp + qxdgdesktopportalfiledialog.cpp qxdgdesktopportalfiledialog_p.h + qxdgdesktopportaltheme.cpp qxdgdesktopportaltheme.h + LIBRARIES + Qt::CorePrivate + Qt::DBus + Qt::GuiPrivate + Qt::ThemeSupportPrivate + # PLUGIN_CLASS_NAME = "QXdgDesktopPortalThemePlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From dee2413bfca7fd09de633b4bebe49512193261e1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 16:57:58 +0100 Subject: [PATCH 0180/1322] cmake: build the ibus plugin Change-Id: Ib2846204cc89b538ffe3b2282f7890f3de6ef33d Reviewed-by: Liang Qi --- src/plugins/CMakeLists.txt | 1 + .../platforminputcontexts/CMakeLists.txt | 10 ++++++++ .../platforminputcontexts/ibus/CMakeLists.txt | 23 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 src/plugins/platforminputcontexts/CMakeLists.txt create mode 100644 src/plugins/platforminputcontexts/ibus/CMakeLists.txt diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 49a3e45b963..4455672660e 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -2,6 +2,7 @@ if(QT_FEATURE_gui) add_subdirectory(imageformats) add_subdirectory(platforms) add_subdirectory(platformthemes) + add_subdirectory(platforminputcontexts) if (NOT ANDROID AND QT_FEATURE_library) add_subdirectory(generic) diff --git a/src/plugins/platforminputcontexts/CMakeLists.txt b/src/plugins/platforminputcontexts/CMakeLists.txt new file mode 100644 index 00000000000..4fb2bb9b637 --- /dev/null +++ b/src/plugins/platforminputcontexts/CMakeLists.txt @@ -0,0 +1,10 @@ + +if(QT_FEATURE_dbus AND (NOT APPLE_OSX) AND (NOT WIN32)) + add_subdirectory(ibus) +endif() + +if(QT_FEATURE_xcb) +# TODO add_subdirectory(compose) +endif() + + diff --git a/src/plugins/platforminputcontexts/ibus/CMakeLists.txt b/src/plugins/platforminputcontexts/ibus/CMakeLists.txt new file mode 100644 index 00000000000..3f79d805786 --- /dev/null +++ b/src/plugins/platforminputcontexts/ibus/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from ibus.pro. + +##################################################################### +## ibusplatforminputcontextplugin Plugin: +##################################################################### + +add_qt_plugin(ibusplatforminputcontextplugin + TYPE platforminputcontexts + SOURCES + main.cpp + qibusinputcontextproxy.cpp qibusinputcontextproxy.h + qibusplatforminputcontext.cpp qibusplatforminputcontext.h + qibusproxy.cpp qibusproxy.h + qibusproxyportal.cpp qibusproxyportal.h + qibustypes.cpp qibustypes.h + LIBRARIES + Qt::DBus + Qt::GuiPrivate + # OTHER_FILES = "$$PWD/ibus.json" + # PLUGIN_CLASS_NAME = "QIbusPlatformInputContextPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From d6aed4b3d05a59464930ff7703665af2fec9bb4f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 17:13:41 +0100 Subject: [PATCH 0181/1322] cmake: enable the compose plugin Change-Id: I0201b37531f7ba7380b2ca2f221283dda9a601a0 Reviewed-by: Liang Qi Reviewed-by: Tobias Hunger --- .../platforminputcontexts/CMakeLists.txt | 2 +- .../compose/CMakeLists.txt | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforminputcontexts/compose/CMakeLists.txt diff --git a/src/plugins/platforminputcontexts/CMakeLists.txt b/src/plugins/platforminputcontexts/CMakeLists.txt index 4fb2bb9b637..c8baf76f95d 100644 --- a/src/plugins/platforminputcontexts/CMakeLists.txt +++ b/src/plugins/platforminputcontexts/CMakeLists.txt @@ -4,7 +4,7 @@ if(QT_FEATURE_dbus AND (NOT APPLE_OSX) AND (NOT WIN32)) endif() if(QT_FEATURE_xcb) -# TODO add_subdirectory(compose) + add_subdirectory(compose) endif() diff --git a/src/plugins/platforminputcontexts/compose/CMakeLists.txt b/src/plugins/platforminputcontexts/compose/CMakeLists.txt new file mode 100644 index 00000000000..ccb5641e849 --- /dev/null +++ b/src/plugins/platforminputcontexts/compose/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from compose.pro. + +find_package(XKB) + +pkg_get_variable(PKG_X11_PREFIX x11 prefix) + +##################################################################### +## composeplatforminputcontextplugin Plugin: +##################################################################### + +add_qt_plugin(composeplatforminputcontextplugin + TYPE platforminputcontexts + SOURCES + generator/qtablegenerator.cpp generator/qtablegenerator.h + qcomposeplatforminputcontext.cpp qcomposeplatforminputcontext.h + qcomposeplatforminputcontextmain.cpp + DEFINES + X11_PREFIX="${PKG_X11_PREFIX}" + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + XKB::XKB + # OTHER_FILES = "$$PWD/compose.json" + # PLUGIN_CLASS_NAME = "QComposePlatformInputContextPlugin" + # PLUGIN_EXTENDS = "-" + # _LOADED = "qt_plugin" +) From f9b78445a93519cf0d2d7bd40c2f8608d86a8606 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 11 Feb 2019 18:07:12 +0100 Subject: [PATCH 0182/1322] cmake: Fixup paths to qvulkan* files Change-Id: Ifbd28e696c3cf64e008fa4617750b79f37ff1f8c Reviewed-by: Albert Astals Cid --- src/gui/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 848ee3bb9ee..b2520f5e066 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -456,7 +456,7 @@ if (QT_FEATURE_vulkan) set(vulkan_fun_p_cpp "qvulkanfunctions_p.cpp") add_custom_command( - OUTPUT "${vulkan_fun}" "${vulkan_fun_p}" "${vulkan_fun_p_cpp}" + OUTPUT "vulkan/${vulkan_fun}" "vulkan/${vulkan_fun_p}" "vulkan/${vulkan_fun_p_cpp}" COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/vulkan/" COMMAND "${qvkgen_command}" "${CMAKE_CURRENT_SOURCE_DIR}/vulkan/vk.xml" @@ -467,16 +467,16 @@ if (QT_FEATURE_vulkan) COMMENT "Generating vulkan data" ) - qt_generate_forwarding_headers("Gui" SOURCE "${vulkan_fun}" - DESTINATION qvulkanfunctions.h + qt_generate_forwarding_headers("Gui" SOURCE "vulkan/${vulkan_fun}" + DESTINATION "qvulkanfunctions.h" CLASSES QVulkanFunctions QVulkanDeviceFunctions ) - qt_generate_forwarding_headers("Gui" SOURCE "${vulkan_fun_p}" - DESTINATION qvulkanfunctions_p.h PRIVATE + qt_generate_forwarding_headers("Gui" SOURCE "vulkan/${vulkan_fun_p}" + DESTINATION "qvulkanfunctions_p.h" PRIVATE ) extend_target(Gui CONDITION QT_FEATURE_vulkan - SOURCES "${vulkan_fun}" "${vulkan_fun_p}" "${vulkan_fun_p_cpp}" + SOURCES "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun}" "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p}" "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p_cpp}" LIBRARIES Vulkan::Vulkan ) endif() From 8d05d88ab94c9d811c84683c512c2d704ac56a8e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 17:55:32 +0100 Subject: [PATCH 0183/1322] cmake: imageformats plugin needs an if guard And add TODO for all the other missing plugins Change-Id: Ic1d3cb7398198aea37ccb4ed6c16fc64e454036a Reviewed-by: Liang Qi --- src/plugins/CMakeLists.txt | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 4455672660e..acea77a60a8 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,10 +1,28 @@ + +if (QT_FEATURE_sql) +# TODO add_subdirectory(sqldrivers) +endif() + +if(QT_FEATURE_network AND QT_FEATURE_bearermanagement) +# TODO add_subdirectory(bearer) +endif() + if(QT_FEATURE_gui) - add_subdirectory(imageformats) add_subdirectory(platforms) add_subdirectory(platformthemes) add_subdirectory(platforminputcontexts) - + if (QT_FEATURE_imageformatplugin) + add_subdirectory(imageformats) + endif() if (NOT ANDROID AND QT_FEATURE_library) add_subdirectory(generic) endif() endif() + +if (QT_FEATURE_widgets) +# TODO add_subdirectory(styles) +endif() + +if (NOT WINRT AND QT_FEATURE_printsupport) +# TODO add_subdirectory(printsupport) +endif() From 71c9db7da804cc169c7c42c763555d85657a9669 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 23:01:27 +0100 Subject: [PATCH 0184/1322] cmake: Blacklist the libinput_axis_api test We already have a cmake find module for libinput so we know it is there Change-Id: I153544c5c13cb57b1ce258243ede17f4be9507fd Reviewed-by: Liang Qi --- src/gui/configure.cmake | 20 +------------------- util/cmake/configurejson2cmake.py | 3 +++ 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 3d5db4aa657..be3dff2f602 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -332,24 +332,6 @@ FBDriver *driver = 0; } ") -# libinput_axis_api -qt_config_compile_test(libinput_axis_api - LABEL "axis API in libinput" - LIBRARIES Libinput::Libinput - CODE -" -#include - -int main(int argc, char **argv) -{ - (void)argc; (void)argv; - /* BEGIN TEST: */ -libinput_event_pointer_has_axis(nullptr, LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL); - /* END TEST: */ - return 0; -} -") - # linuxfb qt_config_compile_test(linuxfb LABEL "LinuxFB" @@ -536,7 +518,7 @@ qt_feature("integrityhid" PRIVATE ) qt_feature("libinput_axis_api" PRIVATE LABEL "axis API in libinput" - CONDITION QT_FEATURE_libinput AND TEST_libinput_axis_api + CONDITION QT_FEATURE_libinput AND ON ) qt_feature("linuxfb" PRIVATE SECTION "Platform plugins" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 2d635e0c8a2..5a2b95d6991 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -184,6 +184,8 @@ def map_tests(test: str) -> str: 'openssl11': '(OPENSSL_VERSION VERSION_GREATER_EQUAL "1.1.0")', 'reduce_exports': 'CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY', + + 'libinput_axis_api': 'ON', } if test in testmap: return testmap.get(test, None) @@ -546,6 +548,7 @@ def parseTest(ctx, test, data, cm_fh): 'posix-iconv', "sun-iconv", 'separate_debug_info', # FIXME: see if cmake can do this 'gc_binaries', + 'libinput_axis_api', } if test in skip_tests: From 3882e9ea09ec9062fd3c711ae6caadb69b67c752 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 11 Feb 2019 18:27:52 +0100 Subject: [PATCH 0185/1322] cmake: Find Cups and enable its plugin Change-Id: I44bf176587331d86eb147d106f28deb0a6618ab4 Reviewed-by: Simon Hausmann --- src/plugins/CMakeLists.txt | 4 +-- src/plugins/printsupport/CMakeLists.txt | 11 ++++++++ src/plugins/printsupport/cups/CMakeLists.txt | 28 ++++++++++++++++++++ src/printsupport/configure.cmake | 4 ++- util/cmake/configurejson2cmake.py | 1 + 5 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 src/plugins/printsupport/CMakeLists.txt create mode 100644 src/plugins/printsupport/cups/CMakeLists.txt diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index acea77a60a8..1daaf47be78 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -23,6 +23,6 @@ if (QT_FEATURE_widgets) # TODO add_subdirectory(styles) endif() -if (NOT WINRT AND QT_FEATURE_printsupport) -# TODO add_subdirectory(printsupport) +if (NOT WINRT AND TARGET PrintSupport) + add_subdirectory(printsupport) endif() diff --git a/src/plugins/printsupport/CMakeLists.txt b/src/plugins/printsupport/CMakeLists.txt new file mode 100644 index 00000000000..9a92a865c0f --- /dev/null +++ b/src/plugins/printsupport/CMakeLists.txt @@ -0,0 +1,11 @@ +if (APPLE_OSX) +# TODO add_subdirectory(cocoa) +endif() + +if (WIN32) +# TODO add_subdirectory(windows) +endif() + +if (UNIX AND NOT APPLE AND QT_FEATURE_cups) + add_subdirectory(cups) +endif() diff --git a/src/plugins/printsupport/cups/CMakeLists.txt b/src/plugins/printsupport/cups/CMakeLists.txt new file mode 100644 index 00000000000..d36a5e7be56 --- /dev/null +++ b/src/plugins/printsupport/cups/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from cups.pro. + +find_package(Cups) + +##################################################################### +## cupsprintersupport Plugin: +##################################################################### + +add_qt_plugin(cupsprintersupport + TYPE printsupport + SOURCES + main.cpp + qcupsprintengine.cpp qcupsprintengine_p.h + qcupsprintersupport.cpp qcupsprintersupport_p.h + qppdprintdevice.cpp qppdprintdevice.h + INCLUDE_DIRECTORIES + ../../../printsupport/kernel + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::PrintSupport + Qt::PrintSupportPrivate + Cups::Cups + # MODULE = "cupsprintersupport" + # OTHER_FILES = "cups.json" + # PLUGIN_CLASS_NAME = "QCupsPrinterSupportPlugin" + # _LOADED = "qt_plugin" +) diff --git a/src/printsupport/configure.cmake b/src/printsupport/configure.cmake index a443e333fc9..40aab5d9f76 100644 --- a/src/printsupport/configure.cmake +++ b/src/printsupport/configure.cmake @@ -6,6 +6,8 @@ #### Libraries +find_package(Cups) +set_package_properties(Cups PROPERTIES TYPE OPTIONAL) #### Tests @@ -18,7 +20,7 @@ qt_feature("cups" PUBLIC PRIVATE SECTION "Painting" LABEL "CUPS" PURPOSE "Provides support for the Common Unix Printing System." - CONDITION libs.cups AND QT_FEATURE_printer AND QT_FEATURE_datestring OR FIXME + CONDITION Cups_FOUND AND QT_FEATURE_printer AND QT_FEATURE_datestring ) qt_feature_definition("cups" "QT_NO_CUPS" NEGATE VALUE "1") qt_feature("cupsjobwidget" PUBLIC PRIVATE diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 5a2b95d6991..d24a3d4b5e9 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -49,6 +49,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: libmap = { 'atspi': 'ATSPI2', 'corewlan': None, # Framework + 'cups': 'Cups', 'double-conversion': 'WrapDoubleConversion', 'drm': 'Libdrm', 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), From f6a830095fbb607307541305a03da663bfb82cf3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 09:57:53 +0100 Subject: [PATCH 0186/1322] cmake: blacklist xlib test, we can just use X11_FOUND Change-Id: Ic733c42e11b00fa8bf107f460a0596aeb10ac37b Reviewed-by: Simon Hausmann --- src/gui/configure.cmake | 20 +------------------- util/cmake/configurejson2cmake.py | 2 ++ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index be3dff2f602..57c5083d475 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -400,25 +400,7 @@ glProgramUniform1i(0, 0, 0); } ") -# xlib -qt_config_compile_test(xlib - LABEL "XLib" - LIBRARIES X11::X11 - CODE -" -#include -int main(int argc, char **argv) -{ - (void)argc; (void)argv; - /* BEGIN TEST: */ -Display *d = XOpenDisplay(NULL); -XCloseDisplay(d); - /* END TEST: */ - return 0; -} -" -) #### Features @@ -734,7 +716,7 @@ qt_feature("xkbcommon_evdev" PRIVATE qt_feature("xlib" PRIVATE LABEL "XLib" AUTODETECT NOT APPLE OR QT_FEATURE_xcb - CONDITION TEST_xlib + CONDITION X11_FOUND ) qt_feature("texthtmlparser" PUBLIC SECTION "Kernel" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index d24a3d4b5e9..6e6c402b079 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -187,6 +187,7 @@ def map_tests(test: str) -> str: 'reduce_exports': 'CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY', 'libinput_axis_api': 'ON', + "xlib": "X11_FOUND", } if test in testmap: return testmap.get(test, None) @@ -550,6 +551,7 @@ def parseTest(ctx, test, data, cm_fh): 'separate_debug_info', # FIXME: see if cmake can do this 'gc_binaries', 'libinput_axis_api', + 'xlib', } if test in skip_tests: From 2e64ac90d8b71bf1afe4ae4af87096a3888ff3be Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 10:01:07 +0100 Subject: [PATCH 0187/1322] cmake: also write FIXME on the configure.cmake for 'use' Since most of the times it means we need to link with some other stuff Change-Id: I06262d4403225bca7a5e68d47145fefcf6702e5a Reviewed-by: Simon Hausmann --- src/corelib/configure.cmake | 3 ++- src/gui/configure.cmake | 40 ++++++++++++++++++------------- src/network/configure.cmake | 12 ++++++---- util/cmake/configurejson2cmake.py | 2 ++ 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 2f5c543e56d..3bb08eba8a5 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -82,7 +82,8 @@ clock_gettime(CLOCK_MONOTONIC, &ts); /* END TEST: */ return 0; } -") +"# FIXME: use: librt +) # cloexec qt_config_compile_test(cloexec diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 57c5083d475..46fb2f993da 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -107,7 +107,8 @@ DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2), /* END TEST: */ return 0; } -") +"# FIXME: use: directwrite +) # drm_atomic qt_config_compile_test(drm_atomic @@ -126,13 +127,12 @@ drmModeAtomicReq *request; /* END TEST: */ return 0; } -") +"# FIXME: use: drm +) # egl-x11 qt_config_compile_test(egl_x11 LABEL "EGL on X11" - LIBRARIES X11::X11 -CODE "// Check if EGL is compatible with X. Some EGL implementations, typically on // embedded devices, are not intended to be used together with X. EGL support // has to be disabled in plugins like xcb in this case since the native display, @@ -156,7 +156,8 @@ XCloseDisplay(dpy); /* END TEST: */ return 0; } -") +"# FIXME: use: egl xcb_xlib +) # egl-brcm qt_config_compile_test(egl_brcm @@ -173,7 +174,8 @@ vc_dispmanx_display_open(0); /* END TEST: */ return 0; } -") +"# FIXME: use: egl bcm_host +) # egl-egldevice qt_config_compile_test(egl_egldevice @@ -193,7 +195,8 @@ EGLOutputLayerEXT layer = 0; /* END TEST: */ return 0; } -") +"# FIXME: use: egl +) # egl-mali qt_config_compile_test(egl_mali @@ -211,7 +214,8 @@ fbdev_window *w = 0; /* END TEST: */ return 0; } -") +"# FIXME: use: egl +) # egl-mali-2 qt_config_compile_test(egl_mali_2 @@ -228,7 +232,8 @@ mali_native_window *w = 0; /* END TEST: */ return 0; } -") +"# FIXME: use: egl +) # egl-viv qt_config_compile_test(egl_viv @@ -252,6 +257,7 @@ fbGetDisplayByIndex(0); return 0; } "# FIXME: qmake: ['DEFINES += EGL_API_FB=1', '!integrity: DEFINES += LINUX=1'] +# FIXME: use: egl ) # egl-openwfd @@ -268,7 +274,8 @@ wfdEnumerateDevices(nullptr, 0, nullptr); /* END TEST: */ return 0; } -") +"# FIXME: use: egl +) # egl-rcar qt_config_compile_test(egl_rcar @@ -286,7 +293,8 @@ PVRGrfxServerInit(); /* END TEST: */ return 0; } -") +"# FIXME: use: egl opengl_es2 +) # evdev qt_config_compile_test(evdev @@ -357,8 +365,6 @@ ioctl(fd, FBIOGET_VSCREENINFO, &vinfo); # opengles3 qt_config_compile_test(opengles3 LABEL "OpenGL ES 3.0" - LIBRARIES OpenGL::GL - CODE "#ifdef __APPLE__ # include #else @@ -379,13 +385,12 @@ glMapBufferRange(GL_ARRAY_BUFFER, 0, 0, GL_MAP_READ_BIT); /* END TEST: */ return 0; } -") +"# FIXME: use: opengl_es2 +) # opengles31 qt_config_compile_test(opengles31 LABEL "OpenGL ES 3.1" - LIBRARIES OpenGL::GL - CODE " #include @@ -398,7 +403,8 @@ glProgramUniform1i(0, 0, 0); /* END TEST: */ return 0; } -") +"# FIXME: use: opengl_es2 +) diff --git a/src/network/configure.cmake b/src/network/configure.cmake index 3bc73701da1..6bafd659c49 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -33,7 +33,8 @@ freeifaddrs(list); /* END TEST: */ return 0; } -") +"# FIXME: use: network +) # ipv6ifname qt_config_compile_test(ipv6ifname @@ -54,7 +55,8 @@ if_freenameindex(if_nameindex()); /* END TEST: */ return 0; } -") +"# FIXME: use: network +) # linux-netlink qt_config_compile_test(linux_netlink @@ -103,7 +105,8 @@ socklen_t sctpInitMsgSize = sizeof(sctpInitMsg); /* END TEST: */ return 0; } -") +"# FIXME: use: network +) # dtls qt_config_compile_test(dtls @@ -121,7 +124,8 @@ int main(int argc, char **argv) /* END TEST: */ return 0; } -") +"# FIXME: use: openssl +) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 6e6c402b079..7efeb88522b 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -610,6 +610,8 @@ def parseTest(ctx, test, data, cm_fh): cm_fh.write('"' + sourceCode + '"') if "qmake" in details: cm_fh.write("# FIXME: qmake: {}\n".format(details["qmake"])) + if "use" in data: + cm_fh.write("# FIXME: use: {}\n".format(data["use"])) cm_fh.write(")\n\n") elif data["type"] == "x86Simd": From cfba14e1e9198f3b902e267e44b9f57d40920e1d Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 10:07:57 +0100 Subject: [PATCH 0188/1322] configurejson2cmake.py: Support for the two cases that have LIBS += Since there's only two i hardcoded it for the moment instead of trying to parse the line Change-Id: I0da578af64ef9621cbbc78bf6ce15bf8a3f63f1c Reviewed-by: Simon Hausmann --- src/corelib/configure.cmake | 14 ++++++-------- util/cmake/configurejson2cmake.py | 24 ++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 3bb08eba8a5..227c0a10045 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -114,11 +114,11 @@ int pipes[2]; # cxx11_future if (UNIX) - set(CXX11_FUTURE_TEST_LIBRARIES pthread) + set(cxx11_future_TEST_LIBRARIES pthread) endif() qt_config_compile_test(cxx11_future LABEL "C++11 " - LIBRARIES ${CXX11_FUTURE_TEST_LIBRARIES} + LIBRARIES "${cxx11_future_TEST_LIBRARIES}" CODE " #include @@ -132,8 +132,7 @@ std::future f = std::async([]() { return 42; }); /* END TEST: */ return 0; } -" -) +") # eventfd qt_config_compile_test(eventfd @@ -197,11 +196,11 @@ shmctl(0, 0, (struct shmid_ds *)(0)); # ipc_posix if (LINUX) - set(IPC_POSIX_TEST_LIBRARIES pthread rt) + set(ipc_posix_TEST_LIBRARIES pthread rt) endif() qt_config_compile_test(ipc_posix LABEL "POSIX IPC" - LIBRARIES ${IPC_POSIX_TEST_LIBRARIES} + LIBRARIES "${ipc_posix_TEST_LIBRARIES}" CODE " #include @@ -219,8 +218,7 @@ shm_unlink(\"test\"); /* END TEST: */ return 0; } -" -) +") # linkat qt_config_compile_test(linkat diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 7efeb88522b..5357ccc44e7 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -604,12 +604,32 @@ def parseTest(ctx, test, data, cm_fh): sourceCode = sourceCode.replace('"', '\\"') + librariesCmakeName = "" + qmakeFixme = "" + cm_fh.write("# {}\n".format(test)) + if "qmake" in details: # We don't really have many so we can just enumerate them all + if details["qmake"] == "unix:LIBS += -lpthread": + librariesCmakeName = format(test) + "_TEST_LIBRARIES" + cm_fh.write("if (UNIX)\n") + cm_fh.write(" set(" + librariesCmakeName + " pthread)\n") + cm_fh.write("endif()\n") + elif details["qmake"] == "linux: LIBS += -lpthread -lrt": + librariesCmakeName = format(test) + "_TEST_LIBRARIES" + cm_fh.write("if (LINUX)\n") + cm_fh.write(" set(" + librariesCmakeName + " pthread rt)\n") + cm_fh.write("endif()\n") + else: + qmakeFixme = "# FIXME: qmake: {}\n".format(details["qmake"]) + cm_fh.write("qt_config_compile_test({}\n".format(featureName(test))) cm_fh.write(lineify("LABEL", data.get("label", ""))) + if librariesCmakeName != "": + cm_fh.write(lineify("LIBRARIES", "${"+librariesCmakeName+"}")) + cm_fh.write(" CODE\n") cm_fh.write('"' + sourceCode + '"') - if "qmake" in details: - cm_fh.write("# FIXME: qmake: {}\n".format(details["qmake"])) + if qmakeFixme != "": + cm_fh.write(qmakeFixme) if "use" in data: cm_fh.write("# FIXME: use: {}\n".format(data["use"])) cm_fh.write(")\n\n") From 443ee65d3b73c901c62e642130cbe3063c405467 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 10:11:24 +0100 Subject: [PATCH 0189/1322] configurejson2cmake.py: Don't emit a fixme for C++11 config Change-Id: I8408f6126115a0f76b0fed2cc42b54e5c148821d Reviewed-by: Simon Hausmann --- src/corelib/configure.cmake | 3 +-- util/cmake/configurejson2cmake.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 227c0a10045..73881a8668f 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -59,8 +59,7 @@ test(fptr); /* END TEST: */ return 0; } -"# FIXME: qmake: CONFIG += c++11 -) +") # clock-monotonic qt_config_compile_test(clock_monotonic diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 5357ccc44e7..8bf9b774595 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -619,6 +619,9 @@ def parseTest(ctx, test, data, cm_fh): cm_fh.write("if (LINUX)\n") cm_fh.write(" set(" + librariesCmakeName + " pthread rt)\n") cm_fh.write("endif()\n") + elif details["qmake"] == "CONFIG += c++11": + # do nothing we're always in c++11 mode + pass else: qmakeFixme = "# FIXME: qmake: {}\n".format(details["qmake"]) From 7b434c0287a67eb58413b7f5781d849d2080786f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 11 Feb 2019 15:45:33 +0100 Subject: [PATCH 0190/1322] CMake: Fix build of system jpeg is not available Change-Id: Ie7462db556d0615e74755fa4fc3b51f625aade2f Reviewed-by: Mikhail Svetkin Reviewed-by: Liang Qi --- src/gui/configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 46fb2f993da..f3a439a8620 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -644,7 +644,7 @@ qt_feature("ico" PUBLIC PRIVATE qt_feature_definition("ico" "QT_NO_ICO" NEGATE VALUE "1") qt_feature("jpeg" PUBLIC PRIVATE LABEL "JPEG" - CONDITION QT_FEATURE_imageformatplugin + CONDITION QT_FEATURE_imageformatplugin AND JPEG_FOUND DISABLE INPUT_libjpeg STREQUAL 'no' ) qt_feature_definition("jpeg" "QT_NO_IMAGEFORMAT_JPEG" NEGATE) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 8bf9b774595..23bd81cb5e8 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -698,6 +698,9 @@ def parseFeature(ctx, feature, data, cm_fh): 'condition': 'NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( TEST_posix_iconv OR TEST_sun_iconv )' }, 'incredibuild_xge': None, + 'jpeg': { + 'condition': 'QT_FEATURE_imageformatplugin AND JPEG_FOUND' + }, 'ltcg': None, 'msvc_mp': None, 'optimize_debug': None, From b3560a66ae731599906a70bff19e38face2d9482 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 11:20:22 +0100 Subject: [PATCH 0191/1322] cmake: Set up VERSION/SOVERSION properly Change-Id: Ic8cddf5ec8182873a6b1e03c76f514284b423322 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a90d09564e8..a340ca0d6ab 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -450,6 +450,8 @@ function(add_qt_module target) set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} OUTPUT_NAME "${module_versioned}") qt_internal_library_deprecation_level(deprecation_define) From 61b5a32df3192c5ea44944e2002665af2e51dc21 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 10:22:09 +0100 Subject: [PATCH 0192/1322] cmake: Use consistent naming scheme for Bootstrap Required for a future patch Change-Id: I63f85e8fb41ae7c76cb39cce00e63d4cc77aef9d Reviewed-by: Simon Hausmann --- src/tools/bootstrap/CMakeLists.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt index e85f7e9e16b..d5d8bcd8936 100644 --- a/src/tools/bootstrap/CMakeLists.txt +++ b/src/tools/bootstrap/CMakeLists.txt @@ -34,7 +34,7 @@ else() set(os_libs "") endif() -add_library(QtBootstrap STATIC +add_library(Bootstrap STATIC ../../corelib/codecs/qlatincodec.cpp ../../corelib/codecs/qtextcodec.cpp ../../corelib/codecs/qutfcodec.cpp @@ -113,18 +113,19 @@ add_library(QtBootstrap STATIC ${os_sources} ) -add_library(Qt::Bootstrap ALIAS QtBootstrap) +add_library(Qt::Bootstrap ALIAS Bootstrap) +qt_internal_add_target_aliases(Bootstrap) qt_ensure_perl() foreach(module QtCore QtXml) execute_process(COMMAND "${HOST_PERL}" -w "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" -quiet -minimal -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") - target_include_directories(QtBootstrap PUBLIC + target_include_directories(Bootstrap PUBLIC "${PROJECT_BINARY_DIR}/include/${module}" "${PROJECT_BINARY_DIR}/include/${module}/${PROJECT_VERSION}" "${PROJECT_BINARY_DIR}/include/${module}/${PROJECT_VERSION}/${module}") endforeach() -target_compile_definitions(QtBootstrap PUBLIC +target_compile_definitions(Bootstrap PUBLIC QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} @@ -134,18 +135,18 @@ target_compile_definitions(QtBootstrap PUBLIC QT_NO_FOREACH QT_NO_CAST_FROM_ASCII ) -target_link_libraries(QtBootstrap PUBLIC Qt::Platform ${os_libs}) -target_include_directories(QtBootstrap PUBLIC "${PROJECT_BINARY_DIR}/include") -target_link_libraries(QtBootstrap PRIVATE ZLIB::ZLIB) +target_link_libraries(Bootstrap PUBLIC Qt::Platform ${os_libs}) +target_include_directories(Bootstrap PUBLIC "${PROJECT_BINARY_DIR}/include") +target_link_libraries(Bootstrap PRIVATE ZLIB::ZLIB) ### fixme: Expose as some cmake equivalent of a reusable qmake mkspecs/features/gc_binaries.prf. if(APPLE) - target_link_libraries(QtBootstrap INTERFACE "-Wl,-dead_strip") + target_link_libraries(Bootstrap INTERFACE "-Wl,-dead_strip") endif() if (APPLE) find_library(FWFoundation Foundation) find_library(FWCoreServices CoreServices) - target_link_libraries(QtBootstrap INTERFACE ${FWFoundation}) - target_link_libraries(QtBootstrap PRIVATE ${FWCoreServices}) + target_link_libraries(Bootstrap INTERFACE ${FWFoundation}) + target_link_libraries(Bootstrap PRIVATE ${FWCoreServices}) endif() From 4bfd6c010bf37f1268a3da36fce2e20cf082157f Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 10:02:15 +0100 Subject: [PATCH 0193/1322] cmake: Create Qt5 compat targets in config files For now create targets a la "Qt5::Core" to stay compatible with the current Qt5 naming scheme. The name is controllable via a CMake option. Change-Id: If43c058221949b1900c2093f39ccc9d0f38028f1 Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 2 +- cmake/QtBuild.cmake | 28 +++++++++++++++------------- cmake/QtConfig.cmake.in | 1 + cmake/QtFeature.cmake | 4 ++-- cmake/QtModuleConfig.cmake.in | 2 +- src/CMakeLists.txt | 2 +- src/corelib/Qt5CoreMacros.cmake | 10 +++++----- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index fdc5271c046..ab96f48ec8c 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -59,7 +59,7 @@ target_include_directories(GlobalConfigPrivate INTERFACE add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) install(TARGETS Platform GlobalConfig GlobalConfigPrivate EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") -install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}") +install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXPORT_NAMESPACE}:: DESTINATION "${config_install_dir}") ## Install some QtBase specific CMake files: install(FILES diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a340ca0d6ab..6a92f573b11 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -38,6 +38,8 @@ set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]") set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]") +set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]") + # Platform define path, etc. if(WIN32) set(QT_DEFAULT_PLATFORM_DEFINITIONS UNICODE _UNICODE WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE) @@ -153,7 +155,7 @@ endfunction() function(qt_ensure_sync_qt) qt_ensure_perl() if(NOT DEFINED QT_SYNCQT) - get_target_property(mocPath "Qt::moc" LOCATION) + get_target_property(mocPath "${QT_CMAKE_EXPORT_NAMESPACE}::moc" LOCATION) get_filename_component(binDirectory "${mocPath}" DIRECTORY) # We could put this into the cache, but on the other hand there's no real need to # pollute the app's cache with this. For the first qtbase build, the variable is @@ -286,11 +288,11 @@ function(extend_target target) set_target_properties("${target}" PROPERTIES AUTOMOC ON - AUTOMOC_EXECUTABLE "$" + AUTOMOC_EXECUTABLE "$" AUTORCC ON - AUTORCC_EXECUTABLE "$" + AUTORCC_EXECUTABLE "$" AUTOUIC ON - AUTOUIC_EXECUTABLE "$" + AUTOUIC_EXECUTABLE "$" ) target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) @@ -525,7 +527,7 @@ function(add_qt_module target) ) set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") - install(EXPORT "${module_versioned}Targets" NAMESPACE Qt:: DESTINATION ${config_install_dir}) + install(EXPORT "${module_versioned}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${config_install_dir}) set(target_deps) foreach(lib ${arg_PUBLIC_LIBRARIES}) @@ -644,7 +646,7 @@ function(add_qt_plugin target) LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${arg_TYPE} ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${arg_TYPE} ) - install(EXPORT "${target}Targets" NAMESPACE Qt:: DESTINATION ${INSTALL_LIBDIR}/cmake) + install(EXPORT "${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${INSTALL_LIBDIR}/cmake) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. @@ -704,7 +706,7 @@ function(add_qt_test name) "${CMAKE_CURRENT_BINARY_DIR}" "${arg_INCLUDE_DIRECTORIES}" DEFINES "${arg_DEFINES}" - LIBRARIES Qt::Core Qt::Test ${arg_LIBRARIES} + LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test ${arg_LIBRARIES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} @@ -732,9 +734,9 @@ function(add_qt_tool name) qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) if (arg_BOOTSTRAP) - set(corelib Qt::Bootstrap) + set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Bootstrap) else() - set(corelib Qt::Core) + set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Core) endif() add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" @@ -789,7 +791,7 @@ function(add_qt_resource target resourceName) set(generatedSourceCode "${CMAKE_CURRENT_BINARY_DIR}/qrc_${resourceName}.cpp") add_custom_command(OUTPUT "${generatedSourceCode}" - COMMAND "Qt::rcc" + COMMAND "${QT_CMAKE_EXPORT_NAMESPACE}::rcc" ARGS --name "${resourceName}" --output "${generatedSourceCode}" "${generatedResourceFile}" DEPENDS ${files} @@ -838,8 +840,8 @@ function(qt_manual_moc result) file(GENERATE OUTPUT "${moc_parameters_file}" CONTENT "${moc_parameters}\n") add_custom_command(OUTPUT "${outfile}" - COMMAND Qt::moc "@${moc_parameters_file}" - DEPENDS "${infile}" ${moc_depends} Qt::moc + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::moc "@${moc_parameters_file}" + DEPENDS "${infile}" ${moc_depends} ${QT_CMAKE_EXPORT_NAMESPACE}::moc WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) endforeach() set("${result}" ${moc_files} PARENT_SCOPE) @@ -873,7 +875,7 @@ function(qt_create_qdbusxml2cpp_command target infile) set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.cpp") add_custom_command(OUTPUT "${header_file}" "${source_file}" - COMMAND Qt::qdbusxml2cpp ${arg_FLAGS} "${option}" "${header_file}:${source_file}" "${infile}" + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp ${arg_FLAGS} "${option}" "${header_file}:${source_file}" "${infile}" DEPENDS "${infile}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index a65f7bd2be7..69586fe52e4 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -36,6 +36,7 @@ foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) endforeach() set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@) if (_Qt_NOTFOUND_MESSAGE) set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}") diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index e57d541898f..79663c17a38 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -409,8 +409,8 @@ function(qt_config_compile_test_x86simd extension label) endfunction() function(qt_make_features_available target) - if(NOT "${target}" MATCHES "^Qt::[a-zA-z][a-zA-Z0-9_]*$") - message(FATAL_ERROR "${target} does not match Qt::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") + if(NOT "${target}" MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-z][a-zA-Z0-9_]*$") + message(FATAL_ERROR "${target} does not match ${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") endif() if(NOT TARGET ${target}) message(FATAL_ERROR "${target} not found.") diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index e6a2d339830..f72e29b1da0 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -31,4 +31,4 @@ endif() include(${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/QtFeature.cmake) -qt_make_features_available(Qt::@target@) +qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f6720c99bd9..551c27b0e7b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,7 +46,7 @@ function(find_or_build_bootstrap_names) find_or_build_bootstrap_tool(tracegen) if (_build_tools) - install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "Qt::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") + install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") endif() endfunction() diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 581c99ed58b..510bce2be18 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -133,7 +133,7 @@ function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target set(_moc_extra_parameters_file @${_moc_parameters_file}) add_custom_command(OUTPUT ${outfile} - COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::moc ${_moc_extra_parameters_file} DEPENDS ${infile} ${moc_depends} ${_moc_working_dir} VERBATIM) @@ -249,7 +249,7 @@ function(QT5_ADD_BINARY_RESOURCES target ) endforeach() add_custom_command(OUTPUT ${rcc_destination} - COMMAND ${Qt5Core_RCC_EXECUTABLE} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles} DEPENDS ${rc_depends} ${out_depends} ${infiles} VERBATIM) add_custom_target(${target} ALL DEPENDS ${rcc_destination}) @@ -282,7 +282,7 @@ function(QT5_ADD_RESOURCES outfiles ) set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON) add_custom_command(OUTPUT ${outfile} - COMMAND ${Qt5Core_RCC_EXECUTABLE} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile} MAIN_DEPENDENCY ${infile} DEPENDS ${_rc_depends} "${out_depends}" VERBATIM) @@ -319,7 +319,7 @@ function(QT5_ADD_BIG_RESOURCES outfiles ) _QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends) set_source_files_properties(${infile} PROPERTIES SKIP_AUTORCC ON) add_custom_command(OUTPUT ${tmpoutfile} - COMMAND ${Qt5Core_RCC_EXECUTABLE} ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ${rcc_options} --name ${outfilename} --pass 1 --output ${tmpoutfile} ${infile} DEPENDS ${infile} ${_rc_depends} "${out_depends}" VERBATIM) set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_AUTOMOC ON) set_source_files_properties(${tmpoutfile} PROPERTIES SKIP_AUTOUIC ON) @@ -327,7 +327,7 @@ function(QT5_ADD_BIG_RESOURCES outfiles ) add_library(rcc_object_${outfilename} OBJECT ${tmpoutfile}) add_dependencies(rcc_object_${outfilename} big_resources_${outfilename}) add_custom_command(OUTPUT ${outfile} - COMMAND ${Qt5Core_RCC_EXECUTABLE} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::rcc ARGS ${rcc_options} --name ${outfilename} --pass 2 --temp $ --output ${outfile} ${infile} DEPENDS rcc_object_${outfilename} VERBATIM) From 92f81ebc21ef4b3ea60a04dcae1d20387082a7e4 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 10:34:19 +0100 Subject: [PATCH 0194/1322] configurejson2cmake.py: openssl -> OpenSSL mapping Change-Id: I29480dfbd4f144e3d5620b43419ec46fb866cf4b Reviewed-by: Liang Qi --- src/network/configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/configure.cmake b/src/network/configure.cmake index 6bafd659c49..e2c4d20d636 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -166,7 +166,7 @@ qt_feature("openssl" PUBLIC PRIVATE qt_feature_definition("openssl" "QT_NO_OPENSSL" NEGATE) qt_feature("openssl_linked" PUBLIC PRIVATE LABEL " Qt directly linked to OpenSSL" - CONDITION NOT QT_FEATURE_securetransport AND libs.openssl OR FIXME + CONDITION NOT QT_FEATURE_securetransport AND OpenSSL_FOUND ENABLE INPUT_openssl STREQUAL 'linked' DISABLE ( NOT INPUT_openssl STREQUAL 'linked' ) ) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 23bd81cb5e8..4bfe023c2ab 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -74,6 +74,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'libudev': 'Libudev', 'lttng-ust': LibraryMapping(package='LTTngUST', resultVariable="LTTNGUST"), 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), + 'openssl': 'OpenSSL', 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), 'pcre2': ['PCRE2', 'REQUIRED'], 'posix_iconv': None, From bb2ae3e409acd88877ddf3d19054a0842404b568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Tue, 12 Feb 2019 09:29:34 +0100 Subject: [PATCH 0195/1322] cmake: replace unused macro with a proper value Change-Id: Icc2b5a63fc503aa99bbb0c8ee9ffddc985e0e3da Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6a92f573b11..08ac660f5fd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -454,7 +454,7 @@ function(add_qt_module target) RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} - OUTPUT_NAME "${module_versioned}") + OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}") qt_internal_library_deprecation_level(deprecation_define) @@ -519,7 +519,7 @@ function(add_qt_module target) qt_internal_add_linker_version_script("${target}") endif() - install(TARGETS "${target}" "${target_private}" EXPORT "${module_versioned}Targets" + install(TARGETS "${target}" "${target_private}" EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" LIBRARY DESTINATION ${INSTALL_LIBDIR} ARCHIVE DESTINATION ${INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} @@ -527,7 +527,7 @@ function(add_qt_module target) ) set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") - install(EXPORT "${module_versioned}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${config_install_dir}) + install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${config_install_dir}) set(target_deps) foreach(lib ${arg_PUBLIC_LIBRARIES}) From 05aeaed906cbec3654178d1438ae2ad361a35ddd Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 10:47:12 +0100 Subject: [PATCH 0196/1322] Find mtdev and use it Change-Id: I90db48efaa6a23add770fcf69b46c4f4c84866c1 Reviewed-by: Liang Qi --- cmake/FindMtdev.cmake | 3 +++ src/gui/configure.cmake | 4 +++- src/platformsupport/input/CMakeLists.txt | 5 ++++- util/cmake/configurejson2cmake.py | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 cmake/FindMtdev.cmake diff --git a/cmake/FindMtdev.cmake b/cmake/FindMtdev.cmake new file mode 100644 index 00000000000..39d98232077 --- /dev/null +++ b/cmake/FindMtdev.cmake @@ -0,0 +1,3 @@ +find_package(PkgConfig) + +pkg_check_modules(Mtdev mtdev IMPORTED_TARGET) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index f3a439a8620..e5888cc1d78 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -54,6 +54,8 @@ find_package(JPEG) set_package_properties(JPEG PROPERTIES TYPE OPTIONAL) find_package(PNG) set_package_properties(PNG PROPERTIES TYPE OPTIONAL) +find_package(Mtdev) +set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) find_package(Tslib) set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) find_package(Vulkan) @@ -531,7 +533,7 @@ qt_feature("mirclient" PRIVATE ) qt_feature("mtdev" PRIVATE LABEL "mtdev" - CONDITION libs.mtdev OR FIXME + CONDITION Mtdev_FOUND ) qt_feature("opengles2" PUBLIC LABEL "OpenGL ES 2.0" diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt index dc5b25c9ce9..43fb26d3034 100644 --- a/src/platformsupport/input/CMakeLists.txt +++ b/src/platformsupport/input/CMakeLists.txt @@ -9,6 +9,9 @@ set_package_properties(XKB PROPERTIES TYPE OPTIONAL) find_package(Tslib) set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) +find_package(Mtdev) +set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) + ##################################################################### ## InputSupport Module: ##################################################################### @@ -61,7 +64,7 @@ extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_libudev extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_mtdev LIBRARIES - mtdev + PkgConfig::Mtdev ) extend_target(InputSupport CONDITION QT_FEATURE_tslib diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 4bfe023c2ab..870c56d4d61 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -73,6 +73,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'librt': 'WrapRt', 'libudev': 'Libudev', 'lttng-ust': LibraryMapping(package='LTTngUST', resultVariable="LTTNGUST"), + 'mtdev': 'Mtdev', 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), 'openssl': 'OpenSSL', 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), From 988162eaf8b2aeae61f820382021116bf4ee391d Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 12:21:56 +0100 Subject: [PATCH 0197/1322] cmake: Start to use ConfigExtra.cmake files Enables the use of e.g. QT_NO_DEBUG in compiler flags, -fPIC, passing on of QT_NAMESPACE, etc. pp. Dropping a lot of custom code which handled adding imported targets for the command-line tools (this is all being handled by CMake already). It needs to be investigated if we need to resurrect Qt5GuiConfigExtras.cmake.in in one way or the other. Change-Id: I4fa141b68fddaad4f33e628c59d5d0b3a7b3a096 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 20 ++- cmake/QtModuleConfig.cmake.in | 6 +- src/corelib/Qt5CoreConfigExtras.cmake.in | 177 ++----------------- src/dbus/Qt5DBusConfigExtras.cmake.in | 33 ---- src/gui/Qt5GuiConfigExtras.cmake.in | 180 -------------------- src/testlib/Qt5TestConfigExtras.cmake.in | 6 +- src/widgets/Qt5WidgetsConfigExtras.cmake.in | 19 --- 7 files changed, 37 insertions(+), 404 deletions(-) delete mode 100644 src/dbus/Qt5DBusConfigExtras.cmake.in delete mode 100644 src/gui/Qt5GuiConfigExtras.cmake.in delete mode 100644 src/widgets/Qt5WidgetsConfigExtras.cmake.in diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 08ac660f5fd..e3f709d2335 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -538,6 +538,21 @@ function(add_qt_module target) list(APPEND target_deps "${dep}\;${PROJECT_VERSION}") endif() endforeach() + + set(extra_cmake_files) + set(extra_cmake_includes) + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") + list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") + list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") + endif() + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake.in") + configure_file("${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake" + @ONLY) + list(APPEND extra_cmake_files "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") + list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") + endif() + configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtModuleConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" @@ -549,11 +564,6 @@ function(add_qt_module target) COMPATIBILITY AnyNewerVersion ) - set(extra_cmake_files) - if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") - list(APPEND extra_cmake_files "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") - endif() - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index f72e29b1da0..f3993bbd8e3 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -25,9 +25,9 @@ endforeach() include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Macros.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Macros.cmake") -endif() +foreach(extra_cmake_include @extra_cmake_includes@) + include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}") +endforeach() include(${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/QtFeature.cmake) diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index e0652fdcf95..3775fc64b9b 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -1,75 +1,18 @@ - -if (NOT TARGET Qt5::qmake) - add_executable(Qt5::qmake IMPORTED) - -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\") -!!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\") -!!ENDIF - _qt5_Core_check_file_exists(${imported_location}) - - set_target_properties(Qt5::qmake PROPERTIES - IMPORTED_LOCATION ${imported_location} - ) -endif() - -if (NOT TARGET Qt5::moc) - add_executable(Qt5::moc IMPORTED) - -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\") -!!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\") -!!ENDIF - _qt5_Core_check_file_exists(${imported_location}) - - set_target_properties(Qt5::moc PROPERTIES - IMPORTED_LOCATION ${imported_location} - ) - # For CMake automoc feature - get_target_property(QT_MOC_EXECUTABLE Qt5::moc LOCATION) -endif() - -if (NOT TARGET Qt5::rcc) - add_executable(Qt5::rcc IMPORTED) - -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\") -!!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\") -!!ENDIF - _qt5_Core_check_file_exists(${imported_location}) - - set_target_properties(Qt5::rcc PROPERTIES - IMPORTED_LOCATION ${imported_location} - ) -endif() - -set(Qt5Core_QMAKE_EXECUTABLE Qt5::qmake) -set(Qt5Core_MOC_EXECUTABLE Qt5::moc) -set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) - -set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_MAJOR_VERSION 5) -set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) -set_property(TARGET Qt5::Core APPEND PROPERTY +set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_MAJOR_VERSION @PROJECT_MAJOR_VERSION@) +set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) +set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE ) -include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigExtrasMkspecDir.cmake\") +# include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigExtrasMkspecDir.cmake\") +# +# foreach(_dir ${_qt5_corelib_extra_includes}) +# _qt5_Core_check_file_exists(${_dir}) +# endforeach() -foreach(_dir ${_qt5_corelib_extra_includes}) - _qt5_Core_check_file_exists(${_dir}) -endforeach() - -list(APPEND Qt5Core_INCLUDE_DIRS ${_qt5_corelib_extra_includes}) -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5_corelib_extra_includes}) -set(_qt5_corelib_extra_includes) - -# Targets using Qt need to use the POSITION_INDEPENDENT_CODE property. The -# Qt5_POSITION_INDEPENDENT_CODE variable is used in the # qt5_use_module -# macro to add it. -set(Qt5_POSITION_INDEPENDENT_CODE True) +# list(APPEND Qt5Core_INCLUDE_DIRS ${_qt5_corelib_extra_includes}) +# set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5_corelib_extra_includes}) +# set(_qt5_corelib_extra_includes) # On x86 and x86-64 systems with ELF binaries (especially Linux), due to # a new optimization in GCC 5.x in combination with a recent version of @@ -78,96 +21,12 @@ set(Qt5_POSITION_INDEPENDENT_CODE True) # Applications now need to be compiled with the -fPIC option if the Qt option # \"reduce relocations\" is active. For backward compatibility only, Qt accepts # the use of -fPIE for GCC 4.x versions. -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP) - -# TODO Qt6: Remove -set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"\") - -!!IF !isEmpty(QT_NAMESPACE) -list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE) -list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE) -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE) -!!ENDIF - -!!IF !isEmpty(CMAKE_DISABLED_FEATURES) -set(Qt5_DISABLED_FEATURES - $$CMAKE_DISABLED_FEATURES -) -!!ENDIF - -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) - -set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype) - -!!IF qtConfig(reduce_exports) -set(QT_VISIBILITY_AVAILABLE \"True\") -!!ENDIF - -!!IF !isEmpty(QT_LIBINFIX) -set(QT_LIBINFIX \"$${QT_LIBINFIX}\") -!!ENDIF - -!!IF !isEmpty(CMAKE_WINDOWS_BUILD) -set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain) - -if (NOT TARGET Qt5::WinMain) - add_library(Qt5::WinMain STATIC IMPORTED) - -!!IF !isEmpty(CMAKE_RELEASE_TYPE) - set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\") -!!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\") -!!ENDIF - - set_target_properties(Qt5::WinMain PROPERTIES - IMPORTED_LOCATION_RELEASE ${imported_location} - ) -!!ENDIF - -!!IF !isEmpty(CMAKE_DEBUG_TYPE) - set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Core_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\") -!!ELSE - set(imported_location \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}\") -!!ENDIF - - set_target_properties(Qt5::WinMain PROPERTIES - IMPORTED_LOCATION_DEBUG ${imported_location} - ) -!!ENDIF - - if (NOT Qt5_NO_LINK_QTMAIN) - set(_isExe $,EXECUTABLE>) - set(_isWin32 $>) - set(_isNotExcluded $>>) - set(_isPolicyNEW $) - get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS) - set_property(TARGET Qt5::Core APPEND PROPERTY - INTERFACE_LINK_LIBRARIES - $<$:Qt5::WinMain> - ) - # For backward compatibility with CMake < 2.8.12 - foreach(_config ${_configs}) - set_property(TARGET Qt5::Core APPEND PROPERTY - IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} - $<$:Qt5::WinMain> - ) - endforeach() - unset(_configs) - unset(_isExe) - unset(_isWin32) - unset(_isNotExcluded) - unset(_isPolicyNEW) - endif() +if (CMAKE_CXX_COMPILER MATCHES "icc.*$" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "-fPIC") endif() -!!ENDIF -get_filename_component(_Qt5CoreConfigDir ${CMAKE_CURRENT_LIST_FILE} PATH) - -set(_Qt5CTestMacros \"${_Qt5CoreConfigDir}/Qt5CTestMacros.cmake\") - -_qt5_Core_check_file_exists(${_Qt5CTestMacros}) +if (NOT "@QT_NAMESPACE@" STREQUAL "") + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=@QT_NAMESPACE@) +endif() +set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) +set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype) diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in deleted file mode 100644 index 1d947159e2e..00000000000 --- a/src/dbus/Qt5DBusConfigExtras.cmake.in +++ /dev/null @@ -1,33 +0,0 @@ - -if (NOT TARGET Qt5::qdbuscpp2xml) - add_executable(Qt5::qdbuscpp2xml IMPORTED) - -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") -!!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") -!!ENDIF - _qt5_DBus_check_file_exists(${imported_location}) - - set_target_properties(Qt5::qdbuscpp2xml PROPERTIES - IMPORTED_LOCATION ${imported_location} - ) -endif() - -if (NOT TARGET Qt5::qdbusxml2cpp) - add_executable(Qt5::qdbusxml2cpp IMPORTED) - -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5DBus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") -!!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") -!!ENDIF - _qt5_DBus_check_file_exists(${imported_location}) - - set_target_properties(Qt5::qdbusxml2cpp PROPERTIES - IMPORTED_LOCATION ${imported_location} - ) -endif() - -set(Qt5DBus_QDBUSCPP2XML_EXECUTABLE Qt5::qdbuscpp2xml) -set(Qt5DBus_QDBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp) diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in deleted file mode 100644 index 07869efd7d8..00000000000 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ /dev/null @@ -1,180 +0,0 @@ - -!!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) - -!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) -set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\") -!!ELSE -set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\") -!!ENDIF - -_qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS}) - -list(APPEND Qt5Gui_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) -set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) -set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) - -macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) - set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) - -!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -!!ELSE - set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -!!ENDIF - -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") -!!ELSE - set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") -!!ENDIF - - set_target_properties(Qt5::${TargetName} PROPERTIES - \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} - \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib} - ) -endmacro() - -add_library(Qt5::Gui_EGL SHARED IMPORTED) -_populate_qt5gui_gl_target_properties(Gui_EGL RELEASE $${CMAKE_ANGLE_EGL_DLL_RELEASE} $${CMAKE_ANGLE_EGL_IMPLIB_RELEASE}) -add_library(Qt5::Gui_GLESv2 SHARED IMPORTED) -_populate_qt5gui_gl_target_properties(Gui_GLESv2 RELEASE $${CMAKE_ANGLE_GLES2_DLL_RELEASE} $${CMAKE_ANGLE_GLES2_IMPLIB_RELEASE}) - -set_property(TARGET Qt5::Gui_EGL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) -set_property(TARGET Qt5::Gui_GLESv2 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_OPENGL_INCLUDE_DIRS}) - -!!IF !isEmpty(CMAKE_DEBUG_TYPE) -_populate_qt5gui_gl_target_properties(Gui_EGL DEBUG $${CMAKE_ANGLE_EGL_DLL_DEBUG} $${CMAKE_ANGLE_EGL_IMPLIB_DEBUG}) -_populate_qt5gui_gl_target_properties(Gui_GLESv2 DEBUG $${CMAKE_ANGLE_GLES2_DLL_DEBUG} $${CMAKE_ANGLE_GLES2_IMPLIB_DEBUG}) -!!ENDIF - -set(Qt5Gui_EGL_LIBRARIES Qt5::Gui_EGL) -set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2) - -!!ELSE - -!!IF !isEmpty(CMAKE_GL_INCDIRS) - -set(_GL_INCDIRS $$CMAKE_GL_INCDIRS) -find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME - PATHS ${_GL_INCDIRS} -) -if (NOT _qt5gui_OPENGL_INCLUDE_DIR) - message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"${_GL_INCDIRS}\\\".\") -endif() -unset(_GL_INCDIRS) - -# Don\'t check for existence of the "_qt5gui_OPENGL_INCLUDE_DIR" because it is -# optional. - -list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR}) -set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR}) - -unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE) - -!!ENDIF - -macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) - set(Qt5Gui_${Name}_LIBRARIES) -!!IF !mac - set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs}) -!!ELSE - foreach(_dir ${IncDirs}) - if (EXISTS ${_dir}) - list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_dir}) - else() - find_path(_actual_dir ${_dir}) # Look in sdk directories - if (_actual_dir) - list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir}) - endif() - unset(_actual_dir CACHE) - endif() - endforeach() -!!ENDIF - foreach(_lib ${Libs}) - string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_lib}) - if (NOT TARGET Qt5::Gui_${_cmake_lib_name} AND NOT _Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE) - find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib} -!!IF !isEmpty(CROSS_COMPILE) - PATHS \"${LibDir}\" -!!IF !mac - NO_DEFAULT_PATH -!!ENDIF -!!ENDIF - ) -!!IF mac - set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") - if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}") - set(Qt5Gui_${_cmake_lib_name}_LIBRARY) - endif() -!!ENDIF - if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) - # The above find_library call doesn\'t work for finding - # libraries in Windows SDK paths outside of the proper - # environment, even if the libraries are present. In other - # cases it is OK for the libraries to not be found - # because they are optional dependencies of Qt5Gui, needed - # only if the qopengl.h header is used. - # We try to find the libraries in the first place because Qt may be - # compiled with another set of GL libraries (such as coming - # from ANGLE). The point of these find calls is to try to - # find the same binaries as Qt is compiled with (as they are - # in the interface of QtGui), so an effort is made to do so - # above with paths known to qmake. - set(_Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE TRUE) - unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) - else() - add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS}) - - set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) - _qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") - -!!IF !isEmpty(CMAKE_WINDOWS_BUILD) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") -!!ENDIF - unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) - - find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d - PATHS \"${LibDir}\" -!!IF !mac - NO_DEFAULT_PATH -!!ENDIF - ) - if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - _qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") -!!IF !isEmpty(CMAKE_WINDOWS_BUILD) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") -!!ENDIF - endif() - unset(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG CACHE) - list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name}) - endif() - endif() - endforeach() -endmacro() - - -!!IF !isEmpty(CMAKE_EGL_LIBS) -_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\") -!!ENDIF - -!!IF !isEmpty(CMAKE_OPENGL_LIBS) -_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$CMAKE_OPENGL_INCDIRS\") - -!!ENDIF - -!!ENDIF - -set(Qt5Gui_OPENGL_IMPLEMENTATION $$CMAKE_QT_OPENGL_IMPLEMENTATION) - -get_target_property(_configs Qt5::Gui IMPORTED_CONFIGURATIONS) -foreach(_config ${_configs}) - set_property(TARGET Qt5::Gui APPEND PROPERTY - IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} - ${Qt5Gui_EGL_LIBRARIES} ${Qt5Gui_OPENGL_LIBRARIES} - ) -endforeach() -unset(_configs) diff --git a/src/testlib/Qt5TestConfigExtras.cmake.in b/src/testlib/Qt5TestConfigExtras.cmake.in index 2a575958ae4..86a706ea9d9 100644 --- a/src/testlib/Qt5TestConfigExtras.cmake.in +++ b/src/testlib/Qt5TestConfigExtras.cmake.in @@ -1,5 +1 @@ - -set_property(TARGET Qt5::Test - APPEND PROPERTY - INTERFACE_COMPILE_DEFINITIONS QT_TESTCASE_BUILDDIR=\\\"\${CMAKE_BINARY_DIR}\\\" -) +set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Test APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_TESTCASE_BUILDDIR="${CMAKE_BINARY_DIR}") diff --git a/src/widgets/Qt5WidgetsConfigExtras.cmake.in b/src/widgets/Qt5WidgetsConfigExtras.cmake.in deleted file mode 100644 index 99d87e2e46f..00000000000 --- a/src/widgets/Qt5WidgetsConfigExtras.cmake.in +++ /dev/null @@ -1,19 +0,0 @@ - -if (NOT TARGET Qt5::uic) - add_executable(Qt5::uic IMPORTED) - -!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Widgets_install_prefix}/$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\") -!!ELSE - set(imported_location \"$${CMAKE_BIN_DIR}uic$$CMAKE_BIN_SUFFIX\") -!!ENDIF - _qt5_Widgets_check_file_exists(${imported_location}) - - set_target_properties(Qt5::uic PROPERTIES - IMPORTED_LOCATION ${imported_location} - ) -endif() - -include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5Widgets_AccessibleFactory.cmake\" OPTIONAL) - -set(Qt5Widgets_UIC_EXECUTABLE Qt5::uic) From f1b688bc7c33d93993945e25b9d3aa4cc7215c5f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 13:13:43 +0100 Subject: [PATCH 0198/1322] Fix qt_config_compile_test when cross-compiling When we do qt_config_compile_test(egl_x11 LABEL "EGL on X11" LIBRARIES X11::X11 ... ) then check_cxx_source_compiles() aborts if the provided targets do not exist (we map LIBRARIES to CMAKE_REQUIRED_LIBRARIES). However we just want the test to fail. Therefore this patch verifies the presence of the targets. Change-Id: Ibd7c1b50d585339af0ca0de58bc5c9cd64d65d6d Reviewed-by: Kevin Funk --- cmake/QtFeature.cmake | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 79663c17a38..4a8449405e7 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -387,10 +387,24 @@ endfunction() function(qt_config_compile_test name) cmake_parse_arguments(arg "" "LABEL" "LIBRARIES;CODE" ${ARGN}) - set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") - set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}") - check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name}) - set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") + foreach(library IN ITEMS ${arg_LIBRARIES}) + if(NOT TARGET "${library}") + # If the dependency looks like a cmake target, then make this compile test + # fail instead of cmake abort later via CMAKE_REQUIRED_LIBRARIES. + string(FIND "${library}" "::" cmake_target_namespace_separator) + if(NOT cmake_target_namespace_separator EQUAL -1) + set(HAVE_${name} FALSE) + break() + endif() + endif() + endforeach() + + if(NOT DEFINED HAVE_${name}) + set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}") + check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name}) + set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") + endif() set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}") endfunction() From 0867dbf2f410b2096c62a9f40b75e4e5ab86dac9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 12:13:38 +0100 Subject: [PATCH 0199/1322] Fix finding syncqt when "cross compiling" This is not quite the correct design yet, but makes the existing mechanism work first. Change-Id: Idbc6f1380adc955a772eb6e5beb6b3a5f7f686bb Reviewed-by: Kevin Funk --- cmake/QtSetup.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 11ccc129b40..a01d8a651c3 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -41,6 +41,8 @@ endif() if("x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") set(QT_SYNCQT "${PROJECT_SOURCE_DIR}/bin/syncqt.pl") install(PROGRAMS "${QT_SYNCQT}" DESTINATION "${INSTALL_BINDIR}") +else() + set(QT_SYNCQT "${HOST_QT_TOOLS_DIRECTORY}/syncqt.pl") endif() ## Enable support for sanitizers: From 9bef044a0bec636ff08f7dcd6e16f6fadd612532 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 12:00:49 +0100 Subject: [PATCH 0200/1322] cmake: Search and enable the sqlite[3] plugin Added to QtFeature.cmake a way to be able to run feature_module begin and end without having an actual module by passing NO_MODULE Change-Id: Ib708bd3878e2591da193d18563c8932cc4b75e7f Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 34 ++++++------ src/plugins/CMakeLists.txt | 2 +- src/plugins/sqldrivers/CMakeLists.txt | 51 ++++++++++++++++++ src/plugins/sqldrivers/configure.cmake | 54 ++++++++++++++++++++ src/plugins/sqldrivers/sqlite/CMakeLists.txt | 25 +++++++++ util/cmake/configurejson2cmake.py | 5 ++ util/cmake/helper.py | 1 + 7 files changed, 155 insertions(+), 17 deletions(-) create mode 100644 src/plugins/sqldrivers/CMakeLists.txt create mode 100644 src/plugins/sqldrivers/configure.cmake create mode 100644 src/plugins/sqldrivers/sqlite/CMakeLists.txt diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 4a8449405e7..13d0203612c 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -1,9 +1,9 @@ function(qt_feature_module_begin) qt_parse_all_arguments(arg "qt_feature_module_begin" - "" "LIBRARY;PRIVATE_FILE;PUBLIC_FILE" "PUBLIC_DEPENDENCIES;PRIVATE_DEPENDENCIES" ${ARGN}) + "NO_MODULE" "LIBRARY;PRIVATE_FILE;PUBLIC_FILE" "PUBLIC_DEPENDENCIES;PRIVATE_DEPENDENCIES" ${ARGN}) - if ("${arg_LIBRARY}" STREQUAL "") - message(FATAL_ERROR "qt_feature_begin_module needs a LIBRARY name!") + if ("${arg_LIBRARY}" STREQUAL "" AND (NOT ${arg_NO_MODULE})) + message(FATAL_ERROR "qt_feature_begin_module needs a LIBRARY name! (or specify NO_MODULE)") endif() if ("${arg_PUBLIC_FILE}" STREQUAL "") message(FATAL_ERROR "qt_feature_begin_module needs a PUBLIC_FILE name!") @@ -357,21 +357,23 @@ function(qt_feature_module_end target) ) qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_public_file}") - get_target_property(targetType "${target}" TYPE) - if("${targetType}" STREQUAL "INTERFACE_LIBRARY") - set(propertyPrefix "INTERFACE_") - else() - set(propertyPrefix "") - set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES") - endif() - foreach(visibility public private) - string(TOUPPER "${visibility}" capitalVisibility) - foreach(state enabled disabled) - string(TOUPPER "${state}" capitalState) + if (NOT ("${target}" STREQUAL "NO_MODULE")) + get_target_property(targetType "${target}" TYPE) + if("${targetType}" STREQUAL "INTERFACE_LIBRARY") + set(propertyPrefix "INTERFACE_") + else() + set(propertyPrefix "") + set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES") + endif() + foreach(visibility public private) + string(TOUPPER "${visibility}" capitalVisibility) + foreach(state enabled disabled) + string(TOUPPER "${state}" capitalState) - set_property(TARGET "${target}" PROPERTY ${propertyPrefix}QT_${capitalState}_${capitalVisibility}_FEATURES "${${state}_${visibility}_features}") + set_property(TARGET "${target}" PROPERTY ${propertyPrefix}QT_${capitalState}_${capitalVisibility}_FEATURES "${${state}_${visibility}_features}") + endforeach() endforeach() - endforeach() + endif() unset(__QtFeature_library PARENT_SCOPE) unset(__QtFeature_private_features PARENT_SCOPE) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 1daaf47be78..0d470824f9e 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,6 +1,6 @@ if (QT_FEATURE_sql) -# TODO add_subdirectory(sqldrivers) + add_subdirectory(sqldrivers) endif() if(QT_FEATURE_network AND QT_FEATURE_bearermanagement) diff --git a/src/plugins/sqldrivers/CMakeLists.txt b/src/plugins/sqldrivers/CMakeLists.txt new file mode 100644 index 00000000000..95e696f48b2 --- /dev/null +++ b/src/plugins/sqldrivers/CMakeLists.txt @@ -0,0 +1,51 @@ +# Generated from sqldrivers.pro. + +# TODO sqldrivers_standalone { +# _QMAKE_CACHE_ = $$shadowed($$SQLDRV_SRC_TREE)/.qmake.conf +# load(qt_configure) +# } + +qt_feature_module_begin( + NO_MODULE + PUBLIC_FILE "qtsqldrivers-config.h" + PRIVATE_FILE "qtsqldrivers-config_p.h" +) +include(configure.cmake) +qt_feature_module_end(NO_MODULE) + + +if(QT_FEATURE_sql_psql) +# TODO add_subdirectory(psql) +endif() + +if(QT_FEATURE_sql_mysql) +# TODO add_subdirectory(mysql) +endif() + +if(QT_FEATURE_sql_odbc) +# TODO add_subdirectory(odbc) +endif() + +if(QT_FEATURE_sql_tds) +# TODO add_subdirectory(tds) +endif() + +if(QT_FEATURE_sql_oci) +# TODO add_subdirectory(oci) +endif() + +if(QT_FEATURE_sql_db2) +# TODO add_subdirectory(db2) +endif() + +if(QT_FEATURE_sql_sqlite) + add_subdirectory(sqlite) +endif() + +if(QT_FEATURE_sql_sqlite2) +# TODO add_subdirectory(sqlite2) +endif() + +if(QT_FEATURE_sql_ibase) +# TODO add_subdirectory(ibase) +endif() diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake new file mode 100644 index 00000000000..626a835f0a2 --- /dev/null +++ b/src/plugins/sqldrivers/configure.cmake @@ -0,0 +1,54 @@ + + +#### Inputs + + + +#### Libraries + +find_package(SQLite3) +set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL) + + +#### Tests + + + +#### Features + +qt_feature("sql_db2" PRIVATE + LABEL "DB2 (IBM)" + CONDITION libs.db2 OR FIXME +) +qt_feature("sql_ibase" PRIVATE + LABEL "InterBase" + CONDITION libs.ibase OR FIXME +) +qt_feature("sql_mysql" PRIVATE + LABEL "MySql" + CONDITION libs.mysql OR FIXME +) +qt_feature("sql_oci" PRIVATE + LABEL "OCI (Oracle)" + CONDITION libs.oci OR FIXME +) +qt_feature("sql_odbc" PRIVATE + LABEL "ODBC" + CONDITION QT_FEATURE_datestring AND libs.odbc OR FIXME +) +qt_feature("sql_psql" PRIVATE + LABEL "PostgreSQL" + CONDITION libs.psql OR FIXME +) +qt_feature("sql_sqlite2" PRIVATE + LABEL "SQLite2" + CONDITION libs.sqlite2 OR FIXME +) +qt_feature("sql_sqlite" PRIVATE + LABEL "SQLite" + CONDITION QT_FEATURE_datestring AND SQLite3_FOUND +) +qt_feature("sql_tds" PRIVATE + LABEL "TDS (Sybase)" + CONDITION QT_FEATURE_datestring AND libs.tds OR FIXME +) diff --git a/src/plugins/sqldrivers/sqlite/CMakeLists.txt b/src/plugins/sqldrivers/sqlite/CMakeLists.txt new file mode 100644 index 00000000000..77a112a4067 --- /dev/null +++ b/src/plugins/sqldrivers/sqlite/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from sqlite.pro. + +find_package(SQLite3) + +##################################################################### +## qsqlite Plugin: +##################################################################### + +add_qt_plugin(qsqlite + TYPE sqldrivers + SOURCES + qsql_sqlite.cpp qsql_sqlite_p.h + smain.cpp + DEFINES + QT_NO_CAST_TO_ASCII + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate + SQLite::SQLite3 + # OTHER_FILES = "sqlite.json" + # PLUGIN_CLASS_NAME = "QSQLiteDriverPlugin" + # QT_FOR_CONFIG = "sqldrivers-private" + # _LOADED = "qt_plugin" +) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 870c56d4d61..e99bb27bc29 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -81,6 +81,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'posix_iconv': None, 'pps': 'PPS', 'slog2': 'Slog2', + 'sqlite3': 'SQLite3', 'sun_iconv': None, 'tslib': 'Tslib', 'udev': 'Libudev', @@ -731,6 +732,9 @@ def parseFeature(ctx, feature, data, cm_fh): 'separate_debug_info': None, 'shared': None, 'silent': None, + 'sql-sqlite' : { + 'condition': 'QT_FEATURE_datestring AND SQLite3_FOUND', + }, 'stack-protector-strong': None, 'static': None, 'static_runtime': None, @@ -746,6 +750,7 @@ def parseFeature(ctx, feature, data, cm_fh): 'system-jpeg': None, 'system-pcre2': None, 'system-png': None, + 'system-sqlite': None, 'system-xcb': None, 'system-zlib': None, 'use_gold_linker': None, diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 16502fd2745..6234d26d09c 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -215,6 +215,7 @@ libray_mapping = { 'libproxy': 'LibProxy::LibProxy', 'librt': 'WrapRt', 'pcre2': 'PCRE2', + 'sqlite': 'SQLite3', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', 'xcb_icccm': 'XCB::ICCCM', 'xcb_image': 'XCB::IMAGE', From 73a3a96c7b42aad2a6c075fe1679baba47a8c6b2 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 12 Feb 2019 10:19:47 +0100 Subject: [PATCH 0201/1322] cmake: update README.md Added info for using homebrew on macOS. Change-Id: Ie425793d3de1e72a9342f6c2aaf67a4f85592f3a Reviewed-by: Kevin Funk --- cmake/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/README.md b/cmake/README.md index b32e64aa9e1..b2a9f3fc3a0 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -35,6 +35,16 @@ You may use vcpkg to install dependencies needed to build QtBase. * When running cmake in qtbase, pass ``-DCMAKE_PREFIX_PATH=/path/to/your/vcpkg/installed/$VCPKG_DEFAULT_TRIPLET`` or ``-DCMAKE_PREFIX_PATH=/path/to/your/vcpkg/installed/%VCPKG_DEFAULT_TRIPLET%`` on Windows. +# Building against homebrew on macOS + +vcpkg doesn't support clang on macOS, see https://github.com/Microsoft/vcpkg/issues/4475 . + + * Install homebrew: ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` + * Build Qt dependencies: ``brew install pcre2 harfbuzz`` + * Build cmake from HEAD (or you can build your own): ``brew --HEAD install cmake`` + * When running cmake in qtbase, pass ``-DCMAKE_PREFIX_PATH=/usr/local`` + + # Building The basic way of building with cmake is as follows: From 43ff1b568a8af05992e6a92f45e9d584058ff6de Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 14:43:38 +0100 Subject: [PATCH 0202/1322] cmake: Fix more old-style CMake macros Use the proper target name for the Qt tools Change-Id: I04b3aed7b58d44e60597223340d66ac97ea083cb Reviewed-by: Simon Hausmann --- src/dbus/Qt5DBusMacros.cmake | 8 ++++---- src/widgets/Qt5WidgetsMacros.cmake | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dbus/Qt5DBusMacros.cmake b/src/dbus/Qt5DBusMacros.cmake index b381ab0934e..ce430ed9cdc 100644 --- a/src/dbus/Qt5DBusMacros.cmake +++ b/src/dbus/Qt5DBusMacros.cmake @@ -58,7 +58,7 @@ function(QT5_ADD_DBUS_INTERFACE _sources _interface _basename) endif() add_custom_command(OUTPUT "${_impl}" "${_header}" - COMMAND ${Qt5DBus_QDBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp ${_params} -p ${_basename} ${_infile} DEPENDS ${_infile} VERBATIM) set_source_files_properties("${_impl}" "${_header}" PROPERTIES SKIP_AUTOMOC TRUE) @@ -111,7 +111,7 @@ function(QT5_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -optio endif() add_custom_command(OUTPUT ${_target} - COMMAND ${Qt5DBus_QDBUSCPP2XML_EXECUTABLE} ${_DBUS_INTERFACE_OPTIONS} ${_in_file} -o ${_target} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbuscpp2xml ${_DBUS_INTERFACE_OPTIONS} ${_in_file} -o ${_target} DEPENDS ${_in_file} VERBATIM ) endfunction() @@ -135,12 +135,12 @@ function(QT5_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optio if(_optionalClassName) add_custom_command(OUTPUT "${_impl}" "${_header}" - COMMAND ${Qt5DBus_QDBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) else() add_custom_command(OUTPUT "${_impl}" "${_header}" - COMMAND ${Qt5DBus_QDBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile} DEPENDS ${_infile} VERBATIM ) endif() diff --git a/src/widgets/Qt5WidgetsMacros.cmake b/src/widgets/Qt5WidgetsMacros.cmake index 737371a5ade..864efae8688 100644 --- a/src/widgets/Qt5WidgetsMacros.cmake +++ b/src/widgets/Qt5WidgetsMacros.cmake @@ -56,7 +56,7 @@ function(QT5_WRAP_UI outfiles ) get_filename_component(infile ${it} ABSOLUTE) set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h) add_custom_command(OUTPUT ${outfile} - COMMAND ${Qt5Widgets_UIC_EXECUTABLE} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::uic ARGS ${ui_options} -o ${outfile} ${infile} MAIN_DEPENDENCY ${infile} VERBATIM) set_source_files_properties(${infile} PROPERTIES SKIP_AUTOUIC ON) From f94fdb35376efb5d2887ecfef67595edff74cbe3 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 12 Feb 2019 14:55:38 +0100 Subject: [PATCH 0203/1322] cmake: add TODOs in plugins/platforms for future Change-Id: I472b87cdd4f87633df7867c161ab861fba519bd3 Reviewed-by: Albert Astals Cid --- src/plugins/platforms/CMakeLists.txt | 60 ++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 907bab64f3e..e37dfc23b29 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -1,4 +1,8 @@ -if (NOT ANDROID) +if(ANDROID) # AND NOT android-embedded +# TODO add_subdirectory(android) +endif() + +if(NOT ANDROID) add_subdirectory(minimal) endif() @@ -10,15 +14,63 @@ if(QT_FEATURE_xcb) add_subdirectory(xcb) endif() +if(APPLE_UIKIT AND NOT watchOS) +# TODO add_subdirectory(ios) +endif() + +if(APPLE_OSX) + add_subdirectory(cocoa) +endif() + +if(WIN32 AND NOT WINRT) +# TODO add_subdirectory(windows) +endif() + +if(WINRT) +# TODO add_subdirectory(winrt) +endif() + +if(QT_FEATURE_direct2d) +# TODO add_subdirectory(direct2d) +endif() + +if(QNX) +# TODO add_subdirectory(qnx) +endif() + if(QT_FEATURE_eglfs) +# TODO add_subdirectory(eglfs) add_subdirectory(minimalegl) endif() +if(QT_FEATURE_directfb) +# TODO add_subdirectory(directfb) +endif() + if(QT_FEATURE_linuxfb) add_subdirectory(linuxfb) endif() -if(APPLE) - add_subdirectory(cocoa) -endif(APPLE) +if(TARGET Qt::Network AND QT_FEATURE_vnc) +# TODO add_subdirectory(vnc) +endif() +if(FREEBSD) +# TODO add_subdirectory(bsdfb) +endif() + +if(HAIKU) +# TODO add_subdirectory(haiku) +endif() + +#if(WASM) +# TODO add_subdirectory(wasm) +#endif() + +if(QT_FEATURE_mirclient) +# TODO add_subdirectory(mirclient) +endif() + +if(QT_FEATURE_integrityfb) +# TODO add_subdirectory(integrityfb) +endif() From 11acba6504560dde54e94989b84df94157f9cc00 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 14:34:40 +0100 Subject: [PATCH 0204/1322] cmake: Find and build psql plugin Change-Id: I8cbc8ab0061f67824d78198cbb926f0625fc7e41 Reviewed-by: Liang Qi --- src/plugins/sqldrivers/CMakeLists.txt | 2 +- src/plugins/sqldrivers/configure.cmake | 4 +++- src/plugins/sqldrivers/psql/CMakeLists.txt | 27 ++++++++++++++++++++++ util/cmake/configurejson2cmake.py | 1 + 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/plugins/sqldrivers/psql/CMakeLists.txt diff --git a/src/plugins/sqldrivers/CMakeLists.txt b/src/plugins/sqldrivers/CMakeLists.txt index 95e696f48b2..cc39a0fe354 100644 --- a/src/plugins/sqldrivers/CMakeLists.txt +++ b/src/plugins/sqldrivers/CMakeLists.txt @@ -15,7 +15,7 @@ qt_feature_module_end(NO_MODULE) if(QT_FEATURE_sql_psql) -# TODO add_subdirectory(psql) + add_subdirectory(psql) endif() if(QT_FEATURE_sql_mysql) diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake index 626a835f0a2..8b349a160df 100644 --- a/src/plugins/sqldrivers/configure.cmake +++ b/src/plugins/sqldrivers/configure.cmake @@ -6,6 +6,8 @@ #### Libraries +find_package(PostgreSQL) +set_package_properties(PostgreSQL PROPERTIES TYPE OPTIONAL) find_package(SQLite3) set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL) @@ -38,7 +40,7 @@ qt_feature("sql_odbc" PRIVATE ) qt_feature("sql_psql" PRIVATE LABEL "PostgreSQL" - CONDITION libs.psql OR FIXME + CONDITION PostgreSQL_FOUND ) qt_feature("sql_sqlite2" PRIVATE LABEL "SQLite2" diff --git a/src/plugins/sqldrivers/psql/CMakeLists.txt b/src/plugins/sqldrivers/psql/CMakeLists.txt new file mode 100644 index 00000000000..f87a8108b1d --- /dev/null +++ b/src/plugins/sqldrivers/psql/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from psql.pro. + +# FIXME cmake FindPostgreSQL is more exhaustive than the check we have for libpq-fe.h +# it also checks for catalog/pg_type.h which is a more internal include, we should +# add a way to tell cmake FindPostgreSQL to optionally only look for the libpq-fe.h one +find_package(PostgreSQL) + +##################################################################### +## qsqlpsql Plugin: +##################################################################### + +add_qt_plugin(qsqlpsql + TYPE sqldrivers + SOURCES + main.cpp + qsql_psql.cpp qsql_psql_p.h + DEFINES + QT_NO_CAST_TO_ASCII + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate + PostgreSQL::PostgreSQL + # OTHER_FILES = "psql.json" + # PLUGIN_CLASS_NAME = "QPSQLDriverPlugin" + # _LOADED = "qt_plugin" +) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index e99bb27bc29..c46d3167f8f 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -80,6 +80,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'pcre2': ['PCRE2', 'REQUIRED'], 'posix_iconv': None, 'pps': 'PPS', + 'psql': 'PostgreSQL', 'slog2': 'Slog2', 'sqlite3': 'SQLite3', 'sun_iconv': None, From 0a14d13b3082bb245ddbb839e15025b9709f4eff Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 14:55:20 +0100 Subject: [PATCH 0205/1322] cmake: Find and build odbc plugin Change-Id: I479d2b1cc897f601ef68b10272c9396e52228201 Reviewed-by: Liang Qi --- src/plugins/sqldrivers/CMakeLists.txt | 2 +- src/plugins/sqldrivers/configure.cmake | 4 ++- src/plugins/sqldrivers/odbc/CMakeLists.txt | 32 ++++++++++++++++++++++ util/cmake/configurejson2cmake.py | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/plugins/sqldrivers/odbc/CMakeLists.txt diff --git a/src/plugins/sqldrivers/CMakeLists.txt b/src/plugins/sqldrivers/CMakeLists.txt index cc39a0fe354..1676396f3a9 100644 --- a/src/plugins/sqldrivers/CMakeLists.txt +++ b/src/plugins/sqldrivers/CMakeLists.txt @@ -23,7 +23,7 @@ if(QT_FEATURE_sql_mysql) endif() if(QT_FEATURE_sql_odbc) -# TODO add_subdirectory(odbc) + add_subdirectory(odbc) endif() if(QT_FEATURE_sql_tds) diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake index 8b349a160df..41a66197d1b 100644 --- a/src/plugins/sqldrivers/configure.cmake +++ b/src/plugins/sqldrivers/configure.cmake @@ -8,6 +8,8 @@ find_package(PostgreSQL) set_package_properties(PostgreSQL PROPERTIES TYPE OPTIONAL) +find_package(ODBC) +set_package_properties(ODBC PROPERTIES TYPE OPTIONAL) find_package(SQLite3) set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL) @@ -36,7 +38,7 @@ qt_feature("sql_oci" PRIVATE ) qt_feature("sql_odbc" PRIVATE LABEL "ODBC" - CONDITION QT_FEATURE_datestring AND libs.odbc OR FIXME + CONDITION QT_FEATURE_datestring AND ODBC_FOUND ) qt_feature("sql_psql" PRIVATE LABEL "PostgreSQL" diff --git a/src/plugins/sqldrivers/odbc/CMakeLists.txt b/src/plugins/sqldrivers/odbc/CMakeLists.txt new file mode 100644 index 00000000000..792edb4c82b --- /dev/null +++ b/src/plugins/sqldrivers/odbc/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from odbc.pro. + +find_package(ODBC) + +##################################################################### +## qsqlodbc Plugin: +##################################################################### + +add_qt_plugin(qsqlodbc + TYPE sqldrivers + SOURCES + main.cpp + qsql_odbc.cpp qsql_odbc_p.h + DEFINES + QT_NO_CAST_TO_ASCII + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::SqlPrivate + ODBC::ODBC + # OTHER_FILES = "odbc.json" + # PLUGIN_CLASS_NAME = "QODBCDriverPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qsqlodbc CONDITION UNIX + DEFINES + UNICODE +) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index c46d3167f8f..df77ea07046 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -74,6 +74,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'libudev': 'Libudev', 'lttng-ust': LibraryMapping(package='LTTngUST', resultVariable="LTTNGUST"), 'mtdev': 'Mtdev', + 'odbc': 'ODBC', 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), 'openssl': 'OpenSSL', 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), From 1126485a575f2934415b96570f53899e29b18e32 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 15:16:42 +0100 Subject: [PATCH 0206/1322] cmake: Build the generic bearer plugin Change-Id: I3ab356e23e22499be98a626d043e2cfb9fc51105 Reviewed-by: Liang Qi --- src/plugins/CMakeLists.txt | 2 +- src/plugins/bearer/CMakeLists.txt | 9 +++++++ src/plugins/bearer/generic/CMakeLists.txt | 29 +++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/plugins/bearer/CMakeLists.txt create mode 100644 src/plugins/bearer/generic/CMakeLists.txt diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 0d470824f9e..a5e23513e32 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -4,7 +4,7 @@ if (QT_FEATURE_sql) endif() if(QT_FEATURE_network AND QT_FEATURE_bearermanagement) -# TODO add_subdirectory(bearer) + add_subdirectory(bearer) endif() if(QT_FEATURE_gui) diff --git a/src/plugins/bearer/CMakeLists.txt b/src/plugins/bearer/CMakeLists.txt new file mode 100644 index 00000000000..d6720eec33d --- /dev/null +++ b/src/plugins/bearer/CMakeLists.txt @@ -0,0 +1,9 @@ +if (NOT ANDROID AND LINUX AND QT_FEATURE_dbus) + add_subdirectory(generic) +# TODO add_subdirectory(connman) +# TODO add_subdirectory(networkmanager) +elseif(ANDROID AND NOT ANDROID_EMBEDDED) +# TODO add_subdirectory(android) +else() + add_subdirectory(generic) +endif() diff --git a/src/plugins/bearer/generic/CMakeLists.txt b/src/plugins/bearer/generic/CMakeLists.txt new file mode 100644 index 00000000000..b275ddf01aa --- /dev/null +++ b/src/plugins/bearer/generic/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from generic.pro. + +##################################################################### +## qgenericbearer Plugin: +##################################################################### + +add_qt_plugin(qgenericbearer + TYPE bearer + SOURCES + ../platformdefs_win.h + ../qbearerengine_impl.h + ../qnetworksession_impl.cpp ../qnetworksession_impl.h + main.cpp + qgenericengine.cpp qgenericengine.h + LIBRARIES + Qt::CorePrivate + Qt::NetworkPrivate + # OTHER_FILES = "generic.json" + # PLUGIN_CLASS_NAME = "QGenericEnginePlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qgenericbearer CONDITION WIN32 AND NOT WINRT + LIBRARIES + iphlpapi +) From 8fdebd5e3732d4f7537a5dab92ea7a47a8f073ba Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 15:18:06 +0100 Subject: [PATCH 0207/1322] cmake: build the connman bearer plugin Change-Id: I034ac995e231e7ad380ca9680e72037a573a1003 Reviewed-by: Liang Qi --- src/plugins/bearer/CMakeLists.txt | 2 +- src/plugins/bearer/connman/CMakeLists.txt | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/plugins/bearer/connman/CMakeLists.txt diff --git a/src/plugins/bearer/CMakeLists.txt b/src/plugins/bearer/CMakeLists.txt index d6720eec33d..e9e62753307 100644 --- a/src/plugins/bearer/CMakeLists.txt +++ b/src/plugins/bearer/CMakeLists.txt @@ -1,6 +1,6 @@ if (NOT ANDROID AND LINUX AND QT_FEATURE_dbus) add_subdirectory(generic) -# TODO add_subdirectory(connman) + add_subdirectory(connman) # TODO add_subdirectory(networkmanager) elseif(ANDROID AND NOT ANDROID_EMBEDDED) # TODO add_subdirectory(android) diff --git a/src/plugins/bearer/connman/CMakeLists.txt b/src/plugins/bearer/connman/CMakeLists.txt new file mode 100644 index 00000000000..f2ad6846027 --- /dev/null +++ b/src/plugins/bearer/connman/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from connman.pro. + +##################################################################### +## qconnmanbearer Plugin: +##################################################################### + +add_qt_plugin(qconnmanbearer + TYPE bearer + SOURCES + ../linux_common/qofonoservice_linux.cpp ../linux_common/qofonoservice_linux_p.h + ../qbearerengine_impl.h + ../qnetworksession_impl.cpp ../qnetworksession_impl.h + main.cpp + qconnmanengine.cpp qconnmanengine.h + qconnmanservice_linux.cpp qconnmanservice_linux_p.h + LIBRARIES + Qt::Core + Qt::NetworkPrivate + Qt::DBus + # OTHER_FILES = "connman.json" + # PLUGIN_CLASS_NAME = "QConnmanEnginePlugin" + # _LOADED = "qt_plugin" +) From 863cea981b9f1c49685759d6d75d199462c12f46 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 12 Feb 2019 15:23:53 +0100 Subject: [PATCH 0208/1322] cmake: add localserver in network Change-Id: I319ffad73bb5f8285b1b2fa583d813667498c3dd Reviewed-by: Albert Astals Cid --- src/network/CMakeLists.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index ce7e5ed77c9..4188cecb9d6 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -276,6 +276,32 @@ extend_target(Network CONDITION WINRT socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h ) +extend_target(Network CONDITION QT_FEATURE_localserver + SOURCES + socket/qlocalserver.cpp socket/qlocalserver.h socket/qlocalserver_p.h + socket/qlocalsocket.cpp socket/qlocalsocket.h socket/qlocalsocket_p.h +) + +extend_target(Network CONDITION QT_FEATURE_localserver AND ((INTEGRITY) OR (WINRT)) + SOURCES + socket/qlocalsocket_tcp.cpp + socket/qlocalserver_tcp.cpp + DEFINES + QT_LOCALSOCKET_TCP +) + +extend_target(Network CONDITION QT_FEATURE_localserver AND (UNIX) AND (NOT INTEGRITY) + SOURCES + socket/qlocalsocket_unix.cpp + socket/qlocalserver_unix.cpp +) + +extend_target(Network CONDITION QT_FEATURE_localserver AND (WIN32) AND (NOT WINRT) + SOURCES + socket/qlocalsocket_win.cpp + socket/qlocalserver_win.cpp +) + extend_target(Network CONDITION NOT QT_FEATURE_openssl SOURCES ssl/qsslcertificate_qt.cpp From 6424e70bbef492f052d1aa6b7ce36d5326625e6e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 15:21:58 +0100 Subject: [PATCH 0209/1322] cmake: compile the networkmanager bearer plugin Change-Id: Ia744afec6114266fcb693702db257fe36ba94b92 Reviewed-by: Liang Qi --- src/plugins/bearer/CMakeLists.txt | 2 +- .../bearer/networkmanager/CMakeLists.txt | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/plugins/bearer/networkmanager/CMakeLists.txt diff --git a/src/plugins/bearer/CMakeLists.txt b/src/plugins/bearer/CMakeLists.txt index e9e62753307..ec860de2cbc 100644 --- a/src/plugins/bearer/CMakeLists.txt +++ b/src/plugins/bearer/CMakeLists.txt @@ -1,7 +1,7 @@ if (NOT ANDROID AND LINUX AND QT_FEATURE_dbus) add_subdirectory(generic) add_subdirectory(connman) -# TODO add_subdirectory(networkmanager) + add_subdirectory(networkmanager) elseif(ANDROID AND NOT ANDROID_EMBEDDED) # TODO add_subdirectory(android) else() diff --git a/src/plugins/bearer/networkmanager/CMakeLists.txt b/src/plugins/bearer/networkmanager/CMakeLists.txt new file mode 100644 index 00000000000..44323620d19 --- /dev/null +++ b/src/plugins/bearer/networkmanager/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from networkmanager.pro. + +##################################################################### +## qnmbearer Plugin: +##################################################################### + +add_qt_plugin(qnmbearer + TYPE bearer + SOURCES + ../linux_common/qofonoservice_linux.cpp ../linux_common/qofonoservice_linux_p.h + ../qbearerengine_impl.h + ../qnetworksession_impl.cpp ../qnetworksession_impl.h + main.cpp + qnetworkmanagerengine.cpp qnetworkmanagerengine.h + qnetworkmanagerservice.cpp qnetworkmanagerservice.h + LIBRARIES + Qt::Core + Qt::NetworkPrivate + Qt::DBus + # OTHER_FILES = "networkmanager.json" + # PLUGIN_CLASS_NAME = "QNetworkManagerEnginePlugin" + # _LOADED = "qt_plugin" +) From 519ef817ffb4dbadb00ac958e7402cbfeaf135af Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 16:58:26 +0100 Subject: [PATCH 0210/1322] Fix Desktop GL/EGL/GLESv2 linkage This change fixes a few things in one go: * cmake's FindOpenGL cannot be used reliably to detect EGL. So use a custom module for that. * Added a custom module for GLESv2 detection, as cmake's FindOpenGL does not support that. * Map CONFIG += opengl to a WrapOpenGL target, which links against either GLESv2 or libGL - just like mkspecs/features/*/opengl.prf * cmake's FindOpenGL remains in use solely to detect the availability of desktop gl. Change-Id: I9315e5ad1fd88e1b7dc7e920053e98fb51fea7fc Reviewed-by: Volker Krause --- cmake/FindEGL.cmake | 32 +++++++++++++++ cmake/FindGLESv2.cmake | 40 +++++++++++++++++++ cmake/FindWrapOpenGL.cmake | 16 ++++++++ src/gui/CMakeLists.txt | 8 +++- src/gui/configure.cmake | 12 ++++-- .../eglconvenience/CMakeLists.txt | 8 +++- .../platforms/minimalegl/CMakeLists.txt | 3 ++ util/cmake/configurejson2cmake.py | 3 +- 8 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 cmake/FindEGL.cmake create mode 100644 cmake/FindGLESv2.cmake create mode 100644 cmake/FindWrapOpenGL.cmake diff --git a/cmake/FindEGL.cmake b/cmake/FindEGL.cmake new file mode 100644 index 00000000000..88997568b0c --- /dev/null +++ b/cmake/FindEGL.cmake @@ -0,0 +1,32 @@ +include(CheckCXXSourceCompiles) +include(CMakePushCheckState) + +find_library(EGL_LIBRARY NAMES EGL) +find_path(EGL_INCLUDE_DIR NAMES "EGL/egl.h" DOC "The EGL include path") + +cmake_push_check_state(RESET) +list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}") +list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}") + +check_cxx_source_compiles(" +#include + +int main(int argc, char *argv[]) { + EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0; + eglDestroyContext(dpy, ctx); +}" HAVE_EGL) + +cmake_pop_check_state() + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EGL DEFAULT_MSG EGL_INCLUDE_DIR EGL_LIBRARY HAVE_EGL) + +mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY HAVE_EGL) + +if(EGL_FOUND AND NOT TARGET EGL::EGL) + add_library(EGL::EGL UNKNOWN IMPORTED) + set_target_properties(EGL::EGL PROPERTIES + IMPORTED_LOCATION "${EGL_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}") +endif() diff --git a/cmake/FindGLESv2.cmake b/cmake/FindGLESv2.cmake new file mode 100644 index 00000000000..a4af6cbbbc0 --- /dev/null +++ b/cmake/FindGLESv2.cmake @@ -0,0 +1,40 @@ +include(CheckCXXSourceCompiles) + +find_library(GLESv2_LIBRARY NAMES GLESv2) +find_path(GLESv2_INCLUDE_DIR NAMES "GLES2/gl2.h" DOC "The OpenGLES 2 include path") + +set(_libraries "${CMAKE_REQUIRED_LIBRARIES}") +list(APPEND CMAKE_REQUIRED_LIBRARIES "${GLESv2_LIBRARY}") +set(_includes "${CMAKE_REQUIRED_INCLUDES}") +list(APPEND CMAKE_REQUIRED_INCLUDES "${GLESv2_INCLUDE_DIR}") + +check_cxx_source_compiles(" +#ifdef __APPLE__ +# include +#else +# define GL_GLEXT_PROTOTYPES +# include +#endif + +int main(int argc, char *argv[]) { + glUniform1f(1, GLfloat(1.0)); + glClear(GL_COLOR_BUFFER_BIT); +}" HAVE_GLESv2) + +set(CMAKE_REQUIRED_LIBRARY "${_libraries}") +unset(_libraries) +set(CMAKE_REQUIRED_INCLUDES "${_includes}") +unset(_includes) + + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_INCLUDE_DIR GLESv2_LIBRARY HAVE_GLESv2) + +mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY HAVE_GLESv2) + +if(GLESv2_FOUND AND NOT TARGET GLESv2::GLESv2) + add_library(GLESv2::GLESv2 UNKNOWN IMPORTED) + set_target_properties(GLESv2::GLESv2 PROPERTIES + IMPORTED_LOCATION "${GLESv2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${GLESv2_INCLUDE_DIR}") +endif() diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake new file mode 100644 index 00000000000..4eefdfa8116 --- /dev/null +++ b/cmake/FindWrapOpenGL.cmake @@ -0,0 +1,16 @@ + +# Logic derived from mkspecs/features/unix/opengl.prf: prefer GLESv2 over GL + +if(TARGET WrapOpenGL) + return() +endif() + +add_library(WrapOpenGL INTERFACE) + +if(QT_FEATURE_opengles2) + find_package(GLESv2) + target_link_libraries(WrapOpenGL INTERFACE GLESv2::GLESv2) +else() + find_package(OpenGL) + target_link_libraries(WrapOpenGL INTERFACE OpenGL::GL) +endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b2520f5e066..4ea528e7aee 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -317,6 +317,12 @@ extend_target(Gui CONDITION TEST_architecture STREQUAL arm64 AND NOT APPLE_UIKIT DEFINES ENABLE_PIXMAN_DRAWHELPERS ) +# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf +# acted like WrapOpenGL: direct linkage against either libGLESv2 or +# libGL, depending in the opengl _feature_. This is done by hand now +# here (where the feature is available). +find_package(WrapOpenGL) + extend_target(Gui CONDITION QT_FEATURE_opengl SOURCES opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h @@ -347,7 +353,7 @@ extend_target(Gui CONDITION QT_FEATURE_opengl opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h LIBRARIES - OpenGL::GL + WrapOpenGL ) extend_target(Gui CONDITION (QT_FEATURE_opengl) AND (NOT QT_FEATURE_opengles2) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index e5888cc1d78..5e29a60463b 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -38,8 +38,8 @@ find_package(ATSPI2) set_package_properties(ATSPI2 PROPERTIES TYPE OPTIONAL) find_package(Libdrm) set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL) -find_package(OpenGL) -set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL) +find_package(EGL) +set_package_properties(EGL PROPERTIES TYPE OPTIONAL) find_package(Freetype) set_package_properties(Freetype PROPERTIES TYPE OPTIONAL) find_package(Fontconfig) @@ -56,6 +56,10 @@ find_package(PNG) set_package_properties(PNG PROPERTIES TYPE OPTIONAL) find_package(Mtdev) set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) +find_package(OpenGL) +set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL) +find_package(GLESv2) +set_package_properties(GLESv2 PROPERTIES TYPE OPTIONAL) find_package(Tslib) set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) find_package(Vulkan) @@ -537,7 +541,7 @@ qt_feature("mtdev" PRIVATE ) qt_feature("opengles2" PUBLIC LABEL "OpenGL ES 2.0" - CONDITION WIN32 OR ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND libs.opengl_es2 ) OR FIXME + CONDITION WIN32 OR ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND ) ENABLE INPUT_opengl STREQUAL 'es2' DISABLE INPUT_opengl STREQUAL 'desktop' OR INPUT_opengl STREQUAL 'dynamic' OR INPUT_opengl STREQUAL 'no' ) @@ -586,7 +590,7 @@ qt_feature("openvg" PUBLIC ) qt_feature("egl" PUBLIC PRIVATE LABEL "EGL" - CONDITION ( QT_FEATURE_opengl OR QT_FEATURE_openvg ) AND ( QT_FEATURE_angle OR OpenGL_EGL_FOUND ) + CONDITION ( QT_FEATURE_opengl OR QT_FEATURE_openvg ) AND ( QT_FEATURE_angle OR EGL_FOUND ) ) qt_feature_definition("egl" "QT_NO_EGL" NEGATE VALUE "1") qt_feature("egl_x11" PRIVATE diff --git a/src/platformsupport/eglconvenience/CMakeLists.txt b/src/platformsupport/eglconvenience/CMakeLists.txt index 2b20a9cb351..af5d277f7a9 100644 --- a/src/platformsupport/eglconvenience/CMakeLists.txt +++ b/src/platformsupport/eglconvenience/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from eglconvenience.pro. -find_package(OpenGL) +find_package(EGL) ##################################################################### ## EglSupport Module: @@ -18,8 +18,12 @@ add_qt_module(EglSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate - OpenGL::EGL + EGL::EGL ${CMAKE_DL_LIBS} + # CONFIG = "static" "internal_module" "egl" + # MODULE = "egl_support" + # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" + # _LOADED = "qt_module" ) ## Scopes: diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt index a038d07df95..f6d46c55a4e 100644 --- a/src/plugins/platforms/minimalegl/CMakeLists.txt +++ b/src/plugins/platforms/minimalegl/CMakeLists.txt @@ -1,5 +1,7 @@ # Generated from minimalegl.pro. +find_package(FindWrapOpenGL) + ##################################################################### ## qminimalegl Plugin: ##################################################################### @@ -19,6 +21,7 @@ add_qt_plugin(qminimalegl Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate Qt::EglSupportPrivate + WrapOpenGL # CONFIG = "egl" # OTHER_FILES = "minimalegl.json" # PLUGIN_CLASS_NAME = "QMinimalEglIntegrationPlugin" diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index df77ea07046..840ffefd059 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -52,7 +52,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'cups': 'Cups', 'double-conversion': 'WrapDoubleConversion', 'drm': 'Libdrm', - 'egl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_EGL"), + 'egl': 'EGL', 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), 'freetype': 'Freetype', 'gbm': 'gbm', @@ -101,6 +101,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'xrender': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), 'zlib': 'ZLIB', 'zstd': 'ZSTD', + 'opengl_es2': 'GLESv2', } # type: Dict[str, Union[str, List[str], LibraryMapping]] if lib not in libmap: raise Exception(' XXXX Unknown library "{}".'.format(lib)) From 1f965067489c59649b89eb2d0a32c74473d6cedd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Feb 2019 14:57:58 +0100 Subject: [PATCH 0211/1322] Fix build without Vulkan The syncqt generated headers are optional, i.e. their source may not exist -- so for now make their installation optional (as it seems to have been the case with qmake). Change-Id: Ieaeb3d13a1d8ff1f158b5b1c918750fec48d3bef Reviewed-by: Kevin Funk --- cmake/QtBuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index e3f709d2335..d207252c299 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -340,10 +340,10 @@ function(qt_install_injections module) set(fwd_hdrs ${injection}) get_filename_component(destinationdir ${destination} DIRECTORY) get_filename_component(destinationname ${destination} NAME) - install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir} RENAME ${destinationname}) + install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir} RENAME ${destinationname} OPTIONAL) foreach(fwd_hdr ${fwd_hdrs}) file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" CONTENT "#include \"${destinationname}\"\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir}) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir} OPTIONAL) endforeach() endforeach() endfunction() From cc8e2c45729a8e84beddc201f801dc23edfdd683 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Tue, 12 Feb 2019 16:04:57 +0100 Subject: [PATCH 0212/1322] Use CMakePushCheckState Change-Id: I58d779674363a7f7db4a7ea4ca4a9f4a9e271798 Reviewed-by: Simon Hausmann --- cmake/FindWrapRt.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/FindWrapRt.cmake b/cmake/FindWrapRt.cmake index 221399b259a..dee41e06179 100644 --- a/cmake/FindWrapRt.cmake +++ b/cmake/FindWrapRt.cmake @@ -1,8 +1,9 @@ include(CheckCXXSourceCompiles) +include(CMakePushCheckState) find_library(LIBRT rt) -set(_libraries "${CMAKE_REQUIRED_LIBRARIES}") +cmake_push_check_state() if(LIBRT_FOUND) list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBRT}") endif() @@ -15,8 +16,7 @@ int main(int argc, char *argv[]) { timespec ts; clock_gettime(CLOCK_REALTIME, &ts); }" HAVE_GETTIME) -set(CMAKE_REQUIRED_LIBRARIES "${_libraries}") -unset(_libraries) +cmake_pop_check_state() add_library(WrapRt INTERFACE) if (LIBRT_FOUND) From 6235fd68d53340e5b51351366ae6f6775dd686c6 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 17:05:00 +0100 Subject: [PATCH 0213/1322] cmake: FindWrapOpenGL->WrapOpenGL Change-Id: Ic44d3ee806cf287a2c3cb36811b99418ea92d8a0 Reviewed-by: Simon Hausmann --- src/plugins/platforms/minimalegl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt index f6d46c55a4e..f42925f632a 100644 --- a/src/plugins/platforms/minimalegl/CMakeLists.txt +++ b/src/plugins/platforms/minimalegl/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from minimalegl.pro. -find_package(FindWrapOpenGL) +find_package(WrapOpenGL) ##################################################################### ## qminimalegl Plugin: From 9a01b4312bbf0336e9a7fb4304c6757db9c0709e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 17:12:25 +0100 Subject: [PATCH 0214/1322] cmake: set WrapOpenGL_FOUND to ON Otherwise the cmake summary at the end says -- The following packages have not been found: * WrapOpenGL It's OpenGL or GLESv2 that will show there as missing if needed Change-Id: I182f1299b86e1a4e24762d0bad6533c6136cbbcc Reviewed-by: Simon Hausmann --- cmake/FindWrapOpenGL.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake index 4eefdfa8116..c97ba0e4665 100644 --- a/cmake/FindWrapOpenGL.cmake +++ b/cmake/FindWrapOpenGL.cmake @@ -2,6 +2,7 @@ # Logic derived from mkspecs/features/unix/opengl.prf: prefer GLESv2 over GL if(TARGET WrapOpenGL) + set(WrapOpenGL_FOUND ON) return() endif() @@ -14,3 +15,4 @@ else() find_package(OpenGL) target_link_libraries(WrapOpenGL INTERFACE OpenGL::GL) endif() +set(WrapOpenGL_FOUND ON) From d523a642dc7f8b75e7a3a945149cce2a5c4451d3 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 12 Feb 2019 17:27:16 +0100 Subject: [PATCH 0215/1322] cmake: enable vnc platform plugin Change-Id: I5015681aff3c9ceb5c0b72571bc8756f3ada104c Reviewed-by: Simon Hausmann --- src/plugins/platforms/CMakeLists.txt | 2 +- src/plugins/platforms/vnc/CMakeLists.txt | 41 ++++++++++++++++++++++++ util/cmake/helper.py | 2 ++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/vnc/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index e37dfc23b29..68ac4023d3a 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -52,7 +52,7 @@ if(QT_FEATURE_linuxfb) endif() if(TARGET Qt::Network AND QT_FEATURE_vnc) -# TODO add_subdirectory(vnc) + add_subdirectory(vnc) endif() if(FREEBSD) diff --git a/src/plugins/platforms/vnc/CMakeLists.txt b/src/plugins/platforms/vnc/CMakeLists.txt new file mode 100644 index 00000000000..ced972391dc --- /dev/null +++ b/src/plugins/platforms/vnc/CMakeLists.txt @@ -0,0 +1,41 @@ +# Generated from vnc.pro. + +##################################################################### +## qvnc Plugin: +##################################################################### + +add_qt_plugin(qvnc + TYPE platforms + SOURCES + main.cpp + qvnc.cpp qvnc_p.h + qvncclient.cpp qvncclient.h + qvncintegration.cpp qvncintegration.h + qvncscreen.cpp qvncscreen.h + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::Network + Qt::GuiPrivate + Qt::ServiceSupportPrivate + Qt::ThemeSupportPrivate + Qt::FbSupportPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + # OTHER_FILES = "vnc.json" + # PLUGIN_CLASS_NAME = "QVncIntegrationPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +extend_target(qvnc CONDITION TARGET Qt::InputSupportPrivate + LIBRARIES + Qt::InputSupportPrivate +) +# +#extend_target(qvnc CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 6234d26d09c..c11632cd066 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -63,6 +63,7 @@ def map_qt_base_library(lib: str) -> str: 'enginio_client': 'Enginio', 'eventdispatchers': 'Qt::EventDispatcherSupport', 'extras': 'Qt::3DExtras', + 'fb_support': 'Qt::FbSupport', 'fbconvenience': 'Qt::FbSupport', 'fontdatabase_support': 'Qt::FontDatabaseSupport', 'gamepad': 'Qt::Gamepad', @@ -73,6 +74,7 @@ def map_qt_base_library(lib: str) -> str: 'help': 'Qt::Help', 'hunspellinputmethod': 'Qt::HunspellInputMethod', 'input': 'Qt::InputSupport', + 'input_support': 'Qt::InputSupport', 'installer-lib': 'Qt::AppManInstaller', 'kmsconvenience': 'Qt::KmsSupport', 'launcher-lib': 'Qt::AppManLauncher', From 96c0dc07a785fa5f2146038a8ac2f35c54fe15b9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 15:45:56 +0100 Subject: [PATCH 0216/1322] Use rpath by default not only for building but also installed binaries This makes it possible to use the binaries out of the box. This is particularly relevant for program binaries that link against QtCore dynamically, when trying to use these binaries during cross-compilation. Change-Id: I7dee93194be3fff5c6e3bbb9e202e4cf5e19b6d0 Reviewed-by: Volker Krause --- cmake/QtBuild.cmake | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index d207252c299..db5b13a291e 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -40,6 +40,20 @@ set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake nam set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]") +# the default RPATH to be used when installing, but only if it's not a system directory +LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) +IF("${isSystemDir}" STREQUAL "-1") + SET(_default_install_rpath "${CMAKE_INSTALL_PREFIX}/lib") +ENDIF("${isSystemDir}" STREQUAL "-1") + +# Default rpath settings: Use rpath for build tree as well as a full path for the installed binaries. +# For origin builds, one needs to override CMAKE_INSTALL_RPATH for example with $ORIGIN/../lib +SET(CMAKE_INSTALL_RPATH "${_default_install_rpath}" CACHE PATH "RPATH for installed binaries") + +# add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + # Platform define path, etc. if(WIN32) set(QT_DEFAULT_PLATFORM_DEFINITIONS UNICODE _UNICODE WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE) From cdab00c7eee15209cfad8fba059a872118a459b2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 13 Feb 2019 10:38:00 +0100 Subject: [PATCH 0217/1322] Replace "our" FindEGL.cmake with the ECM version The ECM version now also does a compile test, which was the only real "functional" difference. Change-Id: I1d5cd590359feba7c7a38ff374992349d5943070 Reviewed-by: Volker Krause --- .../find-modules/FindEGL.cmake | 166 ++++++++++++++++++ cmake/FindEGL.cmake | 32 ---- 2 files changed, 166 insertions(+), 32 deletions(-) create mode 100644 cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake delete mode 100644 cmake/FindEGL.cmake diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake new file mode 100644 index 00000000000..5277d123782 --- /dev/null +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake @@ -0,0 +1,166 @@ +#.rst: +# FindEGL +# ------- +# +# Try to find EGL. +# +# This will define the following variables: +# +# ``EGL_FOUND`` +# True if (the requested version of) EGL is available +# ``EGL_VERSION`` +# The version of EGL; note that this is the API version defined in the +# headers, rather than the version of the implementation (eg: Mesa) +# ``EGL_LIBRARIES`` +# This can be passed to target_link_libraries() instead of the ``EGL::EGL`` +# target +# ``EGL_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if the target is not +# used for linking +# ``EGL_DEFINITIONS`` +# This should be passed to target_compile_options() if the target is not +# used for linking +# +# If ``EGL_FOUND`` is TRUE, it will also define the following imported target: +# +# ``EGL::EGL`` +# The EGL library +# +# In general we recommend using the imported target, as it is easier to use. +# Bear in mind, however, that if the target is in the link interface of an +# exported library, it must be made available by the package config file. +# +# Since pre-1.0.0. + +#============================================================================= +# Copyright 2014 Alex Merry +# Copyright 2014 Martin Gräßlin +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpersStub.cmake) +include(CheckCXXSourceCompiles) +include(CMakePushCheckState) + +ecm_find_package_version_check(EGL) + +# Use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig) +pkg_check_modules(PKG_EGL QUIET egl) + +set(EGL_DEFINITIONS ${PKG_EGL_CFLAGS_OTHER}) + +find_path(EGL_INCLUDE_DIR + NAMES + egl.h + HINTS + ${PKG_EGL_INCLUDE_DIRS} + PATH_SUFFIXES + EGL +) +find_library(EGL_LIBRARY + NAMES + EGL + HINTS + ${PKG_EGL_LIBRARY_DIRS} +) + +# NB: We do *not* use the version information from pkg-config, as that +# is the implementation version (eg: the Mesa version) +if(EGL_INCLUDE_DIR) + # egl.h has defines of the form EGL_VERSION_x_y for each supported + # version; so the header for EGL 1.1 will define EGL_VERSION_1_0 and + # EGL_VERSION_1_1. Finding the highest supported version involves + # finding all these defines and selecting the highest numbered. + file(READ "${EGL_INCLUDE_DIR}/egl.h" _EGL_header_contents) + string(REGEX MATCHALL + "[ \t]EGL_VERSION_[0-9_]+" + _EGL_version_lines + "${_EGL_header_contents}" + ) + unset(_EGL_header_contents) + foreach(_EGL_version_line ${_EGL_version_lines}) + string(REGEX REPLACE + "[ \t]EGL_VERSION_([0-9_]+)" + "\\1" + _version_candidate + "${_EGL_version_line}" + ) + string(REPLACE "_" "." _version_candidate "${_version_candidate}") + if(NOT DEFINED EGL_VERSION OR EGL_VERSION VERSION_LESS _version_candidate) + set(EGL_VERSION "${_version_candidate}") + endif() + endforeach() + unset(_EGL_version_lines) +endif() + +cmake_push_check_state(RESET) +list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}") +list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}") + +check_cxx_source_compiles(" +#include + +int main(int argc, char *argv[]) { + EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0; + eglDestroyContext(dpy, ctx); +}" HAVE_EGL) + +cmake_pop_check_state() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EGL + FOUND_VAR + EGL_FOUND + REQUIRED_VARS + EGL_LIBRARY + EGL_INCLUDE_DIR + HAVE_EGL + VERSION_VAR + EGL_VERSION +) + +if(EGL_FOUND AND NOT TARGET EGL::EGL) + add_library(EGL::EGL UNKNOWN IMPORTED) + set_target_properties(EGL::EGL PROPERTIES + IMPORTED_LOCATION "${EGL_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${EGL_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(EGL_LIBRARY EGL_INCLUDE_DIR HAVE_EGL) + +# compatibility variables +set(EGL_LIBRARIES ${EGL_LIBRARY}) +set(EGL_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) +set(EGL_VERSION_STRING ${EGL_VERSION}) + +include(FeatureSummary) +set_package_properties(EGL PROPERTIES + URL "https://www.khronos.org/egl/" + DESCRIPTION "A platform-agnostic mechanism for creating rendering surfaces for use with other graphics libraries, such as OpenGL|ES and OpenVG." +) diff --git a/cmake/FindEGL.cmake b/cmake/FindEGL.cmake deleted file mode 100644 index 88997568b0c..00000000000 --- a/cmake/FindEGL.cmake +++ /dev/null @@ -1,32 +0,0 @@ -include(CheckCXXSourceCompiles) -include(CMakePushCheckState) - -find_library(EGL_LIBRARY NAMES EGL) -find_path(EGL_INCLUDE_DIR NAMES "EGL/egl.h" DOC "The EGL include path") - -cmake_push_check_state(RESET) -list(APPEND CMAKE_REQUIRED_LIBRARIES "${EGL_LIBRARY}") -list(APPEND CMAKE_REQUIRED_INCLUDES "${EGL_INCLUDE_DIR}") - -check_cxx_source_compiles(" -#include - -int main(int argc, char *argv[]) { - EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0; - eglDestroyContext(dpy, ctx); -}" HAVE_EGL) - -cmake_pop_check_state() - - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(EGL DEFAULT_MSG EGL_INCLUDE_DIR EGL_LIBRARY HAVE_EGL) - -mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY HAVE_EGL) - -if(EGL_FOUND AND NOT TARGET EGL::EGL) - add_library(EGL::EGL UNKNOWN IMPORTED) - set_target_properties(EGL::EGL PROPERTIES - IMPORTED_LOCATION "${EGL_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}") -endif() From 4c51273f1f5eaad1c728c0abd06ba9d6eceafa8a Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 14:44:56 +0100 Subject: [PATCH 0218/1322] cmake: Build qmake using CMake Change-Id: Ia2ad09774252154d19d7c80abfcd72ecd09025ae Reviewed-by: Simon Hausmann --- qmake/CMakeLists.txt | 140 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index eb966b8018a..223eefaa57c 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,2 +1,140 @@ -## FIXME: Actually build something... install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${INSTALL_DATADIR}) + +add_qt_tool(qmake + SOURCES + meta.cpp + option.cpp + project.cpp + property.cpp + library/ioutils.cpp + library/proitems.cpp + library/qmakebuiltins.cpp + library/qmakeevaluator.cpp + library/qmakeglobals.cpp + library/qmakeparser.cpp + library/qmakevfs.cpp + generators/mac/pbuilder_pbx.cpp + generators/makefile.cpp + generators/makefiledeps.cpp + generators/metamakefile.cpp + generators/projectgenerator.cpp + generators/unix/unixmake2.cpp + generators/unix/unixmake.cpp + generators/win32/mingw_make.cpp + generators/win32/msbuild_objectmodel.cpp + generators/win32/msvc_nmake.cpp + generators/win32/msvc_objectmodel.cpp + generators/win32/msvc_vcproj.cpp + generators/win32/msvc_vcxproj.cpp + generators/win32/winmakefile.cpp + generators/xmloutput.cpp + + ${PROJECT_SOURCE_DIR}/src/corelib/codecs/qtextcodec.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/codecs/qutfcodec.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qendian.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qglobal.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qlibraryinfo.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qlogging.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qmalloc.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qnumeric.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qrandom.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qabstractfileengine.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qbuffer.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qdebug.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qdir.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qdiriterator.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfile.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfiledevice.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfileinfo.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemengine.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystementry.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine_iterator.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qiodevice.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qtemporaryfile.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qmetatype.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qsystemerror.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qvariant.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/plugin/quuid.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qdatastream.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonarray.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjson.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsondocument.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonobject.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonparser.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qjsonvalue.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qtextstream.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qxmlstream.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/serialization/qxmlutils.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qarraydata.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qbitarray.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qbytearray.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qbytearraymatcher.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qcryptographichash.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qdatetime.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qhash.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlinkedlist.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlist.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale_tools.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qmap.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qregexp.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qringbuffer.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstringbuilder.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstring_compat.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstring.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qstringlist.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qversionnumber.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qvsnprintf.cpp + + main.cpp + DEFINES + QT_VERSION_STR="${PROJECT_VERSION}" + QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} + QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} + QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} + QT_BUILD_QMAKE QT_BOOTSTRAPPED PROEVALUATOR_FULL + QT_NO_FOREACH + INCLUDE_DIRECTORIES + library + generators + generators/unix + generators/win32 + generators/mac + + ${PROJECT_BINARY_DIR}/include + ${PROJECT_BINARY_DIR}/include/QtCore + ${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION} + ${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore + ${PROJECT_BINARY_DIR}/src/corelib/global +) + +extend_target(qmake CONDITION UNIX + SOURCES + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_unix.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemengine_unix.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemiterator_unix.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine_unix.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale_unix.cpp +) + +extend_target(qmake CONDITION APPLE_OSX + SOURCES + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_foundation.mm + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_mac_objc.mm + ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion_darwin.mm + ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings_mac.cpp + LIBRARIES + -framework ApplicationServices + -framework CoreServices + -framework Foundation +) +# TODO: Windows support, cf. qmake.pro + +set_target_properties(qmake PROPERTIES + AUTOMOC OFF + AUTORCC OFF + AUTOUIC OFF +) From 35a17f194199a72376042451588ae974124e9143 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 20:20:20 +0100 Subject: [PATCH 0219/1322] cmake: src/printsupport: Rerun conversion script Change-Id: I0bdc4eefa5e1e78ba7f68da5848e32297c6af5a1 Reviewed-by: Simon Hausmann --- src/printsupport/CMakeLists.txt | 34 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index 7a46c061d21..13f4a380360 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -20,9 +20,17 @@ add_qt_module(PrintSupport DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH - INCLUDE_DIRECTORIES widgets dialogs - LIBRARIES Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate - PUBLIC_LIBRARIES Qt::Gui # for QPageSize + INCLUDE_DIRECTORIES + widgets + dialogs + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES Qt::Gui # manual: for QPageSize + # MODULE_PLUGIN_TYPES = "printsupport" + # QMAKE_LIBS = "$$QMAKE_LIBS_PRINTSUPPORT" + # _LOADED = "qt_module" ) ## Scopes: @@ -31,6 +39,7 @@ add_qt_module(PrintSupport extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewwidget SOURCES kernel/qpaintengine_preview.cpp kernel/qpaintengine_preview_p.h + widgets/qprintpreviewwidget.cpp widgets/qprintpreviewwidget.h ) extend_target(PrintSupport CONDITION WIN32 @@ -39,20 +48,19 @@ extend_target(PrintSupport CONDITION WIN32 ) extend_target(PrintSupport CONDITION WIN32 AND NOT WINRT - LIBRARIES winspool comdlg32 gdi32 user32 + LIBRARIES + winspool + comdlg32 + gdi32 + user32 ) -extend_target(PrintSupport CONDITION (UNIX AND NOT APPLE) AND QT_FEATURE_cups +extend_target(PrintSupport CONDITION QT_FEATURE_cups AND UNIX AND NOT APPLE SOURCES kernel/qcups.cpp kernel/qcups_p.h ) -extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewwidget - SOURCES - widgets/qprintpreviewwidget.cpp widgets/qprintpreviewwidget.h -) - -extend_target(PrintSupport CONDITION (UNIX AND NOT APPLE) AND QT_FEATURE_cupsjobwidget +extend_target(PrintSupport CONDITION QT_FEATURE_cupsjobwidget AND UNIX AND NOT APPLE SOURCES widgets/qcupsjobwidget.cpp widgets/qcupsjobwidget.ui widgets/qcupsjobwidget_p.h ) @@ -65,7 +73,7 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printdialog dialogs/qprintdialog.h dialogs/qprintdialog.qrc ) -extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND macos +extend_target(PrintSupport CONDITION APPLE_OSX AND QT_FEATURE_printdialog SOURCES dialogs/qpagesetupdialog_mac.mm dialogs/qprintdialog_mac.mm @@ -79,7 +87,7 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND WIN32 dialogs/qprintdialog_win.cpp ) -extend_target(PrintSupport CONDITION (QT_FEATURE_printdialog AND UNIX) AND NOT APPLE +extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND UNIX AND NOT APPLE SOURCES dialogs/qpagesetupdialog_unix.cpp dialogs/qpagesetupdialog_unix_p.h dialogs/qprintdialog_unix.cpp From f0d6fd6b9586de778a56056b4950c2b92f5e2b88 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 19:45:07 +0100 Subject: [PATCH 0220/1322] cmake: Also use -Wl,--no-undefined for Clang Change-Id: Ida6bf41e496a0e800f1146d15edf192d0635a3c9 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index db5b13a291e..37da7ac43e3 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -588,7 +588,7 @@ function(add_qt_module target) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. - if (GCC) + if (GCC OR CLANG) qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") endif() @@ -674,7 +674,7 @@ function(add_qt_plugin target) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. - if (GCC) + if (GCC OR CLANG) qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") endif() From e1a750a102bd7debd67ddabc7a60f6b7d6be4248 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 13 Feb 2019 12:33:21 +0100 Subject: [PATCH 0221/1322] cmake: Minor fix in QtModuleConfig.cmake.in Change-Id: Ia01e935582b5291fa8ed6bf46866fbb74d41f4b0 Reviewed-by: Simon Hausmann --- cmake/QtModuleConfig.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index f3993bbd8e3..e9eec7ae94d 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -18,7 +18,7 @@ foreach(_target_dep ${_target_deps}) endif() if (NOT ${pkg}_FOUND) - set(@target@_FOUND FALSE) + set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) return() endif() endforeach() From 766701a9b2b5a4124186fc4a026b5511bfa61b57 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 13 Feb 2019 09:45:57 +0100 Subject: [PATCH 0222/1322] cmake: Install all necessary .cmake files ... for other modules Change-Id: Iea184036a46816e524de247e1d650ae417de294c Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index ab96f48ec8c..6074f1233c0 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -64,9 +64,15 @@ install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXP ## Install some QtBase specific CMake files: install(FILES cmake/QtBuild.cmake + cmake/QtCompilerOptimization.cmake cmake/QtFeature.cmake + cmake/QtPlatformSupport.cmake cmake/QtPostProcess.cmake cmake/QtSetup.cmake cmake/QtModuleConfig.cmake.in DESTINATION "${config_install_dir}" ) +# TODO: Check whether this is the right place to install these +install(DIRECTORY cmake/3rdparty + DESTINATION "${config_install_dir}" +) From b2337e1d005212b607dd1bd6c8413c0d9b3b1bc2 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 13 Feb 2019 09:45:18 +0100 Subject: [PATCH 0223/1322] cmake: Make sure QtModuleConfig.cmake.in is found ... when QtBuild.cmake is being included from another Qt module Change-Id: Ia55e03422cc84a56dd9eac640621e5b2ee9681bd Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 37da7ac43e3..93369ee9659 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -39,6 +39,7 @@ set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]") set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]") set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]") +set(QT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") # the default RPATH to be used when installing, but only if it's not a system directory LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) @@ -568,7 +569,7 @@ function(add_qt_module target) endif() configure_package_config_file( - "${PROJECT_SOURCE_DIR}/cmake/QtModuleConfig.cmake.in" + "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" INSTALL_DESTINATION "${config_install_dir}" ) From 0896e203d651af55008aefa6edb7da940c27c02a Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 22:39:35 +0100 Subject: [PATCH 0224/1322] cmake: Make sure QT_SYNCQT is persisted Lifetime of the variable is bound to the function body. Use a CACHE variable to escape it (and to speed up future calls to the function). Change-Id: I2d164a1c94e64cc652e65c1eea0522f3d911ad82 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 93369ee9659..c63081d8c01 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -169,14 +169,16 @@ endfunction() function(qt_ensure_sync_qt) qt_ensure_perl() - if(NOT DEFINED QT_SYNCQT) - get_target_property(mocPath "${QT_CMAKE_EXPORT_NAMESPACE}::moc" LOCATION) - get_filename_component(binDirectory "${mocPath}" DIRECTORY) - # We could put this into the cache, but on the other hand there's no real need to - # pollute the app's cache with this. For the first qtbase build, the variable is - # set in global scope. - set(QT_SYNCQT "${binDirectory}/syncqt.pl") + if(DEFINED QT_SYNCQT) + return() endif() + + get_target_property(mocPath "${QT_CMAKE_EXPORT_NAMESPACE}::moc" LOCATION) + get_filename_component(binDirectory "${mocPath}" DIRECTORY) + # We could put this into the cache, but on the other hand there's no real need to + # pollute the app's cache with this. For the first qtbase build, the variable is + # set in global scope. + set(QT_SYNCQT "${binDirectory}/syncqt.pl" CACHE FILEPATH "syncqt script") endfunction() # A version of cmake_parse_arguments that makes sure all arguments are processed and errors out From cf7426e8c9ce81b8bd9bbbbc86f11e4335bf9bd1 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 12 Feb 2019 20:17:57 +0100 Subject: [PATCH 0225/1322] cmake: Make sure to finddeps of private target Public interface libraries of the private target need to be first looked up via `find_dependency(...)` in the CMake config files as well. This patch is just changing the foreach() loop and defer the package config file generation. Change-Id: Iecaf7f778379b526f12ac6a42e76d714d9349b2c Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 73 +++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c63081d8c01..0179086a386 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -546,16 +546,6 @@ function(add_qt_module target) set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${config_install_dir}) - set(target_deps) - foreach(lib ${arg_PUBLIC_LIBRARIES}) - if ("${lib}" MATCHES "^Qt::(Platform|GlobalConfig)") - list(APPEND target_deps "Qt5\;${PROJECT_VERSION}") - elseif ("${lib}" MATCHES "^Qt::") - string(REGEX REPLACE "^Qt::" "${INSTALL_CMAKE_NAMESPACE}" dep "${lib}") - list(APPEND target_deps "${dep}\;${PROJECT_VERSION}") - endif() - endforeach() - set(extra_cmake_files) set(extra_cmake_includes) if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") @@ -570,6 +560,44 @@ function(add_qt_module target) list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") endif() + ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins + # that belong to Qt. + if (GCC OR CLANG) + qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") + endif() + + # When a public module depends on private, also make its private depend on the other's private + set(qt_libs_private "") + foreach(it ${KNOWN_QT_MODULES}) + list(FIND arg_LIBRARIES "Qt::${it}Private" pos) + if(pos GREATER -1) + list(APPEND qt_libs_private "Qt::${it}Private") + endif() + endforeach() + + target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") + target_include_directories("${target_private}" INTERFACE + $ + $ + $ + $ + $ + ) + + set(target_deps) + foreach(lib IN LISTS arg_PUBLIC_LIBRARIES qt_libs_private) + if ("${lib}" MATCHES "^Qt::(.*)") + set(lib "${CMAKE_MATCH_1}") + if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig) + list(APPEND target_deps "Qt5\;${PROJECT_VERSION}") + elseif ("${lib}" MATCHES "(.*)Private") + list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${CMAKE_MATCH_1}\;${PROJECT_VERSION}") + else() + list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${lib}\;${PROJECT_VERSION}") + endif() + endif() + endforeach() + configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" @@ -588,31 +616,6 @@ function(add_qt_module target) DESTINATION "${config_install_dir}" COMPONENT Devel ) - - ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins - # that belong to Qt. - if (GCC OR CLANG) - qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") - endif() - - # When a public module depends on private, also make its private depend on the other's private - set(qt_libs_private "") - foreach(it ${KNOWN_QT_MODULES}) - list(FIND arg_LIBRARIES "Qt::${it}Private" pos) - if(pos GREATER -1) - list(APPEND qt_libs_private "Qt::${it}Private") - endif() - endforeach() - - target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") - - target_include_directories("${target_private}" INTERFACE - $ - $ - $ - $ - $ - ) endfunction() From 2bdb8089293bc0122f51cd3cbc2a31836f99f9aa Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 14 Feb 2019 11:23:50 +0100 Subject: [PATCH 0226/1322] cmake: printsupport depends on core, gui and widgets Change-Id: Ifd1f8c23eca3daa788f814b450ad326f6415212f Reviewed-by: Albert Astals Cid --- src/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 551c27b0e7b..9d5962e5c42 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -84,5 +84,7 @@ endif() if (QT_FEATURE_testlib) add_subdirectory(testlib) endif() -add_subdirectory(printsupport) +if(QT_FEATURE_core AND QT_FEATURE_gui AND QT_FEATURE_widgets) + add_subdirectory(printsupport) +endif() add_subdirectory(plugins) From d37fd195a28ea86528d498c26f3eaa21eafb0e89 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 15 Feb 2019 10:00:52 +0100 Subject: [PATCH 0227/1322] cmake: Compile qobject.cpp with same flags as Core Makes sure qobject.cpp.o also sees -DQT_BUILD_CORE_LIB Change-Id: I2aaf1cec62eeab07bbec6e4135bbe144d4ae7fba Reviewed-by: Simon Hausmann Reviewed-by: Liang Qi --- src/corelib/CMakeLists.txt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ce341ff811e..06cd3e6f8d9 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -254,14 +254,12 @@ set_source_files_properties(${qobject_moc_files} PROPERTIES HEADER_FILE_ONLY ON) target_sources(Core_qobject PRIVATE global/qnamespace.h kernel/qobject.cpp kernel/qobject.h kernel/qobject_p.h ${qobject_moc_files}) -target_include_directories(Core_qobject PRIVATE - "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_CURRENT_BINARY_DIR}/global" - "${CMAKE_CURRENT_BINARY_DIR}/kernel" - "${PROJECT_BINARY_DIR}/include" - "${PROJECT_BINARY_DIR}/include/QtCore" - "${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}" - "${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore") +set_target_properties(Core_qobject PROPERTIES + COMPILE_OPTIONS $ + COMPILE_DEFINITIONS $ + INCLUDE_DIRECTORIES $ +) +target_include_directories(Core_qobject PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/kernel") # for moc_qobject.cpp target_link_libraries(Core_qobject PRIVATE Qt::Platform Qt::GlobalConfig) target_link_libraries(Core PRIVATE Core_qobject) From db9cb61993aa8780281a308542c47fd775aa01b4 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 15:48:58 +0100 Subject: [PATCH 0228/1322] cmake: helper.py more mappings Change-Id: I69a1715bbda8f5ddfb367e7c7c693e4ec412f5c3 Reviewed-by: Simon Hausmann --- util/cmake/helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index c11632cd066..e2dfbf8a7ce 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -56,10 +56,12 @@ def map_qt_base_library(lib: str) -> str: 'crypto-lib': 'Qt::AppManCrypto', 'dbus': 'Qt::DBus', 'devicediscovery': 'Qt::DeviceDiscoverySupport', + 'devicediscovery_support': 'Qt::DeviceDiscoverySupport', 'edid': 'Qt::EdidSupport', 'eglconvenience': 'Qt::EglSupport', 'eglfsdeviceintegration': 'Qt::EglFSDeviceIntegration', 'eglfs_kms_support': 'Qt::EglFsKmsSupport', + 'egl_support': 'Qt::EglSupport', 'enginio_client': 'Enginio', 'eventdispatchers': 'Qt::EventDispatcherSupport', 'extras': 'Qt::3DExtras', @@ -97,6 +99,7 @@ def map_qt_base_library(lib: str) -> str: 'packetprotocol': 'Qt::PacketProtocol', 'particles': 'Qt::QuickParticles', 'platformcompositor': 'Qt::PlatformCompositorSupport', + 'platformcompositor_support': 'Qt::PlatformCompositorSupport', 'plugin-interfaces': 'Qt::AppManPluginInterfaces', 'positioning': 'Qt::Positioning', 'positioningquick': 'Qt::PositioningQuick', From a9d3baa9f4b2eb01630438d0d98d077181dbc494 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 15:57:49 +0100 Subject: [PATCH 0229/1322] cmake: Add the eglfs platform plugin Change-Id: I1caef781db690a3c25e871947c11175cde5cc97b Reviewed-by: Simon Hausmann --- src/plugins/platforms/CMakeLists.txt | 2 +- src/plugins/platforms/eglfs/CMakeLists.txt | 107 +++++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/eglfs/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 68ac4023d3a..e5f66e31761 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -39,7 +39,7 @@ if(QNX) endif() if(QT_FEATURE_eglfs) -# TODO add_subdirectory(eglfs) + add_subdirectory(eglfs) add_subdirectory(minimalegl) endif() diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt new file mode 100644 index 00000000000..0b0f9c0b3d7 --- /dev/null +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -0,0 +1,107 @@ +# Generated from eglfs.pro. + +find_package(EGL) +find_package(WrapOpenGL) + +##################################################################### +## EglFSDeviceIntegration Module: +##################################################################### + +add_qt_module(EglFSDeviceIntegration + SOURCES + api/qeglfsdeviceintegration.cpp api/qeglfsdeviceintegration_p.h + api/qeglfsglobal_p.h + api/qeglfshooks.cpp api/qeglfshooks_p.h + api/qeglfsintegration.cpp api/qeglfsintegration_p.h + api/qeglfsoffscreenwindow.cpp api/qeglfsoffscreenwindow_p.h + api/qeglfsscreen.cpp api/qeglfsscreen_p.h + api/qeglfswindow.cpp api/qeglfswindow_p.h + DEFINES + QT_EGL_NO_X11 + QT_BUILD_EGL_DEVICE_LIB + INCLUDE_DIRECTORIES + api + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::DeviceDiscoverySupportPrivate + Qt::EventDispatcherSupportPrivate + Qt::ServiceSupportPrivate + Qt::ThemeSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::FbSupportPrivate + Qt::EglSupportPrivate + EGL::EGL + WrapOpenGL + # CONFIG = "internal_module" "egl" + # MODULE = "eglfsdeviceintegration" + # _LOADED = "qt_module" +) + +## Scopes: +##################################################################### + +extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::InputSupportPrivate + LIBRARIES + Qt::InputSupportPrivate +) + +extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::PlatformCompositorSupportPrivate + LIBRARIES + Qt::PlatformCompositorSupportPrivate +) + +# TODO +# extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_PLATFORM_HOOKS_SOURCES_ISEMPTY +# DEFINES +# EGLFS_PLATFORM_HOOKS +# ) + +# TODO +# extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_DEVICE_INTEGRATION_ISEMPTY +# DEFINES +# EGLFS_PREFERRED_PLUGIN= +# ) +# +#extend_target(EglFSDeviceIntegration CONDITION use_gold_linker +# # CONFIG = "no_linker_version_script" +#) + +extend_target(EglFSDeviceIntegration CONDITION NOT DEFINES___contains___QT_NO_CURSOR + SOURCES + cursor.qrc +) + +extend_target(EglFSDeviceIntegration CONDITION QT_FEATURE_opengl + SOURCES + api/qeglfscontext.cpp api/qeglfscontext_p.h + api/qeglfscursor.cpp api/qeglfscursor_p.h +) +##################################################################### +## qeglfs Plugin: +##################################################################### + +add_qt_plugin(qeglfs + TYPE platforms + SOURCES + qeglfsmain.cpp + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + api + LIBRARIES + Qt::EglFSDeviceIntegrationPrivate + EGL::EGL + # CONFIG = "egl" + # OTHER_FILES = "$$PWD/eglfs.json" + # PLUGIN_CLASS_NAME = "QEglFSIntegrationPlugin" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### +# +#extend_target(qeglfs CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) +# TODO add_subdirectory(deviceintegration) From dc0870db74c214b6727f53467c005c98fb8cef5d Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 15:51:30 +0100 Subject: [PATCH 0230/1322] pro2cmake: Target dependencies can be on -private libs so use map_qt_library instead of map_qt_base_library Change-Id: I4dd0097fff3ffd9ec4aad36d11d79ea23a08cb90 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 90c36fc57c7..149da8e76de 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -643,7 +643,7 @@ def map_condition(condition: str) -> str: part) if feature: if (feature.group(1) == "qtHaveModule"): - part = 'TARGET {}'.format(map_qt_base_library( + part = 'TARGET {}'.format(map_qt_library( feature.group(2))) else: feature = featureName(feature.group(2)) From 697f358466cd42286204252cbb0b422515442567 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 17:24:53 +0100 Subject: [PATCH 0231/1322] cmake: add deviceintegration/CMakeLists.txt Change-Id: I2b30c27bb4f17f40143a66e89b3d5986375a76a6 Reviewed-by: Simon Hausmann --- src/plugins/platforms/eglfs/CMakeLists.txt | 3 +- .../eglfs/deviceintegration/CMakeLists.txt | 49 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index 0b0f9c0b3d7..fb7f0fcbc26 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -104,4 +104,5 @@ add_qt_plugin(qeglfs #extend_target(qeglfs CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN # # PLUGIN_EXTENDS = "-" #) -# TODO add_subdirectory(deviceintegration) + +add_subdirectory(deviceintegration) diff --git a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt new file mode 100644 index 00000000000..4c0e02a3ca9 --- /dev/null +++ b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt @@ -0,0 +1,49 @@ +# Generated from deviceintegration.pro. + +if(QT_FEATURE_egl_x11) +# TODO # TODO add_subdirectory(eglfs_x11) +endif() + +if(QT_FEATURE_eglfs_gbm OR QT_FEATURE_eglfs_egldevice) +# TODO add_subdirectory(eglfs_kms_support) +endif() + +if(QT_FEATURE_eglfs_gbm) +# TODO add_subdirectory(eglfs_kms) +endif() + +if(QT_FEATURE_eglfs_egldevice) +# TODO add_subdirectory(eglfs_kms_egldevice) +endif() + +if(QT_FEATURE_eglfs_vsp2) +# TODO add_subdirectory(eglfs_kms_vsp2) +endif() + +if(QT_FEATURE_eglfs_brcm) +# TODO add_subdirectory(eglfs_brcm) +endif() + +if(QT_FEATURE_eglfs_mali) +# TODO add_subdirectory(eglfs_mali) +endif() + +if(QT_FEATURE_eglfs_viv) +# TODO add_subdirectory(eglfs_viv) +endif() + +if(QT_FEATURE_eglfs_rcar) +# TODO add_subdirectory(eglfs_rcar) +endif() + +if(QT_FEATURE_eglfs_viv_wl) +# TODO add_subdirectory(eglfs_viv_wl) +endif() + +if(QT_FEATURE_eglfs_openwfd) +# TODO add_subdirectory(eglfs_openwfd) +endif() + +if(QT_FEATURE_opengl) +# TODO add_subdirectory(eglfs_emu) +endif() From 5f8e4b7cf05d8acccdf237fcd4c1a59fc29c2aa4 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 17:30:04 +0100 Subject: [PATCH 0232/1322] cmake: add more mappings to helper.py Change-Id: Ie5096c1fe74105db84ccd60655a20d389a887b14 Reviewed-by: Simon Hausmann --- util/cmake/helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index e2dfbf8a7ce..c7749e50a66 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -79,6 +79,7 @@ def map_qt_base_library(lib: str) -> str: 'input_support': 'Qt::InputSupport', 'installer-lib': 'Qt::AppManInstaller', 'kmsconvenience': 'Qt::KmsSupport', + 'kms_support': 'Qt::KmsSupport', 'launcher-lib': 'Qt::AppManLauncher', 'lib': 'Qt::Designer', 'linuxaccessibility': 'Qt::LinuxAccessibilitySupport', @@ -210,8 +211,10 @@ def substitute_platform(platform: str) -> str: libray_mapping = { + 'drm': 'Libdrm::Libdrm', 'doubleconversion': 'double-conversion', 'freetype': 'Freetype::Freetype', + 'gbm': 'gbm::gbm', 'glib': 'GLIB2::GLIB2', 'harfbuzz': 'harfbuzz::harfbuzz', 'icu': 'ICU::i18n ICU::uc ICU::data', From b56d9916d9a35b1f93354c5d7f67009c3c5245b1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 17:30:55 +0100 Subject: [PATCH 0233/1322] cmake: build eglfs_kms_support Change-Id: I0c1cca14756519f60f71143150e56380fa3a6289 Reviewed-by: Simon Hausmann --- .../eglfs/deviceintegration/CMakeLists.txt | 2 +- .../eglfs_kms_support/CMakeLists.txt | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt diff --git a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt index 4c0e02a3ca9..17f519ba901 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt @@ -5,7 +5,7 @@ if(QT_FEATURE_egl_x11) endif() if(QT_FEATURE_eglfs_gbm OR QT_FEATURE_eglfs_egldevice) -# TODO add_subdirectory(eglfs_kms_support) + add_subdirectory(eglfs_kms_support) endif() if(QT_FEATURE_eglfs_gbm) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt new file mode 100644 index 00000000000..f077ceae4a3 --- /dev/null +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from eglfs_kms_support.pro. + +find_package(Libdrm) + +##################################################################### +## EglFsKmsSupport Module: +##################################################################### + +add_qt_module(EglFsKmsSupport + NO_MODULE_HEADERS + SOURCES + qeglfskmsdevice.cpp qeglfskmsdevice.h + qeglfskmshelpers.h + qeglfskmsintegration.cpp qeglfskmsintegration.h + qeglfskmsscreen.cpp qeglfskmsscreen.h + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + ../../api + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EglFSDeviceIntegrationPrivate + Qt::KmsSupportPrivate + Qt::EdidSupportPrivate + Libdrm::Libdrm + # CONFIG = "no_module_headers" "internal_module" "egl" + # _LOADED = "qt_module" +) From d03b915c209b9da48df5f319c4fd5d369e836c01 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 17:35:14 +0100 Subject: [PATCH 0234/1322] cmake: build eglfs_kms plugin Change-Id: I362c17a67c2cb4c243c39f760c598bfc7e1071bd Reviewed-by: Simon Hausmann --- .../eglfs/deviceintegration/CMakeLists.txt | 2 +- .../eglfs_kms/CMakeLists.txt | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt diff --git a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt index 17f519ba901..d9eed887171 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt @@ -9,7 +9,7 @@ if(QT_FEATURE_eglfs_gbm OR QT_FEATURE_eglfs_egldevice) endif() if(QT_FEATURE_eglfs_gbm) -# TODO add_subdirectory(eglfs_kms) + add_subdirectory(eglfs_kms) endif() if(QT_FEATURE_eglfs_egldevice) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt new file mode 100644 index 00000000000..09a9560f80e --- /dev/null +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from eglfs_kms.pro. + +find_package(gbm) +find_package(Libdrm) + +##################################################################### +## qeglfs-kms-integration Plugin: +##################################################################### + +add_qt_plugin(qeglfs-kms-integration + TYPE egldeviceintegrations + SOURCES + qeglfskmsgbmcursor.cpp qeglfskmsgbmcursor.h + qeglfskmsgbmdevice.cpp qeglfskmsgbmdevice.h + qeglfskmsgbmintegration.cpp qeglfskmsgbmintegration.h + qeglfskmsgbmmain.cpp + qeglfskmsgbmscreen.cpp qeglfskmsgbmscreen.h + qeglfskmsgbmwindow.cpp qeglfskmsgbmwindow.h + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + ../../api + ../eglfs_kms_support + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EglFSDeviceIntegrationPrivate + Qt::EglFsKmsSupportPrivate + Qt::KmsSupportPrivate + Qt::EdidSupportPrivate + Qt::PlatformCompositorSupportPrivate + gbm::gbm + Libdrm::Libdrm + # CONFIG = "egl" + # OTHER_FILES = "$$PWD/eglfs_kms.json" + # PLUGIN_CLASS_NAME = "QEglFSKmsGbmIntegrationPlugin" + # _LOADED = "qt_plugin" +) From df17678ab13020f2e07e9ee7fc504ee2976a3ada Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 17:38:17 +0100 Subject: [PATCH 0235/1322] cmake: build eglfs_kms_egldevice Change-Id: Ib224140d64efdc9c7190add7b568484313ecd7a3 Reviewed-by: Simon Hausmann --- .../eglfs/deviceintegration/CMakeLists.txt | 2 +- .../eglfs_kms_egldevice/CMakeLists.txt | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt diff --git a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt index d9eed887171..59c16a3bcf1 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt @@ -13,7 +13,7 @@ if(QT_FEATURE_eglfs_gbm) endif() if(QT_FEATURE_eglfs_egldevice) -# TODO add_subdirectory(eglfs_kms_egldevice) + add_subdirectory(eglfs_kms_egldevice) endif() if(QT_FEATURE_eglfs_vsp2) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt new file mode 100644 index 00000000000..9dc5d84523e --- /dev/null +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt @@ -0,0 +1,34 @@ +# Generated from eglfs_kms_egldevice.pro. + +find_package(Libdrm) + +##################################################################### +## qeglfs-kms-egldevice-integration Plugin: +##################################################################### + +add_qt_plugin(qeglfs-kms-egldevice-integration + TYPE egldeviceintegrations + SOURCES + qeglfskmsegldevice.cpp qeglfskmsegldevice.h + qeglfskmsegldeviceintegration.cpp qeglfskmsegldeviceintegration.h + qeglfskmsegldevicemain.cpp + qeglfskmsegldevicescreen.cpp qeglfskmsegldevicescreen.h + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + ../../api + ../eglfs_kms_support + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EglFSDeviceIntegrationPrivate + Qt::EglFsKmsSupportPrivate + Qt::KmsSupportPrivate + Qt::EdidSupportPrivate + Qt::PlatformCompositorSupportPrivate + Libdrm::Libdrm + # CONFIG = "egl" + # OTHER_FILES = "$$PWD/eglfs_kms_egldevice.json" + # PLUGIN_CLASS_NAME = "QEglFSKmsEglDeviceIntegrationPlugin" + # _LOADED = "qt_plugin" +) From af7fe32ebd2140c8940373a579e7160e4ce73b57 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 17:39:45 +0100 Subject: [PATCH 0236/1322] cmake: build eglfs_emu Change-Id: I793865f55114d08c342477f4e786d1089239ace4 Reviewed-by: Simon Hausmann --- .../eglfs/deviceintegration/CMakeLists.txt | 2 +- .../eglfs_emu/CMakeLists.txt | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt diff --git a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt index 59c16a3bcf1..f3aa856379c 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt @@ -45,5 +45,5 @@ if(QT_FEATURE_eglfs_openwfd) endif() if(QT_FEATURE_opengl) -# TODO add_subdirectory(eglfs_emu) + add_subdirectory(eglfs_emu) endif() diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt new file mode 100644 index 00000000000..64dd4d8548f --- /dev/null +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from eglfs_emu.pro. + +##################################################################### +## qeglfs-emu-integration Plugin: +##################################################################### + +add_qt_plugin(qeglfs-emu-integration + TYPE egldeviceintegrations + SOURCES + qeglfsemulatorintegration.cpp qeglfsemulatorintegration.h + qeglfsemulatorscreen.cpp qeglfsemulatorscreen.h + qeglfsemumain.cpp + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + ../../api + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EglFSDeviceIntegrationPrivate + # CONFIG = "egl" + # DISTFILES = "eglfs_emu.json" + # OTHER_FILES = "$$PWD/eglfs_emu.json" + # PLUGIN_CLASS_NAME = "QEglFSEmulatorIntegrationPlugin" + # _LOADED = "qt_plugin" +) From 0b13578dcbe529f641d6bacb926d4ab10b5f5e91 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 15 Feb 2019 13:16:35 +0100 Subject: [PATCH 0237/1322] Skip the qmake build when cross-compiling Change-Id: I24da7eb9587235aa937a984e91a833284b4f28e5 Reviewed-by: Kevin Funk --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8946d55d834..1eab8afcca9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,9 @@ if (BUILD_TESTING) add_subdirectory(tests) endif() -add_subdirectory(qmake) +if (NOT CMAKE_CROSSCOMPILING) + add_subdirectory(qmake) +endif() option(BUILD_EXAMPLES "Build Qt examples" ON) if (BUILD_EXAMPLES) From ec410d31cd3d85f76901e156edb278f265737dc3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 15 Feb 2019 13:16:51 +0100 Subject: [PATCH 0238/1322] Fix source file name on Android Change-Id: I0814cb02ef7205bb5d197ea0e5cc7e26a8bc15eb Reviewed-by: Kevin Funk --- src/network/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 4188cecb9d6..85301de86d2 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -216,7 +216,7 @@ extend_target(Network CONDITION APPLE_OSX extend_target(Network CONDITION (ANDROID) AND (QT_FEATURE_dnslookup) SOURCES - -kernel/qdnslookup_unix.cpp + kernel/qdnslookup_unix.cpp kernel/qdnslookup_android.cpp ) From b2f03791c1ea263438139b662f62f46fb49a2328 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 13 Feb 2019 09:30:51 +0100 Subject: [PATCH 0239/1322] Provide some basic instructions for cross-compiling and using CCache Change-Id: I8bb90746d0cef2ea61a5494ef358713d732dcfce Reviewed-by: Kevin Funk --- cmake/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cmake/README.md b/cmake/README.md index b2a9f3fc3a0..7d3d71f7654 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -78,6 +78,30 @@ When you're done with the build, you may want to install it, using ``ninja insta You can use ``cmake-gui {path to build directory}`` or ``ccmake {path to build directory}`` to configure the values of individual cmake variables or Qt features. After changing a value, you need to choose the *configure* step (usually several times:-/), followed by the *generate* step (to generate makefiles/ninja files). +## Building with CCache + +You can pass ``-DQT_USE_CCACHE=ON`` to make the build system look for ``ccache`` in your ``PATH`` and prepend it to all C/C++/Objective-C compiler calls. At the moment this is only supported for the Ninja and the Makefile generators. + +## Cross Compiling + +Compiling for a target architecture that's different than the host requires one build of Qt for the host. This "host build" is needed because the process of building Qt involves the compilation of intermediate code generator tools, that in turn are called to produce source code that needs to be compiled into the final libraries. These tools are built using Qt itself and they need to run on the machine you're building on, regardless of the architecure you are targeting. + +Build Qt regularly for your host system and install it into a directory of your choice using the ``CMAKE_INSTALL_PREFIX`` variable. You are free to disable the build of tests and examples by setting ``BUILD_EXAMPLES=OFF`` and ``BUILD_TESTING=OFF``. + +With this installation of Qt in place, which contains all tools needed, we can proceed to create a new build of Qt that is cross-compiled to the target architecture of choice. You may proceed by setting up your environment. The CMake wiki has further information how to do that at + + + +Yocto based device SDKs come with an environment setup script that needs to be sourced in your shell and takes care of setting up environment variables and a cmake alias with a toolchain file, so that you can call cmake as you always do. + +In order to make sure that Qt picks up the code generator tools from the host build, you need to pass an extra parameter to cmake: + +``` + -DHOST_QT_TOOLS_DIRECTORY=/path/to/your/host_build/bin +``` + +The specified path needs to point to a directory that contains all the binaries of the host build of Qt. + # Debugging CMake files CMake allows specifying the ``--trace`` and ``--trace-expand`` options, which work like ``qmake -d -d``: As the cmake code is evaluated, the values of parameters and variables is shown. This can be a lot of output, so you may want to redirect it to a file. From c604a1265a7c034dd898a200e8c5f2753a9e7f47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 11 Feb 2019 15:50:17 +0100 Subject: [PATCH 0240/1322] Fix use of uic when cross-compiling Don't try to build uic but instead import it. This is done centrally now in add_qt_tool. Change-Id: I241fbb924de68549e9c0320e157351bd7b1bf5c3 Reviewed-by: Kevin Funk --- cmake/QtBuild.cmake | 16 ++++++++++++++++ src/CMakeLists.txt | 27 ++++----------------------- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0179086a386..a75c0165c9b 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -761,6 +761,22 @@ endfunction() # The BOOTSTRAP option allows building it as standalone program, otherwise # it will be linked against QtCore. function(add_qt_tool name) + set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") + if (NOT _build_tools) + message("Searching for ${name}.") + find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH) + if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND") + message(FATAL_ERROR "The name \"${name}\" was not found in the " + "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").") + else() + message(STATUS "${name} was found at ${_PROG_${name}}.") + add_executable("${name}" IMPORTED GLOBAL) + set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}") + qt_internal_add_target_aliases("${name}") + endif() + return() + endif() + qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) if (arg_BOOTSTRAP) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d5962e5c42..0a69798685d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,32 +18,13 @@ function(find_or_build_bootstrap_names) # Move these into their own folder and move this code in the CMakeLists.txt file there! set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") - function(find_or_build_bootstrap_tool name) - if (_build_tools) - add_subdirectory(tools/${name}) - else() - message("Searching for ${name}.") - find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH) - if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND") - message(FATAL_ERROR "The name \"${name}\" was not found in the " - "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").") - else() - message("${name} was found at ${_PROG_${name}}.") - add_executable("${name}" IMPORTED GLOBAL) - set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}") - - add_executable("Qt::${name}" ALIAS "${name}") - endif() - endif() - endfunction() - if (_build_tools) add_subdirectory(tools/bootstrap) # bootstrap library endif() - find_or_build_bootstrap_tool(moc) - find_or_build_bootstrap_tool(rcc) - find_or_build_bootstrap_tool(qfloat16-tables) - find_or_build_bootstrap_tool(tracegen) + add_subdirectory(tools/moc) + add_subdirectory(tools/rcc) + add_subdirectory(tools/qfloat16-tables) + add_subdirectory(tools/tracegen) if (_build_tools) install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") From d61b6ea30a4c7ea3a8c6100f74c88c839f66abc4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 12 Feb 2019 12:21:30 +0100 Subject: [PATCH 0241/1322] Add support for building conveniently with ccache Pass -DQT_USE_CCACHE=ON to enable the use of ccache. This avoids having to set up symlinks, which is useful when cross-compiling against different targets. Change-Id: I023fff105baaa538730997948aa122d2678887ce Reviewed-by: Kevin Funk --- cmake/QtSetup.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index a01d8a651c3..6fd2b2d9234 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -47,3 +47,11 @@ endif() ## Enable support for sanitizers: include(${CMAKE_CURRENT_LIST_DIR}/3rdparty/extra-cmake-modules/modules/ECMEnableSanitizers.cmake) + +option(QT_USE_CCACHE "Enable the use of ccache") +if(QT_USE_CCACHE) + find_program(CCACHE_PROGRAM ccache) + set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") +endif() From 22bd8576cb65e0aef5cdbb51b1e5f55843bc5e3f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 20 Feb 2019 10:29:52 +0100 Subject: [PATCH 0242/1322] Update FindEGL.cmake from upstream Upstream commit 7c64db9568296e1caafcfd7163cea3ab1b1626ae fixed the suffix path checking and thus the build on FreeBSD. Change-Id: I0cceeac0639c2899c617ffd6359098d2154acf5b Reviewed-by: Simon Hausmann --- .../3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake index 5277d123782..de271a11407 100644 --- a/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake +++ b/cmake/3rdparty/extra-cmake-modules/find-modules/FindEGL.cmake @@ -75,11 +75,9 @@ set(EGL_DEFINITIONS ${PKG_EGL_CFLAGS_OTHER}) find_path(EGL_INCLUDE_DIR NAMES - egl.h + EGL/egl.h HINTS ${PKG_EGL_INCLUDE_DIRS} - PATH_SUFFIXES - EGL ) find_library(EGL_LIBRARY NAMES @@ -95,7 +93,7 @@ if(EGL_INCLUDE_DIR) # version; so the header for EGL 1.1 will define EGL_VERSION_1_0 and # EGL_VERSION_1_1. Finding the highest supported version involves # finding all these defines and selecting the highest numbered. - file(READ "${EGL_INCLUDE_DIR}/egl.h" _EGL_header_contents) + file(READ "${EGL_INCLUDE_DIR}/EGL/egl.h" _EGL_header_contents) string(REGEX MATCHALL "[ \t]EGL_VERSION_[0-9_]+" _EGL_version_lines From d885226544c81f92ec897ff6fd08d84d2903d4a2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 15 Feb 2019 11:45:34 +0100 Subject: [PATCH 0243/1322] Fix ELF interpreter detection Use the same approach as with qmake, by using readelf -l /bin/ls and then a regular expression to extract the program interpreter path. It's a little simpler in cmake because we can avoid the perl dance and quotes and just use cmake's built-in regular expression matching. This change also excludes static builds, as with qmake. Change-Id: I699e166c4b38b3fe98e6390316206109ad6363f9 Reviewed-by: Kevin Funk --- src/corelib/CMakeLists.txt | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 06cd3e6f8d9..5c35826cb19 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -268,12 +268,22 @@ set_property(TARGET Core APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_ # FIXME: tools still have a lot of special stuff that is not ported! -# FIXME: qmake condition: (linux*|hurd*):!cross_compile:!static:!*-armcc* -# FIXME: qmake gets the elf interpreter out of /bin/ls -find_program(HOST_ELF_INTERPRETER NAMES ld-linux-x86-64.so.2 PATHS /lib /lib64 NO_DEFAULT_PATH) -if (LINUX AND NOT CMAKE_CROSSCOMPILING AND HOST_ELF_INTERPRETER_FOUND) - qt_internal_add_link_flags(Core "-Wl,-e,qt_core_boilerplate") - target_compile_definitions(Core PRIVATE ELF_INTERPRETER="${HOST_ELF_INTERPRETER}") +if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) + if (NOT DEFINED ELF_INTERPRETER) + execute_process(COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C readelf -l /bin/ls + RESULT_VARIABLE readelf_ok + OUTPUT_VARIABLE readelf_output + ) + if ("${readelf_ok}" STREQUAL "0" AND "${readelf_output}" MATCHES "program interpreter: (.*)]") + set(ELF_INTERPRETER "${CMAKE_MATCH_1}" CACHE INTERNAL "ELF interpreter location") + else + set(ELF_INTERPRETER "" CACHE INTERNAL "ELF interpreter location") + endif() + endif() + if (ELF_INTERPRETER) + qt_internal_add_link_flags(Core "-Wl,-e,qt_core_boilerplate") + target_compile_definitions(Core PRIVATE ELF_INTERPRETER="${ELF_INTERPRETER}") + endif() endif() From b88110a3d7f795e91bff4ed73bd680ad8a364be0 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 21 Feb 2019 11:55:24 +0100 Subject: [PATCH 0244/1322] cmake: fix a syntax for else This amends d885226544c. Change-Id: Ia7b2fb6e0e762c73d3c0775cdd106c1dec646ab2 Reviewed-by: Albert Astals Cid Reviewed-by: Simon Hausmann --- src/corelib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 5c35826cb19..66b4efa5e61 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -276,7 +276,7 @@ if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) ) if ("${readelf_ok}" STREQUAL "0" AND "${readelf_output}" MATCHES "program interpreter: (.*)]") set(ELF_INTERPRETER "${CMAKE_MATCH_1}" CACHE INTERNAL "ELF interpreter location") - else + else() set(ELF_INTERPRETER "" CACHE INTERNAL "ELF interpreter location") endif() endif() From 632d014afd5a3c1a40fc67cf0fc78d8c80d3da8f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 19 Feb 2019 16:38:11 +0100 Subject: [PATCH 0245/1322] cmake: set a CMAKE_BUILD_TYPE if none was specified Because the default "empty" CMAKE_BUILD_TYPE is a weird default Change-Id: I5768f67aa85dce4108e421d2f4eacdfb1cb5beb0 Reviewed-by: Kevin Funk --- cmake/QtSetup.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 6fd2b2d9234..a90f12d0c22 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -1,3 +1,15 @@ +## Set a default build type if none was specified +set(_default_build_type "Release") +if(EXISTS "${CMAKE_SOURCE_DIR}/.git") + set(_default_build_type "Debug") +endif() + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${_default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${_default_build_type}" CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") # Set the possible values of build type for cmake-gui +endif() + ## Force C++ standard, do not fall back, do not use compiler extensions set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) From a25f9a15076782154bf7cf58e3c5af29a7b6653e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 19 Feb 2019 17:37:30 +0100 Subject: [PATCH 0246/1322] cmake: Start adding compiler flags Only has warnings for now Next to come is the support for developer-build and enabling Werror Change-Id: I8070dc06eb439c2a03007cce975c8147ff7e1582 Reviewed-by: Kevin Funk --- cmake/QtBaseGlobalTargets.cmake | 1 + cmake/QtCompilerFlags.cmake | 6 ++++++ cmake/QtSetup.cmake | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 cmake/QtCompilerFlags.cmake diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 6074f1233c0..73deb51b494 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -64,6 +64,7 @@ install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXP ## Install some QtBase specific CMake files: install(FILES cmake/QtBuild.cmake + cmake/QtCompilerFlags.cmake cmake/QtCompilerOptimization.cmake cmake/QtFeature.cmake cmake/QtPlatformSupport.cmake diff --git a/cmake/QtCompilerFlags.cmake b/cmake/QtCompilerFlags.cmake new file mode 100644 index 00000000000..35733027f50 --- /dev/null +++ b/cmake/QtCompilerFlags.cmake @@ -0,0 +1,6 @@ +# Set warnings. All compilers except MSVC support -Wall -Wextra +if (MSVC) + add_compile_options(/W3) +else() + add_compile_options(-Wall -Wextra) +endif() diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index a90f12d0c22..caf908b4c9d 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -42,6 +42,9 @@ include(QtFeature) ## Compiler optimization flags: include(QtCompilerOptimization) +## Compiler flags: +include(QtCompilerFlags) + ## Find host tools (if non native): set(HOST_QT_TOOLS_DIRECTORY "" CACHE PATH "Directory with Qt host tools.") From e03596c2a7d7a3d4b62c90170175fc61957776a9 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 15 Feb 2019 15:50:24 +0100 Subject: [PATCH 0247/1322] pro2cmake: account for child .pro files having includes Change-Id: Ic2213578c9bd27787ae9788acbe4455252a1158c Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 149da8e76de..5537ba38dcf 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -678,7 +678,8 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, subdir_result.asDict().get('statements'), '', scope.basedir) - cmakeify_scope(subdir_scope, cm_fh, indent=indent + 1) + do_include(subdir_scope) + cmakeify_scope(subdir_scope, cm_fh, indent=indent) elif sd.startswith('-'): cm_fh.write('{}### remove_subdirectory' '("{}")\n'.format(ind, sd[1:])) From 31e1dda94b66581580dd92a3664d5f5773b81065 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 21 Feb 2019 14:46:22 +0100 Subject: [PATCH 0248/1322] cmake: Give the egl_x11 test the necessary libs to compile And add the eglfs_x11 plugin We need to actually try to compile the test as the comment it it says that having x11 and egl is not enough since sometimes they are actually incompatible Change-Id: If6bdc08c21b91fa9c41663f2fa653fd59e5ddd2e Reviewed-by: Tobias Hunger --- src/gui/configure.cmake | 8 +++-- .../eglfs/deviceintegration/CMakeLists.txt | 2 +- .../eglfs_x11/CMakeLists.txt | 31 +++++++++++++++++++ util/cmake/configurejson2cmake.py | 15 ++++++--- 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 5e29a60463b..271c8a182e9 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -137,8 +137,13 @@ drmModeAtomicReq *request; ) # egl-x11 +if (HAVE_EGL AND X11_XCB_FOUND AND X11_FOUND) + set(egl_x11_TEST_LIBRARIES EGL::EGL X11::X11 X11::XCB) +endif() qt_config_compile_test(egl_x11 LABEL "EGL on X11" + LIBRARIES "${egl_x11_TEST_LIBRARIES}" + CODE "// Check if EGL is compatible with X. Some EGL implementations, typically on // embedded devices, are not intended to be used together with X. EGL support // has to be disabled in plugins like xcb in this case since the native display, @@ -162,8 +167,7 @@ XCloseDisplay(dpy); /* END TEST: */ return 0; } -"# FIXME: use: egl xcb_xlib -) +") # egl-brcm qt_config_compile_test(egl_brcm diff --git a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt index f3aa856379c..396964a5e71 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from deviceintegration.pro. if(QT_FEATURE_egl_x11) -# TODO # TODO add_subdirectory(eglfs_x11) + add_subdirectory(eglfs_x11) endif() if(QT_FEATURE_eglfs_gbm OR QT_FEATURE_eglfs_egldevice) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt new file mode 100644 index 00000000000..aaa4da9cb38 --- /dev/null +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt @@ -0,0 +1,31 @@ +# Generated from eglfs_x11.pro. + +find_package(XCB) +find_package(X11) +find_package(X11_XCB) + +##################################################################### +## qeglfs-x11-integration Plugin: +##################################################################### + +add_qt_plugin(qeglfs-x11-integration + TYPE egldeviceintegrations + SOURCES + qeglfsx11integration.cpp qeglfsx11integration.h + qeglfsx11main.cpp + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + ../../api + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EglFSDeviceIntegrationPrivate + XCB::XCB + X11::X11 + X11::XCB + # CONFIG = "egl" + # OTHER_FILES = "$$PWD/eglfs_x11.json" + # PLUGIN_CLASS_NAME = "QEglFSX11IntegrationPlugin" + # _LOADED = "qt_plugin" +) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 840ffefd059..0997608ed93 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -616,12 +616,12 @@ def parseTest(ctx, test, data, cm_fh): cm_fh.write("# {}\n".format(test)) if "qmake" in details: # We don't really have many so we can just enumerate them all if details["qmake"] == "unix:LIBS += -lpthread": - librariesCmakeName = format(test) + "_TEST_LIBRARIES" + librariesCmakeName = format(featureName(test)) + "_TEST_LIBRARIES" cm_fh.write("if (UNIX)\n") cm_fh.write(" set(" + librariesCmakeName + " pthread)\n") cm_fh.write("endif()\n") elif details["qmake"] == "linux: LIBS += -lpthread -lrt": - librariesCmakeName = format(test) + "_TEST_LIBRARIES" + librariesCmakeName = format(featureName(test)) + "_TEST_LIBRARIES" cm_fh.write("if (LINUX)\n") cm_fh.write(" set(" + librariesCmakeName + " pthread rt)\n") cm_fh.write("endif()\n") @@ -631,6 +631,15 @@ def parseTest(ctx, test, data, cm_fh): else: qmakeFixme = "# FIXME: qmake: {}\n".format(details["qmake"]) + if "use" in data: + if data["use"] == "egl xcb_xlib": + librariesCmakeName = format(featureName(test)) + "_TEST_LIBRARIES" + cm_fh.write("if (HAVE_EGL AND X11_XCB_FOUND AND X11_FOUND)\n") + cm_fh.write(" set(" + librariesCmakeName + " EGL::EGL X11::X11 X11::XCB)\n") + cm_fh.write("endif()\n") + else: + qmakeFixme += "# FIXME: use: {}\n".format(data["use"]) + cm_fh.write("qt_config_compile_test({}\n".format(featureName(test))) cm_fh.write(lineify("LABEL", data.get("label", ""))) if librariesCmakeName != "": @@ -639,8 +648,6 @@ def parseTest(ctx, test, data, cm_fh): cm_fh.write('"' + sourceCode + '"') if qmakeFixme != "": cm_fh.write(qmakeFixme) - if "use" in data: - cm_fh.write("# FIXME: use: {}\n".format(data["use"])) cm_fh.write(")\n\n") elif data["type"] == "x86Simd": From ca1113728ee488b046238da621b6e5841a864b25 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 21 Feb 2019 15:11:51 +0100 Subject: [PATCH 0249/1322] cmake: Make it so that eglfs plugin doesn't hang on make -jN Since the dependency on moc is in CorePrivate (o Core) we need the target to depend on it otherwise cmake will try to use moc before it is built. This is because what we do with cmake is say "moc is in this path, you can use it", but it's actually not built yet so we need to depend on a target that depends on moc directly otherwise cmake will trust us and try to use a cmake that doesn't exist and just hang forever when running make -jN Change-Id: Icf55c62092fd3fd3754a4f4f28c8c313bf374615 Reviewed-by: Tobias Hunger --- src/plugins/platforms/eglfs/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index fb7f0fcbc26..e508745da81 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -90,6 +90,7 @@ add_qt_plugin(qeglfs INCLUDE_DIRECTORIES api LIBRARIES + Qt::CorePrivate Qt::EglFSDeviceIntegrationPrivate EGL::EGL # CONFIG = "egl" From 885494c50f75b79a33a9275221ae9e0efb91349c Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Mon, 7 Jan 2019 15:22:24 +0100 Subject: [PATCH 0250/1322] CMake: Fix build without double-conversion on macOS Change-Id: I5102e93141eec95044df44884dcf6ecd1b9e8dd0 Reviewed-by: Mikhail Svetkin Reviewed-by: Alexandru Croitor --- cmake/FindWrapDoubleConversion.cmake | 23 +++++++++++++++-------- src/corelib/CMakeLists.txt | 5 +++++ util/cmake/configurejson2cmake.py | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cmake/FindWrapDoubleConversion.cmake b/cmake/FindWrapDoubleConversion.cmake index c93525af23f..749965a7b80 100644 --- a/cmake/FindWrapDoubleConversion.cmake +++ b/cmake/FindWrapDoubleConversion.cmake @@ -1,5 +1,15 @@ include(CheckCXXSourceCompiles) +add_library(WrapDoubleConversion INTERFACE) + +find_package(double-conversion) +if (double-conversion_FOUND) + set_package_properties(double-conversion PROPERTIES TYPE REQUIRED) + target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion) + set(WrapDoubleConversion_FOUND 1) + return() +endif() + check_cxx_source_compiles(" #include #include @@ -25,12 +35,9 @@ int main(int argc, char *argv[]) { return 0; }" HAVE_SPRINTF_L) -add_library(WrapDoubleConversion INTERFACE) -if (NOT HAVE__SPRINTF_L AND NOT HAVE_SPRINTF_L) - find_package(double-conversion) - set_package_properties(double-conversion PROPERTIES TYPE REQUIRED) - target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion) +if (HAVE__SPRINTF_L OR HAVE_SPRINTF_L) + target_compile_definitions(WrapDoubleConversion INTERFACE QT_NO_DOUBLECONVERSION) + set(WrapDoubleConversion_FOUND 1) +else() + set(WrapDoubleConversion_FOUND 0) endif() - -set(WrapDoubleConversion_FOUND 1) - diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 66b4efa5e61..edd2ae52ca2 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1,6 +1,11 @@ find_package(Threads) find_package(WrapDoubleConversion REQUIRED) +if (NOT WrapDoubleConversion_FOUND) + message(FATAL_ERROR "Your C library does not provide sscanf_l/snprintf_l _snprintf_l/_sscanf_l. \ + You need to use libdouble-conversion for double/string conversion.") +endif() + find_library(FWAppKit AppKit) find_library(FWApplicationServices ApplicationServices) find_library(FWCoreFoundation CoreFoundation) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 0997608ed93..5d189558bd7 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -50,7 +50,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'atspi': 'ATSPI2', 'corewlan': None, # Framework 'cups': 'Cups', - 'double-conversion': 'WrapDoubleConversion', + 'double-conversion': None, 'drm': 'Libdrm', 'egl': 'EGL', 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), From b1fa25e7b8974fd9ce4b6d1283b9a43da532992e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 30 Jan 2019 16:54:42 +0100 Subject: [PATCH 0251/1322] CMake: Small unsorted fixes in preparation of upgrading to dev branch Change-Id: Id4d03558e956c6994dc6a8b701030ba4edf86adf Reviewed-by: Alexandru Croitor Reviewed-by: Albert Astals Cid --- util/cmake/configurejson2cmake.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 5d189558bd7..a684130c684 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -550,10 +550,12 @@ def parseInput(ctx, input, data, cm_fh): # }, def parseTest(ctx, test, data, cm_fh): skip_tests = { - 'c11', 'c99', 'c++11', 'c++14', 'c++1y', 'c++1z', - 'reduce_exports', + 'c11', 'c99', + 'gc_binaries', 'posix-iconv', "sun-iconv", + 'precomile_header', + 'reduce_exports', 'separate_debug_info', # FIXME: see if cmake can do this 'gc_binaries', 'libinput_axis_api', @@ -720,7 +722,7 @@ def parseFeature(ctx, feature, data, cm_fh): 'optimize_size': None, 'pkg-config': None, 'posix_fallocate': None, # Only needed for sqlite, which we do not want to build - 'posix_libiconv': { + 'posix-libiconv': { 'condition': 'NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv AND TEST_iconv_needlib', 'enable': 'TEST_posix_iconv AND TEST_iconv_needlib', 'disable': 'NOT TEST_posix_iconv OR NOT TEST_iconv_needlib', From 35f23a3dad20e09bada4e8fcdcc0de16b8a6af2f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Feb 2019 18:02:22 +0100 Subject: [PATCH 0252/1322] CMake: pro2cmake.py: Better parsing of scopes with else Parse conditions more exactly as before, enabling proper handling of else scopes. Change-Id: Icb5dcc73010be4833b2d1cbc1396191992df1ee4 Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 115 +++++++++++---------- util/cmake/tests/data/comment_scope.pro | 6 ++ util/cmake/tests/data/contains_scope.pro | 4 + util/cmake/tests/data/multiline_assign.pro | 4 + util/cmake/tests/data/standardpaths.pro | 17 +++ util/cmake/tests/test_parsing.py | 88 +++++++++++++++- util/cmake/tests/test_scope_handling.py | 56 ++++++++++ 7 files changed, 233 insertions(+), 57 deletions(-) create mode 100644 util/cmake/tests/data/comment_scope.pro create mode 100644 util/cmake/tests/data/contains_scope.pro create mode 100644 util/cmake/tests/data/multiline_assign.pro create mode 100644 util/cmake/tests/data/standardpaths.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5537ba38dcf..63938d75c82 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -32,6 +32,7 @@ from __future__ import annotations from argparse import ArgumentParser import copy +from itertools import chain import os.path import re import io @@ -509,10 +510,12 @@ class QmakeParser: # Define grammar: pp.ParserElement.setDefaultWhitespaceChars(' \t') - LC = pp.Suppress(pp.Literal('\\') + pp.LineEnd()) - EOL = pp.Suppress(pp.Optional(pp.pythonStyleComment()) + pp.LineEnd()) - + LC = pp.Suppress(pp.Literal('\\\n')) + EOL = pp.Suppress(pp.Literal('\n')) + Else = pp.Keyword('else') + DefineTest = pp.Keyword('defineTest') Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') + Substitution \ = pp.Combine(pp.Literal('$') + (((pp.Literal('$') + Identifier @@ -525,32 +528,31 @@ class QmakeParser: | (pp.Literal('$') + pp.Literal('[') + Identifier + pp.Literal(']')) ))) - # Do not match word ending in '\' since that breaks line - # continuation:-/ LiteralValuePart = pp.Word(pp.printables, excludeChars='$#{}()') SubstitutionValue \ = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart | pp.Literal('$'))) - Value = (pp.QuotedString(quoteChar='"', escChar='\\') - | SubstitutionValue) + Value = pp.NotAny(Else | pp.Literal('}') | EOL | pp.Literal('\\')) \ + + (pp.QuotedString(quoteChar='"', escChar='\\') + | SubstitutionValue) - Values = pp.ZeroOrMore(Value)('value') + Values = pp.ZeroOrMore(Value + pp.Optional(LC))('value') Op = pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') \ | pp.Literal('*=') - Operation = Identifier('key') + Op('operation') + Values('value') - Load = pp.Keyword('load') + pp.Suppress('(') \ - + Identifier('loaded') + pp.Suppress(')') - Include = pp.Keyword('include') + pp.Suppress('(') \ - + pp.CharsNotIn(':{=}#)\n')('included') + pp.Suppress(')') - Option = pp.Keyword('option') + pp.Suppress('(') \ - + Identifier('option') + pp.Suppress(')') - DefineTest = pp.Suppress(pp.Keyword('defineTest') - + pp.Suppress('(') + Identifier - + pp.Suppress(')') - + pp.nestedExpr(opener='{', closer='}') - + pp.LineEnd()) # ignore the whole thing... + Key = Identifier + + Operation = Key('key') + pp.Optional(LC) \ + + Op('operation') + pp.Optional(LC) \ + + Values('value') + CallArgs = pp.nestedExpr() + CallArgs.setParseAction(lambda x: ' '.join(chain(*x))) + Load = pp.Keyword('load') + CallArgs('loaded') + Include = pp.Keyword('include') + CallArgs('included') + Option = pp.Keyword('option') + CallArgs('option') + DefineTestDefinition = pp.Suppress(DefineTest + CallArgs \ + + pp.nestedExpr(opener='{', closer='}')) # ignore the whole thing... ForLoop = pp.Suppress(pp.Keyword('for') + pp.nestedExpr() + pp.nestedExpr(opener='{', closer='}', ignoreExpr=None) @@ -559,45 +561,54 @@ class QmakeParser: Scope = pp.Forward() - Statement = pp.Group(Load | Include | Option | DefineTest - | ForLoop | FunctionCall | Operation) - StatementLine = Statement + EOL - StatementGroup = pp.ZeroOrMore(StatementLine | Scope | EOL) + Statement = pp.Group(Load | Include | Option | ForLoop \ + | DefineTestDefinition | FunctionCall | Operation) + StatementLine = Statement + (EOL | pp.FollowedBy('}')) + StatementGroup = pp.ZeroOrMore(StatementLine | Scope | pp.Suppress(EOL)) - Block = pp.Suppress('{') + pp.Optional(EOL) \ - + pp.ZeroOrMore(EOL | Statement + EOL | Scope) \ - + pp.Optional(Statement) + pp.Optional(EOL) \ - + pp.Suppress('}') + pp.Optional(EOL) + Block = pp.Suppress('{') + pp.Optional(LC | EOL) \ + + StatementGroup + pp.Optional(LC | EOL) \ + + pp.Suppress('}') + pp.Optional(LC | EOL) - Condition = pp.Optional(pp.White()) + pp.CharsNotIn(':{=}#\\\n') - Condition.setParseAction(lambda x: ' '.join(x).strip()) + ConditionEnd = pp.FollowedBy((pp.Optional(LC) + (pp.Literal(':') \ + | pp.Literal('{') \ + | pp.Literal('|')))) + ConditionPart = pp.CharsNotIn('#{}|:=\\\n') + pp.Optional(LC) + ConditionEnd + Condition = pp.Combine(ConditionPart \ + + pp.ZeroOrMore((pp.Literal('|') ^ pp.Literal(':')) \ + + ConditionPart)) + Condition.setParseAction(lambda x: ' '.join(x).strip().replace(':', ' && ').strip(' && ')) - SingleLineScope = pp.Suppress(pp.Literal(':')) \ - + pp.Group(Scope | Block | StatementLine)('statements') - MultiLineScope = Block('statements') + SingleLineScope = pp.Suppress(pp.Literal(':')) + pp.Optional(LC) \ + + pp.Group(Block | (Statement + EOL))('statements') + MultiLineScope = pp.Optional(LC) + Block('statements') - SingleLineElse = pp.Suppress(pp.Literal(':')) \ - + pp.Group(Scope | StatementLine)('else_statements') - MultiLineElse = pp.Group(Block)('else_statements') - Else = pp.Suppress(pp.Keyword('else')) \ - + (SingleLineElse | MultiLineElse) - Scope <<= pp.Group(Condition('condition') - + (SingleLineScope | MultiLineScope) - + pp.Optional(Else)) + SingleLineElse = pp.Suppress(pp.Literal(':')) + pp.Optional(LC) \ + + (Scope | Block | (Statement + pp.Optional(EOL))) + MultiLineElse = Block + ElseBranch = pp.Suppress(Else) + (SingleLineElse | MultiLineElse) + Scope <<= pp.Optional(LC) \ + + pp.Group(Condition('condition') \ + + (SingleLineScope | MultiLineScope) \ + + pp.Optional(ElseBranch)('else_statements')) if debug: - for ename in 'EOL Identifier Substitution SubstitutionValue ' \ - 'LiteralValuePart Value Values SingleLineScope ' \ - 'MultiLineScope Scope SingleLineElse ' \ - 'MultiLineElse Else Condition Block ' \ - 'StatementGroup Statement Load Include Option ' \ - 'DefineTest ForLoop FunctionCall Operation'.split(): + for ename in 'LC EOL ' \ + 'Condition ConditionPart ConditionEnd ' \ + 'Else ElseBranch SingleLineElse MultiLineElse ' \ + 'SingleLineScope MultiLineScope ' \ + 'Identifier ' \ + 'Key Op Values Value ' \ + 'Scope Block ' \ + 'StatementGroup StatementLine Statement '\ + 'Load Include Option DefineTest ForLoop ' \ + 'FunctionCall CallArgs Operation'.split(): expr = locals()[ename] expr.setName(ename) expr.setDebug() Grammar = StatementGroup('statements') - Grammar.ignore(LC) + Grammar.ignore(pp.pythonStyleComment()) return Grammar @@ -971,8 +982,8 @@ def simplify_condition(condition: str) -> str: condition = condition.replace(' NOT ', ' ~ ') condition = condition.replace(' AND ', ' & ') condition = condition.replace(' OR ', ' | ') - condition = condition.replace(' ON ', 'true') - condition = condition.replace(' OFF ', 'false') + condition = condition.replace(' ON ', ' true ') + condition = condition.replace(' OFF ', ' false ') try: # Generate and simplify condition using sympy: @@ -989,9 +1000,7 @@ def simplify_condition(condition: str) -> str: # sympy did not like our input, so leave this condition alone: condition = input_condition - if condition == '': - condition = 'ON' - return condition + return condition or 'ON' def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', diff --git a/util/cmake/tests/data/comment_scope.pro b/util/cmake/tests/data/comment_scope.pro new file mode 100644 index 00000000000..be43cad37db --- /dev/null +++ b/util/cmake/tests/data/comment_scope.pro @@ -0,0 +1,6 @@ +# QtCore can't be compiled with -Wl,-no-undefined because it uses the "environ" +# variable and on FreeBSD and OpenBSD, this variable is in the final executable itself. +# OpenBSD 6.0 will include environ in libc. +freebsd|openbsd: QMAKE_LFLAGS_NOUNDEF = + +include(animation/animation.pri) diff --git a/util/cmake/tests/data/contains_scope.pro b/util/cmake/tests/data/contains_scope.pro new file mode 100644 index 00000000000..0f51350a45d --- /dev/null +++ b/util/cmake/tests/data/contains_scope.pro @@ -0,0 +1,4 @@ +contains(DEFINES,QT_EVAL):include(eval.pri) + +HOST_BINS = $$[QT_HOST_BINS] + diff --git a/util/cmake/tests/data/multiline_assign.pro b/util/cmake/tests/data/multiline_assign.pro new file mode 100644 index 00000000000..42a3d0a6745 --- /dev/null +++ b/util/cmake/tests/data/multiline_assign.pro @@ -0,0 +1,4 @@ +A = 42 \ + 43 \ + 44 +B=23 diff --git a/util/cmake/tests/data/standardpaths.pro b/util/cmake/tests/data/standardpaths.pro new file mode 100644 index 00000000000..4b45788e4ff --- /dev/null +++ b/util/cmake/tests/data/standardpaths.pro @@ -0,0 +1,17 @@ +win32 { + !winrt { + SOURCES +=io/qstandardpaths_win.cpp + } else { + SOURCES +=io/qstandardpaths_winrt.cpp + } +} else:unix { + mac { + OBJECTIVE_SOURCES += io/qstandardpaths_mac.mm + } else:android:!android-embedded { + SOURCES += io/qstandardpaths_android.cpp + } else:haiku { + SOURCES += io/qstandardpaths_haiku.cpp + } else { + SOURCES += io/qstandardpaths_unix.cpp + } +} diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 0802fe47422..e4f9680f603 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -37,7 +37,7 @@ _tests_path = os.path.dirname(os.path.abspath(__file__)) def validate_op(key, op, value, to_validate): assert key == to_validate['key'] assert op == to_validate['operation'] - assert value == to_validate['value'] + assert value == to_validate.get('value', None) def validate_single_op(key, op, value, to_validate): @@ -71,10 +71,21 @@ def validate_default_else_test(file_name): def parse_file(file): p = QmakeParser(debug=True) - result = p.parseFile(file).asDict() - assert len(result) == 1 + result = p.parseFile(file) - return result['statements'] + print('\n\n#### Parser result:') + print(result) + print('\n#### End of parser result.\n') + + print('\n\n####Parser result dictionary:') + print(result.asDict()) + print('\n#### End of parser result dictionary.\n') + + result_dictionary = result.asDict() + + assert len(result_dictionary) == 1 + + return result_dictionary['statements'] def test_else(): @@ -129,6 +140,13 @@ def test_else8(): validate_default_else_test(_tests_path + '/data/else8.pro') +def test_multiline_assign(): + result = parse_file(_tests_path + '/data/multiline_assign.pro') + assert len(result) == 2 + validate_op('A', '=', ['42', '43', '44'], result[0]) + validate_op('B', '=', ['23'], result[1]) + + def test_include(): result = parse_file(_tests_path + '/data/include.pro') assert len(result) == 3 @@ -174,3 +192,65 @@ def test_complex_values(): def test_function_if(): result = parse_file(_tests_path + '/data/function_if.pro') assert len(result) == 1 + + +def test_realworld_standardpaths(): + result = parse_file(_tests_path + '/data/standardpaths.pro') + + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + assert cond == 'win32' + assert len(if_branch) == 1 + assert len(else_branch) == 1 + + # win32: + (cond1, if_branch1, else_branch1) = evaluate_condition(if_branch[0]) + assert cond1 == '!winrt' + assert len(if_branch1) == 1 + validate_op('SOURCES', '+=', ['io/qstandardpaths_win.cpp'], if_branch1[0]) + assert len(else_branch1) == 1 + validate_op('SOURCES', '+=', ['io/qstandardpaths_winrt.cpp'], else_branch1[0]) + + # unix: + (cond2, if_branch2, else_branch2) = evaluate_condition(else_branch[0]) + assert cond2 == 'unix' + assert len(if_branch2) == 1 + assert len(else_branch2) == 0 + + # mac / else: + (cond3, if_branch3, else_branch3) = evaluate_condition(if_branch2[0]) + assert cond3 == 'mac' + assert len(if_branch3) == 1 + validate_op('OBJECTIVE_SOURCES', '+=', ['io/qstandardpaths_mac.mm'], if_branch3[0]) + assert len(else_branch3) == 1 + + # android / else: + (cond4, if_branch4, else_branch4) = evaluate_condition(else_branch3[0]) + assert cond4 == 'android && !android-embedded' + assert len(if_branch4) == 1 + validate_op('SOURCES', '+=', ['io/qstandardpaths_android.cpp'], if_branch4[0]) + assert len(else_branch4) == 1 + + # haiku / else: + (cond5, if_branch5, else_branch5) = evaluate_condition(else_branch4[0]) + assert cond5 == 'haiku' + assert len(if_branch5) == 1 + validate_op('SOURCES', '+=', ['io/qstandardpaths_haiku.cpp'], if_branch5[0]) + assert len(else_branch5) == 1 + validate_op('SOURCES', '+=', ['io/qstandardpaths_unix.cpp'], else_branch5[0]) + + +def test_realworld_comment_scope(): + result = parse_file(_tests_path + '/data/comment_scope.pro') + assert len(result) == 2 + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + assert cond == 'freebsd|openbsd' + assert len(if_branch) == 1 + validate_op('QMAKE_LFLAGS_NOUNDEF', '=', None, if_branch[0]) + + assert result[1].get('included', '') == 'animation/animation.pri' + + +def test_realworld_contains_scope(): + result = parse_file(_tests_path + '/data/contains_scope.pro') + assert len(result) == 2 + diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py index 2d4bc183d74..1c3406bac8d 100755 --- a/util/cmake/tests/test_scope_handling.py +++ b/util/cmake/tests/test_scope_handling.py @@ -280,3 +280,59 @@ def test_merge_parent_child_scopes_with_on_child_condition(): assert r0.getString('test1') == 'parent' assert r0.getString('test2') == 'child' + +# Real world examples: + +# qstandardpaths selection: + +def test_qstandardpaths_scopes(): + # top level: + scope1 = _new_scope(condition='ON', scope_id=1) + + # win32 { + scope2 = _new_scope(parent_scope=scope1, condition='WIN32') + # !winrt { + # SOURCES += io/qstandardpaths_win.cpp + scope3 = _new_scope(parent_scope=scope2, condition='NOT WINRT', + SOURCES='qsp_win.cpp') + # } else { + # SOURCES += io/qstandardpaths_winrt.cpp + scope4 = _new_scope(parent_scope=scope2, condition='else', + SOURCES='qsp_winrt.cpp') + # } + # else: unix { + scope5 = _new_scope(parent_scope=scope1, condition='else') + scope6 = _new_scope(parent_scope=scope5, condition='UNIX') + # mac { + # OBJECTIVE_SOURCES += io/qstandardpaths_mac.mm + scope7 = _new_scope(parent_scope=scope6, condition='APPLE_OSX', SOURCES='qsp_mac.mm') + # } else:android:!android-embedded { + # SOURCES += io/qstandardpaths_android.cpp + scope8 = _new_scope(parent_scope=scope6, condition='else') + scope9 = _new_scope(parent_scope=scope8, + condition='ANDROID AND NOT ANDROID_EMBEDDED', + SOURCES='qsp_android.cpp') + # } else:haiku { + # SOURCES += io/qstandardpaths_haiku.cpp + scope10 = _new_scope(parent_scope=scope8, condition='else') + scope11 = _new_scope(parent_scope=scope10, condition='HAIKU', SOURCES='qsp_haiku.cpp') + # } else { + # SOURCES +=io/qstandardpaths_unix.cpp + scope12 = _new_scope(parent_scope=scope10, condition='else', SOURCES='qsp_unix.cpp') + # } + # } + + recursive_evaluate_scope(scope1) + + assert scope1.total_condition == 'ON' + assert scope2.total_condition == 'WIN32' + assert scope3.total_condition == 'WIN32 AND NOT WINRT' + assert scope4.total_condition == 'WINRT' + assert scope5.total_condition == 'UNIX' + assert scope6.total_condition == 'UNIX' + assert scope7.total_condition == 'APPLE_OSX' + assert scope8.total_condition == 'UNIX AND NOT APPLE_OSX' + assert scope9.total_condition == 'ANDROID AND NOT ANDROID_EMBEDDED AND NOT APPLE_OSX' + assert scope10.total_condition == 'UNIX AND NOT APPLE_OSX AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope11.total_condition == 'HAIKU AND UNIX AND NOT APPLE_OSX AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope12.total_condition == 'UNIX AND NOT APPLE_OSX AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' From 8c04d6c967b33a311fe17e69e9c5e2289a2fcd14 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 13 Feb 2019 00:15:15 +0100 Subject: [PATCH 0253/1322] CMake: pro2cmake.py: Improve condition simplification code Improve the code that simplifies conditions to take "OS families" into account. E.g. if a system must be ANDROID, then it is redundant to express that it is NOT APPLE_OSX. Change-Id: Ib7e62726c309bf84b9e5e0d6a6e3465511db0ead Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 37 +++++++++++++++++++------ util/cmake/tests/test_logic_mapping.py | 21 ++++++++++++++ util/cmake/tests/test_scope_handling.py | 4 +-- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 63938d75c82..60e7f433bf7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -875,12 +875,11 @@ def _iterate_expr_tree(expr, op, matches): keepers = (*keepers, *extra_keepers) else: keepers = (*keepers, arg) - return (matches, keepers) + return matches, keepers def _simplify_expressions(expr, op, matches, replacement): - args = expr.args - for arg in args: + for arg in expr.args: expr = expr.subs(arg, _simplify_expressions(arg, op, matches, replacement)) @@ -920,17 +919,34 @@ def _simplify_flavors_in_condition(base: str, flavors, expr): return expr +def _simplify_os_families(expr, family_members, other_family_members): + for family in family_members: + for other in other_family_members: + if other in family_members: + continue # skip those in the sub-family + + f_expr = simplify_logic(family) + o_expr = simplify_logic(other) + + expr = _simplify_expressions(expr, And, (f_expr, Not(o_expr)), f_expr) + expr = _simplify_expressions(expr, And, (Not(f_expr), o_expr), o_expr) + expr = _simplify_expressions(expr, And, (f_expr, o_expr), simplify_logic('false')) + return expr + + def _recursive_simplify(expr): ''' Simplify the expression as much as possible based on domain knowledge. ''' input_expr = expr # Simplify even further, based on domain knowledge: + windowses = ('WIN32', 'WINRT') apples = ('APPLE_OSX', 'APPLE_UIKIT', 'APPLE_IOS', 'APPLE_TVOS', 'APPLE_WATCHOS',) bsds = ('APPLE', 'FREEBSD', 'OPENBSD', 'NETBSD',) + androids = ('ANDROID', 'ANDROID_EMBEDDED') unixes = ('APPLE', *apples, 'BSD', *bsds, 'LINUX', - 'ANDROID', 'ANDROID_EMBEDDED', + *androids, 'HAIKU', 'INTEGRITY', 'VXWORKS', 'QNX', 'WASM') unix_expr = simplify_logic('UNIX') @@ -945,11 +961,6 @@ def _recursive_simplify(expr): expr = _simplify_expressions(expr, Or, (unix_expr, win_expr,), true_expr) # UNIX [AND foo ]AND WIN32 -> OFF [AND foo] expr = _simplify_expressions(expr, And, (unix_expr, win_expr,), false_expr) - for unix_flavor in unixes: - # unix_flavor [AND foo ] AND WIN32 -> FALSE [AND foo] - flavor_expr = simplify_logic(unix_flavor) - expr = _simplify_expressions(expr, And, (win_expr, flavor_expr,), - false_expr) expr = _simplify_flavors_in_condition('WIN32', ('WINRT',), expr) expr = _simplify_flavors_in_condition('APPLE', apples, expr) @@ -957,6 +968,14 @@ def _recursive_simplify(expr): expr = _simplify_flavors_in_condition('UNIX', unixes, expr) expr = _simplify_flavors_in_condition('ANDROID', ('ANDROID_EMBEDDED',), expr) + # Simplify families of OSes against other families: + expr = _simplify_os_families(expr, ('WIN32', 'WINRT'), unixes) + expr = _simplify_os_families(expr, androids, unixes) + expr = _simplify_os_families(expr, ('BSD', *bsds), unixes) + + for family in ('HAIKU', 'QNX', 'INTEGRITY', 'LINUX', 'VXWORKS'): + expr = _simplify_os_families(expr, (family,), unixes) + # Now simplify further: expr = simplify_logic(expr) diff --git a/util/cmake/tests/test_logic_mapping.py b/util/cmake/tests/test_logic_mapping.py index cf7913a6e47..c477aa83510 100755 --- a/util/cmake/tests/test_logic_mapping.py +++ b/util/cmake/tests/test_logic_mapping.py @@ -47,6 +47,14 @@ def test_simplify_off(): validate_simplify_unchanged('OFF') +def test_simplify_not_on(): + validate_simplify('NOT ON', 'OFF') + + +def test_simplify_not_off(): + validate_simplify('NOT OFF', 'ON') + + def test_simplify_isEmpty(): validate_simplify_unchanged('isEmpty(foo)') @@ -99,11 +107,19 @@ def test_simplify_unix_and_win32(): validate_simplify('WIN32 AND UNIX', 'OFF') +def test_simplify_unix_or_win32(): + validate_simplify('WIN32 OR UNIX', 'ON') + + def test_simplify_unix_and_win32_or_foobar_or_barfoo(): validate_simplify('WIN32 AND foobar AND UNIX AND barfoo', 'OFF') def test_simplify_watchos_and_win32(): + validate_simplify('APPLE_WATCHOS AND WIN32', 'OFF') + + +def test_simplify_win32_and_watchos(): validate_simplify('WIN32 AND APPLE_WATCHOS', 'OFF') @@ -163,3 +179,8 @@ def test_simplify_complex_false(): validate_simplify('WIN32 AND foobar AND ( ' 'APPLE OR ( UNIX OR FREEBSD ))', 'OFF') + + +def test_simplify_android_not_apple(): + validate_simplify('ANDROID AND NOT ANDROID_EMBEDDED AND NOT APPLE_OSX', + 'ANDROID AND NOT ANDROID_EMBEDDED') diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py index 1c3406bac8d..8bca8c8ec57 100755 --- a/util/cmake/tests/test_scope_handling.py +++ b/util/cmake/tests/test_scope_handling.py @@ -332,7 +332,7 @@ def test_qstandardpaths_scopes(): assert scope6.total_condition == 'UNIX' assert scope7.total_condition == 'APPLE_OSX' assert scope8.total_condition == 'UNIX AND NOT APPLE_OSX' - assert scope9.total_condition == 'ANDROID AND NOT ANDROID_EMBEDDED AND NOT APPLE_OSX' + assert scope9.total_condition == 'ANDROID AND NOT ANDROID_EMBEDDED' assert scope10.total_condition == 'UNIX AND NOT APPLE_OSX AND (ANDROID_EMBEDDED OR NOT ANDROID)' - assert scope11.total_condition == 'HAIKU AND UNIX AND NOT APPLE_OSX AND (ANDROID_EMBEDDED OR NOT ANDROID)' + assert scope11.total_condition == 'HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' assert scope12.total_condition == 'UNIX AND NOT APPLE_OSX AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID)' From 22dc78f41749d76df38ef1e17d6dc8c272d7cab0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 13 Feb 2019 09:13:37 +0100 Subject: [PATCH 0254/1322] CMake: pro2cmake.py: Fix handling of TEMPLATE=subdir .pro-files Change-Id: I52f575df199c4d9b38123ab5d838f2e85344835d Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 60e7f433bf7..1d48d2ba58a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -676,7 +676,6 @@ def map_condition(condition: str) -> str: def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, indent: int = 0) -> None: - assert scope.TEMPLATE == 'subdirs' ind = ' ' * indent for sd in scope.get('SUBDIRS', []): full_sd = os.path.join(scope.basedir, sd) @@ -697,7 +696,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, else: print(' XXXX: SUBDIR {} in {}: Not found.'.format(sd, scope)) - for c in scope.children(): + for c in scope.children: cond = c.condition if cond == 'else': cm_fh.write('\n{}else()\n'.format(ind)) From c971d2d3593def66c5627f47c575c2ed7ce04fec Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 13 Feb 2019 10:42:56 +0100 Subject: [PATCH 0255/1322] CMake: pro2cmake.py: Handle values with () in assignments Change-Id: I0f59c7fa57cd6c64b151f439d4eea4ae56dca288 Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 11 +++++++++-- util/cmake/tests/data/complex_assign.pro | 2 ++ util/cmake/tests/test_parsing.py | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 util/cmake/tests/data/complex_assign.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 1d48d2ba58a..1f85e977aac 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -515,6 +515,12 @@ class QmakeParser: Else = pp.Keyword('else') DefineTest = pp.Keyword('defineTest') Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') + BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \ + | pp.QuotedString(quoteChar='$(', + endQuoteChar=')', + escQuote='\\', + unquoteResults=False) + ).setParseAction(lambda s, l, t: ['(', *t[0], ')']) Substitution \ = pp.Combine(pp.Literal('$') @@ -534,7 +540,8 @@ class QmakeParser: | pp.Literal('$'))) Value = pp.NotAny(Else | pp.Literal('}') | EOL | pp.Literal('\\')) \ + (pp.QuotedString(quoteChar='"', escChar='\\') - | SubstitutionValue) + | SubstitutionValue + | BracedValue) Values = pp.ZeroOrMore(Value + pp.Optional(LC))('value') @@ -598,7 +605,7 @@ class QmakeParser: 'Else ElseBranch SingleLineElse MultiLineElse ' \ 'SingleLineScope MultiLineScope ' \ 'Identifier ' \ - 'Key Op Values Value ' \ + 'Key Op Values Value BracedValue ' \ 'Scope Block ' \ 'StatementGroup StatementLine Statement '\ 'Load Include Option DefineTest ForLoop ' \ diff --git a/util/cmake/tests/data/complex_assign.pro b/util/cmake/tests/data/complex_assign.pro new file mode 100644 index 00000000000..d251afcdd58 --- /dev/null +++ b/util/cmake/tests/data/complex_assign.pro @@ -0,0 +1,2 @@ +qmake-clean.commands += (cd qmake && $(MAKE) clean ":-(==)-:" '(Foo)' ) + diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index e4f9680f603..c238c80c084 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -254,3 +254,9 @@ def test_realworld_contains_scope(): result = parse_file(_tests_path + '/data/contains_scope.pro') assert len(result) == 2 + +def test_realworld_complex_assign(): + result = parse_file(_tests_path + '/data/complex_assign.pro') + assert len(result) == 1 + validate_op('qmake-clean.commands', '+=', '( cd qmake && $(MAKE) clean ":-(==)-:" \'(Foo)\' )'.split(), + result[0]) From 58bd86443c437e50dee3b4e115d95e984006ab58 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 27 Feb 2019 13:49:04 +0100 Subject: [PATCH 0256/1322] Fix usage of linker -no-undefined flag for macOS Change-Id: I41c55871a8db3d860fc20ad17eb9a97b01d62448 Reviewed-by: Mikhail Svetkin Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a75c0165c9b..4fc60400f56 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -200,6 +200,19 @@ function(qt_internal_add_link_flags target to_add) set_target_properties("${target}" PROPERTIES LINK_FLAGS "${flags}") endfunction() +function(qt_internal_add_link_flags_no_undefined target) + if (GCC OR CLANG) + if(APPLE) + set(no_undefined_flag "-Wl,-undefined,error") + elseif(LINUX) + set(no_undefined_flag "-Wl,--no-undefined") + else() + message(FATAL_ERROR "Platform linker doesn't support erroring upon encountering undefined symbols. Target:\"${target}\".") + endif() + qt_internal_add_link_flags("${target}" "${no_undefined_flag}") + endif() +endfunction() + function(qt_internal_add_linker_version_script target) qt_parse_all_arguments(arg "qt_internal_add_linker" "INTERNAL" "" "PRIVATE_HEADERS" ${ARGN}) @@ -562,9 +575,7 @@ function(add_qt_module target) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. - if (GCC OR CLANG) - qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") - endif() + qt_internal_add_link_flags_no_undefined("${target}") # When a public module depends on private, also make its private depend on the other's private set(qt_libs_private "") @@ -680,9 +691,7 @@ function(add_qt_plugin target) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. - if (GCC OR CLANG) - qt_internal_add_link_flags("${target}" "-Wl,--no-undefined") - endif() + qt_internal_add_link_flags_no_undefined("${target}") qt_internal_add_linker_version_script(${target}) endfunction() From 84af8f9b0bca0e615d45d600834bca31ca66059c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 27 Feb 2019 13:52:57 +0100 Subject: [PATCH 0257/1322] Fix build of qmake on macOS Two changes were needed: - correctly link against frameworks - use qcore_mac.cpp instead of qcore_mac_objc.mm, because we don't link against AppKit Change-Id: Ibd9d6d367a7fcdf7dce277c1b06d36c491294eeb Reviewed-by: Tobias Hunger --- qmake/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 223eefaa57c..14211480dd2 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,5 +1,9 @@ install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${INSTALL_DATADIR}) +find_library(FWApplicationServices ApplicationServices) +find_library(FWCoreServices CoreServices) +find_library(FWFoundation Foundation) + add_qt_tool(qmake SOURCES meta.cpp @@ -123,13 +127,11 @@ extend_target(qmake CONDITION UNIX extend_target(qmake CONDITION APPLE_OSX SOURCES ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_foundation.mm - ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_mac_objc.mm + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qcore_mac.cpp ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion_darwin.mm ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings_mac.cpp LIBRARIES - -framework ApplicationServices - -framework CoreServices - -framework Foundation + ${FWApplicationServices} ${FWCoreServices} ${FWFoundation} ) # TODO: Windows support, cf. qmake.pro From 951e297362917675f605154ff6da89fb1acb3d40 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 13 Feb 2019 12:24:14 +0100 Subject: [PATCH 0258/1322] CMake: pro2cmake.py: Warn and fix broken line continuation Warn on broken line continuation in .pro-files, but fix up the issue and proceed. Change-Id: Ibe68011b312bcea25620ce790a0b44b2983fbd88 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 18 +++++++++++- util/cmake/tests/test_lc_fixup.py | 46 +++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100755 util/cmake/tests/test_lc_fixup.py diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 1f85e977aac..eccf0455595 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -72,6 +72,13 @@ def _parse_commandline(): return parser.parse_args() +def fixup_linecontinuation(contents: str) -> str: + contents = re.sub(r'([^\t ])\\[ \t]*\n', '\\1 \\\n', contents) + contents = re.sub(r'\\[ \t]*\n', '\\\n', contents) + + return contents + + def spaces(indent: int) -> str: return ' ' * indent @@ -622,7 +629,16 @@ class QmakeParser: def parseFile(self, file: str): print('Parsing \"{}\"...'.format(file)) try: - result = self._Grammar.parseFile(file, parseAll=True) + with open(file, 'r') as file_fd: + contents = file_fd.read() + + old_contents = contents + contents = fixup_linecontinuation(contents) + + if old_contents != contents: + print('Warning: Fixed line continuation in .pro-file!\n' + ' Position information in Parsing output might be wrong!') + result = self._Grammar.parseString(contents, parseAll=True) except pp.ParseException as pe: print(pe.line) print(' '*(pe.col-1) + '^') diff --git a/util/cmake/tests/test_lc_fixup.py b/util/cmake/tests/test_lc_fixup.py new file mode 100755 index 00000000000..d3680e895d5 --- /dev/null +++ b/util/cmake/tests/test_lc_fixup.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from pro2cmake import fixup_linecontinuation + +from textwrap import dedent + + +def test_no_change(): + input = "test \\\nline2\n line3" + result = fixup_linecontinuation(input) + assert input == result + + +def test_fix(): + input = "test \\\t\nline2\\\n line3\\ \nline4 \\ \t\nline5\\\n\n\n" + result = fixup_linecontinuation(input) + assert 'test \\\nline2 \\\n line3 \\\nline4 \\\nline5 \\\n\n\n' == result + + From eb832cb00ae231d31052e885d4482e34aeb2640d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 13 Feb 2019 13:04:45 +0100 Subject: [PATCH 0259/1322] CMake: pro2cmake.py: Handle complex conditions Change-Id: Ifb047e5736f1831ddbd65b210e760c2729378334 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 19 +++++++++++-------- util/cmake/tests/data/complex_condition.pro | 4 ++++ util/cmake/tests/test_parsing.py | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 util/cmake/tests/data/complex_condition.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index eccf0455595..9dbcac9fc4e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -546,9 +546,9 @@ class QmakeParser: = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart | pp.Literal('$'))) Value = pp.NotAny(Else | pp.Literal('}') | EOL | pp.Literal('\\')) \ - + (pp.QuotedString(quoteChar='"', escChar='\\') - | SubstitutionValue - | BracedValue) + + (pp.QuotedString(quoteChar='"', escChar='\\') + | SubstitutionValue + | BracedValue) Values = pp.ZeroOrMore(Value + pp.Optional(LC))('value') @@ -584,10 +584,12 @@ class QmakeParser: + StatementGroup + pp.Optional(LC | EOL) \ + pp.Suppress('}') + pp.Optional(LC | EOL) - ConditionEnd = pp.FollowedBy((pp.Optional(LC) + (pp.Literal(':') \ - | pp.Literal('{') \ - | pp.Literal('|')))) - ConditionPart = pp.CharsNotIn('#{}|:=\\\n') + pp.Optional(LC) + ConditionEnd + ConditionEnd = pp.FollowedBy((pp.Optional(pp.White()) + + pp.Optional(LC) + (pp.Literal(':') \ + | pp.Literal('{') \ + | pp.Literal('|')))) + ConditionPart = ((pp.Optional('!') + Identifier + pp.Optional(BracedValue)) \ + ^ pp.CharsNotIn('#{}|:=\\\n')) + pp.Optional(LC) + ConditionEnd Condition = pp.Combine(ConditionPart \ + pp.ZeroOrMore((pp.Literal('|') ^ pp.Literal(':')) \ + ConditionPart)) @@ -1172,7 +1174,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, def write_module(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0) -> None: module_name = scope.TARGET - assert module_name.startswith('Qt') + if not module_name.startswith('Qt'): + print('XXXXXX Module name {} does not start with Qt!'.format(module_name)) extra = [] if 'static' in scope.get('CONFIG'): diff --git a/util/cmake/tests/data/complex_condition.pro b/util/cmake/tests/data/complex_condition.pro new file mode 100644 index 00000000000..bc3369bd632 --- /dev/null +++ b/util/cmake/tests/data/complex_condition.pro @@ -0,0 +1,4 @@ +!system("dbus-send --session --type=signal / local.AutotestCheck.Hello >$$QMAKE_SYSTEM_NULL_DEVICE 2>&1") { + SOURCES = dbus.cpp +} + diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index c238c80c084..f0c80f560e1 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -260,3 +260,17 @@ def test_realworld_complex_assign(): assert len(result) == 1 validate_op('qmake-clean.commands', '+=', '( cd qmake && $(MAKE) clean ":-(==)-:" \'(Foo)\' )'.split(), result[0]) + + +def test_realworld_complex_condition(): + result = parse_file(_tests_path + '/data/complex_condition.pro') + assert len(result) == 1 + (cond, if_branch, else_branch) = evaluate_condition(result[0]) + assert cond == '!system("dbus-send --session --type=signal / ' \ + 'local.AutotestCheck.Hello >$$QMAKE_SYSTEM_NULL_DEVICE ' \ + '2>&1")' + assert len(if_branch) == 1 + validate_op('SOURCES', '=', ['dbus.cpp'], if_branch[0]) + + assert len(else_branch) == 0 + From 04d69817027c37440a85b0f0ec8b9b0e8c037b56 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Feb 2019 13:53:04 +0100 Subject: [PATCH 0260/1322] CMake: run_pro2cmake.py: Add statistics Change-Id: I78e65970694d0c37c4b3c3ba6e6a83155579ea0f Reviewed-by: Alexandru Croitor --- util/cmake/run_pro2cmake.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 4340eab0941..1a3c1581e39 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -34,11 +34,27 @@ import sys script_path = os.path.dirname(os.path.abspath(__file__)) base_path = os.path.dirname(script_path) -pro2cmake = script_path + '/pro2cmake.py' +pro2cmake = os.path.join(script_path, 'pro2cmake.py') if len(sys.argv) > 1: base_path = os.path.abspath(sys.argv[1]) -for filename in glob.iglob(base_path + '/**/*.pro', recursive=True): - print('Converting:', filename) - subprocess.run([pro2cmake, filename]) +failed_files = [] + +pro_file_count = 0 +for filename in glob.iglob(os.path.join(base_path, '**/*.pro'), + recursive=True): + pro_file_count += 1 + print('{} ({}): Converting: {} ...' + .format(pro_file_count, len(failed_files), filename)) + result = subprocess.run([pro2cmake, os.path.basename(filename)], + cwd=os.path.dirname(filename)) + if result.returncode != 0: + failed_files.append(filename) + +if failed_files: + print('The following files were not successfully ' + 'converted ({} of {}):'.format(len(failed_files), pro_file_count)) + for f in failed_files: + print(' "{}"'.format(f)) + From 8512f5179d2674dd9c0b89eeebbf2c6d32e3e4b4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 27 Feb 2019 13:37:01 +0100 Subject: [PATCH 0261/1322] CMake: pro2cmake.py: Fix parsing of for loops Ignore for loops in the pro2cmake.py parser and add a unit test for that. Change-Id: I2a0c075c45cf56f4f24ada2d53e8e8e94ce19f26 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 15 ++++++--------- util/cmake/tests/data/for.pro | 11 +++++++++++ util/cmake/tests/test_parsing.py | 7 +++++++ 3 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 util/cmake/tests/data/for.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9dbcac9fc4e..6002f780376 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -520,7 +520,6 @@ class QmakeParser: LC = pp.Suppress(pp.Literal('\\\n')) EOL = pp.Suppress(pp.Literal('\n')) Else = pp.Keyword('else') - DefineTest = pp.Keyword('defineTest') Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \ | pp.QuotedString(quoteChar='$(', @@ -560,17 +559,15 @@ class QmakeParser: Operation = Key('key') + pp.Optional(LC) \ + Op('operation') + pp.Optional(LC) \ + Values('value') - CallArgs = pp.nestedExpr() + CallArgs = pp.Optional(LC) + pp.nestedExpr() CallArgs.setParseAction(lambda x: ' '.join(chain(*x))) Load = pp.Keyword('load') + CallArgs('loaded') Include = pp.Keyword('include') + CallArgs('included') Option = pp.Keyword('option') + CallArgs('option') - DefineTestDefinition = pp.Suppress(DefineTest + CallArgs \ - + pp.nestedExpr(opener='{', closer='}')) # ignore the whole thing... - ForLoop = pp.Suppress(pp.Keyword('for') + pp.nestedExpr() - + pp.nestedExpr(opener='{', closer='}', - ignoreExpr=None) - + pp.LineEnd()) # ignore the whole thing... + DefineTestDefinition = pp.Suppress(pp.Keyword('defineTest') + CallArgs + + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing... + ForLoop = pp.Suppress(pp.Keyword('for') + CallArgs + + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing... FunctionCall = pp.Suppress(Identifier + pp.nestedExpr()) Scope = pp.Forward() @@ -617,7 +614,7 @@ class QmakeParser: 'Key Op Values Value BracedValue ' \ 'Scope Block ' \ 'StatementGroup StatementLine Statement '\ - 'Load Include Option DefineTest ForLoop ' \ + 'Load Include Option DefineTestDefinition ForLoop ' \ 'FunctionCall CallArgs Operation'.split(): expr = locals()[ename] expr.setName(ename) diff --git a/util/cmake/tests/data/for.pro b/util/cmake/tests/data/for.pro new file mode 100644 index 00000000000..5751432980e --- /dev/null +++ b/util/cmake/tests/data/for.pro @@ -0,0 +1,11 @@ +SOURCES = main.cpp +for (config, SIMD) { + uc = $$upper($$config) + DEFINES += QT_COMPILER_SUPPORTS_$${uc} + + add_cflags { + cflags = QMAKE_CFLAGS_$${uc} + !defined($$cflags, var): error("This compiler does not support $${uc}") + QMAKE_CXXFLAGS += $$eval($$cflags) + } +} diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index f0c80f560e1..d0a9960dc7f 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -173,6 +173,13 @@ def test_definetest(): assert result[0] == [] +def test_for(): + result = parse_file(_tests_path + '/data/for.pro') + assert len(result) == 2 + validate_op('SOURCES', '=', ['main.cpp'], result[0]) + assert result[1] == [] + + def test_unset(): result = parse_file(_tests_path + '/data/unset.pro') assert len(result) == 1 From 754ba287999e0d1681f77d12f6d7c3ae0362745a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 27 Feb 2019 13:58:00 +0100 Subject: [PATCH 0262/1322] CMake: pro2cmake.py: Fix parsing of Line continuation before end of file ... and add a test case for this. Change-Id: If20d737b54ecb3f9e128e59070b238c840acad6c Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- util/cmake/tests/data/sql.pro | 3 +++ util/cmake/tests/test_parsing.py | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 util/cmake/tests/data/sql.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6002f780376..5d161a139ab 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -518,7 +518,7 @@ class QmakeParser: pp.ParserElement.setDefaultWhitespaceChars(' \t') LC = pp.Suppress(pp.Literal('\\\n')) - EOL = pp.Suppress(pp.Literal('\n')) + EOL = pp.Suppress(pp.Literal('\n') ^ pp.LineEnd()) Else = pp.Keyword('else') Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \ diff --git a/util/cmake/tests/data/sql.pro b/util/cmake/tests/data/sql.pro new file mode 100644 index 00000000000..a9d7fc7c5a4 --- /dev/null +++ b/util/cmake/tests/data/sql.pro @@ -0,0 +1,3 @@ +TEMPLATE = subdirs +SUBDIRS = \ + kernel \ diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index d0a9960dc7f..1f50fc87ab3 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -281,3 +281,9 @@ def test_realworld_complex_condition(): assert len(else_branch) == 0 + +def test_realworld_sql(): + result = parse_file(_tests_path + '/data/sql.pro') + assert len(result) == 2 + validate_op('TEMPLATE', '=', ['subdirs'], result[0]) + validate_op('SUBDIRS', '=', ['kernel'], result[1]) From 33fe56c630d9e59b2a33e28db5e062323d577d34 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 27 Feb 2019 15:17:36 +0100 Subject: [PATCH 0263/1322] CMake: pro2cmake.py: Make \$\$QT_FOO work in assignments This broke somewhere along the way. Add a test for this. Change-Id: I106ddff6eb86a51ef132285d1bc623f3b5cf71fb Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- util/cmake/tests/data/escaped_value.pro | 2 ++ util/cmake/tests/test_parsing.py | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 util/cmake/tests/data/escaped_value.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5d161a139ab..1f76d9dedd8 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -544,7 +544,7 @@ class QmakeParser: SubstitutionValue \ = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart | pp.Literal('$'))) - Value = pp.NotAny(Else | pp.Literal('}') | EOL | pp.Literal('\\')) \ + Value = pp.NotAny(Else | pp.Literal('}') | EOL) \ + (pp.QuotedString(quoteChar='"', escChar='\\') | SubstitutionValue | BracedValue) diff --git a/util/cmake/tests/data/escaped_value.pro b/util/cmake/tests/data/escaped_value.pro new file mode 100644 index 00000000000..7c95b1fc309 --- /dev/null +++ b/util/cmake/tests/data/escaped_value.pro @@ -0,0 +1,2 @@ +MODULE_AUX_INCLUDES = \ + \$\$QT_MODULE_INCLUDE_BASE/QtANGLE diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 1f50fc87ab3..dd4e5508f60 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -287,3 +287,10 @@ def test_realworld_sql(): assert len(result) == 2 validate_op('TEMPLATE', '=', ['subdirs'], result[0]) validate_op('SUBDIRS', '=', ['kernel'], result[1]) + + +def test_realworld_qtconfig(): + result = parse_file(_tests_path + '/data/escaped_value.pro') + assert len(result) == 1 + validate_op('MODULE_AUX_INCLUDES', '=', ['\\$\\$QT_MODULE_INCLUDE_BASE/QtANGLE'], result[0]) + From f2e968b245e0428b75eecb0bb7244a0391e3b355 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 27 Feb 2019 15:31:29 +0100 Subject: [PATCH 0264/1322] CMake: pro2cmake.py: Handle for loops without block Handle for loops with a single line of instructions and add a test for that. Change-Id: I041ae30f64abcbd3db7df29933647f047b92ede3 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 4 +++- util/cmake/tests/data/single_line_for.pro | 4 ++++ util/cmake/tests/test_parsing.py | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 util/cmake/tests/data/single_line_for.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 1f76d9dedd8..06d0c925d92 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -568,11 +568,13 @@ class QmakeParser: + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing... ForLoop = pp.Suppress(pp.Keyword('for') + CallArgs + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing... + ForLoopSingleLine = pp.Suppress(pp.Keyword('for') + CallArgs + + pp.Literal(':') + pp.SkipTo(EOL, ignore=LC)) # ignore the whole thing... FunctionCall = pp.Suppress(Identifier + pp.nestedExpr()) Scope = pp.Forward() - Statement = pp.Group(Load | Include | Option | ForLoop \ + Statement = pp.Group(Load | Include | Option | ForLoop | ForLoopSingleLine \ | DefineTestDefinition | FunctionCall | Operation) StatementLine = Statement + (EOL | pp.FollowedBy('}')) StatementGroup = pp.ZeroOrMore(StatementLine | Scope | pp.Suppress(EOL)) diff --git a/util/cmake/tests/data/single_line_for.pro b/util/cmake/tests/data/single_line_for.pro new file mode 100644 index 00000000000..806d08a49cf --- /dev/null +++ b/util/cmake/tests/data/single_line_for.pro @@ -0,0 +1,4 @@ +for(d, sd): \ + exists($$d/$${d}.pro): \ + SUBDIRS += $$d + diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index dd4e5508f60..2f227e0ba26 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -180,6 +180,12 @@ def test_for(): assert result[1] == [] +def test_single_line_for(): + result = parse_file(_tests_path + '/data/single_line_for.pro') + assert len(result) == 1 + assert result[0] == [] + + def test_unset(): result = parse_file(_tests_path + '/data/unset.pro') assert len(result) == 1 From 83354655b2f96f0fc5fa8f39d10b58c36a9e8bf5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 27 Feb 2019 16:12:13 +0100 Subject: [PATCH 0265/1322] CMake: pro2cmake.py: Simplify code and add test for line continuation Simplify code a bit and add a test for line continuation fixup. Change-Id: If865bc94d7d419c65d3280b5f9613ebc0d3db74a Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- util/cmake/tests/data/lc.pro | 10 ++++++++++ util/cmake/tests/test_parsing.py | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 util/cmake/tests/data/lc.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 06d0c925d92..ef81d4cfef3 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -518,7 +518,7 @@ class QmakeParser: pp.ParserElement.setDefaultWhitespaceChars(' \t') LC = pp.Suppress(pp.Literal('\\\n')) - EOL = pp.Suppress(pp.Literal('\n') ^ pp.LineEnd()) + EOL = pp.Suppress(pp.LineEnd()) Else = pp.Keyword('else') Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \ diff --git a/util/cmake/tests/data/lc.pro b/util/cmake/tests/data/lc.pro new file mode 100644 index 00000000000..def80e7c959 --- /dev/null +++ b/util/cmake/tests/data/lc.pro @@ -0,0 +1,10 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qmacstyle \ + qstyle \ + qstyleoption \ + qstylesheetstyle \ + +!qtConfig(private_tests): SUBDIRS -= \ + qstylesheetstyle \ + diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 2f227e0ba26..79ad0a49454 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -300,3 +300,8 @@ def test_realworld_qtconfig(): assert len(result) == 1 validate_op('MODULE_AUX_INCLUDES', '=', ['\\$\\$QT_MODULE_INCLUDE_BASE/QtANGLE'], result[0]) + +def test_realworld_lc(): + result = parse_file(_tests_path + '/data/lc.pro') + assert len(result) == 3 + From 07f922286c9224b2999e8fc721ab5f180542eb8c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 27 Feb 2019 17:09:52 +0100 Subject: [PATCH 0266/1322] Fix building tests on macOS Change-Id: I15a83d5abf9e8fa541ff3ca60bd8243f5f4b85e3 Reviewed-by: Simon Hausmann --- tests/auto/widgets/kernel/qwidget/CMakeLists.txt | 2 +- tests/auto/widgets/widgets/qlineedit/CMakeLists.txt | 2 +- tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt | 2 +- tests/auto/widgets/widgets/qmenubar/CMakeLists.txt | 2 +- tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/CMakeLists.txt b/tests/auto/widgets/kernel/qwidget/CMakeLists.txt index ac09f88ae29..3bafe782d6b 100644 --- a/tests/auto/widgets/kernel/qwidget/CMakeLists.txt +++ b/tests/auto/widgets/kernel/qwidget/CMakeLists.txt @@ -12,5 +12,5 @@ add_qt_test("tst_qwidget" extend_target("tst_qwidget" CONDITION APPLE_OSX SOURCES tst_qwidget_mac_helpers.mm - LIBRARIES FWSecurity FWAppKit + LIBRARIES ${FWSecurity} ${FWAppKit} ) diff --git a/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt b/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt index 626b9fc4036..00e0c1d5754 100644 --- a/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qlineedit/CMakeLists.txt @@ -6,4 +6,4 @@ add_qt_test("tst_qlineedit" RUN_SERIAL SOURCES tst_qlineedit.cpp Qt::TestPrivate ) -extend_target("tst_qlineedit" CONDITION APPLE_OSX LIBRARIES FWAppKit) +extend_target("tst_qlineedit" CONDITION APPLE_OSX LIBRARIES ${FWAppKit}) diff --git a/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt b/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt index ca3bf2afa1e..0f32c0ebce6 100644 --- a/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qmdiarea/CMakeLists.txt @@ -8,4 +8,4 @@ add_qt_test("tst_qmdiarea" RUN_SERIAL SOURCES tst_qmdiarea.cpp ) extend_target("tst_qmdiarea" CONDITION TARGET Qt::OpenGL LIBRARIES Qt::OpenGL) -extend_target("tst_qmdiarea" CONDITION APPLE_OSX LIBRARIES FWSecurity) +extend_target("tst_qmdiarea" CONDITION APPLE_OSX LIBRARIES ${FWSecurity}) diff --git a/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt b/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt index 84878c7ec82..3fb1c5ccb19 100644 --- a/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qmenubar/CMakeLists.txt @@ -2,5 +2,5 @@ add_qt_test("tst_qmenubar" RUN_SERIAL SOURCES tst_qmenubar.cpp LIBRARIES Qt::Wid extend_target("tst_qmenubar" CONDITION APPLE_OSX SOURCES tst_qmenubar_mac.mm - LIBRARIES FWAppKit + LIBRARIES ${FWAppKit} ) diff --git a/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt b/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt index d05e0aa8c68..f3a9a9ab90f 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qplaintextedit/CMakeLists.txt @@ -4,4 +4,4 @@ add_qt_test("tst_qplaintextedit" RUN_SERIAL SOURCES tst_qplaintextedit.cpp Qt::GuiPrivate ) -extend_target("tst_qplaintextedit" CONDITION APPLE_OSX LIBRARIES FWAppKit) +extend_target("tst_qplaintextedit" CONDITION APPLE_OSX LIBRARIES ${FWAppKit}) From 3c9d7dfb304dcad8ceea29ac729e76d8eca913f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB=20=D0=A1=D0=B2=D0=B5?= =?UTF-8?q?=D1=82=D0=BA=D0=B8=D0=BD?= Date: Mon, 11 Feb 2019 13:27:00 +0100 Subject: [PATCH 0267/1322] cmake: Cleanup harfbuzz features Remove system-harfbuzz feature and use harfbuzz feature as system Change-Id: I441345a667450f1c2d19380b0709911011c7ceb7 Reviewed-by: Tobias Hunger --- src/gui/configure.cmake | 12 +----------- util/cmake/configurejson2cmake.py | 6 ++++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 271c8a182e9..03a3734691b 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -6,10 +6,6 @@ set(INPUT_freetype "undefined" CACHE STRING "") set_property(CACHE INPUT_freetype PROPERTY STRINGS undefined no qt system) -# input harfbuzz -set(INPUT_harfbuzz "undefined" CACHE STRING "") -set_property(CACHE INPUT_harfbuzz PROPERTY STRINGS undefined no qt system) - # input libjpeg set(INPUT_libjpeg "undefined" CACHE STRING "") set_property(CACHE INPUT_libjpeg PROPERTY STRINGS undefined no qt system) @@ -479,15 +475,9 @@ qt_feature("fontconfig" PUBLIC PRIVATE qt_feature_definition("fontconfig" "QT_NO_FONTCONFIG" NEGATE VALUE "1") qt_feature("harfbuzz" PUBLIC PRIVATE LABEL "HarfBuzz" + CONDITION HARFBUZZ_FOUND ) qt_feature_definition("harfbuzz" "QT_NO_HARFBUZZ" NEGATE VALUE "1") -qt_feature("system_harfbuzz" PRIVATE - LABEL " Using system HarfBuzz" - AUTODETECT NOT APPLE AND NOT WIN32 - CONDITION QT_FEATURE_harfbuzz AND harfbuzz_FOUND - ENABLE INPUT_harfbuzz STREQUAL 'system' - DISABLE INPUT_harfbuzz STREQUAL 'qt' -) qt_feature("qqnx_imf" PRIVATE LABEL "IMF" CONDITION libs.imf OR FIXME diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index a684130c684..efce7fee4a9 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -432,6 +432,8 @@ def parseInput(ctx, input, data, cm_fh): "gui", + "harfbuzz", + "headersclean", "incredibuild-xge", @@ -708,6 +710,9 @@ def parseFeature(ctx, feature, data, cm_fh): 'disable': 'NOT TEST_posix_iconv OR TEST_iconv_needlib', }, 'GNUmake': None, + 'harfbuzz': { + 'condition': 'HARFBUZZ_FOUND' + }, 'host-dbus': None, 'iconv': { 'condition': 'NOT QT_FEATURE_icu AND QT_FEATURE_textcodec AND ( TEST_posix_iconv OR TEST_sun_iconv )' @@ -759,6 +764,7 @@ def parseFeature(ctx, feature, data, cm_fh): }, 'system-doubleconversion': None, # No system libraries anymore! 'system-freetype': None, + 'system-harfbuzz': None, 'system-jpeg': None, 'system-pcre2': None, 'system-png': None, From 363eccf0108baccbabab9747a2eb9d7aa0373045 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 13:32:44 +0100 Subject: [PATCH 0268/1322] CMake: pro2cmake.py: Handle BOOTSTRAP for add_qt_tool Add BOOTSTRAP for tools that need it automatically. Change-Id: I33b2ec16dfcb09709f844ed232ce9974a9d7c7ed Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ef81d4cfef3..d21ae36a824 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1197,8 +1197,11 @@ def write_tool(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0) -> None: tool_name = scope.TARGET + extra = ['BOOTSTRAP'] if 'force_bootstrap' in scope.get('CONFIG', []) else [] + write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope, - indent=indent, known_libraries={'Qt::Core', }) + indent=indent, known_libraries={'Qt::Core', }, + extra_lines=extra) def write_test(cm_fh: typing.IO[str], scope: Scope, *, From a5f51e489885babf48cbc3fd224e1492a02bd60f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:00:19 +0100 Subject: [PATCH 0269/1322] CMake: pro2cmake.py: Automatically map equals(QT_ARCH, "foo") in conditions Change-Id: I10d8001ba8330deaa622ef8c499b2b6fe438e28a Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index d21ae36a824..7c00afad1cb 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -656,9 +656,9 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: condition = re.sub(r'\bif\s*\((.*?)\)', r'\1', condition) condition = re.sub(r'\bisEmpty\s*\((.*?)\)', r'\1_ISEMPTY', condition) - condition = re.sub(r'\bcontains\s*\((.*?), (.*)?\)', + condition = re.sub(r'\bcontains\s*\((.*?),\s*"?(.*?)"?\)', r'\1___contains___\2', condition) - condition = re.sub(r'\bequals\s*\((.*?), (.*)?\)', + condition = re.sub(r'\bequals\s*\((.*?),\s*"?(.*?)"?\)', r'\1___equals___\2', condition) condition = re.sub(r'\s*==\s*', '___STREQUAL___', condition) @@ -1070,6 +1070,14 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', return current_condition +def map_to_cmake_condition(condition: str) -> str: + condition = re.sub(r'\bQT_ARCH___equals___([a-zA-Z_0-9]*)', + r'(TEST_architecture STREQUAL "\1")', condition) + condition = re.sub(r'\bQT_ARCH___contains___([a-zA-Z_0-9]*)', + r'(TEST_architecture STREQUAL "\1")', condition) + return condition + + def write_extend_target(cm_fh: typing.IO[str], target: str, scope: Scope, indent: int = 0): extend_qt_io_string = io.StringIO() @@ -1083,7 +1091,7 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, extend_scope = '\n{}extend_target({} CONDITION {}\n' \ '{}{})\n'.format(spaces(indent), target, - scope.total_condition, + map_to_cmake_condition(scope.total_condition), extend_qt_string, ignored_keys_report) if not extend_qt_string: From 66a4267f93b24b5cc6aac9aea1133f79675c1756 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:54:40 +0100 Subject: [PATCH 0270/1322] CMake: pro2cmake.py: Map libpng to PNG::PNG Change-Id: Ia8dd20b777e24e2783bedb0f063db2189e0b7ed3 Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index c7749e50a66..b50289e97d0 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -220,6 +220,7 @@ libray_mapping = { 'icu': 'ICU::i18n ICU::uc ICU::data', 'libatomic': 'Atomic', 'libdl': '${CMAKE_DL_LIBS}', + 'libpng' : 'PNG::PNG', 'libproxy': 'LibProxy::LibProxy', 'librt': 'WrapRt', 'pcre2': 'PCRE2', From 9a7af3949a9839ff9047d7923f68e8d98d960b02 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:16:07 +0100 Subject: [PATCH 0271/1322] CMake: Re-generate CMakeLists.txt file for xml Change-Id: I6d2570b5b98defc241acf653847b4c433432290f Reviewed-by: Albert Astals Cid --- src/xml/CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt index ae045ae76e1..08914676409 100644 --- a/src/xml/CMakeLists.txt +++ b/src/xml/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from xml.pro. ##################################################################### -## QtXml Module: +## Xml Module: ##################################################################### add_qt_module(Xml @@ -14,17 +14,16 @@ add_qt_module(Xml QT_NO_FOREACH LIBRARIES Qt::CorePrivate - PUBLIC_LIBRARIES - Qt::Core + # PRECOMPILED_HEADER = + # _LOADED = "qt_module" ) ## Scopes: ##################################################################### -### FIXME -# extend_target(Xml CONDITION (MSVC) AND (TEST_architecture_arch STREQUAL i386)) -# SOURCES -# ### FIXME: QMAKE_LFLAGS += /BASE:0x61000000 -# ) +extend_target(Xml CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x61000000" +) add_qt_docs(./doc/qtxml.qdocconf) From bfca573f87568909d73badadcea686b26171cec1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:19:08 +0100 Subject: [PATCH 0272/1322] CMake: Re-generate CMakeLists.txt file for dbus Change-Id: I13ce987d4db99e160bf579ea3a785ac45cc1417b Reviewed-by: Albert Astals Cid --- src/dbus/CMakeLists.txt | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index 4150c1274a9..dd012565306 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from dbus.pro. ##################################################################### -## QtDBus Module: +## DBus Module: ##################################################################### add_qt_module(DBus @@ -21,7 +21,7 @@ add_qt_module(DBus qdbusinterface.cpp qdbusinterface.h qdbusinterface_p.h qdbusinternalfilters.cpp qdbusintrospection.cpp qdbusintrospection_p.h -# FIXME: this file is included in qdbusargument.cpp: qdbusmarshaller.cpp + qdbusmarshaller.cpp qdbusmessage.cpp qdbusmessage.h qdbusmessage_p.h qdbusmetaobject.cpp qdbusmetatype.cpp qdbusmetatype.h @@ -42,17 +42,31 @@ add_qt_module(DBus DBUS_API_SUBJECT_TO_CHANGE QT_NO_FOREACH LIBRARIES - Qt::Core Qt::CorePrivate + # MODULE_CONFIG = "dbusadaptors" "dbusinterfaces" + # _LOADED = "qt_module" ) +set_source_files_properties(qdbusmarshaller.cpp + PROPERTIES HEADER_FILE_ONLY ON) # special case: This file is included by qdbusargument.cpp + + ## Scopes: ##################################################################### extend_target(DBus CONDITION QT_FEATURE_dbus_linked - DEFINES QT_LINKED_LIBDBUS LIBRARIES dbus + DEFINES + QT_LINKED_LIBDBUS + LIBRARIES + dbus ) -extend_target(DBus CONDITION WIN32 LIBRARIES ws2_32 advapi32 netapi32 user32) +extend_target(DBus CONDITION WIN32 + LIBRARIES + ws2_32 + advapi32 + netapi32 + user32 +) add_qt_docs(./doc/qtdbus.qdocconf) From 0fb799a0d773f311434598c320dbfe258258454b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:23:07 +0100 Subject: [PATCH 0273/1322] CMake: Re-generate CMakeLists.txt file for uic Change-Id: I9411b727b199d35709cf0fef37d3a442982cc3da Reviewed-by: Albert Astals Cid --- src/tools/uic/CMakeLists.txt | 48 +++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/src/tools/uic/CMakeLists.txt b/src/tools/uic/CMakeLists.txt index 0c40af3540f..46826b7d52f 100644 --- a/src/tools/uic/CMakeLists.txt +++ b/src/tools/uic/CMakeLists.txt @@ -1,16 +1,40 @@ +# Generated from uic.pro. + +##################################################################### +## uic Tool: +##################################################################### + add_qt_tool(uic SOURCES - cpp/cppwritedeclaration.cpp - cpp/cppwriteincludes.cpp - cpp/cppwriteinitialization.cpp - customwidgetsinfo.cpp - databaseinfo.cpp - driver.cpp + cpp/cppwritedeclaration.cpp cpp/cppwritedeclaration.h + cpp/cppwriteincludes.cpp cpp/cppwriteincludes.h + cpp/cppwriteinitialization.cpp cpp/cppwriteinitialization.h + customwidgetsinfo.cpp customwidgetsinfo.h + databaseinfo.cpp databaseinfo.h + driver.cpp driver.h + globaldefs.h main.cpp - treewalker.cpp - ui4.cpp - uic.cpp - validator.cpp - INCLUDE_DIRECTORIES cpp - DEFINES QT_UIC QT_UIC_CPP_GENERATOR + option.h + treewalker.cpp treewalker.h + ui4.cpp ui4.h + uic.cpp uic.h + utils.h + validator.cpp validator.h + DEFINES + QT_UIC + QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + QT_UIC_CPP_GENERATOR + INCLUDE_DIRECTORIES + cpp + # QMAKE_TARGET_DESCRIPTION = "Qt User Interface Compiler" + # _LOADED = "qt_tool" + # _OPTION = "host_build" ) + +## Scopes: +##################################################################### +# +#extend_target(uic CONDITION NOT force_bootstrap AND NOT qtConfig(commandlineparser OR NOT QT_FEATURE_textcodec OR NOT QT_FEATURE_xmlstreamreader OR NOT QT_FEATURE_xmlstreamwriter +# # CONFIG = "force_bootstrap" +#) From 27fc264b7d7d89b29f809ffefb601b69bc1ddb4c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:30:58 +0100 Subject: [PATCH 0274/1322] CMake: Re-generate CMakeLists.txt files for src/tools/* Re-generate the CMakeLists.txt files for qdbusxml2cpp, qdbuscpp2xml, qlalr and qvkgen. Change-Id: I473a7bbdfa5ed5049d17324fb7dab4940124ef86 Reviewed-by: Albert Astals Cid --- src/tools/qdbuscpp2xml/CMakeLists.txt | 24 +++++++++++++++++++++--- src/tools/qdbusxml2cpp/CMakeLists.txt | 22 +++++++++++++++++++++- src/tools/qlalr/CMakeLists.txt | 10 ++++++++++ src/tools/qvkgen/CMakeLists.txt | 10 +++++++++- 4 files changed, 61 insertions(+), 5 deletions(-) diff --git a/src/tools/qdbuscpp2xml/CMakeLists.txt b/src/tools/qdbuscpp2xml/CMakeLists.txt index 58f9b3a9e63..5e2937aa05c 100644 --- a/src/tools/qdbuscpp2xml/CMakeLists.txt +++ b/src/tools/qdbuscpp2xml/CMakeLists.txt @@ -1,3 +1,9 @@ +# Generated from qdbuscpp2xml.pro. + +##################################################################### +## qdbuscpp2xml Tool: +##################################################################### + add_qt_tool(qdbuscpp2xml SOURCES ../moc/cbordevice.h @@ -9,14 +15,26 @@ add_qt_tool(qdbuscpp2xml ../moc/symbols.h ../moc/token.cpp ../moc/token.h ../moc/utils.h - qdbuscpp2xml.cpp + qdbuscpp2xml.cpp # special case DEFINES QT_NO_CAST_FROM_ASCII QT_NO_FOREACH INCLUDE_DIRECTORIES - ../moc/ - ../moc/../../3rdparty/tinycbor/src + ../moc LIBRARIES + tinycbor # special case Qt::CorePrivate Qt::DBusPrivate + # COMPILE_OPTIONS # special case + # "$$QT_HOST_CFLAGS_DBUS" + # QMAKE_TARGET_DESCRIPTION = "Qt D-Bus C++ to XML Compiler" + # _LOADED = "qt_tool" + # _OPTION = "host_build" ) + +## Scopes: +##################################################################### + +# special case: +# extend_target(qdbuscpp2xml CONDITION force_bootstrap [...]) +# extend_target(qdbuscpp2xml CONDITION NOT force_bootstrap [...]) diff --git a/src/tools/qdbusxml2cpp/CMakeLists.txt b/src/tools/qdbusxml2cpp/CMakeLists.txt index 7db59b48839..e9a72a3d45b 100644 --- a/src/tools/qdbusxml2cpp/CMakeLists.txt +++ b/src/tools/qdbusxml2cpp/CMakeLists.txt @@ -1,9 +1,29 @@ +# Generated from qdbusxml2cpp.pro. + +##################################################################### +## qdbusxml2cpp Tool: +##################################################################### + add_qt_tool(qdbusxml2cpp - SOURCES qdbusxml2cpp.cpp + SOURCES + qdbusxml2cpp.cpp DEFINES QT_NO_CAST_FROM_ASCII QT_NO_FOREACH LIBRARIES Qt::CorePrivate Qt::DBusPrivate + # COMPILE_OPTIONS # special case + # "$$QT_HOST_CFLAGS_DBUS" + # QMAKE_TARGET_DESCRIPTION = "Qt D-Bus XML to C++ Compiler" + # _LOADED = "qt_tool" + # _OPTION = "host_build" ) + +## Scopes: +##################################################################### + +# special case: +# extend_target(qdbusxml2cpp CONDITION NOT force_bootstrap [...]) +#extend_target(qdbusxml2cpp CONDITION NOT QT_FEATURE_commandlineparser AND NOT force_bootstrap [...]) +# extend_target(qdbusxml2cpp CONDITION force_bootstrap [...]) diff --git a/src/tools/qlalr/CMakeLists.txt b/src/tools/qlalr/CMakeLists.txt index b63607e937e..83d067751f7 100644 --- a/src/tools/qlalr/CMakeLists.txt +++ b/src/tools/qlalr/CMakeLists.txt @@ -1,3 +1,9 @@ +# Generated from qlalr.pro. + +##################################################################### +## qlalr Tool: +##################################################################### + add_qt_tool(qlalr SOURCES compress.cpp compress.h @@ -10,4 +16,8 @@ add_qt_tool(qlalr recognizer.cpp recognizer.h DEFINES QT_NO_FOREACH + # OTHER_FILES = "lalr.g" + # QMAKE_TARGET_DESCRIPTION = "Qt Look Ahead LR Parser Generator" + # _LOADED = "qt_tool" + # _OPTION = "host_build" ) diff --git a/src/tools/qvkgen/CMakeLists.txt b/src/tools/qvkgen/CMakeLists.txt index 2e9ab3458bf..ea9dbeeed74 100644 --- a/src/tools/qvkgen/CMakeLists.txt +++ b/src/tools/qvkgen/CMakeLists.txt @@ -1,5 +1,13 @@ +# Generated from qvkgen.pro. + ##################################################################### ## qvkgen Tool: ##################################################################### -add_qt_tool(qvkgen SOURCES qvkgen.cpp) +add_qt_tool(qvkgen + SOURCES + qvkgen.cpp + # QMAKE_TARGET_DESCRIPTION = "Qt Vulkan Header Generator" + # _LOADED = "qt_tool" + # _OPTION = "host_build" +) From f3e3832c4dfcdc9148b414c4063668a9306e77ba Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 14:34:41 +0100 Subject: [PATCH 0275/1322] CMake: Re-generate CMakeLists.txt file for concurrent and sql Change-Id: I3b61e35a65d369f0fff7c61c0b3af6f6e2974e1f Reviewed-by: Albert Astals Cid --- src/concurrent/CMakeLists.txt | 23 +++++++++++++++++++++-- src/sql/CMakeLists.txt | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index d760844a8c1..e0e069d322f 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -1,3 +1,9 @@ +# Generated from concurrent.pro. + +##################################################################### +## Concurrent Module: +##################################################################### + add_qt_module(Concurrent SOURCES qtconcurrent_global.h @@ -18,8 +24,21 @@ add_qt_module(Concurrent DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH - LIBRARIES Qt::CorePrivate - PUBLIC_LIBRARIES Qt::Core + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES # special case + Qt::Core + # CONFIG = "exceptions" + # PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" + # _LOADED = "qt_module" +) + +## Scopes: +##################################################################### + +extend_target(Concurrent CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x66000000" ) add_qt_docs(./doc/qtconcurrent.qdocconf) diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index ac4dd8f023b..8581f80d01a 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -24,6 +24,20 @@ add_qt_module(Sql QT_NO_FOREACH LIBRARIES Qt::CorePrivate + PUBLIC_LIBRARIES # special case + Qt::Core + # MODULE_PLUGIN_TYPES = "sqldrivers" + # PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" + # SQL_P = "sql" + # _LOADED = "qt_module" +) + +## Scopes: +##################################################################### + +extend_target(Sql CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x62000000" ) extend_target(Sql CONDITION QT_FEATURE_sqlmodel From e1de70933e3af47f5600ebe5a7b3930e26690c8a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 4 Mar 2019 13:05:54 +0100 Subject: [PATCH 0276/1322] CMake: Handle gc-sections linker flags Add a function to set gc-sections flags on the linker. Change-Id: I9ac02364836d2aa8de239adb8d3a5d29659a4007 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 4fc60400f56..1cb8426b302 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -191,15 +191,6 @@ macro(qt_parse_all_arguments result type flags options multiopts) endmacro() -function(qt_internal_add_link_flags target to_add) - get_target_property(flags "${target}" LINK_FLAGS) - if ("${flags}" STREQUAL "flags-NOTFOUND") - set(flags "") - endif() - string(APPEND flags " ${to_add}") - set_target_properties("${target}" PROPERTIES LINK_FLAGS "${flags}") -endfunction() - function(qt_internal_add_link_flags_no_undefined target) if (GCC OR CLANG) if(APPLE) @@ -209,7 +200,26 @@ function(qt_internal_add_link_flags_no_undefined target) else() message(FATAL_ERROR "Platform linker doesn't support erroring upon encountering undefined symbols. Target:\"${target}\".") endif() - qt_internal_add_link_flags("${target}" "${no_undefined_flag}") + target_link_options("${target}" PRIVATE "${no_undefined_flag}") + endif() +endfunction() + +function(qt_internal_add_link_flags_gc_sections target visibility) + set(possible_visibilities PRIVATE INTERFACE PUBLIC) + list(FIND possible_visibilities "${visibility}" known_visibility) + if (known_visibility EQUAL "-1") + message(FATAL_ERROR "Visibitily setting must be one of PRIVATE, INTERFACE or PUBLIC.") + endif() + + if (GCC OR CLANG) + if(APPLE) + set(gc_sections_flag "-Wl,-dead_strip") + elseif(LINUX OR BSD OR SOLARIS OR WIN32) + set(gc_sections_flag "-Wl,--gc-sections") + else() + message(FATAL_ERROR "Platform linker doesn't support gc sections. Target:\"${target}\".") + endif() + target_link_options("${target}" ${visibility} "${gc_sections_flag}") endif() endfunction() @@ -256,7 +266,7 @@ function(qt_internal_add_linker_version_script target) WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Generating version linker script" ) - qt_internal_add_link_flags("${target}" "-Wl,--version-script,${outfile}") + target_link_options("${target}" PRIVATE "-Wl,--version-script,${outfile}") endif() endif() endfunction() From 32d4f139c85a91687cb641941994787d7f9bf1cf Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 13:42:13 +0100 Subject: [PATCH 0277/1322] CMake: Re-generate bootstrap-related CMakeLists.txt files Change-Id: Ia4be80729807c6aaac5b22a0dab81a841d57bdcd Reviewed-by: Alexandru Croitor --- src/tools/bootstrap/CMakeLists.txt | 302 ++++++++++++----------- src/tools/moc/CMakeLists.txt | 38 ++- src/tools/qfloat16-tables/CMakeLists.txt | 16 +- src/tools/rcc/CMakeLists.txt | 23 +- src/tools/tracegen/CMakeLists.txt | 24 +- 5 files changed, 246 insertions(+), 157 deletions(-) diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt index d5d8bcd8936..4bbbe08ea51 100644 --- a/src/tools/bootstrap/CMakeLists.txt +++ b/src/tools/bootstrap/CMakeLists.txt @@ -1,152 +1,174 @@ +# Generated from bootstrap.pro. -if(WIN32) - set(os_sources +##################################################################### +## Bootstrap Module: +##################################################################### + +# special case: +add_library(Bootstrap STATIC) +extend_target(Bootstrap + SOURCES + ../../corelib/codecs/qlatincodec.cpp + ../../corelib/codecs/qtextcodec.cpp + ../../corelib/codecs/qutfcodec.cpp + ../../corelib/global/qendian.cpp + ../../corelib/global/qglobal.cpp + ../../corelib/global/qlogging.cpp + ../../corelib/global/qmalloc.cpp + ../../corelib/global/qnumeric.cpp + ../../corelib/global/qoperatingsystemversion.cpp + ../../corelib/global/qrandom.cpp + ../../corelib/io/qabstractfileengine.cpp + ../../corelib/io/qbuffer.cpp + ../../corelib/io/qdebug.cpp + ../../corelib/io/qdir.cpp + ../../corelib/io/qdiriterator.cpp + ../../corelib/io/qfile.cpp + ../../corelib/io/qfiledevice.cpp + ../../corelib/io/qfileinfo.cpp + ../../corelib/io/qfilesystemengine.cpp + ../../corelib/io/qfilesystementry.cpp + ../../corelib/io/qfsfileengine.cpp + ../../corelib/io/qfsfileengine_iterator.cpp + ../../corelib/io/qiodevice.cpp + ../../corelib/io/qloggingcategory.cpp + ../../corelib/io/qloggingregistry.cpp + ../../corelib/io/qresource.cpp + ../../corelib/io/qsavefile.cpp + ../../corelib/io/qstandardpaths.cpp + ../../corelib/io/qtemporarydir.cpp + ../../corelib/io/qtemporaryfile.cpp + ../../corelib/kernel/qcoreapplication.cpp + ../../corelib/kernel/qcoreglobaldata.cpp + ../../corelib/kernel/qmetatype.cpp + ../../corelib/kernel/qsystemerror.cpp + ../../corelib/kernel/qvariant.cpp + ../../corelib/plugin/quuid.cpp + ../../corelib/serialization/qdatastream.cpp + ../../corelib/serialization/qjson.cpp + ../../corelib/serialization/qjsonarray.cpp + ../../corelib/serialization/qjsondocument.cpp + ../../corelib/serialization/qjsonobject.cpp + ../../corelib/serialization/qjsonparser.cpp + ../../corelib/serialization/qjsonvalue.cpp + ../../corelib/serialization/qjsonwriter.cpp + ../../corelib/serialization/qtextstream.cpp + ../../corelib/serialization/qxmlstream.cpp + ../../corelib/serialization/qxmlutils.cpp + ../../corelib/tools/qarraydata.cpp + ../../corelib/tools/qbitarray.cpp + ../../corelib/tools/qbytearray.cpp + ../../corelib/tools/qbytearraymatcher.cpp + ../../corelib/tools/qcommandlineoption.cpp + ../../corelib/tools/qcommandlineparser.cpp + ../../corelib/tools/qcryptographichash.cpp + ../../corelib/tools/qdatetime.cpp + ../../corelib/tools/qhash.cpp + ../../corelib/tools/qline.cpp + ../../corelib/tools/qlinkedlist.cpp + ../../corelib/tools/qlist.cpp + ../../corelib/tools/qlocale.cpp + ../../corelib/tools/qlocale_tools.cpp + ../../corelib/tools/qmap.cpp + ../../corelib/tools/qpoint.cpp + ../../corelib/tools/qrect.cpp + ../../corelib/tools/qregexp.cpp + ../../corelib/tools/qringbuffer.cpp + ../../corelib/tools/qsize.cpp + ../../corelib/tools/qstring.cpp + ../../corelib/tools/qstring_compat.cpp + ../../corelib/tools/qstringbuilder.cpp + ../../corelib/tools/qstringlist.cpp + ../../corelib/tools/qversionnumber.cpp + ../../corelib/tools/qvsnprintf.cpp + ../../xml/dom/qdom.cpp + ../../xml/sax/qxml.cpp + PUBLIC_DEFINES # special case: + QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} + QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} + QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} + QT_VERSION_STR="${PROJECT_VERSION}" + QT_BOOTSTRAPPED + QT_NO_CAST_ASCII + QT_NO_FOREACH + QT_NO_CAST_FROM_ASCII + PUBLIC_INCLUDE_DIRECTORIES # special case + $ + $ + PUBLIC_LIBRARIES # special case + ZLIB::ZLIB + # CONFIG = "minimal_syncqt" "internal_module" "force_bootstrap" "gc_binaries" + # INSTALLS = "lib" + # MODULE_CONFIG = "gc_binaries" + # MODULE_DEFINES = "QT_VERSION_STR=$$shell_quote\"$$QT_VERSION\"" "QT_VERSION_MAJOR=$$QT_MAJOR_VERSION" "QT_VERSION_MINOR=$$QT_MINOR_VERSION" "QT_VERSION_PATCH=$$QT_PATCH_VERSION" "QT_BOOTSTRAPPED" "QT_NO_CAST_TO_ASCII" + # MODULE_INCNAME = "QtCore" "QtXml" + # _LOADED = "qt_module" + # _OPTION = "host_build" + # lib.CONFIG = "dummy_install" +) + +qt_internal_add_target_aliases(Bootstrap) # special case + +## Scopes: +##################################################################### + +extend_target(Bootstrap CONDITION UNIX + SOURCES + ../../corelib/io/qfilesystemengine_unix.cpp + ../../corelib/io/qfilesystemiterator_unix.cpp + ../../corelib/io/qfsfileengine_unix.cpp + ../../corelib/kernel/qcore_unix.cpp +) + +extend_target(Bootstrap CONDITION WIN32 + SOURCES ../../corelib/global/qoperatingsystemversion_win.cpp ../../corelib/io/qfilesystemengine_win.cpp ../../corelib/io/qfilesystemiterator_win.cpp ../../corelib/io/qfsfileengine_win.cpp + ../../corelib/io/qstandardpaths_win.cpp ../../corelib/kernel/qcoreapplication_win.cpp ../../corelib/plugin/qsystemlibrary.cpp - ../../corelib/io/qstandardpaths_win.cpp - ) - set(os_libs user32 ole32 advapi32 shell32 netapi32) -else() - set(os_sources - ../../corelib/kernel/qcore_unix.cpp - ../../corelib/io/qfilesystemengine_unix.cpp - ../../corelib/io/qfilesystemiterator_unix.cpp - ../../corelib/io/qfsfileengine_unix.cpp - ) - - if(APPLE) - list(APPEND os_sources - ../../corelib/global/qoperatingsystemversion_darwin.mm - ../../corelib/io/qstandardpaths_mac.mm - ../../corelib/kernel/qcoreapplication_mac.cpp - ../../corelib/kernel/qcore_mac.cpp - ../../corelib/kernel/qcore_mac_objc.mm - ../../corelib/kernel/qcore_foundation.mm - ../../corelib/io/qurl.cpp - ) - else() - list(APPEND os_sources ../../corelib/io/qstandardpaths_unix.cpp) - endif() - set(os_libs "") -endif() - -add_library(Bootstrap STATIC - ../../corelib/codecs/qlatincodec.cpp - ../../corelib/codecs/qtextcodec.cpp - ../../corelib/codecs/qutfcodec.cpp - ../../corelib/global/qendian.cpp - ../../corelib/global/qglobal.cpp - ../../corelib/global/qlogging.cpp - ../../corelib/global/qmalloc.cpp - ../../corelib/global/qnumeric.cpp - ../../corelib/global/qoperatingsystemversion.cpp - ../../corelib/global/qrandom.cpp - ../../corelib/io/qabstractfileengine.cpp - ../../corelib/io/qbuffer.cpp - ../../corelib/io/qdebug.cpp - ../../corelib/io/qdir.cpp - ../../corelib/io/qdiriterator.cpp - ../../corelib/io/qfile.cpp - ../../corelib/io/qfileinfo.cpp - ../../corelib/io/qfilesystementry.cpp - ../../corelib/io/qfilesystemengine.cpp - ../../corelib/io/qfsfileengine.cpp - ../../corelib/io/qfsfileengine_iterator.cpp - ../../corelib/io/qiodevice.cpp - ../../corelib/io/qfiledevice.cpp - ../../corelib/io/qresource.cpp - ../../corelib/io/qtemporarydir.cpp - ../../corelib/io/qtemporaryfile.cpp - ../../corelib/io/qsavefile.cpp - ../../corelib/io/qstandardpaths.cpp - ../../corelib/io/qloggingcategory.cpp - ../../corelib/io/qloggingregistry.cpp - ../../corelib/kernel/qcoreapplication.cpp - ../../corelib/kernel/qcoreglobaldata.cpp - ../../corelib/kernel/qmetatype.cpp - ../../corelib/kernel/qvariant.cpp - ../../corelib/kernel/qsystemerror.cpp - ../../corelib/plugin/quuid.cpp - ../../corelib/serialization/qdatastream.cpp - ../../corelib/serialization/qjson.cpp - ../../corelib/serialization/qjsondocument.cpp - ../../corelib/serialization/qjsonobject.cpp - ../../corelib/serialization/qjsonarray.cpp - ../../corelib/serialization/qjsonvalue.cpp - ../../corelib/serialization/qjsonparser.cpp - ../../corelib/serialization/qjsonwriter.cpp - ../../corelib/serialization/qtextstream.cpp - ../../corelib/serialization/qxmlutils.cpp - ../../corelib/serialization/qxmlstream.cpp - ../../corelib/tools/qbitarray.cpp - ../../corelib/tools/qbytearray.cpp - ../../corelib/tools/qarraydata.cpp - ../../corelib/tools/qbytearraymatcher.cpp - ../../corelib/tools/qcommandlineparser.cpp - ../../corelib/tools/qcommandlineoption.cpp - ../../corelib/tools/qcryptographichash.cpp - ../../corelib/tools/qdatetime.cpp - ../../corelib/tools/qhash.cpp - ../../corelib/tools/qlist.cpp - ../../corelib/tools/qlinkedlist.cpp - ../../corelib/tools/qlocale.cpp - ../../corelib/tools/qlocale_tools.cpp - ../../corelib/tools/qmap.cpp - ../../corelib/tools/qregexp.cpp - ../../corelib/tools/qringbuffer.cpp - ../../corelib/tools/qpoint.cpp - ../../corelib/tools/qrect.cpp - ../../corelib/tools/qsize.cpp - ../../corelib/tools/qline.cpp - ../../corelib/tools/qstring.cpp - ../../corelib/tools/qstringbuilder.cpp - ../../corelib/tools/qstring_compat.cpp - ../../corelib/tools/qstringlist.cpp - ../../corelib/tools/qversionnumber.cpp - ../../corelib/tools/qvsnprintf.cpp - ../../xml/dom/qdom.cpp - ../../xml/sax/qxml.cpp - ${os_sources} + LIBRARIES + user32 + ole32 + advapi32 + shell32 + netapi32 ) -add_library(Qt::Bootstrap ALIAS Bootstrap) -qt_internal_add_target_aliases(Bootstrap) - -qt_ensure_perl() -foreach(module QtCore QtXml) - execute_process(COMMAND "${HOST_PERL}" -w "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" -quiet -minimal -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") - target_include_directories(Bootstrap PUBLIC - "${PROJECT_BINARY_DIR}/include/${module}" - "${PROJECT_BINARY_DIR}/include/${module}/${PROJECT_VERSION}" - "${PROJECT_BINARY_DIR}/include/${module}/${PROJECT_VERSION}/${module}") -endforeach() - -target_compile_definitions(Bootstrap PUBLIC - QT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} - QT_VERSION_MINOR=${PROJECT_VERSION_MINOR} - QT_VERSION_PATCH=${PROJECT_VERSION_PATCH} - QT_VERSION_STR="${PROJECT_VERSION}" - QT_BOOTSTRAPPED - QT_NO_CAST_ASCII - QT_NO_FOREACH - QT_NO_CAST_FROM_ASCII +extend_target(Bootstrap CONDITION APPLE_OSX + SOURCES + ../../corelib/global/qoperatingsystemversion_darwin.mm + ../../corelib/io/qstandardpaths_mac.mm + ../../corelib/kernel/qcore_foundation.mm + ../../corelib/kernel/qcore_mac.cpp + ../../corelib/kernel/qcore_mac_objc.mm + ../../corelib/kernel/qcoreapplication_mac.cpp + LIBRARIES + ${FWCoreServices} + ${FWFoundation} ) -target_link_libraries(Bootstrap PUBLIC Qt::Platform ${os_libs}) -target_include_directories(Bootstrap PUBLIC "${PROJECT_BINARY_DIR}/include") -target_link_libraries(Bootstrap PRIVATE ZLIB::ZLIB) -### fixme: Expose as some cmake equivalent of a reusable qmake mkspecs/features/gc_binaries.prf. -if(APPLE) - target_link_libraries(Bootstrap INTERFACE "-Wl,-dead_strip") -endif() +extend_target(Bootstrap CONDITION APPLE_OSX AND APPLE_UIKIT + LIBRARIES + ${FWUIKit} +) -if (APPLE) - find_library(FWFoundation Foundation) - find_library(FWCoreServices CoreServices) - target_link_libraries(Bootstrap INTERFACE ${FWFoundation}) - target_link_libraries(Bootstrap PRIVATE ${FWCoreServices}) -endif() +extend_target(Bootstrap CONDITION UNIX AND NOT APPLE_OSX + SOURCES + ../../corelib/io/qstandardpaths_unix.cpp +) + +# special case: This will never get cross_compiled! +# extend_target(Bootstrap CONDITION cross_compile [...]) +# extend_target(Bootstrap CONDITION NOT cross_compile [...]) + +extend_target(Bootstrap CONDITION WIN32 AND mingw + LIBRARIES + uuid +) + +# special case: +qt_internal_add_link_flags_gc_sections(Bootstrap PUBLIC) +set_target_properties(Bootstrap PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF) diff --git a/src/tools/moc/CMakeLists.txt b/src/tools/moc/CMakeLists.txt index b16ed026a4c..470baa7127a 100644 --- a/src/tools/moc/CMakeLists.txt +++ b/src/tools/moc/CMakeLists.txt @@ -1,10 +1,32 @@ -add_qt_tool(moc BOOTSTRAP - LIBRARIES tinycbor +# Generated from moc.pro. + +##################################################################### +## moc Tool: +##################################################################### + +add_qt_tool(moc + BOOTSTRAP SOURCES - moc.cpp - preprocessor.cpp - generator.cpp - parser.cpp - token.cpp - main.cpp + cbordevice.h + generator.cpp generator.h + main.cpp # special case + moc.cpp moc.h + outputrevision.h + parser.cpp parser.h + preprocessor.cpp preprocessor.h + symbols.h + token.cpp token.h + utils.h + DEFINES + QT_MOC + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_FROM_BYTEARRAY + QT_NO_COMPRESS + QT_NO_FOREACH + LIBRARIES + tinycbor + # CONFIG = "force_bootstrap" + # QMAKE_TARGET_DESCRIPTION = "Qt Meta Object Compiler" + # _LOADED = "qt_tool" + # _OPTION = "host_build" ) diff --git a/src/tools/qfloat16-tables/CMakeLists.txt b/src/tools/qfloat16-tables/CMakeLists.txt index 60d62829760..f437ccc8db9 100644 --- a/src/tools/qfloat16-tables/CMakeLists.txt +++ b/src/tools/qfloat16-tables/CMakeLists.txt @@ -1,2 +1,16 @@ -add_qt_tool(qfloat16-tables BOOTSTRAP SOURCES gen_qfloat16_tables.cpp) +# Generated from qfloat16-tables.pro. +##################################################################### +## qfloat16-tables Tool: +##################################################################### + +add_qt_tool(qfloat16-tables + BOOTSTRAP + SOURCES + gen_qfloat16_tables.cpp + # CONFIG = "force_bootstrap" + # INSTALLS = "lib" + # _LOADED = "qt_tool" + # _OPTION = "host_build" + # lib.CONFIG = "dummy_install" +) diff --git a/src/tools/rcc/CMakeLists.txt b/src/tools/rcc/CMakeLists.txt index 4a882e78608..12fd0690a71 100644 --- a/src/tools/rcc/CMakeLists.txt +++ b/src/tools/rcc/CMakeLists.txt @@ -1 +1,22 @@ -add_qt_tool(rcc BOOTSTRAP SOURCES rcc.cpp main.cpp) +# Generated from rcc.pro. + +##################################################################### +## rcc Tool: +##################################################################### + +add_qt_tool(rcc + BOOTSTRAP + SOURCES + main.cpp + rcc.cpp rcc.h + DEFINES + QT_RCC + QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + # CONFIG = "force_bootstrap" + # QMAKE_TARGET_DESCRIPTION = "Qt Resource Compiler" + # _LOADED = "qt_tool" + # _OPTION = "host_build" +) diff --git a/src/tools/tracegen/CMakeLists.txt b/src/tools/tracegen/CMakeLists.txt index 85ae0ffef70..bfb33d77c51 100644 --- a/src/tools/tracegen/CMakeLists.txt +++ b/src/tools/tracegen/CMakeLists.txt @@ -1,10 +1,20 @@ -add_qt_tool(tracegen BOOTSTRAP +# Generated from tracegen.pro. + +##################################################################### +## tracegen Tool: +##################################################################### + +add_qt_tool(tracegen + BOOTSTRAP SOURCES - etw.cpp - helpers.cpp - lttng.cpp - panic.cpp - provider.cpp - qtheaders.cpp + etw.cpp etw.h + helpers.cpp helpers.h + lttng.cpp lttng.h + panic.cpp panic.h + provider.cpp provider.h + qtheaders.cpp qtheaders.h tracegen.cpp + # CONFIG = "force_bootstrap" + # _LOADED = "qt_tool" + # _OPTION = "host_build" ) From d72b717119de3d9bad859c1e059c35f34697a3ac Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 6 Mar 2019 10:38:22 +0100 Subject: [PATCH 0278/1322] Fix build There is no more internal function for adding general linker flags. Let's use the appropriate cmake function right away, regardless of the compiler choice. This is also how global.pri handled it. Change-Id: I20c9002a31aa4d7e64c1c59d8d67118774da337c Reviewed-by: Alexandru Croitor --- src/corelib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index edd2ae52ca2..4fe51d031c2 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -286,7 +286,7 @@ if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) endif() endif() if (ELF_INTERPRETER) - qt_internal_add_link_flags(Core "-Wl,-e,qt_core_boilerplate") + target_link_options(Core PRIVATE "-Wl,-e,qt_core_boilerplate") target_compile_definitions(Core PRIVATE ELF_INTERPRETER="${ELF_INTERPRETER}") endif() endif() From 25ee3d1c3b05a4e87201effa5b270078778e98ad Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Wed, 6 Mar 2019 13:51:38 +0100 Subject: [PATCH 0279/1322] cmake: Fix moc on macOS moc does not generate moc_defs.h and that's why moc does not understand that he runs on macOS. It happens because cmake can not find Qt version. Change-Id: I34c51ebb69dc1ff782a0f129e114cda819122805 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 58 +++++++++++++++++++++++++++++++------- src/corelib/CMakeLists.txt | 5 +++- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 1cb8426b302..09e9899bc53 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -292,12 +292,42 @@ function(qt_internal_module_info result target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS;DISABLE_AUTOGEN_TOOLS") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES;PUBLIC_COMPILE_OPTIONS;PUBLIC_LINK_OPTIONS") option(QT_CMAKE_DEBUG_EXTEND_TARGET "Debug extend_target calls in Qt's build system" OFF) +# This function checks which autotools should be used: AUTOMOC/UIC/RCC +function(qt_autogen_tools target) + qt_parse_all_arguments(arg "qt_autogen_tools" "" "" "${__default_private_args}" ${ARGN}) + + set_property(TARGET "${target}" PROPERTY INTERFACE_QT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) + set_property(TARGET "${target}" APPEND PROPERTY + COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION + ) + + list(APPEND autogen_tools "moc" "uic" "rcc") + if (arg_DISABLE_AUTOGEN_TOOLS) + foreach(disable_tool ${arg_DISABLE_AUTOGEN_TOOLS}) + list(REMOVE_ITEM autogen_tools "${disable_tool}") + endforeach() + endif() + + foreach(autogen_tool ${autogen_tools}) + string(TOUPPER "${autogen_tool}" captitalAutogenTool) + + set_target_properties("${target}" + PROPERTIES + AUTO${captitalAutogenTool} ON + AUTO${captitalAutogenTool}_EXECUTABLE "$") + endforeach() + + set_directory_properties(PROPERTIES + QT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} + QT_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +endfunction() + # This function can be used to add sources/libraries/etc. to the specified CMake target # if the provided CONDITION evaluates to true. function(extend_target target) @@ -326,15 +356,6 @@ function(extend_target target) list(APPEND dbus_sources "${sources}") endforeach() - set_target_properties("${target}" PROPERTIES - AUTOMOC ON - AUTOMOC_EXECUTABLE "$" - AUTORCC ON - AUTORCC_EXECUTABLE "$" - AUTOUIC ON - AUTOUIC_EXECUTABLE "$" - ) - target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) if (arg_COMPILE_FLAGS) set_source_files_properties(${arg_SOURCES} PROPERTIES COMPILE_FLAGS "${arg_COMPILE_FLAGS}") @@ -498,6 +519,10 @@ function(add_qt_module target) qt_internal_library_deprecation_level(deprecation_define) + qt_autogen_tools("${target}" + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} + ) + extend_target("${target}" SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES @@ -660,6 +685,10 @@ function(add_qt_plugin target) qt_internal_library_deprecation_level(deprecation_define) + qt_autogen_tools("${target}" + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} + ) + extend_target("${target}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES @@ -718,6 +747,11 @@ function(add_qt_executable name) endif() add_executable("${name}" ${arg_EXE_FLAGS}) + + qt_autogen_tools("${name}" + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} + ) + extend_target("${name}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES @@ -759,6 +793,7 @@ function(add_qt_test name) COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") @@ -798,8 +833,10 @@ function(add_qt_tool name) qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) + set(disable_autogen_tools "${arg_DISABLE_AUTOGEN_TOOLS}") if (arg_BOOTSTRAP) set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Bootstrap) + list(APPEND disable_autogen_tools "uic" "moc" "rcc") else() set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Core) endif() @@ -813,6 +850,7 @@ function(add_qt_tool name) COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} + DISABLE_AUTOGEN_TOOLS ${disable_autogen_tools} ) qt_internal_add_target_aliases("${name}") diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 4fe51d031c2..ed0ec76961d 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -238,10 +238,13 @@ add_qt_module(Core tinycbor Threads::Threads ZLIB::ZLIB QtHarfBuzz Qt::GlobalConfigPrivate - PUBLIC_LIBRARIES Qt::Platform + PUBLIC_LIBRARIES + Qt::Platform DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH + DISABLE_AUTOGEN_TOOLS + uic ) add_dependencies(Core Qt::moc) From 32c59d6856285ad25f1dc52cc5428105b674945c Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 13 Feb 2019 13:12:14 +0100 Subject: [PATCH 0280/1322] cmake: fix cocoa and graphics on macOS Change-Id: Ia956c74a54874f91cc0ea8e5105164de88890ff2 Reviewed-by: Mikhail Svetkin Reviewed-by: Alexandru Croitor --- src/CMakeLists.txt | 2 +- src/platformsupport/graphics/CMakeLists.txt | 1 + src/plugins/platforms/cocoa/CMakeLists.txt | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0a69798685d..a5dfa6a5418 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,7 +65,7 @@ endif() if (QT_FEATURE_testlib) add_subdirectory(testlib) endif() -if(QT_FEATURE_core AND QT_FEATURE_gui AND QT_FEATURE_widgets) +if(QT_FEATURE_gui AND QT_FEATURE_widgets) add_subdirectory(printsupport) endif() add_subdirectory(plugins) diff --git a/src/platformsupport/graphics/CMakeLists.txt b/src/platformsupport/graphics/CMakeLists.txt index 2846fc024bb..c3b8e8e64d3 100644 --- a/src/platformsupport/graphics/CMakeLists.txt +++ b/src/platformsupport/graphics/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(GraphicsSupport + STATIC SOURCES qrasterbackingstore.cpp qrasterbackingstore_p.h DEFINES diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index a757c402934..66cc2bcd892 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -87,13 +87,13 @@ extend_target(qcocoa CONDITION QT_FEATURE_vulkan extend_target(qcocoa CONDITION QT_FEATURE_widgets SOURCES - # qcocoaprintdevice.h qcocoaprintdevice.mm - # qcocoaprintersupport.h qcocoaprintersupport.mm - # qpaintengine_mac.mm qpaintengine_mac_p.h - # qprintengine_mac.mm qprintengine_mac_p.h + qcocoaprintdevice.h qcocoaprintdevice.mm + qcocoaprintersupport.h qcocoaprintersupport.mm + qpaintengine_mac.mm qpaintengine_mac_p.h + qprintengine_mac.mm qprintengine_mac_p.h LIBRARIES Qt::WidgetsPrivate - # Qt::PrintSupportPrivate + Qt::PrintSupportPrivate ) extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_colordialog) From b51fbd72b950c335070c30b47b156f3f0dda9692 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 13 Feb 2019 14:47:29 +0100 Subject: [PATCH 0281/1322] cmake: build qmacstyle Change-Id: I1fa0196036ffd31b5961bb5b73ff21123a818af8 Reviewed-by: Albert Astals Cid Reviewed-by: Mikhail Svetkin --- src/plugins/CMakeLists.txt | 2 +- src/plugins/styles/CMakeLists.txt | 11 +++++++++++ src/plugins/styles/mac/CMakeLists.txt | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/plugins/styles/CMakeLists.txt create mode 100644 src/plugins/styles/mac/CMakeLists.txt diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index a5e23513e32..9c4eee2db46 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -20,7 +20,7 @@ if(QT_FEATURE_gui) endif() if (QT_FEATURE_widgets) -# TODO add_subdirectory(styles) + add_subdirectory(styles) endif() if (NOT WINRT AND TARGET PrintSupport) diff --git a/src/plugins/styles/CMakeLists.txt b/src/plugins/styles/CMakeLists.txt new file mode 100644 index 00000000000..34248d0a592 --- /dev/null +++ b/src/plugins/styles/CMakeLists.txt @@ -0,0 +1,11 @@ +if(QT_FEATURE_style_android) +# TODO add_subdirectory(android) +endif() + +if(QT_FEATURE_style_mac) + add_subdirectory(mac) +endif() + +if(QT_FEATURE_style_windowsvista) +# TODO add_subdirectory(windowsvista) +endif() diff --git a/src/plugins/styles/mac/CMakeLists.txt b/src/plugins/styles/mac/CMakeLists.txt new file mode 100644 index 00000000000..1daee300606 --- /dev/null +++ b/src/plugins/styles/mac/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from mac.pro. + +##################################################################### +## qmacstyle Plugin: +##################################################################### + +add_qt_plugin(qmacstyle + TYPE styles + SOURCES + main.mm + qmacstyle_mac.mm qmacstyle_mac_p.h + qmacstyle_mac_p_p.h + LIBRARIES + Qt::WidgetsPrivate + ${FWAppKit} + # DISTFILES = "macstyle.json" + # PLUGIN_CLASS_NAME = "QMacStylePlugin" + # _LOADED = "qt_plugin" +) From e3c2d74506db74c07e25b71c8cf7fc770b134166 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 6 Mar 2019 17:06:43 +0100 Subject: [PATCH 0282/1322] Update README to specify the minimum version of CMake needed Change-Id: I10e594859129bddfa56f078389b2272a0072fda0 Reviewed-by: Simon Hausmann --- cmake/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 7d3d71f7654..8f0b498c14a 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -4,9 +4,12 @@ Initial port is on-going. Some modules of QtBase are ported, incl. some of the p Basic functionality is there (moc, uic, etc.), but documentation, translations, qdbusxml2cpp, etc. are missing. -NOTE: YOU WILL NEED CMAKE 3.14 or later (for example, master branch, -after a1b3d79f728f2c626d3aac2e68dbab524baa4634, for more details see -https://gitlab.kitware.com/cmake/cmake/merge_requests/2679 ). +NOTE: YOU WILL NEED CMAKE 3.15 or later (for example, master branch, +after 168c11f70e52f9b4f00ef289a95023be3f273d2d, for more details see +https://gitlab.kitware.com/cmake/cmake/merge_requests/2679 +and +https://gitlab.kitware.com/cmake/cmake/merge_requests/3049 +). # Intro From 997c869280b8dfd03f15cfb9243daa17f4a3e576 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 7 Mar 2019 08:45:24 +0100 Subject: [PATCH 0283/1322] cmake: fix the order of parameters for homebrew Change-Id: I7b597a8d6bc81eafb21e5368a29700638c351bdf Reviewed-by: Alexandru Croitor --- cmake/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/README.md b/cmake/README.md index 8f0b498c14a..49fbda5df37 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -44,7 +44,7 @@ vcpkg doesn't support clang on macOS, see https://github.com/Microsoft/vcpkg/iss * Install homebrew: ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` * Build Qt dependencies: ``brew install pcre2 harfbuzz`` - * Build cmake from HEAD (or you can build your own): ``brew --HEAD install cmake`` + * Build cmake from HEAD (or you can build your own): ``brew install --HEAD cmake`` * When running cmake in qtbase, pass ``-DCMAKE_PREFIX_PATH=/usr/local`` From 138c0d04373b48164a31a031885381874a1f82c0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 14:32:58 +0100 Subject: [PATCH 0284/1322] CMake: Re-generate CMakeLists.txt file for corelib Change-Id: I96fb3e388a39481c513f1c6a23327e41a785e4af Reviewed-by: Alexandru Croitor --- src/corelib/CMakeLists.txt | 925 ++++++++++++++++++++++--------------- 1 file changed, 557 insertions(+), 368 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ed0ec76961d..b12e5674732 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1,29 +1,15 @@ +# Generated from corelib.pro. + +# special case: find_package(Threads) find_package(WrapDoubleConversion REQUIRED) if (NOT WrapDoubleConversion_FOUND) - message(FATAL_ERROR "Your C library does not provide sscanf_l/snprintf_l _snprintf_l/_sscanf_l. \ - You need to use libdouble-conversion for double/string conversion.") + message(FATAL_ERROR "Your C library does not provide \ + sscanf_l/snprintf_l _snprintf_l/_sscanf_l. \ + You need to use libdouble-conversion for double/string conversion.") endif() -find_library(FWAppKit AppKit) -find_library(FWApplicationServices ApplicationServices) -find_library(FWCoreFoundation CoreFoundation) -find_library(FWCoreServices CoreServices) -find_library(FWDiskArbitration DiskArbitration) -find_library(FWFoundation Foundation) -find_library(FWIOKit IOKit) -find_library(FWMobileCoreServices MobileCoreServices) -find_library(FWSecurity Security) -find_library(FWUIKit UIKit) -find_library(FWWatchKit WatchKit) - -## Evaluation helper target: -# FIXME: How does this work? -add_library(Qt_Evaluation INTERFACE) -target_sources(Qt_Evaluation INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/kernel/qtcore_eval.cpp") -target_include_directories(Qt_Evaluation INTERFACE global) - ##################################################################### ## Core Module: ##################################################################### @@ -55,6 +41,7 @@ add_qt_module(Core global/qlibraryinfo.cpp global/qlibraryinfo.h global/qlogging.cpp global/qlogging.h global/qmalloc.cpp + # global/qnamespace.h # special case global/qnumeric.cpp global/qnumeric.h global/qnumeric_p.h global/qoperatingsystemversion.cpp global/qoperatingsystemversion.h global/qoperatingsystemversion_p.h global/qprocessordetection.h @@ -63,7 +50,7 @@ add_qt_module(Core global/qsystemdetection.h global/qtypeinfo.h global/qtypetraits.h - global/qversiontagging.cpp global/qversiontagging.h + global/qversiontagging.cpp global/qversiontagging.h # special case io/qabstractfileengine.cpp io/qabstractfileengine_p.h io/qbuffer.cpp io/qbuffer.h io/qdataurl.cpp io/qdataurl_p.h @@ -78,8 +65,6 @@ add_qt_module(Core io/qfilesystementry.cpp io/qfilesystementry_p.h io/qfilesystemiterator_p.h io/qfilesystemmetadata_p.h - io/qfilesystemwatcher.cpp io/qfilesystemwatcher.h io/qfilesystemwatcher_p.h - io/qfilesystemwatcher_polling.cpp io/qfilesystemwatcher_polling_p.h io/qfsfileengine.cpp io/qfsfileengine_p.h io/qfsfileengine_iterator.cpp io/qfsfileengine_iterator_p.h io/qiodevice.cpp io/qiodevice.h io/qiodevice_p.h @@ -102,6 +87,8 @@ add_qt_module(Core io/qurlquery.cpp io/qurlquery.h io/qurlrecode.cpp io/qurltlds_p.h + itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h + itemmodels/qitemselectionmodel.cpp itemmodels/qitemselectionmodel.h itemmodels/qitemselectionmodel_p.h kernel/qabstracteventdispatcher.cpp kernel/qabstracteventdispatcher.h kernel/qabstracteventdispatcher_p.h kernel/qabstractnativeeventfilter.cpp kernel/qabstractnativeeventfilter.h kernel/qbasictimer.cpp kernel/qbasictimer.h @@ -120,6 +107,7 @@ add_qt_module(Core kernel/qmetatype.cpp kernel/qmetatype.h kernel/qmetatype_p.h kernel/qmetatypeswitcher_p.h kernel/qmimedata.cpp kernel/qmimedata.h + # kernel/qobject.cpp kernel/qobject.h kernel/qobject_p.h # special case kernel/qobject_impl.h kernel/qobjectcleanuphandler.cpp kernel/qobjectcleanuphandler.h kernel/qobjectdefs.h @@ -157,6 +145,14 @@ add_qt_module(Core serialization/qtextstream.cpp serialization/qtextstream.h serialization/qtextstream_p.h serialization/qxmlstream.cpp serialization/qxmlstream.h serialization/qxmlstream_p.h serialization/qxmlutils.cpp serialization/qxmlutils_p.h + statemachine/qabstractstate.cpp statemachine/qabstractstate.h statemachine/qabstractstate_p.h + statemachine/qabstracttransition.cpp statemachine/qabstracttransition.h statemachine/qabstracttransition_p.h + statemachine/qfinalstate.cpp statemachine/qfinalstate.h statemachine/qfinalstate_p.h + statemachine/qhistorystate.cpp statemachine/qhistorystate.h statemachine/qhistorystate_p.h + statemachine/qsignaleventgenerator_p.h + statemachine/qsignaltransition.cpp statemachine/qsignaltransition.h statemachine/qsignaltransition_p.h + statemachine/qstate.cpp statemachine/qstate.h statemachine/qstate_p.h + statemachine/qstatemachine.cpp statemachine/qstatemachine.h statemachine/qstatemachine_p.h thread/qmutex.h thread/qreadwritelock.h thread/qrunnable.cpp thread/qrunnable.h @@ -182,7 +178,7 @@ add_qt_module(Core tools/qdoublescanprint_p.h tools/qeasingcurve.cpp tools/qeasingcurve.h tools/qfreelist.cpp tools/qfreelist_p.h - tools/qharfbuzz.cpp + tools/qharfbuzz.cpp tools/qharfbuzz_p.h tools/qhash.cpp tools/qhash.h tools/qhashfunctions.h tools/qiterator.h @@ -215,6 +211,7 @@ add_qt_module(Core tools/qsize.cpp tools/qsize.h tools/qstack.h tools/qstring.cpp tools/qstring.h + tools/qstring_compat.cpp tools/qstringalgorithms.h tools/qstringalgorithms_p.h tools/qstringbuilder.cpp tools/qstringbuilder.h tools/qstringiterator_p.h @@ -231,27 +228,86 @@ add_qt_module(Core tools/qvector.h tools/qversionnumber.cpp tools/qversionnumber.h tools/qvsnprintf.cpp - INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_BINARY_DIR}/global # For qconfig.cpp - LIBRARIES - WrapDoubleConversion - tinycbor Threads::Threads ZLIB::ZLIB - QtHarfBuzz - Qt::GlobalConfigPrivate - PUBLIC_LIBRARIES - Qt::Platform DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH - DISABLE_AUTOGEN_TOOLS - uic + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_BINARY_DIR}/global # special case for qconfig.cpp + LIBRARIES # special case: + Qt::GlobalConfigPrivate + QtHarfBuzz + Threads::Threads + tinycbor + WrapDoubleConversion + ZLIB::ZLIB + PUBLIC_LIBRARIES # special case: + Qt::Platform + # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" + # ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" + # ANDROID_PERMISSIONS = "android.permission.INTERNET" "android.permission.WRITE_EXTERNAL_STORAGE" + # CMAKE_DISABLED_FEATURES = "$$joinQT_DISABLED_FEATURES,"$$escape_expand(\\n) "" + # CMAKE_HOST_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA/src],$$[QT_INSTALL_PREFIX]" + # CMAKE_INSTALL_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA],$$[QT_INSTALL_PREFIX]" + # CONFIG = "exceptions" "qt_tracepoints" "$$MODULE_CONFIG" "simd" "optimize_full" + # HOST_BINS = "$$[QT_HOST_BINS]" + # INSTALLS = "ctest_qt5_module_files" "cmake_qt5_umbrella_module_files" + # MIPS_DSP_ASM = "tools/qstring_mips_dsp_asm.S" + # MIPS_DSP_HEADERS = "../gui/painting/qt_mips_asm_dsp_p.h" + # MODULE = "core" + # MODULE_CONFIG = "moc" "resources" + # PRECOMPILED_HEADER = "global/qt_pch.h" + # QMAKE_DSYM_DEBUG_SCRIPT = "$$PWD/debug_script.py" + # QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtCore.dynlist" + # QMAKE_EXTRA_COMPILERS = "qfloat16_tables" + # QMAKE_PKGCONFIG_VARIABLES = "host_bins" "qt_conf" + # QMAKE_QFLOAT16_TABLES_GENERATE = "global/qfloat16.h" + # QMAKE_SUBSTITUTES = "ctest_macros_file" "cmake_umbrella_config_file" "cmake_umbrella_config_module_location" "cmake_umbrella_config_module_location_for_install" "cmake_umbrella_config_version_file" "cmake_extras_mkspec_dir" "cmake_extras_mkspec_dir_for_install" + # TRACEPOINT_PROVIDER = "$$PWD/qtcore.tracepoints" + # TR_EXCLUDE = "../3rdparty/*" + # VERSIONTAGGING_SOURCES = "global/qversiontagging.cpp" + # _LOADED = "qt_module" "cmake_functions" + # cmake_extras_mkspec_dir.input = "$$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in" + # cmake_extras_mkspec_dir.output = "$$DESTDIR/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" + # cmake_extras_mkspec_dir_for_install.input = "$$PWD/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in" + # cmake_extras_mkspec_dir_for_install.output = "$$DESTDIR/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" + # cmake_qt5_umbrella_module_files.files = "$$cmake_umbrella_config_file.output" "$$cmake_umbrella_config_version_file.output" "$$cmake_umbrella_config_module_location_for_install.output" + # cmake_qt5_umbrella_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5" + # cmake_umbrella_config_file.input = "$$PWD/Qt5Config.cmake.in" + # cmake_umbrella_config_file.output = "$$DESTDIR/cmake/Qt5/Qt5Config.cmake" + # cmake_umbrella_config_module_location.input = "$$PWD/Qt5ModuleLocation.cmake.in" + # cmake_umbrella_config_module_location.output = "$$DESTDIR/cmake/Qt5/Qt5ModuleLocation.cmake" + # cmake_umbrella_config_module_location_for_install.input = "$$PWD/Qt5ModuleLocationForInstall.cmake.in" + # cmake_umbrella_config_module_location_for_install.output = "$$DESTDIR/cmake/install/Qt5/Qt5ModuleLocation.cmake" + # cmake_umbrella_config_version_file.input = "$$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in" + # cmake_umbrella_config_version_file.output = "$$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake" + # ctest_macros_file.CONFIG = "verbatim" + # ctest_macros_file.input = "$$PWD/Qt5CTestMacros.cmake" + # ctest_macros_file.output = "$$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake" + # ctest_qt5_module_files.files = "$$ctest_macros_file.output" "$$cmake_extras_mkspec_dir_for_install.output" + # ctest_qt5_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5Core" + # host_bins.name = "host_bins" + # host_bins.variable = "HOST_BINS" + # qfloat16_tables.commands = "$$QMAKE_QFLOAT16_TABLES" "${QMAKE_FILE_OUT}" + # qfloat16_tables.depends = "$$QMAKE_QFLOAT16_TABLES" + # qfloat16_tables.input = "QMAKE_QFLOAT16_TABLES_GENERATE" + # qfloat16_tables.output = "global/qfloat16tables.cpp" + # qfloat16_tables.variable_out = "SOURCES" + # qt_conf.name = "qt_config" + # qt_conf.variable = "QT_CONFIG" ) + +# special case: add_dependencies(Core Qt::moc) add_dependencies(Core Qt::rcc) add_dependencies(CorePrivate Qt::moc) add_dependencies(CorePrivate Qt::rcc) +if (QT_NAMESPACE STREQUAL "") +else() + target_compile_definitions(Core PUBLIC "QT_NAMESPACE=${QT_NAMESPACE}") +endif() + configure_file(global/qconfig.cpp.in global/qconfig.cpp) # Handle QObject: Automoc does not work for this as it would @@ -271,18 +327,20 @@ target_include_directories(Core_qobject PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/ker target_link_libraries(Core_qobject PRIVATE Qt::Platform Qt::GlobalConfig) target_link_libraries(Core PRIVATE Core_qobject) -set_property(TARGET Core APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") -set_property(TARGET Core APPEND PROPERTY PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") - -# FIXME: tools still have a lot of special stuff that is not ported! +set_property(TARGET Core APPEND PROPERTY + PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") +set_property(TARGET Core APPEND PROPERTY + PRIVATE_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig_p.h") +# Find ELF interpreter and define a macro for that: if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) if (NOT DEFINED ELF_INTERPRETER) execute_process(COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C readelf -l /bin/ls RESULT_VARIABLE readelf_ok OUTPUT_VARIABLE readelf_output ) - if ("${readelf_ok}" STREQUAL "0" AND "${readelf_output}" MATCHES "program interpreter: (.*)]") + if ("${readelf_ok}" STREQUAL "0" + AND "${readelf_output}" MATCHES "program interpreter: (.*)]") set(ELF_INTERPRETER "${CMAKE_MATCH_1}" CACHE INTERNAL "ELF interpreter location") else() set(ELF_INTERPRETER "" CACHE INTERNAL "ELF interpreter location") @@ -295,273 +353,221 @@ if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) endif() -### Platform support: +## Scopes: ##################################################################### +# +#extend_target(Core CONDITION QT_FEATURE_gc_binaries +# # MODULE_CONFIG = "gc_binaries" +#) +# +#extend_target(Core CONDITION NOT QT_NAMESPACE_ISEMPTY +# # MODULE_DEFINES = "QT_NAMESPACE=$$QT_NAMESPACE" +#) -# Windows +extend_target(Core CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x67000000" +) +# +#extend_target(Core CONDITION FREEBSD OR OPENBSD +# # QMAKE_LFLAGS_NOUNDEF = +#) -### All Windows: extend_target(Core CONDITION WIN32 SOURCES + global/qoperatingsystemversion_win.cpp global/qoperatingsystemversion_win_p.h io/qfilesystemengine_win.cpp - io/qfilesystemwatcher_win.cpp io/qfilesystemwatcher_win_p.h io/qfsfileengine_win.cpp io/qlockfile_win.cpp kernel/qcoreapplication_win.cpp kernel/qelapsedtimer_win.cpp kernel/qsharedmemory_win.cpp kernel/qsystemsemaphore_win.cpp - kernel/qwineventnotifier.cpp - kernel/qwineventnotifier.h - kernel/qwineventnotifier_p.h - plugin/qsystemlibrary.cpp - plugin/qsystemlibrary_p.h + kernel/qwineventnotifier.cpp kernel/qwineventnotifier.h kernel/qwineventnotifier_p.h + plugin/qsystemlibrary.cpp plugin/qsystemlibrary_p.h thread/qatomic_msvc.h thread/qthread_win.cpp - tools/qlocale_win.cpp - global/qoperatingsystemversion_win.cpp - LIBRARIES kernel32 user32 shell32 uuid ole32 advapi32 winmm version ws2_32 + # special case: DEFINES + LIBRARIES + ws2_32 ) -### Classic windows: extend_target(Core CONDITION WIN32 AND NOT WINRT SOURCES io/qsettings_win.cpp io/qstandardpaths_win.cpp io/qstorageinfo_win.cpp - io/qwindowspipereader.cpp - io/qwindowspipereader_p.h - io/qwindowspipewriter.cpp - io/qwindowspipewriter_p.h + io/qwindowspipereader.cpp io/qwindowspipereader_p.h + io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h - LIBRARIES mpr netapi32 userenv + LIBRARIES + kernel32 + user32 + shell32 + uuid + ole32 + advapi32 + winmm + version + mpr + netapi32 + userenv ) -### WinRT -extend_target(Core CONDITION WIN32 AND WINRT - SOURCES - io/qsettings_winrt.cpp - io/qstandardpaths_winrt.cpp - io/qstorageinfo_stub.cpp - kernel/qeventdispatcher_winrt.cpp kernel/qeventdispatcher_winrt_p.h - kernel/qfunctions_fake_env_p.h - kernel/qfunctions_winrt.cpp kernel/qfunctions_winrt.h -) - -### All Apple: extend_target(Core CONDITION APPLE SOURCES - io/qsettings_mac.cpp + global/qoperatingsystemversion_darwin.mm + LIBRARIES + ${FWCoreFoundation} + ${FWFoundation} +) + +extend_target(Core CONDITION APPLE_OSX + SOURCES io/qstandardpaths_mac.mm io/qstorageinfo_mac.cpp kernel/qcfsocketnotifier.cpp kernel/qcfsocketnotifier_p.h - kernel/qcoreapplication_mac.cpp kernel/qcore_foundation.mm + kernel/qcore_mac.cpp kernel/qcore_mac_p.h kernel/qcore_mac_objc.mm - kernel/qcore_mac_objc.mm kernel/qcore_mac.cpp kernel/qcore_mac_p.h - kernel/qelapsedtimer_mac.cpp + kernel/qcoreapplication_mac.cpp kernel/qeventdispatcher_cf.mm kernel/qeventdispatcher_cf_p.h - global/qoperatingsystemversion_darwin.mm - LIBRARIES ${FWCoreFoundation} ${FWFoundation} -) - -### Apple desktop machines: -extend_target(Core CONDITION APPLE_OSX - SOURCES - io/qfilesystemwatcher_fsevents.mm io/qfilesystemwatcher_fsevents_p.h - tools/qlocale_mac.mm LIBRARIES - ${FWCoreServices} ${FWAppKit} ${FWSecurity} - ${FWApplicationServices} ${FWDiskArbitration} ${FWIOKit} + ${FWApplicationServices} + ${FWCoreServices} + ${FWFoundation} + ${FWCoreServices} + ${FWAppKit} + ${FWSecurity} + ${FWDiskArbitration} + ${FWIOKit} ) -### Apple mobile machines: -extend_target(Core CONDITION APPLE AND NOT APPLE_OSX - LIBRARIES ${FWMobileCoreServices} -) - -extend_target(Core CONDITION APPLE_WATCHOS LIBRARIES ${FWWatchKit}) -extend_target(Core CONDITION APPLE_TVOS LIBRARIES ${FWUIKit}) - extend_target(Core CONDITION INTEGRITY - SOURCES tools/qlocale_unix.cpp - LIBRARIES posix ivfs socket net shm_client + LIBRARIES + posix + ivfs + socket + net + shm_client + COMPILE_OPTIONS + "--pending_instantiations=128" ) +# +#extend_target(Core CONDITION pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR) +# # CMAKE_HOST_DATA_DIR = "$$[QT_HOST_DATA/src]/" +# # CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = "True" +#) +# +#extend_target(Core CONDITION pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR) +# # CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/" +# # CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True" +#) +# +#extend_target(Core CONDITION contains(QT_CPU_FEATURES__ss_QT_ARCH, f16c) +# # f16c_cxx = "true" +#) +# +#extend_target(Core CONDITION (NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (CLANG OR intel_icl OR ICC) +# # f16c_cxx = "false" +#) +# +#extend_target(Core CONDITION ((NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (NOT (CLANG OR intel_icl OR ICC))) AND (GCC AND f16c AND x86SimdAlways) +# # f16c_cxx = "true" +#) +# +#extend_target(Core CONDITION (((NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (NOT (CLANG OR intel_icl OR ICC))) AND (NOT (GCC AND f16c AND x86SimdAlways))) AND (MSVC AND contains(QT_CPU_FEATURES__ss_QT_ARCH,avx)) +# # f16c_cxx = "true" +#) +# +#extend_target(Core CONDITION (((NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (NOT (CLANG OR intel_icl OR ICC))) AND (NOT (GCC AND f16c AND x86SimdAlways))) AND (NOT (MSVC AND contains(QT_CPU_FEATURES__ss_QT_ARCH,avx))) +# # f16c_cxx = "false" +#) + +extend_target(Core CONDITION _ss_f16c_cxx + DEFINES + QFLOAT16_INCLUDE_FAST +) +# +#extend_target(Core CONDITION NOT _ss_f16c_cxx +# # F16C_SOURCES = "global/qfloat16_f16c.c" +#) + +extend_target(Core CONDITION linux_x_ OR hurd_x_ AND NOT cross_compile AND NOT static AND NOT _x_-armcc_x_ + DEFINES + ELF_INTERPRETER=\\\"=Creadelf-l/bin/ls|perl-n-e\'/programinterpreter:.*]/{print$1;}\'\\\" + LINK_OPTIONS + "-Wl,-e,qt_core_boilerplate" +) + +extend_target(Core CONDITION LINUX AND NOT static + SOURCES + global/minimum-linux_p.h +) +# +#extend_target(Core CONDITION LINUX AND precompile_header AND NOT static +# # NO_PCH_ASM = "global/minimum-linux.S" +# # QMAKE_EXTRA_COMPILERS = "no_pch_assembler" +# # no_pch_assembler.commands = "$$QMAKE_CC" "-c" "$(CFLAGS)" "$(INCPATH)" "${QMAKE_FILE_IN}" "-o" "${QMAKE_FILE_OUT}" +# # no_pch_assembler.dependency_type = "TYPE_C" +# # no_pch_assembler.input = "NO_PCH_ASM" +# # no_pch_assembler.name = "compiling[no_pch]" "${QMAKE_FILE_IN}" +# # no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" +#) +# +#extend_target(Core CONDITION LINUX AND precompile_header AND silent AND NOT static +# # no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&" "$$no_pch_assembler.commands" +#) + +extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static + SOURCES + global/minimum-linux.S +) + +extend_target(Core CONDITION QT_FEATURE_slog2 + LIBRARIES + slog2 +) + +extend_target(Core CONDITION QT_FEATURE_journald + LIBRARIES + journald +) +# +#extend_target(Core CONDITION GCC AND ltcg +# # QMAKE_EXTRA_COMPILERS = "versiontagging_compiler" +# # versiontagging_compiler.commands = "$$QMAKE_CXX" "-c" "$(CXXFLAGS)" "$(INCPATH)" "-fno-lto" "-o" "${QMAKE_FILE_OUT}" "${QMAKE_FILE_IN}" +# # versiontagging_compiler.dependency_type = "TYPE_C" +# # versiontagging_compiler.input = "VERSIONTAGGING_SOURCES" +# # versiontagging_compiler.name = "compiling[versiontagging]" "${QMAKE_FILE_IN}" +# # versiontagging_compiler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" +# # versiontagging_compiler.variable_out = "OBJECTS" +#) +# +#extend_target(Core CONDITION GCC AND ltcg AND silent +# # versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&" "$$versiontagging_compiler.commands" +#) + extend_target(Core CONDITION UNIX SOURCES io/qfilesystemengine_unix.cpp + io/qfilesystemiterator_unix.cpp io/qfsfileengine_unix.cpp io/qlockfile_unix.cpp + kernel/qcore_unix.cpp kernel/qcore_unix_p.h + kernel/qeventdispatcher_unix.cpp kernel/qeventdispatcher_unix_p.h + kernel/qpoll_p.h + kernel/qtimerinfo_unix.cpp kernel/qtimerinfo_unix_p.h thread/qthread_unix.cpp + DEFINES + QT_NO_CAST_TO_ASCII # special case: Add that here instead of removing it in WIN32! ) -extend_target(Core CONDITION UNIX AND NOT APPLE - SOURCES - tools/qlocale_unix.cpp -) - -extend_target(Core CONDITION ANDROID - SOURCES - io/qstandardpaths_android.cpp - io/qstorageinfo_unix.cpp - kernel/qjni.cpp kernel/qjni_p.h - kernel/qjnihelpers.cpp kernel/qjnihelpers_p.h - kernel/qjnionload.cpp -) - -extend_target(Core CONDITION HAIKU - SOURCES - io/qstandardpaths_haiku.cpp - io/qstorageinfo_unix.cpp - LIBRARIES be -) - -extend_target(Core CONDITION BSD - SOURCES io/qfilesystemwatcher_kqueue.cpp io/qfilesystemwatcher_kqueue_p.h -) - -extend_target(Core CONDITION VXWORKS - SOURCES kernel/qfunctions_vxworks.cpp kernel/qfunctions_vxworks.h -) - -extend_target(Core CONDITION NACL - SOURCES kernel/qfunctions_nacl.cpp kernel/qfunctions_nacl.h -) - -extend_target(Core CONDITION NOT WIN32 AND NOT APPLE AND NOT ANDROID AND NOT HAIKU - SOURCES - io/qstandardpaths_unix.cpp - io/qstorageinfo_unix.cpp -) - -### standardpaths, storageinfo and settings: -if (WIN32) - if (WINRT) - target_sources(Core PRIVATE - io/qsettings_winrt.cpp - io/qstandardpaths_winrt.cpp - io/qstorageinfo_stub.cpp - ) - else() - target_sources(Core PRIVATE - io/qsettings_win.cpp - io/qstandardpaths_win.cpp - io/qstorageinfo_win.cpp - ) - endif() -elseif (UNIX) - if (NOT INTEGRITY AND NOT UIKIT) - target_sources(Core PRIVATE io/forkfd_qt.cpp) - target_include_directories(Core PRIVATE ../3rdparty/forkfd) - endif() - if (NOT NACL AND APPLE) - target_sources(Core PRIVATE io/qsettings_mac.cpp) - endif() - if (APPLE) - target_sources(Core PRIVATE - io/qstandardpaths_mac.mm - io/qstorageinfo_mac.cpp - ) - elseif(ANDROID AND NOT ANDROID_EMBEDDED) - target_sources(Core PRIVATE - io/qstandardpaths_android.cpp - io/qstorageinfo_unix.cpp - ) - elseif(HAIKU) - target_sources(Core PRIVATE - io/qstandardpaths_haiku.cpp - io/qstorageinfo_unix.cpp - ) - else() - target_sources(Core PRIVATE - io/qstandardpaths_unix.cpp - io/qstorageinfo_unix.cpp - ) - endif() -endif() - -### kernel stuff: -if (UNIX OR INTEGRITY) - extend_target(Core SOURCES - kernel/qcore_unix.cpp - kernel/qcore_unix_p.h - kernel/qeventdispatcher_unix.cpp - kernel/qeventdispatcher_unix_p.h - kernel/qpoll_p.h - kernel/qtimerinfo_unix.cpp - kernel/qtimerinfo_unix_p.h - ) - if (NOT APPLE OR NACL) - target_sources(Core PRIVATE kernel/qelapsedtimer_unix.cpp) - endif() - - if (ANDROID) - target_sources(Core PRIVATE - kernel/qsharedmemory_android.cpp - kernel/qsystemsemaphore_android.cpp - ) - else() - target_sources(Core PRIVATE - kernel/qsharedmemory_posix.cpp - kernel/qsharedmemory_systemv.cpp - kernel/qsharedmemory_unix.cpp - kernel/qsystemsemaphore_posix.cpp - kernel/qsystemsemaphore_systemv.cpp - kernel/qsystemsemaphore_unix.cpp - ) - endif() - - # FIXME: Implement this! - # This is needed by QMetaType::typeName array implementation - #integrity: QMAKE_CXXFLAGS += --pending_instantiations=128 -elseif(NOT WIN32 AND NOT UNIX AND NOT APPLE) - target_sources(Core PRIVATE kernel/qelapsedtimer_generic.cpp) -endif() - - - -### Feature support: -##################################################################### - -## inotify: -extend_target(Core CONDITION QT_FEATURE_inotify - SOURCES - io/qfilesystemwatcher_inotify.cpp io/qfilesystemwatcher_inotify_p.h -) - -## qqnx_pps: -extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps - SOURCES - kernel/qppsattribute.cpp kernel/qppsattribute_p.h - kernel/qppsattributeprivate_p.h - kernel/qppsobject.cpp kernel/qppsobject_p.h - kernel/qppsobjectprivate_p.h - LIBRARIES PPS::PPS -) - -## clock_gettime: -extend_target(Core CONDITION UNIX AND QT_FEATURE_clock_gettime - LIBRARIES WrapRt -) - -## glib: -extend_target(Core CONDITION QT_FEATURE_glib - SOURCES - kernel/qeventdispatcher_glib.cpp kernel/qeventdispatcher_glib_p.h - LIBRARIES GLIB2::GLIB2 -) - -## poll_select: -extend_target(Core CONDITION UNIX AND QT_FEATURE_poll_select - SOURCES kernel/qpoll.cpp -) - -## thread: extend_target(Core CONDITION QT_FEATURE_thread SOURCES - thread/qatomic_bootstrap.h thread/qatomic.cpp thread/qatomic.h + thread/qatomic_bootstrap.h thread/qatomic_cxx11.h thread/qbasicatomic.h thread/qfutex_p.h @@ -578,14 +584,30 @@ extend_target(Core CONDITION QT_FEATURE_thread extend_target(Core CONDITION QT_FEATURE_thread AND WIN32 SOURCES + thread/qmutex_win.cpp thread/qwaitcondition_win.cpp ) -extend_target(Core CONDITION QT_FEATURE_thread AND NOT WIN32 - SOURCES thread/qwaitcondition_unix.cpp +extend_target(Core CONDITION QT_FEATURE_thread AND UNIX + SOURCES + thread/qwaitcondition_unix.cpp +) + +extend_target(Core CONDITION APPLE AND QT_FEATURE_thread + SOURCES + thread/qmutex_mac.cpp +) + +extend_target(Core CONDITION LINUX AND QT_FEATURE_thread + SOURCES + thread/qmutex_linux.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread AND UNIX AND NOT APPLE AND NOT LINUX + SOURCES + thread/qmutex_unix.cpp ) -## future: extend_target(Core CONDITION QT_FEATURE_future SOURCES thread/qexception.cpp thread/qexception.h @@ -596,25 +618,46 @@ extend_target(Core CONDITION QT_FEATURE_future thread/qresultstore.cpp thread/qresultstore.h ) -## ICU: +extend_target(Core CONDITION QT_FEATURE_std_atomic64 + LIBRARIES + Atomic +) + +extend_target(Core CONDITION ICC + COMPILE_OPTIONS + "-fp-model" + "strict" +) + +extend_target(Core CONDITION MSVC + SOURCES + tools/qvector_msvc.cpp +) + +extend_target(Core CONDITION APPLE_OSX AND NOT NACL + SOURCES + io/qsettings_mac.cpp + kernel/qelapsedtimer_mac.cpp + tools/qlocale_mac.mm +) + +extend_target(Core CONDITION UNIX AND (NACL OR NOT APPLE_OSX) + SOURCES + tools/qlocale_unix.cpp +) + +extend_target(Core CONDITION WIN32 AND (NACL OR NOT APPLE_OSX) + SOURCES + tools/qlocale_win.cpp +) + extend_target(Core CONDITION QT_FEATURE_icu SOURCES - codecs/qicucodec.cpp + codecs/qicucodec.cpp codecs/qicucodec_p.h tools/qcollator_icu.cpp tools/qlocale_icu.cpp - LIBRARIES ICU::i18n ICU::uc ICU::data -) - -extend_target(Core CONDITION NOT QT_FEATURE_icu AND WIN32 - SOURCES tools/qcollator_win.cpp -) - -extend_target(Core CONDITION NOT QT_FEATURE_icu AND APPLE - SOURCES tools/qcollator_macx.cpp -) - -extend_target(Core CONDITION NOT QT_FEATURE_icu AND NOT WIN32 AND NOT APPLE - SOURCES tools/qcollator_posix.cpp + LIBRARIES + ICU::i18n ICU::uc ICU::data ) extend_target(Core CONDITION NOT QT_FEATURE_icu @@ -628,16 +671,22 @@ extend_target(Core CONDITION NOT QT_FEATURE_icu codecs/qsjiscodec.cpp codecs/qsjiscodec_p.h ) -extend_target(Core CONDITION NOT QT_FEATURE_icu AND QT_FEATURE_iconv - SOURCES codecs/qiconvcodec.cpp codecs/qiconvcodec_p.h - LIBRARIES Iconv +extend_target(Core CONDITION WIN32 AND NOT QT_FEATURE_icu + SOURCES + codecs/qwindowscodec.cpp codecs/qwindowscodec_p.h + tools/qcollator_win.cpp ) -extend_target(Core CONDITION NOT QT_FEATURE_icu AND WIN32 - SOURCES codecs/qwindowscodec.cpp codecs/qwindowscodec_p.h +extend_target(Core CONDITION APPLE_OSX AND NOT QT_FEATURE_icu + SOURCES + tools/qcollator_macx.cpp +) + +extend_target(Core CONDITION UNIX AND NOT APPLE_OSX AND NOT QT_FEATURE_icu + SOURCES + tools/qcollator_posix.cpp ) -## timezone: extend_target(Core CONDITION QT_FEATURE_timezone SOURCES tools/qtimezone.cpp tools/qtimezone.h @@ -645,134 +694,278 @@ extend_target(Core CONDITION QT_FEATURE_timezone tools/qtimezoneprivate_data_p.h ) -extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 - SOURCES tools/qtimezoneprivate_win.cpp +extend_target(Core CONDITION APPLE AND QT_FEATURE_timezone AND NOT NACL + SOURCES + tools/qtimezoneprivate_mac.mm ) -extend_target(Core CONDITION QT_FEATURE_timezone AND APPLE - SOURCES tools/qtimezoneprivate_mac.mm +extend_target(Core CONDITION ANDROID AND QT_FEATURE_timezone AND NOT ANDROID_EMBEDDED AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_android.cpp ) -extend_target(Core CONDITION QT_FEATURE_timezone AND ANDROID - SOURCES tools/qtimezoneprivate_android.cpp +extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_tz.cpp ) -extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND NOT APPLE - SOURCES tools/qtimezoneprivate_tz.cpp +extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_icu.cpp ) -extend_target(Core CONDITION QT_FEATURE_timezone AND QT_FEATURE_icu AND NOT WIN32 AND NOT ANDROID AND NOT APPLE - SOURCES tools/qtimezoneprivate_icu.cpp +extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND WIN32 AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_icu.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 AND NOT QT_FEATURE_icu AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_win.cpp ) -## datetimeparser: extend_target(Core CONDITION QT_FEATURE_datetimeparser - SOURCES tools/qdatetimeparser.cpp tools/qdatetimeparser_p.h + SOURCES + tools/qdatetimeparser.cpp tools/qdatetimeparser_p.h ) -## regularexpression: extend_target(Core CONDITION QT_FEATURE_regularexpression - SOURCES tools/qregularexpression.cpp tools/qregularexpression.h - LIBRARIES PCRE2 + SOURCES + tools/qregularexpression.cpp tools/qregularexpression.h + LIBRARIES + PCRE2 ) -## commandlineparser: extend_target(Core CONDITION QT_FEATURE_commandlineparser SOURCES tools/qcommandlineoption.cpp tools/qcommandlineoption.h tools/qcommandlineparser.cpp tools/qcommandlineparser.h ) -## processenvironment: +extend_target(Core CONDITION UNIX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS AND NOT WASM AND (NOT APPLE_OSX OR NOT ICC) + LIBRARIES + m +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher + SOURCES + io/qfilesystemwatcher.cpp io/qfilesystemwatcher.h io/qfilesystemwatcher_p.h + io/qfilesystemwatcher_polling.cpp io/qfilesystemwatcher_polling_p.h +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND WIN32 + SOURCES + io/qfilesystemwatcher_win.cpp io/qfilesystemwatcher_win_p.h +) + +extend_target(Core CONDITION APPLE_OSX AND QT_FEATURE_filesystemwatcher + SOURCES + io/qfilesystemwatcher_fsevents.mm io/qfilesystemwatcher_fsevents_p.h +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND QT_FEATURE_inotify AND UNIX AND NOT APPLE_OSX + SOURCES + io/qfilesystemwatcher_inotify.cpp io/qfilesystemwatcher_inotify_p.h +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND UNIX AND NOT APPLE_OSX AND NOT QT_FEATURE_inotify AND (APPLE OR FREEBSD OR NETBSD OR OPENBSD) + SOURCES + io/qfilesystemwatcher_kqueue.cpp io/qfilesystemwatcher_kqueue_p.h +) + extend_target(Core CONDITION QT_FEATURE_processenvironment - SOURCES io/qprocess.cpp io/qprocess.h io/qprocess_p.h + SOURCES + io/qprocess.cpp io/qprocess.h io/qprocess_p.h ) extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32 AND NOT WINRT - SOURCES io/qprocess_win.cpp -) - -extend_target(Core CONDITION QT_FEATURE_processenvironment AND APPLE - SOURCES io/qprocess_darwin.mm + SOURCES + io/qprocess_win.cpp ) extend_target(Core CONDITION QT_FEATURE_processenvironment AND UNIX - SOURCES io/qprocess_unix.cpp -) - -## filesystemiterator: -extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND WIN32 - SOURCES io/qfilesystemiterator_win.cpp -) - -extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND UNIX - SOURCES io/qfilesystemiterator_unix.cpp -) - -## itemmodel: -extend_target(Core CONDITION QT_FEATURE_itemmodel SOURCES - itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h - itemmodels/qitemselectionmodel.cpp itemmodels/qitemselectionmodel.h itemmodels/qitemselectionmodel_p.h + io/qprocess_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND WIN32 + SOURCES + io/qfilesystemiterator_win.cpp +) + +extend_target(Core CONDITION WINRT + SOURCES + io/qsettings_winrt.cpp + io/qstandardpaths_winrt.cpp + io/qstorageinfo_stub.cpp + kernel/qeventdispatcher_winrt.cpp kernel/qeventdispatcher_winrt_p.h + kernel/qfunctions_fake_env_p.h + kernel/qfunctions_winrt.cpp kernel/qfunctions_winrt.h +) + +extend_target(Core CONDITION UNIX AND NOT APPLE_UIKIT AND NOT INTEGRITY + SOURCES + ../3rdparty/forkfd/forkfd.h + io/forkfd_qt.cpp + INCLUDE_DIRECTORIES + ../3rdparty/forkfd +) + +extend_target(Core CONDITION APPLE_OSX AND QT_FEATURE_processenvironment + SOURCES + io/qprocess_darwin.mm +) + +extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED + SOURCES + io/qstandardpaths_android.cpp + io/qstorageinfo_unix.cpp + kernel/qjni.cpp kernel/qjni_p.h + kernel/qjnihelpers.cpp kernel/qjnihelpers_p.h + kernel/qjnionload.cpp +) + +extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) + SOURCES + io/qstandardpaths_haiku.cpp + io/qstorageinfo_unix.cpp + LIBRARIES + be +) + +extend_target(Core CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp ) -## proxymodel: extend_target(Core CONDITION QT_FEATURE_proxymodel - SOURCES itemmodels/qabstractproxymodel.cpp itemmodels/qabstractproxymodel.h itemmodels/qabstractproxymodel_p.h + SOURCES + itemmodels/qabstractproxymodel.cpp itemmodels/qabstractproxymodel.h itemmodels/qabstractproxymodel_p.h ) -## identityproxymodel: -extend_target(Core CONDITION QT_FEATURE_identityproxymodel - SOURCES itemmodels/qidentityproxymodel.cpp itemmodels/qidentityproxymodel.h +extend_target(Core CONDITION QT_FEATURE_concatenatetablesproxymodel AND QT_FEATURE_proxymodel + SOURCES + itemmodels/qconcatenatetablesproxymodel.cpp itemmodels/qconcatenatetablesproxymodel.h ) -## identityproxymodel: -extend_target(Core CONDITION QT_FEATURE_sortfilterproxymodel - SOURCES itemmodels/qsortfilterproxymodel.cpp itemmodels/qsortfilterproxymodel.h +extend_target(Core CONDITION QT_FEATURE_identityproxymodel AND QT_FEATURE_proxymodel + SOURCES + itemmodels/qidentityproxymodel.cpp itemmodels/qidentityproxymodel.h +) + +extend_target(Core CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_sortfilterproxymodel + SOURCES + itemmodels/qsortfilterproxymodel.cpp itemmodels/qsortfilterproxymodel.h ) -## stringlistmodel: extend_target(Core CONDITION QT_FEATURE_stringlistmodel - SOURCES itemmodels/qstringlistmodel.cpp itemmodels/qstringlistmodel.h + SOURCES + itemmodels/qstringlistmodel.cpp itemmodels/qstringlistmodel.h ) -## library: extend_target(Core CONDITION QT_FEATURE_library SOURCES plugin/qelfparser_p.cpp plugin/qelfparser_p.h plugin/qlibrary.cpp plugin/qlibrary.h plugin/qlibrary_p.h plugin/qmachparser.cpp plugin/qmachparser_p.h - LIBRARIES ${CMAKE_DL_LIBS} -) - -extend_target(Core CONDITION QT_FEATURE_library AND WIN32 - SOURCES plugin/qlibrary_win.cpp + LIBRARIES + ${CMAKE_DL_LIBS} ) extend_target(Core CONDITION QT_FEATURE_library AND UNIX - SOURCES plugin/qlibrary_unix.cpp -) - -## statemachine: -extend_target(Core CONDITION QT_FEATURE_statemachine SOURCES - statemachine/qabstractstate.cpp statemachine/qabstractstate.h statemachine/qabstractstate_p.h - statemachine/qabstracttransition.cpp statemachine/qabstracttransition.h statemachine/qabstracttransition_p.h - statemachine/qfinalstate.cpp statemachine/qfinalstate.h statemachine/qfinalstate_p.h - statemachine/qhistorystate.cpp statemachine/qhistorystate.h statemachine/qhistorystate_p.h - statemachine/qsignaleventgenerator_p.h - statemachine/qsignaltransition.cpp statemachine/qsignaltransition.h statemachine/qsignaltransition_p.h - statemachine/qstate.cpp statemachine/qstate.h statemachine/qstate_p.h - statemachine/qstatemachine.cpp statemachine/qstatemachine.h statemachine/qstatemachine_p.h - INCLUDE_DIRECTORIES statemachine + plugin/qlibrary_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_library AND WIN32 + SOURCES + plugin/qlibrary_win.cpp +) + +extend_target(Core CONDITION APPLE_OSX AND (APPLE_IOS OR APPLE_TVOS) + LIBRARIES + ${FWUIKit} +) + +extend_target(Core CONDITION APPLE_OSX AND APPLE_WATCHOS + LIBRARIES + ${FWWatchKit} +) + +extend_target(Core CONDITION NACL + SOURCES + kernel/qfunctions_nacl.cpp kernel/qfunctions_nacl.h +) + +extend_target(Core CONDITION INTEGRITY OR (NACL AND UNIX) OR (UNIX AND NOT APPLE) + SOURCES + kernel/qelapsedtimer_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_poll_select AND UNIX + SOURCES + kernel/qpoll.cpp +) + +extend_target(Core CONDITION QT_FEATURE_glib AND UNIX + SOURCES + kernel/qeventdispatcher_glib.cpp kernel/qeventdispatcher_glib_p.h + LIBRARIES + GLIB2::GLIB2 +) + +extend_target(Core CONDITION QT_FEATURE_clock_gettime AND UNIX + LIBRARIES + WrapRt +) + +extend_target(Core CONDITION UNIX AND NOT ANDROID + SOURCES + kernel/qsharedmemory_posix.cpp + kernel/qsharedmemory_systemv.cpp + kernel/qsharedmemory_unix.cpp + kernel/qsystemsemaphore_posix.cpp + kernel/qsystemsemaphore_systemv.cpp + kernel/qsystemsemaphore_unix.cpp +) + +extend_target(Core CONDITION ANDROID + SOURCES + kernel/qsharedmemory_android.cpp + kernel/qsystemsemaphore_android.cpp +) + +extend_target(Core CONDITION VXWORKS + SOURCES + kernel/qfunctions_vxworks.cpp kernel/qfunctions_vxworks.h +) + +extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps + SOURCES + kernel/qppsattribute.cpp kernel/qppsattribute_p.h + kernel/qppsattributeprivate_p.h + kernel/qppsobject.cpp kernel/qppsobject_p.h + kernel/qppsobjectprivate_p.h + LIBRARIES + pps +) + +extend_target(Core CONDITION QT_FEATURE_iconv AND NOT QT_FEATURE_icu + SOURCES + codecs/qiconvcodec.cpp codecs/qiconvcodec_p.h +) + +extend_target(Core CONDITION QT_FEATURE_gnu_libiconv AND QT_FEATURE_iconv AND NOT QT_FEATURE_icu + LIBRARIES + iconv ) -# qeventtransition: extend_target(Core CONDITION QT_FEATURE_qeventtransition - SOURCES statemachine/qeventtransition.cpp statemachine/qeventtransition.h statemachine/qeventtransition_p.h + SOURCES + statemachine/qeventtransition.cpp statemachine/qeventtransition.h statemachine/qeventtransition_p.h ) -# mimetype: extend_target(Core CONDITION QT_FEATURE_mimetype SOURCES mimetypes/mimetypes.qrc @@ -783,16 +976,10 @@ extend_target(Core CONDITION QT_FEATURE_mimetype mimetypes/qmimeprovider.cpp mimetypes/qmimeprovider_p.h mimetypes/qmimetype.cpp mimetypes/qmimetype.h mimetypes/qmimetype_p.h mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h - INCLUDE_DIRECTORIES mimetypes ) -# Enable Evaluation based on QT_EVAL variable being set from the outside: -extend_target(Core CONDITION QT_EVAL LIBRARIES Qt_Evaluation) - -### Extra stuff: -##################################################################### - +# special case: add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" COMMAND qfloat16-tables ARGS "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" @@ -801,13 +988,15 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp VERBATIM) target_sources(Core PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp") -qt_create_tracepoints(Core qtcore.tracepoints) +set_source_files_properties( + thread/qmutex_linux.cpp + thread/qmutex_mac.cpp + thread/qmutex_unix.cpp + thread/qmutex_win.cpp + PROPERTIES HEADER_FILE_ONLY ON) # special case: These files are included by qmutex.cpp! -# Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library. -if(WIN32) - get_target_property(defines Core COMPILE_DEFINITIONS) - list(REMOVE_ITEM defines QT_NO_CAST_TO_ASCII) - set_target_properties(Core PROPERTIES COMPILE_DEFINITIONS "${defines}") -endif() +qt_internal_add_link_flags_gc_sections(Core PRIVATE) # special case + +qt_create_tracepoints(Core ./qtcore.tracepoints) add_qt_docs(./doc/qtcore.qdocconf) From 4471249d33dd1b1e87ee5f2881c7341fc1f43c64 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 1 Mar 2019 15:14:59 +0100 Subject: [PATCH 0285/1322] CMake: Re-generate CMakeLists.txt file for network Change-Id: Ib75578958a98947efbca853692b24528c1a3e8a5 Reviewed-by: Alexandru Croitor --- src/CMakeLists.txt | 1 + src/network/CMakeLists.txt | 245 ++++++++++++++++--------------------- 2 files changed, 107 insertions(+), 139 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5dfa6a5418..8bde1f760ba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,7 @@ if(APPLE) find_library(FWIOKit IOKit) find_library(FWMobileCoreServices MobileCoreServices) find_library(FWSecurity Security) + find_library(FWSystemConfiguration SystemConfiguration) find_library(FWUIKit UIKit) find_library(FWWatchKit WatchKit) endif() diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 85301de86d2..187800b1c2d 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from network.pro. ##################################################################### -## QtNetwork Module: +## Network Module: ##################################################################### add_qt_module(Network @@ -9,7 +9,6 @@ add_qt_module(Network access/qabstractnetworkcache.cpp access/qabstractnetworkcache.h access/qabstractnetworkcache_p.h access/qhsts.cpp access/qhsts_p.h access/qhstspolicy.cpp access/qhstspolicy.h - access/qhstsstore.cpp access/qhstsstore_p.h access/qnetworkaccessauthenticationmanager.cpp access/qnetworkaccessauthenticationmanager_p.h access/qnetworkaccessbackend.cpp access/qnetworkaccessbackend_p.h access/qnetworkaccesscache.cpp access/qnetworkaccesscache_p.h @@ -56,31 +55,36 @@ add_qt_module(Network kernel LIBRARIES Qt::CorePrivate + ZLIB::ZLIB # special case + PUBLIC_LIBRARIES # special case + Qt::Core + # MODULE_PLUGIN_TYPES = "bearer" + # MODULE_WINRT_CAPABILITIES = "internetClient" "internetClientServer" "privateNetworkClientServer" + # PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" + # QMAKE_LIBS = "$$QMAKE_LIBS_NETWORK" + # _LOADED = "qt_module" ) ## Scopes: ##################################################################### -find_library(FWCoreFoundation CoreFoundation) -find_library(FWSecurity Security) -find_library(FWCFNetwork CFNetwork) -find_library(FWCoreServices CoreServices) -find_library(FWSystemConfiguration SystemConfiguration) - -# -#extend_target(Network CONDITION MSVC -#) -# -#extend_target(Network CONDITION (MSVC) AND (equals(QT_ARCH, i386)) -#) +extend_target(Network CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x64000000" +) # #extend_target(Network CONDITION QT_FEATURE_bearermanagement +# # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroidBearer.jar" +# # ANDROID_LIB_DEPENDENCIES = "plugins/bearer/libqandroidbearer.so" +# # ANDROID_PERMISSIONS = "android.permission.ACCESS_NETWORK_STATE" +# # MODULE_PLUGIN_TYPES = "bearer" #) extend_target(Network CONDITION QT_FEATURE_ftp SOURCES access/qftp.cpp access/qftp_p.h access/qnetworkaccessftpbackend.cpp access/qnetworkaccessftpbackend_p.h + kernel/qurlinfo.cpp kernel/qurlinfo_p.h ) extend_target(Network CONDITION QT_FEATURE_networkdiskcache @@ -88,9 +92,17 @@ extend_target(Network CONDITION QT_FEATURE_networkdiskcache access/qnetworkdiskcache.cpp access/qnetworkdiskcache.h access/qnetworkdiskcache_p.h ) +extend_target(Network CONDITION QT_FEATURE_settings + SOURCES + access/qhstsstore.cpp access/qhstsstore_p.h +) + extend_target(Network CONDITION APPLE_OSX + SOURCES + kernel/qnetworkproxy_mac.cpp LIBRARIES ${FWSecurity} + ${FWCoreFoundation} ) extend_target(Network CONDITION WASM @@ -118,47 +130,14 @@ extend_target(Network CONDITION QT_FEATURE_http access/qhttpprotocolhandler.cpp access/qhttpprotocolhandler_p.h access/qhttpthreaddelegate.cpp access/qhttpthreaddelegate_p.h access/qnetworkreplyhttpimpl.cpp access/qnetworkreplyhttpimpl_p.h - LIBRARIES - ZLIB::ZLIB + socket/qhttpsocketengine.cpp socket/qhttpsocketengine_p.h ) -extend_target(Network CONDITION APPLE_UIKIT - SOURCES - kernel/qnetworkinterface_uikit_p.h -) - -if(APPLE_OSX) - set(proxy_sources kernel/qnetworkproxy_mac.cpp) -elseif(WIN32 AND NOT WINRT) - set(proxy_sources kernel/qnetworkproxy_win.cpp) -elseif(QT_FEATURE_libproxy) - set(proxy_sources kernel/qnetworkproxy_libproxy.cpp) - set(proxy_libs PkgConfig::Libproxy dl) -else() - set(proxy_sources kernel/qnetworkproxy_generic.cpp) -endif() - -if(NOT DEFINED proxy_libs) - set(proxy_libs "") -endif() - -extend_target(Network - SOURCES - ${proxy_sources} - LIBRARIES - ${proxy_libs} -) - -extend_target(Network CONDITION (QT_FEATURE_http) AND (QT_FEATURE_ssl) +extend_target(Network CONDITION QT_FEATURE_http AND QT_FEATURE_ssl SOURCES access/qspdyprotocolhandler.cpp access/qspdyprotocolhandler_p.h ) -extend_target(Network CONDITION QT_FEATURE_ftp - SOURCES - kernel/qurlinfo.cpp kernel/qurlinfo_p.h -) - extend_target(Network CONDITION QT_FEATURE_dnslookup SOURCES kernel/qdnslookup.cpp kernel/qdnslookup.h kernel/qdnslookup_p.h @@ -167,10 +146,30 @@ extend_target(Network CONDITION QT_FEATURE_dnslookup extend_target(Network CONDITION UNIX SOURCES kernel/qhostinfo_unix.cpp + socket/qnativesocketengine_unix.cpp + socket/qnet_unix_p.h +) + +# special case: Do not add this to android! +extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY AND NOT ANDROID + SOURCES + kernel/qdnslookup_unix.cpp +) + +extend_target(Network CONDITION QT_FEATURE_linux_netlink AND UNIX + SOURCES + kernel/qnetworkinterface_linux.cpp +) + +extend_target(Network CONDITION UNIX AND NOT QT_FEATURE_linux_netlink + SOURCES + kernel/qnetworkinterface_unix.cpp +) + +extend_target(Network CONDITION ANDROID AND QT_FEATURE_dnslookup + SOURCES + kernel/qdnslookup_android.cpp ) -# -#extend_target(Network CONDITION (UNIX) AND (NOT INTEGRITY) -#) extend_target(Network CONDITION WIN32 SOURCES @@ -180,44 +179,52 @@ extend_target(Network CONDITION WIN32 extend_target(Network CONDITION WIN32 AND NOT WINRT SOURCES kernel/qnetworkinterface_win.cpp + kernel/qnetworkproxy_win.cpp + socket/qnativesocketengine_win.cpp LIBRARIES dnsapi iphlpapi + advapi32 ) -extend_target(Network CONDITION WIN32 AND NOT WINRT AND QT_FEATURE_dnslookup +extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32 AND NOT WINRT SOURCES kernel/qdnslookup_win.cpp ) -extend_target(Network CONDITION ((UNIX) AND (NOT INTEGRITY)) AND (QT_FEATURE_dnslookup) +extend_target(Network CONDITION WINRT SOURCES - kernel/qdnslookup_unix.cpp + kernel/qnetworkinterface_winrt.cpp + socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h ) -extend_target(Network CONDITION (UNIX) AND (QT_FEATURE_linux_netlink) +extend_target(Network CONDITION QT_FEATURE_dnslookup AND WINRT SOURCES - kernel/qnetworkinterface_linux.cpp + kernel/qdnslookup_winrt.cpp ) -extend_target(Network CONDITION (UNIX) AND (NOT ((UNIX) AND (QT_FEATURE_linux_netlink))) - SOURCES - kernel/qnetworkinterface_unix.cpp +extend_target(Network CONDITION APPLE_OSX AND NOT APPLE_UIKIT + LIBRARIES + ${FWCoreServices} + ${FWSystemConfiguration} ) -# TODO: how to merge to above -extend_target(Network CONDITION APPLE_OSX +extend_target(Network CONDITION APPLE_UIKIT SOURCES - kernel/qnetworkinterface_unix.cpp + kernel/qnetworkinterface_uikit_p.h ) -# -#extend_target(Network CONDITION ANDROID -#) -extend_target(Network CONDITION (ANDROID) AND (QT_FEATURE_dnslookup) +extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT APPLE_OSX AND (UNIX OR WINRT) SOURCES - kernel/qdnslookup_unix.cpp - kernel/qdnslookup_android.cpp + kernel/qnetworkproxy_libproxy.cpp + LIBRARIES + LibProxy::LibProxy + ${CMAKE_DL_LIBS} +) + +extend_target(Network CONDITION NOT APPLE_OSX AND NOT QT_FEATURE_libproxy AND (UNIX OR WINRT) + SOURCES + kernel/qnetworkproxy_generic.cpp ) extend_target(Network CONDITION QT_FEATURE_socks5 @@ -225,11 +232,6 @@ extend_target(Network CONDITION QT_FEATURE_socks5 socket/qsocks5socketengine.cpp socket/qsocks5socketengine_p.h ) -extend_target(Network CONDITION QT_FEATURE_http - SOURCES - socket/qhttpsocketengine.cpp socket/qhttpsocketengine_p.h -) - extend_target(Network CONDITION QT_FEATURE_sctp SOURCES socket/qsctpserver.cpp socket/qsctpserver.h socket/qsctpserver_p.h @@ -241,39 +243,9 @@ extend_target(Network CONDITION NOT WINRT socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h ) -extend_target(Network CONDITION UNIX - SOURCES - socket/qnativesocketengine_unix.cpp - socket/qnet_unix_p.h -) - -### FIXME -# extend_target(Network CONDITION msvc AND equals(QT_ARCH, i386): -# QMAKE_LFLAGS += /BASE:0x64000000 -# ) - -extend_target(Network CONDITION WIN32 - SOURCES -) - -extend_target(Network CONDITION (WIN32) AND (NOT WINRT) - SOURCES - socket/qnativesocketengine_win.cpp -) - -extend_target(Network CONDITION WIN32 - LIBRARIES - ws2_32 -) - -extend_target(Network CONDITION (WIN32) AND (NOT WINRT) - LIBRARIES - advapi32 -) - -extend_target(Network CONDITION WINRT - SOURCES - socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h +extend_target(Network CONDITION MSVC + MOC_OPTIONS + "-D_WINSOCK_DEPRECATED_NO_WARNINGS" ) extend_target(Network CONDITION QT_FEATURE_localserver @@ -282,24 +254,29 @@ extend_target(Network CONDITION QT_FEATURE_localserver socket/qlocalsocket.cpp socket/qlocalsocket.h socket/qlocalsocket_p.h ) -extend_target(Network CONDITION QT_FEATURE_localserver AND ((INTEGRITY) OR (WINRT)) +extend_target(Network CONDITION QT_FEATURE_localserver AND (INTEGRITY OR WINRT) SOURCES - socket/qlocalsocket_tcp.cpp socket/qlocalserver_tcp.cpp + socket/qlocalsocket_tcp.cpp DEFINES QT_LOCALSOCKET_TCP ) -extend_target(Network CONDITION QT_FEATURE_localserver AND (UNIX) AND (NOT INTEGRITY) +extend_target(Network CONDITION QT_FEATURE_localserver AND UNIX AND NOT INTEGRITY AND NOT WINRT SOURCES - socket/qlocalsocket_unix.cpp socket/qlocalserver_unix.cpp + socket/qlocalsocket_unix.cpp ) -extend_target(Network CONDITION QT_FEATURE_localserver AND (WIN32) AND (NOT WINRT) +extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32 AND NOT WINRT SOURCES - socket/qlocalsocket_win.cpp socket/qlocalserver_win.cpp + socket/qlocalsocket_win.cpp +) + +extend_target(Network CONDITION QT_FEATURE_system_proxies + DEFINES + QT_USE_SYSTEM_PROXIES ) extend_target(Network CONDITION NOT QT_FEATURE_openssl @@ -319,7 +296,7 @@ extend_target(Network CONDITION QT_FEATURE_ssl ssl/qsslsocket.cpp ssl/qsslsocket.h ssl/qsslsocket_p.h ) -extend_target(Network CONDITION (QT_FEATURE_ssl) AND (WINRT) +extend_target(Network CONDITION QT_FEATURE_ssl AND WINRT SOURCES ssl/qsslcertificate_winrt.cpp ssl/qssldiffiehellmanparameters_dummy.cpp @@ -329,7 +306,7 @@ extend_target(Network CONDITION (QT_FEATURE_ssl) AND (WINRT) ssl/qsslsocket_winrt.cpp ssl/qsslsocket_winrt_p.h ) -extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_securetransport) +extend_target(Network CONDITION QT_FEATURE_securetransport AND QT_FEATURE_ssl SOURCES ssl/qssldiffiehellmanparameters_dummy.cpp ssl/qsslellipticcurve_dummy.cpp @@ -340,12 +317,12 @@ extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_securetransport ssl/qsslsocket_qt.cpp ) -extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_dtls) +extend_target(Network CONDITION QT_FEATURE_dtls AND QT_FEATURE_ssl SOURCES ssl/qdtls.cpp ssl/qdtls.h ssl/qdtls_p.h ) -extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_openssl) +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl SOURCES ssl/qsslcertificate_openssl.cpp ssl/qsslcontext_openssl.cpp ssl/qsslcontext_openssl_p.h @@ -356,56 +333,46 @@ extend_target(Network CONDITION (QT_FEATURE_ssl) AND (QT_FEATURE_openssl) ssl/qsslsocket_openssl_symbols.cpp ssl/qsslsocket_openssl_symbols_p.h ) -extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_dtls) +extend_target(Network CONDITION QT_FEATURE_dtls AND QT_FEATURE_openssl AND QT_FEATURE_ssl SOURCES ssl/qdtls_openssl.cpp ssl/qdtls_openssl_p.h ) -extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_opensslv11) +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_opensslv11 AND QT_FEATURE_ssl SOURCES ssl/qsslcontext_openssl11.cpp ssl/qsslsocket_openssl11.cpp ssl/qsslsocket_openssl11_symbols_p.h + DEFINES # special case + "OPENSSL_API_COMPAT=0x10100000L" ) -extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (NOT QT_FEATURE_opensslv11) +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_opensslv11 SOURCES ssl/qsslcontext_opensslpre11.cpp ssl/qsslsocket_opensslpre11.cpp ssl/qsslsocket_opensslpre11_symbols_p.h ) -extend_target(Network CONDITION (APPLE_OSX) AND (NOT APPLE_UIKIT) - LIBRARIES - ${FWCoreServices} - ${FWSystemConfiguration} -) - -extend_target(Network CONDITION APPLE_OSX - LIBRARIES - ${FWCoreFoundation} -) - -extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (APPLE) +extend_target(Network CONDITION APPLE AND QT_FEATURE_openssl AND QT_FEATURE_ssl SOURCES ssl/qsslsocket_mac_shared.cpp ) -# -#extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (ANDROID) -#) -extend_target(Network CONDITION (((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (ANDROID)) AND (NOT ANDROID_EMBEDDED) +extend_target(Network CONDITION ANDROID AND QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT ANDROID_EMBEDDED SOURCES ssl/qsslsocket_openssl_android.cpp ) # -#extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_openssl_linked) +#extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_openssl_linked AND QT_FEATURE_ssl +# # QMAKE_USE_FOR_PRIVATE = "openssl" #) # -#extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (NOT (((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (QT_FEATURE_openssl_linked))) +#extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_openssl_linked +# # QMAKE_USE_FOR_PRIVATE = "openssl/nolink" #) -extend_target(Network CONDITION ((QT_FEATURE_ssl) AND (QT_FEATURE_openssl)) AND (WIN32) +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 SOURCES ssl/qwindowscarootfetcher.cpp ssl/qwindowscarootfetcher_p.h LIBRARIES From becbe4df3a7f493c0d3e40f29495279f503d3895 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Mar 2019 10:05:10 +0100 Subject: [PATCH 0286/1322] Improve add_qt_resource function * Handle BASE to give the directory files will be relative to. * Support lang="foo" for qresource sections. Change-Id: I36087220d03789a97105dc6dd1aca7a25a063d9f Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 09e9899bc53..6eabccb83c2 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -870,28 +870,44 @@ endfunction() function(add_qt_resource target resourceName) - qt_parse_all_arguments(rcc "add_qt_resource" "" "PREFIX;BASE" "FILES" ${ARGN}) + qt_parse_all_arguments(rcc "add_qt_resource" "" "PREFIX;LANG;BASE" "FILES" ${ARGN}) - set(qrcContents "") - if (${rcc_PREFIX}) - string(APPEND qrcContents " \n") - else() - string(APPEND qrcContents " \n") + # Generate .qrc file: + + # + set(qrcContents "\n \n") foreach(file ${rcc_FILES}) - get_property(alias SOURCE ${file} PROPERTY alias) + if(rcc_BASE) + set(based_file "${rcc_BASE}/${file}") + else() + set(based_file "${file}") + endif() + get_property(alias SOURCE ${based_file} PROPERTY alias) if (NOT alias) set(alias "${file}") endif() ### FIXME: escape file paths to be XML conform - string(APPEND qrcContents " ${CMAKE_CURRENT_SOURCE_DIR}/${file}\n") + # ... + string(APPEND qrcContents " ") + string(APPEND qrcContents "${CMAKE_CURRENT_SOURCE_DIR}/${based_file}\n") endforeach() + # string(APPEND qrcContents " \n\n") + set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/${resourceName}.qrc") file(GENERATE OUTPUT "${generatedResourceFile}" CONTENT "${qrcContents}") + # Process .qrc file: + set(generatedSourceCode "${CMAKE_CURRENT_BINARY_DIR}/qrc_${resourceName}.cpp") add_custom_command(OUTPUT "${generatedSourceCode}" COMMAND "${QT_CMAKE_EXPORT_NAMESPACE}::rcc" From af8413af152212a7513b6fa71259ec58a6e7868f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 11 Mar 2019 12:32:56 +0100 Subject: [PATCH 0287/1322] Fix header Depends file generation The script used to write incorrect dependency headers due to not clearing the qtdeps variable at each loop step. Change-Id: Icf293be7cea596daa096ab19d390c0bb468a8654 Reviewed-by: Tobias Hunger --- cmake/QtPostProcess.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 48de9ef3964..0d50d7fa476 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -16,6 +16,7 @@ function(qt_internal_create_depends_files) message("Generating depends files for ${KNOWN_QT_MODULES}...") foreach (target ${KNOWN_QT_MODULES}) get_target_property(depends "${target}" LINK_LIBRARIES) + set(qtdeps "") foreach (dep ${depends}) # Normalize module by stripping leading "Qt::" and trailing "Private" if (dep MATCHES "Qt::(.*)") From 4b105d77c24fb09fc65f1b1e622a47c69dabccaf Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Mar 2019 11:06:23 +0100 Subject: [PATCH 0288/1322] CMake: pro2cmake.py: Remove .qrc files! Remove qrc files from CMake. Use add_qt_resource function instead. Change-Id: I64cdbd9498f97d23cd8e03f34ab5ae4a52dba5af Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 107 ++++++++++++++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 16 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 7c00afad1cb..7abb8f5a1c8 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -32,6 +32,7 @@ from __future__ import annotations from argparse import ArgumentParser import copy +import xml.etree.ElementTree as ET from itertools import chain import os.path import re @@ -72,6 +73,61 @@ def _parse_commandline(): return parser.parse_args() +def process_qrc_file(target: str, filepath: str, base_dir: str = '') -> str: + assert(target) + resource_name = os.path.splitext(os.path.basename(filepath))[0] + base_dir = os.path.join('' if base_dir == '.' else base_dir, os.path.dirname(filepath)) + + tree = ET.parse(filepath) + root = tree.getroot() + assert(root.tag == 'RCC') + + output = '' + + resource_count = 0 + for resource in root: + assert(resource.tag == 'qresource') + lang = resource.get('lang', '') + prefix = resource.get('prefix', '') + + full_resource_name = resource_name + (str(resource_count) if resource_count > 0 else '') + + files: Dict[str, str] = {} + for file in resource: + path = file.text + assert path + + # Get alias: + alias = file.get('alias', '') + files[path] = alias + + sorted_files = sorted(files.keys()) + + assert(sorted_files) + + for source in sorted_files: + alias = files[source] + if alias: + full_source = os.path.join(base_dir, source) + output += 'set_source_files_properties("{}"\n' \ + ' PROPERTIES alias "{}")\n'.format(full_source, alias) + + params = '' + if lang: + params += ' LANG "{}"'.format(lang) + if prefix: + params += ' PREFIX "{}"'.format(prefix) + if base_dir: + params += ' BASE "{}"'.format(base_dir) + output += 'add_qt_resource({} "{}"{} FILES\n {})\n'.format(target, full_resource_name, + params, + '\n '.join(sorted_files)) + + resource_count += 1 + + return output + + def fixup_linecontinuation(contents: str) -> str: contents = re.sub(r'([^\t ])\\[ \t]*\n', '\\1 \\\n', contents) contents = re.sub(r'\\[ \t]*\n', '\\\n', contents) @@ -778,28 +834,19 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, ind = spaces(indent) scope.reset_visited_keys() + # mark RESOURCES as visited: + scope.get('RESOURCES', '') + plugin_type = scope.get('PLUGIN_TYPE') if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) + vpath = scope.expand('VPATH') + sources = scope.expand('SOURCES') + scope.expand('HEADERS') \ + scope.expand('OBJECTIVE_SOURCES') + scope.expand('NO_PCH_SOURCES') \ + scope.expand('FORMS') - resources = scope.expand('RESOURCES') - if resources: - qrc_only = True - for r in resources: - if not r.endswith('.qrc'): - qrc_only = False - break - - if not qrc_only: - print(' XXXX Ignoring non-QRC file resources.') - else: - sources += resources - - vpath = scope.expand('VPATH') sources = [map_source_to_cmake(s, scope.basedir, vpath) for s in sources] if sources: @@ -1078,6 +1125,31 @@ def map_to_cmake_condition(condition: str) -> str: return condition +def write_resources(cm_fh: typing.IO[str], target: str, scope: Scope, indent: int = 0): + vpath = scope.expand('VPATH') + + # Handle QRC files by turning them into add_qt_resource: + resources = scope.expand('RESOURCES') + qrc_output = '' + if resources: + qrc_only = True + for r in resources: + if r.endswith('.qrc'): + qrc_output += process_qrc_file(target, + map_source_to_cmake(r, scope.basedir, vpath), + scope.basedir) + else: + qrc_only = False + + if not qrc_only: + print(' XXXX Ignoring non-QRC file resources.') + + if qrc_output: + cm_fh.write('\n# Resources:\n') + for line in qrc_output.split('\n'): + cm_fh.write(' ' * indent + line + '\n') + + def write_extend_target(cm_fh: typing.IO[str], target: str, scope: Scope, indent: int = 0): extend_qt_io_string = io.StringIO() @@ -1106,6 +1178,8 @@ def write_extend_target(cm_fh: typing.IO[str], target: str, cm_fh.write(extend_scope) + write_resources(cm_fh, target, scope, indent) + def flatten_scopes(scope: Scope) -> typing.List[Scope]: result = [scope] # type: typing.List[Scope] @@ -1137,8 +1211,7 @@ def merge_scopes(scopes: typing.List[Scope]) -> typing.List[Scope]: def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cmake_function: str, scope: Scope, *, extra_lines: typing.List[str] = [], - indent: int = 0, - **kwargs: typing.Any): + indent: int = 0, **kwargs: typing.Any): # Evaluate total condition of all scopes: recursive_evaluate_scope(scope) @@ -1168,6 +1241,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, # Footer: cm_fh.write('{})\n'.format(spaces(indent))) + write_resources(cm_fh, name, scope, indent) + # Scopes: if len(scopes) == 1: return From ea7d13de0da8fc1107f97f18f14cc3d16ab7008b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 11 Mar 2019 16:39:46 +0100 Subject: [PATCH 0289/1322] Update README to mention setting the vcpkg toolchain Change-Id: Icac2ba956246901e02bb6aa257f81cccf56560e8 Reviewed-by: Tobias Hunger --- cmake/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/README.md b/cmake/README.md index 49fbda5df37..24ac29d8e6a 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -35,7 +35,8 @@ You may use vcpkg to install dependencies needed to build QtBase. * Linux: ``x64-linux`` * Windows: ``qt-x86-windows-static`` * Build Qt dependencies: ``vcpkg install zlib pcre2 double-conversion harfbuzz`` - * When running cmake in qtbase, pass ``-DCMAKE_PREFIX_PATH=/path/to/your/vcpkg/installed/$VCPKG_DEFAULT_TRIPLET`` or ``-DCMAKE_PREFIX_PATH=/path/to/your/vcpkg/installed/%VCPKG_DEFAULT_TRIPLET%`` on Windows. + * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake`` + Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_PATH. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). # Building against homebrew on macOS From 42ae8218b1e18b002df5a26a2f4e961af61aaa5d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Mar 2019 15:10:22 +0100 Subject: [PATCH 0290/1322] CMake: configurejson2cmake.py: Fix typo Change-Id: Ib142032577f1d84bfb2402103271db04a4bb25a1 Reviewed-by: Simon Hausmann --- util/cmake/configurejson2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index efce7fee4a9..244bc4ae4c2 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -138,7 +138,7 @@ def map_tests(test: str) -> str: 'bmi': 'TEST_subarch_bmi', 'bmi2': 'TEST_subarch_bmi2', 'cx16': 'TEST_subarch_cx16', - 'f16c': 'TEST_subarch_c16c', + 'f16c': 'TEST_subarch_f16c', 'fma': 'TEST_subarch_fma', 'fma4': 'TEST_subarch_fma4', 'fsgsbase': 'TEST_subarch_fsgsbase', From 6ca047aba9d41d4b2f00ecef33a6a7ca43d90ac8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 13 Mar 2019 13:55:56 +0100 Subject: [PATCH 0291/1322] Use qt_evaluate_config_expression for feature enable conditions Certain features like opengles2 can be enabled or disabled based on the conditions that are specified in the ENABLE and DISABLE parameters. Because some of those conditions use STREQUAL with a single quoted argument, we have to use qt_evaluate_config_expression to circumvent the CMake bug regarding single quotes, which is described in the function implementation. Only then will enabling / disabling work correctly. Change-Id: I3b68ef611c985f0d8416fd089055fd862da1e542 Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 13d0203612c..87fe4a55dd7 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -224,9 +224,11 @@ function(qt_evaluate_feature feature) qt_evaluate_config_expression(condition ${arg_CONDITION}) endif() - if(${arg_DISABLE}) + qt_evaluate_config_expression(disable_result ${arg_DISABLE}) + qt_evaluate_config_expression(enable_result ${arg_ENABLE}) + if(${disable_result}) set(result OFF) - elseif((${arg_ENABLE}) OR (${arg_AUTODETECT})) + elseif((${enable_result}) OR (${arg_AUTODETECT})) set(result ${condition}) else() # feature not auto-detected and not explicitly enabled From d48160be9e752833ab3658d1e7f50b49b60f1a85 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Mar 2019 13:45:20 +0100 Subject: [PATCH 0292/1322] Corelib: Update to include qrc-file removal Change-Id: I18d556d7517de7d9f2eb55045511d2166f0105ce Reviewed-by: Simon Hausmann --- src/corelib/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index b12e5674732..64c43ba377c 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -968,7 +968,6 @@ extend_target(Core CONDITION QT_FEATURE_qeventtransition extend_target(Core CONDITION QT_FEATURE_mimetype SOURCES - mimetypes/mimetypes.qrc mimetypes/qmimedatabase.cpp mimetypes/qmimedatabase.h mimetypes/qmimedatabase_p.h mimetypes/qmimeglobpattern.cpp mimetypes/qmimeglobpattern_p.h mimetypes/qmimemagicrule.cpp mimetypes/qmimemagicrule_p.h @@ -978,6 +977,12 @@ extend_target(Core CONDITION QT_FEATURE_mimetype mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h ) +# Resources: +set_source_files_properties("mimetypes/mime/packages/freedesktop.org.xml" + PROPERTIES alias "freedesktop.org.xml") +add_qt_resource(Core "mimetypes" PREFIX "/qt-project.org/qmime/packages" BASE "mimetypes" FILES + mime/packages/freedesktop.org.xml) + # special case: add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" From 6e16f127ad4f1bf8f8191b72be12aa20785d816c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 11 Mar 2019 15:09:33 +0100 Subject: [PATCH 0293/1322] CMake: pro2cmake.py: Handle SIMD sources Change-Id: Ib445888e769432e8c247ae2d2fb5d8af2d5cd275 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 52 +++++++++++++++++++++++++++++++++++++++++ util/cmake/pro2cmake.py | 26 +++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6eabccb83c2..f08415d88e0 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -919,6 +919,58 @@ function(add_qt_resource target resourceName) target_sources(${target} PRIVATE "${generatedSourceCode}") endfunction() + +# Handle files that need special SIMD-related flags. +# This creates an object library and makes target link +# to it (privately). +function(add_qt_simd_part target) + qt_parse_all_arguments(arg "add_qt_simd_part" "" "" + "NAME;SIMD;${__default_private_args};COMPILE_FLAGS" ${ARGN}) + if ("x${arg_SIMD}" STREQUAL x) + message(FATAL_ERROR "add_qt_simd_part needs a SIMD type to be set.") + endif() + + set(condition "QT_FEATURE_${arg_SIMD}") + if("${arg_SIMD}" STREQUAL arch_haswell) + set(condition "TEST_subarch_avx2 AND TEST_subarch_bmi AND TEST_subarch_bmi2 AND TEST_subarch_f16c AND TEST_subarch_fma AND TEST_subarch_lzcnt AND TEST_subarch_popcnt") + elseif("${arg_SIMD}" STREQUAL avx512common) + set(condition "TEST_subarch_avx512cd") + elseif("${arg_SIMD}" STREQUAL avx512core) + set(condition "TEST_subarch_avx512cd AND TEST_subarch_avx512bw AND TEST_subarch_avx512dq AND TEST_subarch_avx512vl") + endif() + + set(name "${arg_NAME}") + if("x${name}" STREQUAL x) + set(name "${target}_simd_${arg_SIMD}") + endif() + + qt_evaluate_config_expression(result ${condition}) + if(${result}) + if(QT_CMAKE_DEBUG_EXTEND_TARGET) + message("add_qt_simd_part(${target} SIMD ${arg_SIMD} ...): Evaluated") + endif() + string(TOUPPER "QT_CFLAGS_${arg_SIMD}" simd_flags) + + add_library("${name}" OBJECT) + target_sources("${name}" PRIVATE ${arg_SOURCES}) + target_include_directories("${name}" PRIVATE + ${arg_INCLUDE_DIRECTORIES} + $) + target_compile_options("${name}" PRIVATE + ${${simd_flags}} + ${arg_COMPILE_FLAGS} + $) + target_compile_definitions("${name}" PRIVATE + $) + + target_link_libraries("${target}" PRIVATE "${name}") + else() + if(QT_CMAKE_DEBUG_EXTEND_TARGET) + message("add_qt_simd_part(${target} SIMD ${arg_SIMD} ...): Skipped") + endif() + endif() +endfunction() + # From Qt5CoreMacros # Function used to create the names of output files preserving relative dirs function(qt_make_output_file infile prefix suffix source_dir binary_dir result) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 7abb8f5a1c8..37ead105131 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1208,6 +1208,30 @@ def merge_scopes(scopes: typing.List[Scope]) -> typing.List[Scope]: return result +def write_simd_part(cm_fh: typing.IO[str], target: str, scope: Scope, indent: int = 0): + simd_options = [ 'sse2', 'sse3', 'ssse3', 'sse4_1', 'sse4_2', 'aesni', 'shani', 'avx', 'avx2', + 'avx512f', 'avx512cd', 'avx512er', 'avx512pf', 'avx512dq', 'avx512bw', + 'avx512vl', 'avx512ifma', 'avx512vbmi', 'f16c', 'rdrnd', 'neon', 'mips_dsp', + 'mips_dspr2', + 'arch_haswell', 'avx512common', 'avx512core']; + ind = spaces(indent) + + for simd in simd_options: + SIMD = simd.upper(); + sources = scope.get('{}_HEADERS'.format(SIMD), []) \ + + scope.get('{}_SOURCES'.format(SIMD), []) \ + + scope.get('{}_C_SOURCES'.format(SIMD), []) \ + + scope.get('{}_ASM'.format(SIMD), []) + + if not sources: + continue + + cm_fh.write('{}add_qt_simd_part({} SIMD {}\n'.format(ind, target, simd)) + cm_fh.write('{} SOURCES\n'.format(ind)) + cm_fh.write('{} {}\n'.format(ind, '\n{} '.format(ind).join(sources))) + cm_fh.write('{})\n\n'.format(ind)) + + def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cmake_function: str, scope: Scope, *, extra_lines: typing.List[str] = [], @@ -1243,6 +1267,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, write_resources(cm_fh, name, scope, indent) + write_simd_part(cm_fh, name, scope, indent) + # Scopes: if len(scopes) == 1: return From fbf98bf255e2fe134c3274e314b945097e2905e4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 12 Mar 2019 19:55:51 +0100 Subject: [PATCH 0294/1322] CMake: pro2cmake.py: Better reporting of unused keys from qmake Change-Id: Ie1b1f446c314bb5248cc13efeae1f279b0182e04 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 53 +++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 37ead105131..adcbaa98686 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -829,10 +829,8 @@ def write_scope_header(cm_fh: typing.IO[str], *, indent: int = 0): def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, - indent: int = 0, known_libraries=set()) \ - -> typing.Set[str]: + indent: int = 0, known_libraries=set()): ind = spaces(indent) - scope.reset_visited_keys() # mark RESOURCES as visited: scope.get('RESOURCES', '') @@ -912,25 +910,28 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, for mo in moc_options: cm_fh.write('{} "{}"\n'.format(ind, mo)) - return set(scope.keys) - scope.visited_keys - def is_simple_condition(condition: str) -> bool: return ' ' not in condition \ or (condition.startswith('NOT ') and ' ' not in condition[4:]) -def write_ignored_keys(scope: Scope, ignored_keys, indent) -> str: +def write_ignored_keys(scope: Scope, indent: str) -> str: result = '' + ignored_keys = scope.keys - scope.visited_keys for k in sorted(ignored_keys): if k == '_INCLUDED' or k == 'TARGET' or k == 'QMAKE_DOCS' or k == 'QT_SOURCE_TREE' \ - or k == 'QT_BUILD_TREE': + or k == 'QT_BUILD_TREE' or k == 'TRACEPOINT_PROVIDER': # All these keys are actually reported already continue values = scope.get(k) value_string = '' if not values \ else '"' + '" "'.join(scope.get(k)) + '"' result += '{}# {} = {}\n'.format(indent, k, value_string) + + if result: + result = '\n#### Keys ignored in scope {}:\n{}'.format(scope, result) + return result @@ -1152,29 +1153,18 @@ def write_resources(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in def write_extend_target(cm_fh: typing.IO[str], target: str, scope: Scope, indent: int = 0): + ind = spaces(indent) extend_qt_io_string = io.StringIO() - ignored_keys = write_sources_section(extend_qt_io_string, scope) + write_sources_section(extend_qt_io_string, scope) extend_qt_string = extend_qt_io_string.getvalue() - ignored_keys_report = write_ignored_keys(scope, ignored_keys, - spaces(indent + 1)) - if extend_qt_string and ignored_keys_report: - ignored_keys_report = '\n' + ignored_keys_report - extend_scope = '\n{}extend_target({} CONDITION {}\n' \ - '{}{})\n'.format(spaces(indent), target, + '{}{})\n'.format(ind, target, map_to_cmake_condition(scope.total_condition), - extend_qt_string, ignored_keys_report) + extend_qt_string, ind) if not extend_qt_string: - if ignored_keys_report: - # Comment out the generated extend_target call because there - # no sources were found, but keep it commented for - # informational purposes. - extend_scope = ''.join(['#' + line for line in - extend_scope.splitlines(keepends=True)]) - else: - extend_scope = '' # Nothing to report, so don't! + extend_scope = '' # Nothing to report, so don't! cm_fh.write(extend_scope) @@ -1249,6 +1239,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, assert len(scopes) assert scopes[0].total_condition == 'ON' + scopes[0].reset_visited_keys() + # Now write out the scopes: write_header(cm_fh, name, typename, indent=indent) @@ -1256,11 +1248,7 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, for extra_line in extra_lines: cm_fh.write('{} {}\n'.format(spaces(indent), extra_line)) - ignored_keys = write_sources_section(cm_fh, scopes[0], indent=indent, **kwargs) - ignored_keys_report = write_ignored_keys(scopes[0], ignored_keys, - spaces(indent + 1)) - if ignored_keys_report: - cm_fh.write(ignored_keys_report) + write_sources_section(cm_fh, scopes[0], indent=indent, **kwargs) # Footer: cm_fh.write('{})\n'.format(spaces(indent))) @@ -1269,6 +1257,11 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, write_simd_part(cm_fh, name, scope, indent) + ignored_keys_report = write_ignored_keys(scopes[0], spaces(indent)) + if ignored_keys_report: + cm_fh.write(ignored_keys_report) + + # Scopes: if len(scopes) == 1: return @@ -1276,7 +1269,11 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, write_scope_header(cm_fh, indent=indent) for c in scopes[1:]: + c.reset_visited_keys() write_extend_target(cm_fh, name, c, indent=indent) + ignored_keys_report = write_ignored_keys(c, spaces(indent)) + if ignored_keys_report: + cm_fh.write(ignored_keys_report) def write_module(cm_fh: typing.IO[str], scope: Scope, *, From 64147fcb3380244c0dcf744dc84f31ec917cc608 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 12 Mar 2019 21:55:58 +0100 Subject: [PATCH 0295/1322] CMake: Add QT_CFLAGS_* when building x86simd tests Change-Id: I5caa088d517cb9d3749c3ed8ef88a41552c1d340 Reviewed-by: Alexandru Croitor --- cmake/QtFeature.cmake | 13 ++++++------- cmake/QtPlatformSupport.cmake | 1 + config.tests/x86_simd/CMakeLists.txt | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 config.tests/x86_simd/CMakeLists.txt diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 87fe4a55dd7..030bcd90c97 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -413,17 +413,16 @@ function(qt_config_compile_test name) endfunction() function(qt_config_compile_test_x86simd extension label) - string(TOUPPER ${extension} extension_uppercase) if (DEFINED TEST_X86SIMD_${extension}) return() endif() - try_compile(TEST_X86SIMD_${extension} "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/x86_simd/main.cpp" - COMPILE_DEFINITIONS -DQT_COMPILER_SUPPORTS_${extension_uppercase} - OUTPUT_VARIABLE foo - ) - set(TEST_subarch_${extension} "${TEST_X86SIMD_${extension}}" CACHE INTERNAL "${label}" ) + try_compile("TEST_X86SIMD_${extension}" + "${CMAKE_CURRENT_BINARY_DIR}/config.tests/x86_simd_${extension}" + "${CMAKE_CURRENT_SOURCE_DIR}/config.tests/x86_simd" + x86_simd + CMAKE_FLAGS "-DSIMD:string=${extension}") + set(TEST_subarch_${extension} "${TEST_X86SIMD_${extension}}" CACHE INTERNAL "${label}") endfunction() function(qt_make_features_available target) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index 4f3103e304a..45479a3a7ea 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -33,6 +33,7 @@ set01(ANDROID_EMBEDDED ANDROID) # FIXME: How to identify this? set01(GCC CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set01(CLANG CMAKE_CXX_COMPILER_ID MATCHES "Clang") set01(ICC CMAKE_C_COMPILER MATCHES "icc|icl") +set01(QCC CMAKE_C_COMPILER MATCHES "qcc") # FIXME: How to identify this? if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(QT_64BIT TRUE) diff --git a/config.tests/x86_simd/CMakeLists.txt b/config.tests/x86_simd/CMakeLists.txt new file mode 100644 index 00000000000..b213cf10fca --- /dev/null +++ b/config.tests/x86_simd/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.14.0) +project(x86_simd LANGUAGES CXX) + +include(../../cmake/QtPlatformSupport.cmake) +include(../../cmake/QtCompilerOptimization.cmake) + +string(TOUPPER "${SIMD}" upper_simd) + +if(NOT DEFINED "QT_CFLAGS_${upper_simd}") + message(FATAL_ERROR "This compiler does not support ${SIMD}.") +endif() + +add_executable("SimdTest${SIMD}") +target_sources("SimdTest${SIMD}" PRIVATE main.cpp) +target_compile_options("SimdTest${SIMD}" PRIVATE ${QT_CFLAGS_${upper_simd}}) From e5b26997500a56f42be920a509821358f60aaa53 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 14 Mar 2019 11:27:38 +0100 Subject: [PATCH 0296/1322] Do define generation after feature evaluation Instead of generating defines guarded by feature ifdefs, record the define information (condition, name, value, etc), and generate the final define statement only if the feature condition evaluated to true. This removes the need to generate feature defines (QT_FEATURE_foo) for features that have neither public nor private outputs in the configure.json file. Also note that all qt_feature_definition() calls (which correspond to type:"define" outputs in json files) now generate defines only in the public header, which seems to be consistent with how qmake evaluates json files. Change-Id: I5210b405d5735dd9df5f7a55d1ea9547bb7b1159 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 62 +++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 030bcd90c97..38ff328de4d 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -21,6 +21,8 @@ function(qt_feature_module_begin) set(__QtFeature_private_extra "" PARENT_SCOPE) set(__QtFeature_public_extra "" PARENT_SCOPE) + + set(__QtFeature_define_definitions "" PARENT_SCOPE) endfunction() function(qt_feature feature) @@ -252,31 +254,44 @@ endfunction() function(qt_feature_definition feature name) qt_parse_all_arguments(arg "qt_feature_definition" "NEGATE" "VALUE" "" ${ARGN}) - # Generate code: - set(expected 1) - if (arg_NEGATE) - set(expected -1) - endif() - set(msg "\n#if defined(QT_FEATURE_${feature}) && QT_FEATURE_${feature} == ${expected}\n") - if (arg_VALUE) - string(APPEND msg "# define ${name} ${arg_VALUE}\n") - else() - string(APPEND msg "# define ${name}\n") - endif() - string(APPEND msg "#endif\n") + # Store all the define related info in a unique variable key. + set(key_name "_QT_FEATURE_DEFINE_DEFINITION_${feature}_${name}") + set(${key_name} "FEATURE;${feature};NAME;${name};${ARGN}" PARENT_SCOPE) - # Store for later use: - list(FIND __QtFeature_public_features "${feature}" public_index) - if (public_index GREATER -1) - string(APPEND __QtFeature_public_extra "${msg}") + # Store the key for later evaluation and subsequent define generation: + list(APPEND __QtFeature_define_definitions "${key_name}") + + set(__QtFeature_define_definitions ${__QtFeature_define_definitions} PARENT_SCOPE) +endfunction() + +function(qt_evaluate_feature_definition key) + if(NOT DEFINED ${key}) + qt_debug_print_variables(DEDUP MATCH "^_QT_FEATURE_DEFINE_DEFINITION") + message(FATAL_ERROR "Attempting to evaluate feature define ${key} but its definition is missing. ") endif() - list(FIND __QtFeature_private_features "${feature}" private_index) - if (private_index GREATER -1) - string(APPEND __QtFeature_private_extra "${msg}") + + cmake_parse_arguments(arg + "NEGATE;" + "FEATURE;NAME;VALUE;" "" ${${key}}) + + set(expected ON) + if (arg_NEGATE) + set(expected OFF) + endif() + + set(msg "") + + if(QT_FEATURE_${arg_FEATURE} STREQUAL expected) + if (arg_VALUE) + string(APPEND msg "#define ${arg_NAME} ${arg_VALUE}\n") + else() + string(APPEND msg "#define ${arg_NAME}\n") + endif() + + string(APPEND __QtFeature_public_extra "${msg}") endif() set(__QtFeature_public_extra ${__QtFeature_public_extra} PARENT_SCOPE) - set(__QtFeature_private_extra ${__QtFeature_private_extra} PARENT_SCOPE) endfunction() function(qt_extra_definition name value) @@ -345,6 +360,11 @@ function(qt_feature_module_end target) endif() endforeach() + foreach(key ${__QtFeature_define_definitions}) + qt_evaluate_feature_definition(${key}) + unset(${key} PARENT_SCOPE) + endforeach() + foreach(feature ${all_features}) unset(_QT_FEATURE_DEFINITION_${feature} PARENT_SCOPE) endforeach() @@ -386,6 +406,8 @@ function(qt_feature_module_end target) unset(__QtFeature_private_extra PARENT_SCOPE) unset(__QtFeature_public_extra PARENT_SCOPE) + + unset(__QtFeature_define_definitions PARENT_SCOPE) endfunction() function(qt_config_compile_test name) From 37b154858f41c0aa32ad124878fae96c39563d39 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 14 Mar 2019 13:16:13 +0100 Subject: [PATCH 0297/1322] Improve configurejson2cmake feature output generation There were a few cases of feature outputs that were handled incorrectly before this change, specifically: - publicFeatures and privateFeatures with custom names - privateFeatures that also ended up writing defines into public headers - publicFeatures that ended up in private headers - internal features (that should have no QT_FEATURE_foo defines) that were still written to either public or private headers The change takes care of all those cases by keeping a map of which features need to be written along with any visibility specifications, as well as custom name changes. Change-Id: I37baeaeacdfe4935128a392c72ca71b5c3ca1c8d Reviewed-by: Simon Hausmann --- util/cmake/configurejson2cmake.py | 98 ++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 28 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 244bc4ae4c2..fe2bf50eaad 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -802,9 +802,11 @@ def parseFeature(ctx, feature, data, cm_fh): # feature that is only used in the conditions of other features output = ["internalFeature"] - publicInfo = False - privateInfo = False - internalFeature = False + publicFeature = False # #define QT_FEATURE_featurename in public header + privateFeature = False # #define QT_FEATURE_featurename in private header + negativeFeature = False # #define QT_NO_featurename in public header + internalFeature = False # No custom or QT_FEATURE_ defines + publicDefine = False # #define MY_CUSTOM_DEFINE in public header for o in output: outputType = o @@ -815,44 +817,84 @@ def parseFeature(ctx, feature, data, cm_fh): if outputType in ['varAssign', 'varAppend', 'varRemove', 'publicQtConfig', 'privateConfig', 'publicConfig']: continue - - elif outputType in ['feature', 'publicFeature', 'define']: - publicInfo = True + elif outputType == 'define': + publicDefine = True + elif outputType == 'feature': + negativeFeature = True + elif outputType == 'publicFeature': + publicFeature = True elif outputType == 'privateFeature': - privateInfo = True + privateFeature = True elif outputType == 'internalFeature': internalFeature = True else: print(' XXXX UNHANDLED OUTPUT TYPE {} in feature {}.'.format(outputType, feature)) continue - if not publicInfo and not privateInfo and not internalFeature: + if not any([publicFeature, privateFeature, internalFeature, publicDefine, negativeFeature]): print(' **** Skipping feature {}: Not relevant for C++.'.format(feature)) return - # write feature: cxxFeature = featureName(feature) - if comment: - cm_fh.write('# {}\n'.format(comment)) - cm_fh.write('qt_feature("{}"'.format(cxxFeature)) - if publicInfo: - cm_fh.write(' PUBLIC') - if privateInfo: - cm_fh.write(' PRIVATE') - cm_fh.write('\n') + def writeFeature(name, publicFeature=False, privateFeature=False, labelAppend=''): + if comment: + cm_fh.write('# {}\n'.format(comment)) - cm_fh.write(lineify('SECTION', section)) - cm_fh.write(lineify('LABEL', label)) - if purpose != label: - cm_fh.write(lineify('PURPOSE', purpose)) - cm_fh.write(lineify('AUTODETECT', autoDetect, quote=False)) - cm_fh.write(lineify('CONDITION', condition, quote=False)) - cm_fh.write(lineify('ENABLE', enable, quote=False)) - cm_fh.write(lineify('DISABLE', disable, quote=False)) - cm_fh.write(lineify('EMIT_IF', emitIf, quote=False)) - cm_fh.write(')\n') + cm_fh.write('qt_feature("{}"'.format(name)) + if publicFeature: + cm_fh.write(' PUBLIC') + if privateFeature: + cm_fh.write(' PRIVATE') + cm_fh.write('\n') + cm_fh.write(lineify('SECTION', section)) + cm_fh.write(lineify('LABEL', label + labelAppend)) + if purpose != label: + cm_fh.write(lineify('PURPOSE', purpose)) + cm_fh.write(lineify('AUTODETECT', autoDetect, quote=False)) + cm_fh.write(lineify('CONDITION', condition, quote=False)) + cm_fh.write(lineify('ENABLE', enable, quote=False)) + cm_fh.write(lineify('DISABLE', disable, quote=False)) + cm_fh.write(lineify('EMIT_IF', emitIf, quote=False)) + cm_fh.write(')\n') + + # Write qt_feature() calls before any qt_feature_definition() calls + + # Default internal feature case. + featureCalls = {} + featureCalls[cxxFeature] = {'name': cxxFeature, 'labelAppend': ''} + + # Go over all outputs to compute the number of features that have to be declared + for o in output: + outputType = o + name = cxxFeature + + # The label append is to provide a unique label for features that have more than one output + # with different names. + labelAppend = '' + + if isinstance(o, dict): + outputType = o['type'] + if 'name' in o: + name = o['name'] + labelAppend = ': {}'.format(o['name']) + + if outputType not in ['feature', 'publicFeature', 'privateFeature']: + continue + if name not in featureCalls: + featureCalls[name] = {'name': name, 'labelAppend': labelAppend} + + if outputType in ['feature', 'publicFeature']: + featureCalls[name]['publicFeature'] = True + elif outputType == 'privateFeature': + featureCalls[name]['privateFeature'] = True + + # Write the qt_feature() calls from the computed feature map + for _, args in featureCalls.items(): + writeFeature(**args) + + # Write qt_feature_definition() calls for o in output: outputType = o outputArgs = {} @@ -860,7 +902,7 @@ def parseFeature(ctx, feature, data, cm_fh): outputType = o['type'] outputArgs = o - # Map feature to define: + # Map negative feature to define: if outputType == 'feature': outputType = 'define' outputArgs = {'name': 'QT_NO_{}'.format(cxxFeature.upper()), From 4f1a155909dfcba7353ebe9eee669d65336bd943 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 14 Mar 2019 13:22:09 +0100 Subject: [PATCH 0298/1322] Regenerate cmake files from configure.json files The new files represent the json features more closely. This helps with various build issues as well, like dynamicgl feature not being present before. Change-Id: I433592f48e0550700226a635492a3ce15af743c1 Reviewed-by: Simon Hausmann --- configure.cmake | 62 ++++++++++++++++++++----------------- src/corelib/configure.cmake | 14 ++++----- src/gui/configure.cmake | 14 ++++++--- src/network/configure.cmake | 6 ++-- 4 files changed, 53 insertions(+), 43 deletions(-) diff --git a/configure.cmake b/configure.cmake index 2a8bbd336f1..c12b7d3b876 100644 --- a/configure.cmake +++ b/configure.cmake @@ -192,10 +192,14 @@ qt_feature("android_style_assets" PRIVATE LABEL "Android Style Assets" CONDITION ANDROID ) -qt_feature("developer_build" PUBLIC PRIVATE +qt_feature("developer_build" LABEL "Developer build" AUTODETECT OFF ) +qt_feature("private_tests" PRIVATE + LABEL "Developer build: private_tests" + AUTODETECT OFF +) qt_feature_definition("developer_build" "QT_BUILD_INTERNAL") qt_feature("appstore_compliant" PUBLIC LABEL "App store compliance" @@ -215,132 +219,132 @@ qt_feature("framework" PUBLIC CONDITION APPLE AND BUILD_SHARED_LIBS ) qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD") -qt_feature("largefile" PUBLIC +qt_feature("largefile" LABEL "Large file support" CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT WINRT ) qt_feature_definition("largefile" "QT_LARGEFILE_SUPPORT" VALUE "64") -qt_feature("reduce_exports" PUBLIC PRIVATE +qt_feature("reduce_exports" PRIVATE LABEL "Reduce amount of exported symbols" CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY ) qt_feature_definition("reduce_exports" "QT_VISIBILITY_AVAILABLE") -qt_feature("sse2" PUBLIC PRIVATE +qt_feature("sse2" PRIVATE LABEL "SSE2" CONDITION ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) ) AND TEST_subarch_sse2 ) qt_feature_definition("sse2" "QT_COMPILER_SUPPORTS_SSE2" VALUE "1") -qt_feature("sse3" PUBLIC +qt_feature("sse3" LABEL "SSE3" CONDITION QT_FEATURE_sse2 AND TEST_subarch_sse3 ) qt_feature_definition("sse3" "QT_COMPILER_SUPPORTS_SSE3" VALUE "1") -qt_feature("ssse3" PUBLIC +qt_feature("ssse3" LABEL "SSSE3" CONDITION QT_FEATURE_sse3 AND TEST_subarch_ssse3 ) qt_feature_definition("ssse3" "QT_COMPILER_SUPPORTS_SSSE3" VALUE "1") -qt_feature("sse4_1" PUBLIC +qt_feature("sse4_1" LABEL "SSE4.1" CONDITION QT_FEATURE_ssse3 AND TEST_subarch_sse4_1 ) qt_feature_definition("sse4_1" "QT_COMPILER_SUPPORTS_SSE4_1" VALUE "1") -qt_feature("sse4_2" PUBLIC +qt_feature("sse4_2" LABEL "SSE4.2" CONDITION QT_FEATURE_sse4_1 AND TEST_subarch_sse4_2 ) qt_feature_definition("sse4_2" "QT_COMPILER_SUPPORTS_SSE4_2" VALUE "1") -qt_feature("avx" PUBLIC +qt_feature("avx" LABEL "AVX" CONDITION QT_FEATURE_sse4_2 AND TEST_subarch_avx ) qt_feature_definition("avx" "QT_COMPILER_SUPPORTS_AVX" VALUE "1") -qt_feature("f16c" PUBLIC +qt_feature("f16c" LABEL "F16C" - CONDITION QT_FEATURE_avx AND TEST_subarch_c16c + CONDITION QT_FEATURE_avx AND TEST_subarch_f16c ) qt_feature_definition("f16c" "QT_COMPILER_SUPPORTS_F16C" VALUE "1") -qt_feature("avx2" PUBLIC PRIVATE +qt_feature("avx2" PRIVATE LABEL "AVX2" CONDITION QT_FEATURE_avx AND TEST_subarch_avx2 ) qt_feature_definition("avx2" "QT_COMPILER_SUPPORTS_AVX2" VALUE "1") -qt_feature("avx512f" PUBLIC +qt_feature("avx512f" LABEL "F" CONDITION QT_FEATURE_avx2 AND TEST_subarch_avx512f ) qt_feature_definition("avx512f" "QT_COMPILER_SUPPORTS_AVX512F" VALUE "1") -qt_feature("avx512er" PUBLIC +qt_feature("avx512er" LABEL "ER" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512er ) qt_feature_definition("avx512er" "QT_COMPILER_SUPPORTS_AVX512ER" VALUE "1") -qt_feature("avx512cd" PUBLIC +qt_feature("avx512cd" LABEL "CD" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512cd ) qt_feature_definition("avx512cd" "QT_COMPILER_SUPPORTS_AVX512CD" VALUE "1") -qt_feature("avx512pf" PUBLIC +qt_feature("avx512pf" LABEL "PF" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512pf ) qt_feature_definition("avx512pf" "QT_COMPILER_SUPPORTS_AVX512PF" VALUE "1") -qt_feature("avx512dq" PUBLIC +qt_feature("avx512dq" LABEL "DQ" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512dq ) qt_feature_definition("avx512dq" "QT_COMPILER_SUPPORTS_AVX512DQ" VALUE "1") -qt_feature("avx512bw" PUBLIC +qt_feature("avx512bw" LABEL "BW" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512bw ) qt_feature_definition("avx512bw" "QT_COMPILER_SUPPORTS_AVX512BW" VALUE "1") -qt_feature("avx512vl" PUBLIC +qt_feature("avx512vl" LABEL "VL" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512vl ) qt_feature_definition("avx512vl" "QT_COMPILER_SUPPORTS_AVX512VL" VALUE "1") -qt_feature("avx512ifma" PUBLIC +qt_feature("avx512ifma" LABEL "IFMA" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512ifma ) qt_feature_definition("avx512ifma" "QT_COMPILER_SUPPORTS_AVX512IFMA" VALUE "1") -qt_feature("avx512vbmi" PUBLIC +qt_feature("avx512vbmi" LABEL "VBMI" CONDITION QT_FEATURE_avx512f AND TEST_subarch_avx512vbmi ) qt_feature_definition("avx512vbmi" "QT_COMPILER_SUPPORTS_AVX512VBMI" VALUE "1") -qt_feature("aesni" PUBLIC +qt_feature("aesni" LABEL "AES" CONDITION QT_FEATURE_sse2 AND TEST_subarch_aes ) qt_feature_definition("aesni" "QT_COMPILER_SUPPORTS_AES" VALUE "1") -qt_feature("rdrnd" PUBLIC +qt_feature("rdrnd" LABEL "RDRAND" CONDITION TEST_subarch_rdseed ) qt_feature_definition("rdrnd" "QT_COMPILER_SUPPORTS_RDRND" VALUE "1") -qt_feature("shani" PUBLIC +qt_feature("shani" LABEL "SHA" CONDITION QT_FEATURE_sse2 AND TEST_subarch_sha ) qt_feature_definition("shani" "QT_COMPILER_SUPPORTS_SHA" VALUE "1") -qt_feature("x86SimdAlways" PUBLIC +qt_feature("x86SimdAlways" LABEL "Intrinsics without -mXXX option" CONDITION ( ( TEST_architecture_arch STREQUAL i386 ) OR ( TEST_architecture_arch STREQUAL x86_64 ) ) AND ON ) qt_feature_definition("x86SimdAlways" "QT_COMPILER_SUPPORTS_SIMD_ALWAYS" VALUE "1") -qt_feature("mips_dsp" PUBLIC +qt_feature("mips_dsp" LABEL "DSP" CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_subarch_dsp ) qt_feature_definition("mips_dsp" "QT_COMPILER_SUPPORTS_MIPS_DSP" VALUE "1") -qt_feature("mips_dspr2" PUBLIC +qt_feature("mips_dspr2" LABEL "DSPr2" CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_subarch_dspr2 ) qt_feature_definition("mips_dspr2" "QT_COMPILER_SUPPORTS_MIPS_DSPR2" VALUE "1") -qt_feature("neon" PUBLIC +qt_feature("neon" LABEL "NEON" CONDITION ( ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 ) ) AND TEST_subarch_neon ) @@ -400,7 +404,7 @@ qt_feature("sql" PRIVATE qt_feature("testlib" PRIVATE LABEL "Qt Testlib" ) -qt_feature("widgets" PUBLIC PRIVATE +qt_feature("widgets" PRIVATE LABEL "Qt Widgets" AUTODETECT NOT APPLE_TVOS AND NOT APPLE_WATCHOS CONDITION QT_FEATURE_gui diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 73881a8668f..38eac75a415 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -403,9 +403,9 @@ qt_feature("iconv" PUBLIC PRIVATE qt_feature_definition("iconv" "QT_NO_ICONV" NEGATE VALUE "1") qt_feature("posix_libiconv" PRIVATE LABEL "POSIX iconv" - CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv - ENABLE INPUT_iconv STREQUAL 'posix' - DISABLE INPUT_iconv STREQUAL 'sun' OR INPUT_iconv STREQUAL 'gnu' OR INPUT_iconv STREQUAL 'no' + CONDITION NOT WIN32 AND NOT QNX AND NOT ANDROID AND NOT APPLE AND TEST_posix_iconv AND TEST_iconv_needlib + ENABLE TEST_posix_iconv AND TEST_iconv_needlib + DISABLE NOT TEST_posix_iconv OR NOT TEST_iconv_needlib ) qt_feature("sun_libiconv" LABEL "SUN iconv" @@ -429,7 +429,7 @@ qt_feature("inotify" PUBLIC PRIVATE CONDITION TEST_inotify ) qt_feature_definition("inotify" "QT_NO_INOTIFY" NEGATE VALUE "1") -qt_feature("ipc_posix" PUBLIC +qt_feature("ipc_posix" LABEL "Using POSIX IPC" AUTODETECT NOT WIN32 CONDITION NOT TEST_ipc_sysv AND TEST_ipc_posix @@ -472,7 +472,7 @@ qt_feature("poll_poll" PRIVATE CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND TEST_poll EMIT_IF NOT WIN32 ) -qt_feature("poll_select" PUBLIC PRIVATE +qt_feature("poll_select" PRIVATE LABEL "Emulated poll()" CONDITION NOT QT_FEATURE_poll_ppoll AND NOT QT_FEATURE_poll_pollts AND NOT QT_FEATURE_poll_poll EMIT_IF NOT WIN32 @@ -500,7 +500,7 @@ qt_feature("syslog" PRIVATE AUTODETECT OFF CONDITION TEST_syslog ) -qt_feature("threadsafe_cloexec" PUBLIC +qt_feature("threadsafe_cloexec" LABEL "Threadsafe pipe creation" CONDITION TEST_cloexec ) @@ -587,7 +587,7 @@ qt_feature("library" PUBLIC SECTION "File I/O" LABEL "QLibrary" PURPOSE "Provides a wrapper for dynamically loaded libraries." - CONDITION WIN32 OR HPUX OR ( NOT NACL AND UNIX ) + CONDITION WIN32 OR HPUX OR ( NOT NACL AND ON ) ) qt_feature_definition("library" "QT_NO_LIBRARY" NEGATE VALUE "1") qt_feature("settings" PUBLIC diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 03a3734691b..157898953e2 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -562,12 +562,18 @@ qt_feature("opengl_desktop" ENABLE INPUT_opengl STREQUAL 'desktop' DISABLE INPUT_opengl STREQUAL 'es2' OR INPUT_opengl STREQUAL 'dynamic' OR INPUT_opengl STREQUAL 'no' ) -qt_feature("opengl_dynamic" PUBLIC +qt_feature("opengl_dynamic" LABEL "Dynamic OpenGL" AUTODETECT OFF CONDITION WIN32 AND NOT WINRT ENABLE INPUT_opengl STREQUAL 'dynamic' ) +qt_feature("dynamicgl" PUBLIC + LABEL "Dynamic OpenGL: dynamicgl" + AUTODETECT OFF + CONDITION WIN32 AND NOT WINRT + ENABLE INPUT_opengl STREQUAL 'dynamic' +) qt_feature_definition("opengl_dynamic" "QT_OPENGL_DYNAMIC") qt_feature("opengl" PUBLIC LABEL "OpenGL" @@ -632,7 +638,7 @@ qt_feature("eglfs_openwfd" PRIVATE LABEL "EGLFS OpenWFD" CONDITION INTEGRITY AND QT_FEATURE_eglfs AND TEST_egl_openwfd ) -qt_feature("gif" PUBLIC PRIVATE +qt_feature("gif" PRIVATE LABEL "GIF" CONDITION QT_FEATURE_imageformatplugin ) @@ -642,13 +648,13 @@ qt_feature("ico" PUBLIC PRIVATE CONDITION QT_FEATURE_imageformatplugin ) qt_feature_definition("ico" "QT_NO_ICO" NEGATE VALUE "1") -qt_feature("jpeg" PUBLIC PRIVATE +qt_feature("jpeg" PRIVATE LABEL "JPEG" CONDITION QT_FEATURE_imageformatplugin AND JPEG_FOUND DISABLE INPUT_libjpeg STREQUAL 'no' ) qt_feature_definition("jpeg" "QT_NO_IMAGEFORMAT_JPEG" NEGATE) -qt_feature("png" PUBLIC PRIVATE +qt_feature("png" PRIVATE LABEL "PNG" DISABLE INPUT_libpng STREQUAL 'no' ) diff --git a/src/network/configure.cmake b/src/network/configure.cmake index e2c4d20d636..38a3ff30992 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -156,7 +156,7 @@ qt_feature("linux_netlink" PRIVATE LABEL "Linux AF_NETLINK" CONDITION LINUX AND TEST_linux_netlink ) -qt_feature("openssl" PUBLIC PRIVATE +qt_feature("openssl" PRIVATE LABEL "OpenSSL" AUTODETECT NOT WINRT AND NOT WASM CONDITION NOT QT_FEATURE_securetransport AND ( QT_FEATURE_openssl_linked OR OPENSSL_INCLUDE_DIR ) @@ -164,14 +164,14 @@ qt_feature("openssl" PUBLIC PRIVATE DISABLE INPUT_openssl STREQUAL 'no' OR INPUT_ssl STREQUAL 'no' ) qt_feature_definition("openssl" "QT_NO_OPENSSL" NEGATE) -qt_feature("openssl_linked" PUBLIC PRIVATE +qt_feature("openssl_linked" PRIVATE LABEL " Qt directly linked to OpenSSL" CONDITION NOT QT_FEATURE_securetransport AND OpenSSL_FOUND ENABLE INPUT_openssl STREQUAL 'linked' DISABLE ( NOT INPUT_openssl STREQUAL 'linked' ) ) qt_feature_definition("openssl_linked" "QT_LINKED_OPENSSL") -qt_feature("securetransport" PUBLIC PRIVATE +qt_feature("securetransport" PRIVATE LABEL "SecureTransport" CONDITION APPLE AND ( INPUT_openssl STREQUAL '' OR INPUT_openssl STREQUAL 'no' ) DISABLE INPUT_securetransport STREQUAL 'no' OR INPUT_ssl STREQUAL 'no' From 3f03917b54ace1041f7a640dc65b452b0275fafc Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 11 Mar 2019 12:34:52 +0100 Subject: [PATCH 0299/1322] Fix Windows build - Fix qmake build - Fix QtNetwork moc-ing, by including the moc files inside the cpp files - Fix sql odbc plugin by including QT_PLUGIN define - Fix Boostrap to link against the Platform target, to get the correct Unicode and WIN64 defines. - Fix vulkan headers to be found - Fix freetype bzip and png unresolved symbols / linker issues when building minimal platform plugin (also need to make sure to use the vcpkg toolchain instead of CMAKE_PREFIX_PATH because then find_package is overridden, which does magic to properly propagate static library dependencies). - Fix qfilesystementry test not to be built without private tests feature (it led to undefined symbols issues). - Make sure to remove QT_NO_CAST_TO_ASCII define when building QtCore, so that the qstringbuilder3 test builds successfully. Task-number: QTBUG-74140 Change-Id: I353d08392b604d55f8e62cdd8696d1e19a3c084a Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 5 + qmake/CMakeLists.txt | 15 +++ src/corelib/CMakeLists.txt | 10 +- src/network/CMakeLists.txt | 6 + src/network/socket/qhttpsocketengine.cpp | 2 + src/network/socket/qnativesocketengine.cpp | 2 + src/network/socket/qsocks5socketengine.cpp | 2 + .../fontdatabases/CMakeLists.txt | 107 +++++++++--------- .../vkconvenience/CMakeLists.txt | 4 + src/plugins/sqldrivers/odbc/qsql_odbc.cpp | 2 + src/tools/bootstrap/CMakeLists.txt | 1 + tests/auto/corelib/io/CMakeLists.txt | 4 +- 12 files changed, 105 insertions(+), 55 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f08415d88e0..e7ae97e5038 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -707,6 +707,7 @@ function(add_qt_plugin target) QT_BUILDING_QT QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" + QT_PLUGIN PUBLIC_DEFINES QT_${module_upper}_LIB ${arg_PUBLIC_DEFINES} @@ -722,6 +723,10 @@ function(add_qt_plugin target) MOC_OPTIONS ${arg_MOC_OPTIONS} ) + if(NOT ${QT_BUILD_SHARED_LIBS}) + extend_target("${target}" DEFINES QT_STATICPLUGIN) + endif() + install(TARGETS "${target}" EXPORT "${target}Targets" LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${arg_TYPE} ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${arg_TYPE} diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 14211480dd2..dc4c88f2a5f 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -134,6 +134,21 @@ extend_target(qmake CONDITION APPLE_OSX ${FWApplicationServices} ${FWCoreServices} ${FWFoundation} ) # TODO: Windows support, cf. qmake.pro +extend_target(qmake CONDITION WIN32 + SOURCES + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemengine_win.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfilesystemiterator_win.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qfsfileengine_win.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/tools/qlocale_win.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/global/qoperatingsystemversion_win.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/io/qsettings_win.cpp + ${PROJECT_SOURCE_DIR}/src/corelib/plugin/qsystemlibrary.cpp + generators/win32/registry.cpp + DEFINES + UNICODE _ENABLE_EXTENDED_ALIGNED_STORAGE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS + LIBRARIES + ole32 advapi32 kernel32 netapi32 +) set_target_properties(qmake PROPERTIES AUTOMOC OFF diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 64c43ba377c..ca6893b75fa 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -560,8 +560,6 @@ extend_target(Core CONDITION UNIX kernel/qpoll_p.h kernel/qtimerinfo_unix.cpp kernel/qtimerinfo_unix_p.h thread/qthread_unix.cpp - DEFINES - QT_NO_CAST_TO_ASCII # special case: Add that here instead of removing it in WIN32! ) extend_target(Core CONDITION QT_FEATURE_thread @@ -1000,6 +998,14 @@ set_source_files_properties( thread/qmutex_win.cpp PROPERTIES HEADER_FILE_ONLY ON) # special case: These files are included by qmutex.cpp! +# special case +# Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library. +if(WIN32) + get_target_property(defines Core COMPILE_DEFINITIONS) + list(REMOVE_ITEM defines QT_NO_CAST_TO_ASCII) + set_target_properties(Core PROPERTIES COMPILE_DEFINITIONS "${defines}") +endif() + qt_internal_add_link_flags_gc_sections(Core PRIVATE) # special case qt_create_tracepoints(Core ./qtcore.tracepoints) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 187800b1c2d..bfcf89bad21 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -379,4 +379,10 @@ extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 crypt32 ) +# Special case, from mkspecs/common/msvc-desktop.conf +extend_target(Network CONDITION WIN32 + LIBRARIES + ws2_32 +) + add_qt_docs(./doc/qtnetwork.qdocconf) diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index 9427c3b00d8..1dd99112c2c 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -866,3 +866,5 @@ QAbstractSocketEngine *QHttpSocketEngineHandler::createSocketEngine(qintptr, QOb QT_END_NAMESPACE #endif // !QT_NO_NETWORKPROXY + +#include "moc_qhttpsocketengine_p.cpp" diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 8947a7ee8ad..f78f874f400 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -1382,3 +1382,5 @@ void QNativeSocketEngine::setExceptionNotificationEnabled(bool enable) } QT_END_NAMESPACE + +#include "moc_qnativesocketengine_p.cpp" diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index a07ea650469..30bc8ae7d50 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -1937,3 +1937,5 @@ QAbstractSocketEngine *QSocks5SocketEngineHandler::createSocketEngine(qintptr so } QT_END_NAMESPACE + +#include "moc_qsocks5socketengine_p.cpp" diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 7033af1737b..4a410e0c011 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -1,30 +1,26 @@ # Generated from fontdatabases.pro. ##################################################################### -## QtFontDatabaseSupport Module: +## FontDatabaseSupport Module: ##################################################################### -find_package(Freetype) -find_library(FWCoreGraphics CoreGraphics) -find_library(FWCoreFoundation CoreFoundation) -find_library(FWCoreText CoreText) -find_library(FWFoundation Foundation) -find_library(FWAppKit AppKit) +find_package(Freetype) # Special case add_qt_module(FontDatabaseSupport STATIC - SOURCES fake.cpp DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES Qt::CorePrivate Qt::GuiPrivate + # CONFIG = "static" "internal_module" + # MODULE = "fontdatabase_support" + # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" + # _LOADED = "qt_module" ) -set_source_files_properties(fake.cpp PROPERTIES - SKIP_AUTOMOC ON - SKIP_AUTOUIC ON - SKIP_AUTORCC ON -) + +## Scopes: +##################################################################### extend_target(FontDatabaseSupport CONDITION APPLE SOURCES @@ -35,7 +31,9 @@ extend_target(FontDatabaseSupport CONDITION APPLE ${FWCoreGraphics} ${FWCoreText} ${FWFoundation} - ${FWAppKit} + ${FWAppKit} # Special case + + # CONFIG = "watchos_coretext" ) extend_target(FontDatabaseSupport CONDITION APPLE AND QT_FEATURE_freetype @@ -58,7 +56,7 @@ extend_target(FontDatabaseSupport CONDITION UNIX genericunix/qgenericunixfontdatabase_p.h ) -extend_target(FontDatabaseSupport CONDITION UNIX AND QT_FEATURE_fontconfig +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_fontconfig AND UNIX SOURCES fontconfig/qfontconfigdatabase.cpp fontconfig/qfontconfigdatabase_p.h fontconfig/qfontenginemultifontconfig.cpp fontconfig/qfontenginemultifontconfig_p.h @@ -66,46 +64,51 @@ extend_target(FontDatabaseSupport CONDITION UNIX AND QT_FEATURE_fontconfig fontconfig ) -#extend_target(FontDatabaseSupport CONDITION WIN32 -#) +extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT + SOURCES + windows/qwindowsfontdatabase.cpp windows/qwindowsfontdatabase_p.h + windows/qwindowsfontengine.cpp windows/qwindowsfontengine_p.h + windows/qwindowsnativeimage.cpp windows/qwindowsnativeimage_p.h + LIBRARIES + Qt::GuiPrivate + ole32 + gdi32 + user32 + advapi32 +) -#extend_target(FontDatabaseSupport CONDITION (WIN32) AND (NOT WINRT) -# SOURCES -# qwindowsfontdatabase.cpp qwindowsfontdatabase_p.h -# qwindowsfontengine.cpp qwindowsfontengine_p.h -# qwindowsnativeimage.cpp qwindowsnativeimage_p.h -# LIBRARIES -# Qt::GuiPrivate -#) +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 AND NOT WINRT + SOURCES + windows/qwindowsfontdatabase_ft.cpp windows/qwindowsfontdatabase_ft_p.h +) -#extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (QT_FEATURE_freetype) -# SOURCES -# qwindowsfontdatabase_ft.cpp qwindowsfontdatabase_ft_p.h -#) +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_directwrite AND WIN32 AND NOT WINRT + SOURCES + windows/qwindowsfontenginedirectwrite.cpp windows/qwindowsfontenginedirectwrite_p.h +) -#extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (QT_FEATURE_directwrite) -# SOURCES -# qwindowsfontenginedirectwrite.cpp qwindowsfontenginedirectwrite_p.h -#) +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT WINRT + DEFINES + QT_USE_DIRECTWRITE2 +) -#extend_target(FontDatabaseSupport CONDITION (((WIN32) AND (NOT WINRT)) AND (QT_FEATURE_directwrite)) AND (QT_FEATURE_directwrite2) -# DEFINES -# QT_USE_DIRECTWRITE2 -#) +extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT QT_FEATURE_directwrite AND NOT WINRT + DEFINES + QT_NO_DIRECTWRITE +) -#extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (NOT QT_FEATURE_directwrite) -# DEFINES -# QT_NO_DIRECTWRITE -#) -## -##extend_target(FontDatabaseSupport CONDITION ((WIN32) AND (NOT WINRT)) AND (mingw) -##) +extend_target(FontDatabaseSupport CONDITION WIN32 AND mingw AND NOT WINRT + LIBRARIES + uuid +) -#extend_target(FontDatabaseSupport CONDITION WINRT -# SOURCES -# qwinrtfontdatabase.cpp qwinrtfontdatabase_p.h -# DEFINES -# __WRL_NO_DEFAULT_LIB__ -# LIBRARIES -# Qt::GuiPrivate -#) +extend_target(FontDatabaseSupport CONDITION WINRT + SOURCES + winrt/qwinrtfontdatabase.cpp winrt/qwinrtfontdatabase_p.h + DEFINES + __WRL_NO_DEFAULT_LIB__ + LIBRARIES + Qt::GuiPrivate + ws2_32 + dwrite +) diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt index b9504f2b941..ced2db5e206 100644 --- a/src/platformsupport/vkconvenience/CMakeLists.txt +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -4,6 +4,9 @@ ## VulkanSupport Module: ##################################################################### +# Special case. +find_package(Vulkan) + add_qt_module(VulkanSupport STATIC SOURCES @@ -13,4 +16,5 @@ add_qt_module(VulkanSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + Vulkan::Vulkan ) diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp index 1fbbcd0ef18..74abed56a98 100644 --- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp +++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp @@ -2649,3 +2649,5 @@ bool QODBCDriver::isIdentifierEscaped(const QString &identifier, IdentifierType) } QT_END_NAMESPACE + +#include "moc_qsql_odbc_p.cpp" diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt index 4bbbe08ea51..69e334c4921 100644 --- a/src/tools/bootstrap/CMakeLists.txt +++ b/src/tools/bootstrap/CMakeLists.txt @@ -97,6 +97,7 @@ extend_target(Bootstrap $ PUBLIC_LIBRARIES # special case ZLIB::ZLIB + Qt::Platform # CONFIG = "minimal_syncqt" "internal_module" "force_bootstrap" "gc_binaries" # INSTALLS = "lib" # MODULE_CONFIG = "gc_binaries" diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt index 3cebec6d9da..e1b4f931cdd 100644 --- a/tests/auto/corelib/io/CMakeLists.txt +++ b/tests/auto/corelib/io/CMakeLists.txt @@ -1,7 +1,9 @@ add_subdirectory(largefile) add_subdirectory(qbuffer) add_subdirectory(qdataurl) -add_subdirectory(qfilesystementry) +if(QT_FEATURE_private_tests) + add_subdirectory(qfilesystementry) +endif() add_subdirectory(qfilesystemwatcher) add_subdirectory(qipaddress) # add_subdirectory(qloggingcategory) From a9af99c926a4f7da597a965923328cfdc112004a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 7 Mar 2019 19:54:52 +0100 Subject: [PATCH 0300/1322] Add windows platform plugin and its requirements - executed pro2cmake script on windows qpa plugin - added windowsuiautomation platformsupport project - fixed plugin dlls and lib files to be written to the same path - fixed an issue comErrorString which used implicit casting from QString to char*, but plugins are currently built with QT_NO_CAST_TO_ASCII Task-number: QTBUG-74140 Change-Id: I5db3b6c5264bbd5dfba2998b049fda36eb312c70 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 3 +- src/platformsupport/CMakeLists.txt | 3 + .../windowsuiautomation/CMakeLists.txt | 27 +++ src/plugins/platforms/CMakeLists.txt | 2 +- src/plugins/platforms/windows/CMakeLists.txt | 187 ++++++++++++++++++ .../platforms/windows/qwindowscontext.cpp | 2 +- 6 files changed, 221 insertions(+), 3 deletions(-) create mode 100644 src/platformsupport/windowsuiautomation/CMakeLists.txt create mode 100644 src/plugins/platforms/windows/CMakeLists.txt diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index e7ae97e5038..1bbe12d8301 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -681,7 +681,8 @@ function(add_qt_plugin target) set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") qt_internal_library_deprecation_level(deprecation_define) diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index 826cda39032..ece4eed2aab 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -23,6 +23,9 @@ if(QT_FEATURE_accessibility) if(QT_FEATURE_accessibility_atspi_bridge) add_subdirectory(linuxaccessibility) endif() + if(WIN32 AND NOT WINRT) + add_subdirectory(windowsuiautomation) + endif() endif() if(QT_FEATURE_vulkan) diff --git a/src/platformsupport/windowsuiautomation/CMakeLists.txt b/src/platformsupport/windowsuiautomation/CMakeLists.txt new file mode 100644 index 00000000000..542a7369669 --- /dev/null +++ b/src/platformsupport/windowsuiautomation/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from windowsuiautomation.pro. + +##################################################################### +## WindowsUIAutomationSupport Module: +##################################################################### + +add_qt_module(WindowsUIAutomationSupport + STATIC + SOURCES + qwindowsuiawrapper.cpp qwindowsuiawrapper_p.h + uiaattributeids_p.h + uiaclientinterfaces_p.h + uiacontroltypeids_p.h + uiaerrorids_p.h + uiaeventids_p.h + uiageneralids_p.h + uiapatternids_p.h + uiapropertyids_p.h + uiaserverinterfaces_p.h + uiatypes_p.h + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + # CONFIG = "static" "internal_module" + # MODULE = "windowsuiautomation_support" + # _LOADED = "qt_module" +) diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index e5f66e31761..a6dfadc7e86 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -23,7 +23,7 @@ if(APPLE_OSX) endif() if(WIN32 AND NOT WINRT) -# TODO add_subdirectory(windows) + add_subdirectory(windows) endif() if(WINRT) diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt new file mode 100644 index 00000000000..cb4da2dab55 --- /dev/null +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -0,0 +1,187 @@ +# Generated from windows.pro. + +##################################################################### +## qwindows Plugin: +##################################################################### + +add_qt_plugin(qwindows + TYPE platforms + SOURCES + openglblacklists.qrc + qtwindowsglobal.h + qwin10helpers.cpp qwin10helpers.h + qwindowscombase.h + qwindowscontext.cpp qwindowscontext.h + qwindowscursor.cpp qwindowscursor.h + qwindowsdialoghelpers.cpp qwindowsdialoghelpers.h + qwindowsdropdataobject.cpp qwindowsdropdataobject.h + qwindowsinputcontext.cpp qwindowsinputcontext.h + qwindowsintegration.cpp qwindowsintegration.h + qwindowsinternalmimedata.cpp qwindowsinternalmimedata.h + qwindowskeymapper.cpp qwindowskeymapper.h + qwindowsmenu.cpp qwindowsmenu.h + qwindowsmime.cpp qwindowsmime.h + qwindowsmousehandler.cpp qwindowsmousehandler.h + qwindowsnativeinterface.cpp qwindowsnativeinterface.h + qwindowsole.cpp qwindowsole.h + qwindowsopengltester.cpp qwindowsopengltester.h + qwindowspointerhandler.cpp qwindowspointerhandler.h + qwindowsscreen.cpp qwindowsscreen.h + qwindowsservices.cpp qwindowsservices.h + qwindowstheme.cpp qwindowstheme.h + qwindowsthreadpoolrunner.h + qwindowswindow.cpp qwindowswindow.h + main.cpp + qwindowsbackingstore.cpp qwindowsbackingstore.h + qwindowsgdiintegration.cpp qwindowsgdiintegration.h + qwindowsgdinativeinterface.cpp qwindowsgdinativeinterface.h + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::ThemeSupportPrivate + gdi32 + dwmapi + ole32 + user32 + winspool + imm32 + winmm + oleaut32 + shlwapi + shell32 + advapi32 + wtsapi32 + # OTHER_FILES = "windows.json" + # PLUGIN_CLASS_NAME = "QWindowsIntegrationPlugin" + # QT_FOR_CONFIG = "gui" + # _LOADED = "qt_plugin" +) + +## Scopes: +##################################################################### + +# TODO +extend_target(qwindows CONDITION QT_FEATURE_accessibility + SOURCES + uiautomation/qwindowsuiaaccessibility.cpp uiautomation/qwindowsuiaaccessibility.h + uiautomation/qwindowsuiabaseprovider.cpp uiautomation/qwindowsuiabaseprovider.h + uiautomation/qwindowsuiagriditemprovider.cpp uiautomation/qwindowsuiagriditemprovider.h + uiautomation/qwindowsuiagridprovider.cpp uiautomation/qwindowsuiagridprovider.h + uiautomation/qwindowsuiainvokeprovider.cpp uiautomation/qwindowsuiainvokeprovider.h + uiautomation/qwindowsuiamainprovider.cpp uiautomation/qwindowsuiamainprovider.h + uiautomation/qwindowsuiaprovidercache.cpp uiautomation/qwindowsuiaprovidercache.h + uiautomation/qwindowsuiarangevalueprovider.cpp uiautomation/qwindowsuiarangevalueprovider.h + uiautomation/qwindowsuiaselectionitemprovider.cpp uiautomation/qwindowsuiaselectionitemprovider.h + uiautomation/qwindowsuiaselectionprovider.cpp uiautomation/qwindowsuiaselectionprovider.h + uiautomation/qwindowsuiatableitemprovider.cpp uiautomation/qwindowsuiatableitemprovider.h + uiautomation/qwindowsuiatableprovider.cpp uiautomation/qwindowsuiatableprovider.h + uiautomation/qwindowsuiatextprovider.cpp uiautomation/qwindowsuiatextprovider.h + uiautomation/qwindowsuiatextrangeprovider.cpp uiautomation/qwindowsuiatextrangeprovider.h + uiautomation/qwindowsuiatoggleprovider.cpp uiautomation/qwindowsuiatoggleprovider.h + uiautomation/qwindowsuiautils.cpp uiautomation/qwindowsuiautils.h + uiautomation/qwindowsuiavalueprovider.cpp uiautomation/qwindowsuiavalueprovider.h + LIBRARIES + Qt::AccessibilitySupportPrivate +) + +# Special case, disable vulkan for now because headers can't be found. +extend_target(qwindows CONDITION QT_FEATURE_vulkan + SOURCES + qwindowsvulkaninstance.cpp qwindowsvulkaninstance.h + LIBRARIES + vulkan_supportPrivate +) + +#extend_target(qwindows CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN +# # PLUGIN_EXTENDS = "-" +#) + +extend_target(qwindows CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl AND NOT QT_FEATURE_opengles2 + LIBRARIES + opengl32 +) + +extend_target(qwindows CONDITION mingw + LIBRARIES + uuid +) + +extend_target(qwindows CONDITION QT_FEATURE_opengl + SOURCES + qwindowsopenglcontext.h +) + +extend_target(qwindows CONDITION QT_FEATURE_opengles2 + SOURCES + qwindowseglcontext.cpp qwindowseglcontext.h +) + +extend_target(qwindows CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 + SOURCES + qwindowsglcontext.cpp qwindowsglcontext.h +) + +extend_target(qwindows CONDITION QT_FEATURE_opengl_dynamic + SOURCES + qwindowseglcontext.cpp qwindowseglcontext.h +) + +extend_target(qwindows CONDITION QT_FEATURE_systemtrayicon + SOURCES + qwindowssystemtrayicon.cpp qwindowssystemtrayicon.h +) + +extend_target(qwindows CONDITION QT_FEATURE_clipboard + SOURCES + qwindowsclipboard.cpp qwindowsclipboard.h +) + +extend_target(qwindows CONDITION QT_FEATURE_clipboard AND QT_FEATURE_draganddrop + SOURCES + qwindowsdrag.cpp qwindowsdrag.h +) + +extend_target(qwindows CONDITION QT_FEATURE_tabletevent + SOURCES + qwindowstabletsupport.cpp qwindowstabletsupport.h + INCLUDE_DIRECTORIES + ${PROJECT_SOURCE_DIR}/src/3rdparty/wintab +) + +extend_target(qwindows CONDITION QT_FEATURE_sessionmanager + SOURCES + qwindowssessionmanager.cpp qwindowssessionmanager.h +) + +extend_target(qwindows CONDITION QT_FEATURE_imageformat_png + SOURCES + cursors.qrc +) + +# TODO +extend_target(qwindows CONDITION (QT_FEATURE_accessibility) + LIBRARIES + Qt::WindowsUIAutomationSupportPrivate +) + +extend_target(qwindows CONDITION QT_FEATURE_accessibility AND mingw + LIBRARIES + uuid +) + +#extend_target(qwindows CONDITION QT_FEATURE_combined_angle_lib +# DEFINES +# LIBEGL_NAME= +# LIBGLESV2_NAME= +#) + +#extend_target(qwindows CONDITION NOT QT_FEATURE_combined_angle_lib +# DEFINES +# LIBEGL_NAME= +# LIBGLESV2_NAME= +#) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 253aeb9d761..13a60af5a70 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -911,7 +911,7 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr) } _com_error error(hr); result += QByteArrayLiteral(" ("); - result += errorMessageFromComError(error); + result += errorMessageFromComError(error).toUtf8(); result += ')'; return result; } From b173f0b905155b4e17160c5ea44f7625599f7fcb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 18:49:04 +0100 Subject: [PATCH 0301/1322] CMake: Treat OUTPUT_DIRECTORY as relative to top level build directory Treat a relative path in OUTPUT_DIRECTORY as relative to the top level build directory, not to the current build directory. Change-Id: I4d409d1362a8f73d13b93cf5ab98e82e60dd62cb Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 1bbe12d8301..ffa0432edbe 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -752,6 +752,9 @@ function(add_qt_executable name) set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") endif() + get_filename_component(arg_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" + ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}") + add_executable("${name}" ${arg_EXE_FLAGS}) qt_autogen_tools("${name}" From 74aa6abac6b26f800619dea91fa8396e5efde2b2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:10:28 +0100 Subject: [PATCH 0302/1322] CMake: Fix names for generated DBus adaptor/interface files Use the same names for DBus adaptor/interface files that are also used by qmake. E.g. io.qt.something.xml will be turned into something_interface.(cpp|h) or something_adaptor.(cpp|h). Change-Id: I799b8aee7addd1fe590e8f3ec078e5325b68d5b1 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ffa0432edbe..a14dc1e72d8 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1043,7 +1043,22 @@ function(qt_create_qdbusxml2cpp_command target infile) endif() if ("${arg_BASENAME}" STREQUAL "") - get_filename_component(file_name "${infile}" NAME_WE) + get_filename_component(file_dir "${infile}" DIRECTORY) + get_filename_component(file_name "${infile}" NAME_WLE) + get_filename_component(file_ext "${infile}" LAST_EXT) + + if("${file_ext}" STREQUAL ".xml") + else() + message(FATAL_ERROR "DBUS ${type} input file is not xml.") + endif() + + # use last part of io.qt.something.xml! + get_filename_component(file_ext "${file_name}" LAST_EXT) + if("x${file_ext}" STREQUAL "x") + else() + string(SUBSTRING "${file_ext}" 1 -1 file_name) # cut of leading '.' + endif() + string(TOLOWER "${file_name}" file_name) set(file_name "${file_name}_${type}") else() From d84a2b82747d83b8b52e106ee516cba7b62386a8 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:12:52 +0100 Subject: [PATCH 0303/1322] CMake: pro2cmake.py: Fix typo Change-Id: I5eebe64f825ab28a67093b1a2cef417ed0908ec0 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index adcbaa98686..56d5f24b676 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -349,7 +349,7 @@ class Scope(object): return child_count == 1 or self._children[1]._condition == 'else' def settle_condition(self): - new_children: typing.List[scope] = [] + new_children: typing.List[Scope] = [] for c in self._children: c.settle_condition() From 347261aaf64ce30f5dc45f2b16c7bc7a693cdea3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:13:41 +0100 Subject: [PATCH 0304/1322] CMake: pro2cmake.py: Handle DBUS_*S Handle DBUS_ADAPTORS and DBUS_INTERFACES and turn them into equivalent CMake statements. Change-Id: Ia8a69e7ab97d9f18df93097a6e2c7c1686cb16a3 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 56d5f24b676..c5bd96b90bc 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -852,6 +852,18 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, for l in sort_sources(sources): cm_fh.write('{} {}\n'.format(ind, l)) + dbus_adaptors = scope.expand('DBUS_ADAPTORS') + if dbus_adaptors: + cm_fh.write('{} DBUS_ADAPTOR_SOURCES\n'.format(ind)) + for d in sort_sources(dbus_adaptors): + cm_fh.write('{} {}\n'.format(ind, d)) + + dbus_interfaces = scope.expand('DBUS_INTERFACES') + if dbus_interfaces: + cm_fh.write('{} DBUS_INTERFACE_SOURCES\n'.format(ind)) + for d in sort_sources(dbus_interfaces): + cm_fh.write('{} {}\n'.format(ind, d)) + defines = scope.expand('DEFINES') if defines: cm_fh.write('{} DEFINES\n'.format(ind)) From 88549c28551538277a944d9ba690b19533a14e36 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:15:22 +0100 Subject: [PATCH 0305/1322] CMake: pro2cmake.py: Handle "target.path" and "INSTALLS = target" Add installation location information into CMakeLists.txt files if available in CMake. Change-Id: I498deac71b1cc33c7d30790e32da236afdcb23af Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index c5bd96b90bc..a9d70ce84c9 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1336,7 +1336,15 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, binary_name = scope.TARGET assert binary_name - extra = ['GUI', ] if gui else [] + extra = ['GUI',] if gui else[] + + target_path = scope.getString('target.path') + if target_path: + target_path = target_path.replace('$$[QT_INSTALL_EXAMPLES]', '${INSTALL_EXAMPLESDIR}') + extra.append('OUTPUT_DIRECTORY "{}"'.format(target_path)) + if 'target' in scope.get('INSTALLS'): + extra.append('INSTALL_DIRECTORY "{}"'.format(target_path)) + write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope, extra_lines=extra, indent=indent, known_libraries={'Qt::Core', }) From cb7a3aaa4cceff2b4502ce3d5c568e0b58f8e5fe Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:16:40 +0100 Subject: [PATCH 0306/1322] CMake: pro2cmake.py: Report more qmake variables as used Report some more qmake variables as used when they are used to decide which kind of target to write. Change-Id: Id2602bb8cc07130456c04c53148acb73f21b0f21 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index a9d70ce84c9..4c8d2815493 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1237,7 +1237,8 @@ def write_simd_part(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, cmake_function: str, scope: Scope, *, extra_lines: typing.List[str] = [], - indent: int = 0, **kwargs: typing.Any): + indent: int = 0, extra_keys: typing.List[str], + **kwargs: typing.Any): # Evaluate total condition of all scopes: recursive_evaluate_scope(scope) @@ -1252,6 +1253,8 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, assert scopes[0].total_condition == 'ON' scopes[0].reset_visited_keys() + for k in extra_keys: + scopes[0].get(k) # Now write out the scopes: write_header(cm_fh, name, typename, indent=indent) @@ -1302,7 +1305,7 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, extra_lines=extra, indent=indent, - known_libraries={'Qt::Core', }) + known_libraries={'Qt::Core', }, extra_keys=[]) if 'qt_tracepoints' in scope.get('CONFIG'): tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), @@ -1319,7 +1322,7 @@ def write_tool(cm_fh: typing.IO[str], scope: Scope, *, write_main_part(cm_fh, tool_name, 'Tool', 'add_qt_tool', scope, indent=indent, known_libraries={'Qt::Core', }, - extra_lines=extra) + extra_lines=extra, extra_keys=['CONFIG']) def write_test(cm_fh: typing.IO[str], scope: Scope, *, @@ -1328,7 +1331,8 @@ def write_test(cm_fh: typing.IO[str], scope: Scope, *, assert test_name write_main_part(cm_fh, test_name, 'Test', 'add_qt_test', scope, - indent=indent, known_libraries={'Qt::Core', 'Qt::Test', }) + indent=indent, known_libraries={'Qt::Core', 'Qt::Test',}, + extra_keys=[]) def write_binary(cm_fh: typing.IO[str], scope: Scope, @@ -1347,7 +1351,7 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, write_main_part(cm_fh, binary_name, 'Binary', 'add_qt_executable', scope, extra_lines=extra, indent=indent, - known_libraries={'Qt::Core', }) + known_libraries={'Qt::Core', }, extra_keys=['target.path', 'INSTALLS']) def write_plugin(cm_fh, scope, *, indent: int = 0): @@ -1355,7 +1359,7 @@ def write_plugin(cm_fh, scope, *, indent: int = 0): assert plugin_name write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope, - indent=indent, known_libraries={'QtCore', }) + indent=indent, known_libraries={'QtCore', }, extra_keys=[]) def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, From 4f736db08c43fdbe4cfea8da7bf12fac5a0ec6ce Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Mar 2019 13:58:34 +0100 Subject: [PATCH 0307/1322] CMake: Re-generate gui Change-Id: Ia14d61ba0f2fa346090ebbb2cd179ba5b38e3056 Reviewed-by: Alexandru Croitor --- src/gui/CMakeLists.txt | 387 ++++++++++++++++++++++++++++------------- 1 file changed, 268 insertions(+), 119 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 4ea528e7aee..21a0d7684b2 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,6 +1,7 @@ +# special case: set(OpenGL_GL_PREFERENCE GLVND) -find_library(FWCoreGraphics CoreGraphics) +find_package(WrapOpenGL) # special case ##################################################################### ## Gui Module: @@ -35,7 +36,7 @@ if (QT_FEATURE_gui) endif() add_qt_module(Gui - FEATURE_DEPENDENCIES + FEATURE_DEPENDENCIES # special case: Qt::Network SOURCES animation/qguivariantanimation.cpp @@ -46,6 +47,7 @@ add_qt_module(Gui image/qiconengineplugin.cpp image/qiconengineplugin.h image/qiconloader.cpp image/qiconloader_p.h image/qimage.cpp image/qimage.h image/qimage_p.h + image/qimage_compat.cpp image/qimage_conversions.cpp image/qimageiohandler.cpp image/qimageiohandler.h image/qimagepixmapcleanuphooks.cpp image/qimagepixmapcleanuphooks_p.h @@ -63,6 +65,7 @@ add_qt_module(Gui image/qppmhandler.cpp image/qppmhandler_p.h image/qxbmhandler.cpp image/qxbmhandler_p.h image/qxpmhandler.cpp image/qxpmhandler_p.h + # itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h # special case kernel/qclipboard.cpp kernel/qclipboard.h kernel/qcursor.cpp kernel/qcursor.h kernel/qcursor_p.h kernel/qevent.cpp kernel/qevent.h kernel/qevent_p.h @@ -156,7 +159,7 @@ add_qt_module(Gui painting/qpainterpath.cpp painting/qpainterpath.h painting/qpainterpath_p.h painting/qpathclipper.cpp painting/qpathclipper_p.h painting/qpathsimplifier.cpp painting/qpathsimplifier_p.h - painting/qpdf.cpp painting/qpdf_p.h painting/qpdf.qrc + painting/qpdf.cpp painting/qpdf_p.h painting/qpdfwriter.cpp painting/qpdfwriter.h painting/qpen.cpp painting/qpen.h painting/qplatformbackingstore.cpp painting/qplatformbackingstore.h @@ -229,15 +232,187 @@ add_qt_module(Gui QT_NO_FOREACH LIBRARIES Qt::CorePrivate + ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core ) +# Resources: +set_source_files_properties("painting/../../3rdparty/icc/sRGB2014.icc" + PROPERTIES alias "sRGB2014.icc") +add_qt_resource(Gui "qpdf" PREFIX "qpdf/" BASE "painting" FILES + ../../3rdparty/icc/sRGB2014.icc + qpdfa_metadata.xml) + +# special case: +# This name is fixed in the code:-/ +add_qt_resource(Gui qmake_webgradients PREFIX "/qgradient" BASE "painting" FILES + webgradients.binaryjson +) + +add_qt_simd_part(Gui SIMD sse2 + SOURCES + painting/qdrawhelper_sse2.cpp +) + +add_qt_simd_part(Gui SIMD ssse3 + SOURCES + image/qimage_ssse3.cpp + painting/qdrawhelper_ssse3.cpp +) + +add_qt_simd_part(Gui SIMD sse4_1 + SOURCES + painting/qdrawhelper_sse4.cpp + painting/qimagescale_sse4.cpp +) + +add_qt_simd_part(Gui SIMD neon + SOURCES + painting/qdrawhelper_neon_p.h + image/qimage_neon.cpp + painting/qdrawhelper_neon.cpp + painting/qimagescale_neon.cpp + ../3rdparty/pixman/pixman-arm-neon-asm.S + painting/qdrawhelper_neon_asm.S +) + +add_qt_simd_part(Gui SIMD mips_dsp + SOURCES + painting/qdrawhelper_mips_dsp_p.h + painting/qt_mips_asm_dsp_p.h + painting/qdrawhelper_mips_dsp.cpp + painting/qdrawhelper_mips_dsp_asm.S +) + +add_qt_simd_part(Gui SIMD mips_dspr2 + SOURCES + image/qimage_mips_dspr2.cpp + image/qimage_mips_dspr2_asm.S + painting/qdrawhelper_mips_dspr2_asm.S +) + +# special case: Replace arch_haswell with avx2 feature. That is what is used in the code requireing +# this file, too! +add_qt_simd_part(Gui SIMD avx2 + SOURCES + painting/qdrawhelper_avx2.cpp +) + + +#### Keys ignored in scope 1:.:gui.pro:: +# CONFIG = "simd" "optimize_full" "qt_tracepoints" +# KERNEL_P = "kernel" +# MODULE_PLUGIN_TYPES = "platforms" "platforms/darwin" "xcbglintegrations" "platformthemes" "platforminputcontexts" "generic" "iconengines" "imageformats" "egldeviceintegrations" +# PRECOMPILED_HEADER = "kernel/qt_gui_pch.h" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtGui.dynlist" +# QMAKE_EXTRA_COMPILERS = "qvkgen_h" "qvkgen_ph" "qvkgen_pimpl" +# QMAKE_LIBS = "$$QMAKE_LIBS_GUI" +# QMAKE_QVKGEN_INPUT = "vulkan/vk.xml" +# QMAKE_QVKGEN_LICENSE_HEADER = "$$QT_SOURCE_TREE/header.LGPL" +# _LOADED = "qt_module" "cmake_functions" +# qvkgen_h.commands = "$$QMAKE_QVKGEN" "${QMAKE_FILE_IN}" "$$shell_quote$$QMAKE_QVKGEN_LICENSE_HEADER" "${QMAKE_FILE_OUT_PATH}/${QMAKE_FILE_OUT_BASE}" +# qvkgen_h.input = "QMAKE_QVKGEN_INPUT" +# qvkgen_h.output = "$$OUT_PWD/vulkan/qvulkanfunctions.h" +# qvkgen_ph.commands = "$$escape_expand\\n" +# qvkgen_ph.depends = "$$OUT_PWD/vulkan/qvulkanfunctions.h" +# qvkgen_ph.input = "QMAKE_QVKGEN_INPUT" +# qvkgen_ph.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.h" +# qvkgen_pimpl.commands = "$$escape_expand\\n" +# qvkgen_pimpl.depends = "$$OUT_PWD/vulkan/qvulkanfunctions_p.h" +# qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT" +# qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp" +# targ_headers.CONFIG = "no_check_exist" +# webgradients.base = "painting" # special case +# webgradients.files = "painting/webgradients.binaryjson" # special case +# webgradients.prefix = "qgradient" # special case + +#special case: +extend_target(Gui CONDITION QT_FEATURE_standarditemmodel + SOURCES + itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h +) + ## Scopes: ##################################################################### -extend_target(Gui CONDITION APPLE_OSX LIBRARIES ${FWAppKit}) -extend_target(Gui CONDITION APPLE LIBRARIES ${FWCoreGraphics}) +#### Keys ignored in scope 2:.:gui.pro:qtConfig(opengl._x_): +# MODULE_CONFIG = "opengl" + +#### Keys ignored in scope 3:.:gui.pro:QT_FEATURE_angle: +# CMAKE_ANGLE_EGL_DLL_DEBUG = "libEGLd.dll" +# CMAKE_ANGLE_EGL_DLL_RELEASE = "libEGL.dll" +# CMAKE_ANGLE_EGL_IMPLIB_DEBUG = "libEGLd.$${QMAKE_EXTENSION_STATICLIB}" +# CMAKE_ANGLE_EGL_IMPLIB_RELEASE = "libEGL.$${QMAKE_EXTENSION_STATICLIB}" +# CMAKE_ANGLE_GLES2_DLL_DEBUG = "libGLESv2d.dll" +# CMAKE_ANGLE_GLES2_DLL_RELEASE = "libGLESv2.dll" +# CMAKE_ANGLE_GLES2_IMPLIB_DEBUG = "libGLESv2d.$${QMAKE_EXTENSION_STATICLIB}" +# CMAKE_ANGLE_GLES2_IMPLIB_RELEASE = "libGLESv2.$${QMAKE_EXTENSION_STATICLIB}" +# CMAKE_GL_INCDIRS = "$$CMAKE_INCLUDE_DIR" +# CMAKE_QT_OPENGL_IMPLEMENTATION = "GLESv2" +# MODULE_AUX_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE/QtANGLE" + +#### Keys ignored in scope 4:.:gui.pro:testcocoon: +# _LOADED = "testcocoon" + +extend_target(Gui CONDITION APPLE_OSX + LIBRARIES + ${FWAppKit} +) + +extend_target(Gui CONDITION APPLE + SOURCES + image/qimage_darwin.mm + painting/qcoregraphics.mm painting/qcoregraphics_p.h + LIBRARIES + ${FWCoreGraphics} +) + +extend_target(Gui CONDITION WIN32 + SOURCES + kernel/qwindowdefs_win.h +) + +#### Keys ignored in scope 7:.:gui.pro:WIN32: +# CMAKE_WINDOWS_BUILD = "True" + +#### Keys ignored in scope 10:.:gui.pro:QT_FEATURE_egl: +# CMAKE_EGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_EGL" + +#### Keys ignored in scope 11:.:gui.pro:NOT QMAKE_LIBDIR_EGL_ISEMPTY: +# CMAKE_EGL_LIBDIR = "$$cmakeTargetPath$$QMAKE_LIBDIR_EGL" + +#### Keys ignored in scope 12:.:gui.pro:QT_FEATURE_opengles2: +# CMAKE_GL_HEADER_NAME = "GLES2/gl2.h" +# CMAKE_OPENGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_OPENGL_ES2" +# CMAKE_OPENGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_OPENGL_ES2" +# CMAKE_QT_OPENGL_IMPLEMENTATION = "GLESv2" + +#### Keys ignored in scope 13:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ES2_ISEMPTY: +# CMAKE_GL_INCDIRS = "$$cmakeTargetPaths$$QMAKE_INCDIR_OPENGL_ES2" + +#### Keys ignored in scope 14:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ES2_ISEMPTY: +# CMAKE_OPENGL_LIBDIR = "$$cmakePortablePaths$$QMAKE_LIBDIR_OPENGL_ES2" + +#### Keys ignored in scope 16:.:gui.pro:QT_FEATURE_opengl: +# CMAKE_GL_HEADER_NAME = "GL/gl.h" +# CMAKE_OPENGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_OPENGL" +# CMAKE_QT_OPENGL_IMPLEMENTATION = "GL" + +#### Keys ignored in scope 17:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ISEMPTY: +# CMAKE_GL_INCDIRS = "$$cmakeTargetPaths$$QMAKE_INCDIR_OPENGL" + +#### Keys ignored in scope 18:.:gui.pro:NOT QT_FEATURE_dynamicgl: +# CMAKE_OPENGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_OPENGL" + +#### Keys ignored in scope 19:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ISEMPTY: +# CMAKE_OPENGL_LIBDIR = "$$cmakePortablePaths$$QMAKE_LIBDIR_OPENGL" + +#### Keys ignored in scope 20:.:gui.pro:APPLE_OSX: +# CMAKE_GL_HEADER_NAME = "gl.h" + +#### Keys ignored in scope 21:.:gui.pro:QT_FEATURE_egl: +# CMAKE_EGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_EGL" extend_target(Gui CONDITION QT_FEATURE_accessibility SOURCES @@ -249,9 +424,11 @@ extend_target(Gui CONDITION QT_FEATURE_accessibility accessible/qplatformaccessibility.cpp accessible/qplatformaccessibility.h ) -extend_target(Gui CONDITION QT_FEATURE_accessibility AND APPLE - SOURCES accessible/qaccessiblecache_mac.mm - LIBRARIES ${FWFoundation} +extend_target(Gui CONDITION APPLE_OSX AND QT_FEATURE_accessibility + SOURCES + accessible/qaccessiblecache_mac.mm + LIBRARIES + ${FWFoundation} ) extend_target(Gui CONDITION QT_FEATURE_draganddrop @@ -268,63 +445,6 @@ extend_target(Gui CONDITION QT_FEATURE_opengl kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h kernel/qopenglwindow.cpp kernel/qopenglwindow.h kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h -) - -extend_target(Gui CONDITION WIN32 SOURCES kernel/qwindowdefs_win.h) - -extend_target(Gui CONDITION QT_FEATURE_movie SOURCES image/qmovie.cpp image/qmovie.h) - -extend_target(Gui CONDITION WIN32 AND NOT WINRT SOURCES image/qpixmap_win.cpp) - -extend_target(Gui CONDITION APPLE SOURCES image/qimage_darwin.mm) - -extend_target(Gui CONDITION QT_FEATURE_png - SOURCES - image/qpnghandler.cpp image/qpnghandler_p.h - LIBRARIES PNG::PNG -) - -extend_target(Gui CONDITION QT_FEATURE_harfbuzz - SOURCES - text/qharfbuzzng.cpp text/qharfbuzzng_p.h - LIBRARIES harfbuzz::harfbuzz -) - -extend_target(Gui CONDITION QT_FEATURE_textodfwriter - SOURCES - text/qtextodfwriter.cpp text/qtextodfwriter_p.h - text/qzip.cpp - text/qzipreader_p.h - text/qzipwriter_p.h -) - -extend_target(Gui CONDITION QT_FEATURE_cssparser SOURCES text/qcssparser.cpp text/qcssparser_p.h) - -extend_target(Gui CONDITION QT_FEATURE_standarditemmodel - SOURCES itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h -) - -# This name is fixed in the code:-/ -set_property(SOURCE painting/webgradients.binaryjson PROPERTY alias webgradients.binaryjson) -add_qt_resource(Gui qmake_webgradients PREFIX "/qgradient" - FILES painting/webgradients.binaryjson -) - -extend_target(Gui CONDITION APPLE SOURCES painting/qcoregraphics.mm painting/qcoregraphics_p.h) -extend_target(Gui CONDITION QT_FEATURE_cssparser SOURCES painting/qcssutil.cpp) - -extend_target(Gui CONDITION TEST_architecture STREQUAL arm64 AND NOT APPLE_UIKIT AND NOT WIN32 - DEFINES ENABLE_PIXMAN_DRAWHELPERS -) - -# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf -# acted like WrapOpenGL: direct linkage against either libGLESv2 or -# libGL, depending in the opengl _feature_. This is done by hand now -# here (where the feature is available). -find_package(WrapOpenGL) - -extend_target(Gui CONDITION QT_FEATURE_opengl - SOURCES opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h @@ -352,11 +472,71 @@ extend_target(Gui CONDITION QT_FEATURE_opengl opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h - LIBRARIES + LIBRARIES # special case WrapOpenGL ) -extend_target(Gui CONDITION (QT_FEATURE_opengl) AND (NOT QT_FEATURE_opengles2) +#### Keys ignored in scope 27:.:kernel/kernel.pri:QT_FEATURE_opengl: +# CONFIG = "opengl" + +extend_target(Gui CONDITION QT_FEATURE_movie + SOURCES + image/qmovie.cpp image/qmovie.h +) + +extend_target(Gui CONDITION WIN32 AND NOT WINRT + SOURCES + image/qpixmap_win.cpp +) + +extend_target(Gui CONDITION QT_FEATURE_png + SOURCES + image/qpnghandler.cpp image/qpnghandler_p.h + LIBRARIES + PNG::PNG +) + +extend_target(Gui CONDITION QT_FEATURE_harfbuzz + SOURCES + text/qharfbuzzng.cpp text/qharfbuzzng_p.h + LIBRARIES + harfbuzz::harfbuzz +) + +extend_target(Gui CONDITION QT_FEATURE_textodfwriter + SOURCES + text/qtextodfwriter.cpp text/qtextodfwriter_p.h + text/qzip.cpp + text/qzipreader_p.h + text/qzipwriter_p.h +) + +extend_target(Gui CONDITION QT_FEATURE_cssparser + SOURCES + painting/qcssutil.cpp + text/qcssparser.cpp text/qcssparser_p.h +) + +#### Keys ignored in scope 53:.:opengl/opengl.pri:QT_FEATURE_opengles2: +# CONFIG = "opengles2" + +extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 + SOURCES + painting/qdrawhelper.cpp +) + +#### Keys ignored in scope 43:.:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: +# CONFIG = "no_clang_integrated_as" + +extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT (TEST_architecture STREQUAL "arm64") + DEFINES + ENABLE_PIXMAN_DRAWHELPERS +) + +#### Keys ignored in scope 53:.:opengl/opengl.pri:QT_FEATURE_opengles2: +# CONFIG = "opengles2" + +extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 SOURCES opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h @@ -388,7 +568,7 @@ extend_target(Gui CONDITION (QT_FEATURE_opengl) AND (NOT QT_FEATURE_opengles2) opengl/qopengltimerquery.cpp opengl/qopengltimerquery.h ) -extend_target(Gui CONDITION (QT_FEATURE_opengl) AND (QT_FEATURE_opengles2) +extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 SOURCES opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h ) @@ -399,58 +579,22 @@ extend_target(Gui CONDITION QT_FEATURE_vulkan vulkan/qvulkanfunctions.cpp vulkan/qvulkaninstance.cpp vulkan/qvulkaninstance.h vulkan/qvulkanwindow.cpp vulkan/qvulkanwindow.h vulkan/qvulkanwindow_p.h + LIBRARIES + vulkan/nolink ) -extend_target(Gui CONDITION QT_FEATURE_sse2 - SOURCES painting/qdrawhelper_sse2.cpp - COMPILE_FLAGS ${QT_CFLAGS_SSE2} -) +#### Keys ignored in scope 61:.:vulkan/vulkan.pri:QT_FEATURE_vulkan: +# CONFIG = "generated_privates" +# qvkgen_h.variable_out = "HEADERS" +# qvkgen_ph.variable_out = "HEADERS" +# qvkgen_pimpl.variable_out = "SOURCES" -extend_target(Gui CONDITION QT_FEATURE_ssse3 - SOURCES - image/qimage_ssse3.cpp - painting/qdrawhelper_ssse3.cpp - COMPILE_FLAGS ${QT_CFLAGS_SSSE3} -) - -extend_target(Gui CONDITION QT_FEATURE_sse4_1 - SOURCES - painting/qdrawhelper_sse4.cpp - painting/qimagescale_sse4.cpp - COMPILE_FLAGS ${QT_CFLAGS_SSE4_1} -) - -extend_target(Gui CONDITION QT_FEATURE_avx2 - SOURCES painting/qdrawhelper_avx2.cpp - COMPILE_FLAGS ${QT_CFLAGS_AVX2} -) - -extend_target(Gui CONDITION QT_FEATURE_neon - SOURCES - image/qimage_neon.cpp - painting/qdrawhelper_neon.cpp painting/qdrawhelper_neon_p.h - painting/qimagescale_neon.cpp painting/qdrawhelper_neon_asm.S - ../3rdparty/pixman/pixman-arm-neon-asm.S - COMPILE_FLAGS ${QT_CFLAGS_NEON} -) - -extend_target(Gui CONDITION QT_FEATURE_mips_dsp - SOURCES - painting/qdrawhelper_mips_dsp.cpp painting/qdrawhelper_mips_dsp_p.h - painting/qt_mips_asm_dsp_p - painting/qdrawhelper_mips_dsp_asm.S - COMPILE_FLAGS ${QT_FLAGS_MIPS_DSP} -) - -extend_target(Gui CONDITION QT_FEATURE_mips_dspr2 - SOURCES - image/qimage_mips_dspr2.cpp image/qimage_mips_dspr2_asm.S - painting/qdrawhelper_mips_dspr2_asm.S - COMPILE_FLAGS ${QT_FLAGS_MIPS_DSPR2} -) - -qt_create_tracepoints(Gui qtgui.tracepoints) +#### Keys ignored in scope 63:.:vulkan/vulkan.pri:else: +# qvkgen_h.CONFIG = "target_predeps" "no_link" +# qvkgen_ph.CONFIG = "target_predeps" "no_link" +# qvkgen_pimpl.CONFIG = "target_predeps" "no_link" +# special case: if (QT_FEATURE_vulkan) set(qvkgen_command "${HOST_QVKGEN}") if (TARGET qvkgen) @@ -482,7 +626,10 @@ if (QT_FEATURE_vulkan) ) extend_target(Gui CONDITION QT_FEATURE_vulkan - SOURCES "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun}" "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p}" "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p_cpp}" + SOURCES + "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun}" + "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p}" + "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p_cpp}" LIBRARIES Vulkan::Vulkan ) endif() @@ -491,7 +638,9 @@ endif() # headers. So a private QtGui header is #include and # a qpa header is #include , both of them implying # linkage against Qt::GuiPrivate. -qt_read_headers_pri("Gui" "module_headers") -install(FILES ${module_headers_qpa} DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) +qt_read_headers_pri("Gui" "module_headers") # special case +install(FILES ${module_headers_qpa} + DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) # special case +qt_create_tracepoints(Gui ./qtgui.tracepoints) add_qt_docs(./doc/qtgui.qdocconf) From 485e96c4ee8c6856001307abf13a5f1f410afa75 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:09:27 +0100 Subject: [PATCH 0308/1322] CMake: Handle INSTALL_DIRECTORY for qt_executables Allow to override the install directory for Qt executables. Change-Id: I9561976eefe9c7b573bb97ddaaa39e30d3b6d9fb Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a14dc1e72d8..899083f6195 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -746,7 +746,7 @@ endfunction() # Please consider to use a more specific version target like the one created # by add_qt_test or add_qt_tool below. function(add_qt_executable name) - qt_parse_all_arguments(arg "add_qt_executable" "GUI" "OUTPUT_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_executable" "GUI" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x") set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") @@ -755,6 +755,10 @@ function(add_qt_executable name) get_filename_component(arg_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}") + if ("x${arg_INSTALL_DIRECTORY}" STREQUAL "x") + set(arg_INSTALL_DIRECTORY "${INSTALL_BINDIR}") + endif() + add_executable("${name}" ${arg_EXE_FLAGS}) qt_autogen_tools("${name}" @@ -782,6 +786,10 @@ function(add_qt_executable name) WIN32_EXECUTABLE "${arg_GUI}" MACOSX_BUNDLE "${arg_GUI}" ) + + install(TARGETS "${name}" + RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}" + BUNDLE DESTINATION "${arg_INSTALL_DIRECTORY}") endfunction() From dedc645510ff8cf11228b569763bf36cd7cedb1a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 20 Mar 2019 12:09:12 +0100 Subject: [PATCH 0309/1322] CMake: Make add_qt_executable link to Qt::Core by default Make add_qt_executable link to Qt::Core by default. Add a BOOTSTRAP flag to disable this behavior again. Pass BOOTSTRAP on from add_qt_tool to add_qt_executable. Change-Id: I26e7f1e03254122f626b3765cccc0dc4414a4fc0 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 899083f6195..dd9d5b1693e 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -746,7 +746,7 @@ endfunction() # Please consider to use a more specific version target like the one created # by add_qt_test or add_qt_tool below. function(add_qt_executable name) - qt_parse_all_arguments(arg "add_qt_executable" "GUI" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x") set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") @@ -765,6 +765,11 @@ function(add_qt_executable name) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) + set(extra_libraries "") + if(NOT arg_BOOTSTRAP) + set(extra_libraries "Qt::Core") + endif() + extend_target("${name}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES @@ -772,7 +777,7 @@ function(add_qt_executable name) "${CMAKE_CURRENT_BINARY_DIR}" ${arg_INCLUDE_DIRECTORIES} DEFINES ${arg_DEFINES} - LIBRARIES ${arg_LIBRARIES} + LIBRARIES ${arg_LIBRARIES} ${extra_libraries} DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" @@ -858,7 +863,13 @@ function(add_qt_tool name) set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Core) endif() + set(bootstrap "") + if(arg_BOOTSTRAP) + set(bootstrap BOOTSTRAP) + endif() + add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" + ${bootstrap} SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES ${arg_INCLUDE_DIRECTORIES} From 432f7232e3b1a4b2668e31e1ccfdd4d404b49960 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 20 Mar 2019 12:11:47 +0100 Subject: [PATCH 0310/1322] CMake: Add public dependency from Qt::Dbus to Qt::Core Anything that uses Qt::Dbus also needs to link to Qt::Core, so encode that in the target. Change-Id: Ibc984d5b5e118aae8d1c0d21117fcff1664b0ae3 Reviewed-by: Alexandru Croitor --- src/dbus/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index dd012565306..d17667a26a1 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -43,6 +43,8 @@ add_qt_module(DBus QT_NO_FOREACH LIBRARIES Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core # special case # MODULE_CONFIG = "dbusadaptors" "dbusinterfaces" # _LOADED = "qt_module" ) From a9c379199da684c3a88af2898fe8384f0c70986c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 20 Mar 2019 17:36:25 +0100 Subject: [PATCH 0311/1322] Fix internal features to also be evaluated This amends 4f1a155909dfcba7353ebe9eee669d65336bd943 and 37b154858f41c0aa32ad124878fae96c39563d39 which caused the regeneration of some json features to be internal. Some of those features were not evaluated any more unless they were referenced in another feature. Make sure to explicitly evaluate all internal features as well. Change-Id: I4367f309585fe29dc89d8a6b793de381956ae51d Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 38ff328de4d..2166ac69ff6 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -13,8 +13,9 @@ function(qt_feature_module_begin) endif() set(__QtFeature_library "${arg_LIBRARY}" PARENT_SCOPE) - set(__QtFeature_private_features "" PARENT_SCOPE) set(__QtFeature_public_features "" PARENT_SCOPE) + set(__QtFeature_private_features "" PARENT_SCOPE) + set(__QtFeature_internal_features "" PARENT_SCOPE) set(__QtFeature_private_file "${arg_PRIVATE_FILE}" PARENT_SCOPE) set(__QtFeature_public_file "${arg_PUBLIC_FILE}" PARENT_SCOPE) @@ -39,9 +40,14 @@ function(qt_feature feature) if (arg_PRIVATE) list(APPEND __QtFeature_private_features "${feature}") endif() + if (NOT arg_PUBLIC AND NOT arg_PRIVATE) + list(APPEND __QtFeature_internal_features "${feature}") + endif() + set(__QtFeature_public_features ${__QtFeature_public_features} PARENT_SCOPE) set(__QtFeature_private_features ${__QtFeature_private_features} PARENT_SCOPE) + set(__QtFeature_internal_features ${__QtFeature_internal_features} PARENT_SCOPE) endfunction() function(qt_evaluate_to_boolean expressionVar) @@ -332,7 +338,7 @@ function(qt_internal_feature_write_file file features extra) endfunction() function(qt_feature_module_end target) - set(all_features ${__QtFeature_public_features} ${__QtFeature_private_features}) + set(all_features ${__QtFeature_public_features} ${__QtFeature_private_features} ${__QtFeature_internal_features}) list(REMOVE_DUPLICATES all_features) foreach(feature ${all_features}) @@ -398,8 +404,9 @@ function(qt_feature_module_end target) endif() unset(__QtFeature_library PARENT_SCOPE) - unset(__QtFeature_private_features PARENT_SCOPE) unset(__QtFeature_public_features PARENT_SCOPE) + unset(__QtFeature_private_features PARENT_SCOPE) + unset(__QtFeature_internal_features PARENT_SCOPE) unset(__QtFeature_private_file PARENT_SCOPE) unset(__QtFeature_public_file PARENT_SCOPE) From 25f67fbb073c8bedf26e165f52abacf3e20a6a94 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 21 Mar 2019 13:12:46 +0100 Subject: [PATCH 0312/1322] Fix wrong target in qt_feature_module_begin Presumably this was a copy paste that was not intended. Change-Id: I09e3bb12b3b3f7af75726d7a952d79814ea9c876 Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 73deb51b494..5ede1c7b590 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -39,7 +39,7 @@ target_include_directories(GlobalConfig INTERFACE $ $ ) -qt_feature_module_begin(LIBRARY Core +qt_feature_module_begin(LIBRARY GlobalConfig PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) From ba7c62eed53b2304c54643cbddc29db887fcd869 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 21 Mar 2019 13:14:09 +0100 Subject: [PATCH 0313/1322] Fix sub-architecture (instruction sets / SIMD) handling In qmake there are at least 2 things to know regarding sub-architectures and instruction sets. Which instruction sets does the compiler know to compile for, represented by the various config.tests and features in qtbase/configure.json. And which instructions sets are enabled by the compiler by default, represented by the configure.json "architecture" test and accessed via QT_CPU_FEATURES.$$arch qmake argument. Before this patch there was some mishandling of the above concepts in CMake code. The former can now be checked in CMake with via TEST_subarch_foo and QT_FEATURE_foo (where foo is sse2, etc). The latter can now be checked by TEST_arch_${TEST_architecture_arch}_subarch_foo (where foo is sse2, etc and the main arch is dynamyicall evaluated). The configurejson2cmake script was adjusted to take care of the above changes, and the cmake files were regenerated as well. Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c Reviewed-by: Simon Hausmann --- cmake/QtBaseConfigureTests.cmake | 3 ++- config.tests/x86_simd/CMakeLists.txt | 10 +++++++++- configure.cmake | 6 +++--- util/cmake/configurejson2cmake.py | 5 +++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index b79a1e3839c..5a345cbc3c6 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -39,7 +39,8 @@ function(run_config_test_architecture) set(TEST_architecture_arch "${_architecture}" CACHE INTERNAL "Target machine architecture") set(TEST_subarch 1 CACHE INTERNAL "Ran machine subArchitecture test") foreach(it ${_sub_architecture}) - set(TEST_subarch_${it} 1 CACHE INTERNAL "Target sub architecture result") + # Equivalent to qmake's QT_CPU_FEATURES.$arch. + set(TEST_arch_${TEST_architecture_arch}_subarch_${it} 1 CACHE INTERNAL "Target sub architecture result") endforeach() set(TEST_buildAbi "${_build_abi}" CACHE INTERNAL "Target machine buildAbi") endfunction() diff --git a/config.tests/x86_simd/CMakeLists.txt b/config.tests/x86_simd/CMakeLists.txt index b213cf10fca..b624b7bc959 100644 --- a/config.tests/x86_simd/CMakeLists.txt +++ b/config.tests/x86_simd/CMakeLists.txt @@ -4,12 +4,20 @@ project(x86_simd LANGUAGES CXX) include(../../cmake/QtPlatformSupport.cmake) include(../../cmake/QtCompilerOptimization.cmake) +# FIXME: Make the this project handle a list of SIMD entries. +# FIXME: Make this project handle appending of the cflags (similar to the qmake project). +# This is needed for the x86SimdAlways configure test ( +# aka we test to see if setting no SIMD (-msse2) cflags at all, will result in their implicit +# addition by the compiler). string(TOUPPER "${SIMD}" upper_simd) if(NOT DEFINED "QT_CFLAGS_${upper_simd}") - message(FATAL_ERROR "This compiler does not support ${SIMD}.") + # Don't use CMake error() because a configure error also fails the try_compile() call. + # Instead use a compile flag that doesn't exist to force a compiler error. + set(QT_CFLAGS_${upper_simd} "--qt-cflags-not-found") endif() add_executable("SimdTest${SIMD}") target_sources("SimdTest${SIMD}" PRIVATE main.cpp) target_compile_options("SimdTest${SIMD}" PRIVATE ${QT_CFLAGS_${upper_simd}}) +target_compile_definitions("SimdTest${SIMD}" PRIVATE QT_COMPILER_SUPPORTS_${upper_simd}) diff --git a/configure.cmake b/configure.cmake index c12b7d3b876..a62a7469168 100644 --- a/configure.cmake +++ b/configure.cmake @@ -336,17 +336,17 @@ qt_feature("x86SimdAlways" qt_feature_definition("x86SimdAlways" "QT_COMPILER_SUPPORTS_SIMD_ALWAYS" VALUE "1") qt_feature("mips_dsp" LABEL "DSP" - CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_subarch_dsp + CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_arch_${TEST_architecture_arch}_subarch_dsp ) qt_feature_definition("mips_dsp" "QT_COMPILER_SUPPORTS_MIPS_DSP" VALUE "1") qt_feature("mips_dspr2" LABEL "DSPr2" - CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_subarch_dspr2 + CONDITION ( TEST_architecture_arch STREQUAL mips ) AND TEST_arch_${TEST_architecture_arch}_subarch_dspr2 ) qt_feature_definition("mips_dspr2" "QT_COMPILER_SUPPORTS_MIPS_DSPR2" VALUE "1") qt_feature("neon" LABEL "NEON" - CONDITION ( ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 ) ) AND TEST_subarch_neon + CONDITION ( ( TEST_architecture_arch STREQUAL arm ) OR ( TEST_architecture_arch STREQUAL arm64 ) ) AND TEST_arch_${TEST_architecture_arch}_subarch_neon ) qt_feature_definition("neon" "QT_COMPILER_SUPPORTS_NEON" VALUE "1") qt_feature("alloca_h" PRIVATE diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index fe2bf50eaad..eb3fd606fe1 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -117,7 +117,7 @@ def map_tests(test: str) -> str: 'c99': '$', 'c11': '$', - 'x86SimdAlways': 'ON', # FIXME: Is this the right thing? + 'x86SimdAlways': 'ON', # FIXME: Make this actually do a compile test. 'aesni': 'TEST_subarch_aes', 'avx': 'TEST_subarch_avx', @@ -333,7 +333,8 @@ def map_condition(condition): substitution = 'QT_FEATURE_{}'.format(featureName(match.group(2))) elif match.group(1) == 'subarch': - substitution = 'TEST_subarch_{}'.format(match.group(2)) + substitution = 'TEST_arch_{}_subarch_{}'.format("${TEST_architecture_arch}", + match.group(2)) elif match.group(1) == 'call': if match.group(2) == 'crossCompile': From 92ab6c2108f04a575b1754d9b7bff1db91b31769 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 21 Mar 2019 13:31:16 +0100 Subject: [PATCH 0314/1322] Add MSVC specific instruction set compiler flags This is only a half solution, because some of them need to be set based on the detected MSVC version and Windows kit, similar to how it's done by qmake. Change-Id: Ice13c99d6fe0a033ddfebf9d4be924dcd6b8a36c Reviewed-by: Simon Hausmann --- cmake/QtCompilerOptimization.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/QtCompilerOptimization.cmake b/cmake/QtCompilerOptimization.cmake index 151d06925b2..5ca28c4de42 100644 --- a/cmake/QtCompilerOptimization.cmake +++ b/cmake/QtCompilerOptimization.cmake @@ -24,6 +24,21 @@ if (MSVC) set(QT_CFLAGS_SSE4_2 "${QT_CFLAGS_SSE2}") set(QT_CFLAGS_AESNI "${QT_CFLAGS_SSE2}") set(QT_CFLAGS_SHANI "${QT_CFLAGS_SSE2}") + + # FIXME to be Visual Studio version specific, like in mkspecs/common/msvc-version.conf + set(QT_CFLAGS_AVX "-arch:AVX") + set(QT_CFLAGS_AVX2 "-arch:AVX2") + set(QT_CFLAGS_F16C "-arch:AVX") + set(QT_CFLAGS_RDRND "") + set(QT_CFLAGS_AVX512F "-arch:AVX512") + set(QT_CFLAGS_AVX512ER "-arch:AVX512") + set(QT_CFLAGS_AVX512CD "-arch:AVX512") + set(QT_CFLAGS_AVX512PF "-arch:AVX512") + set(QT_CFLAGS_AVX512DQ "-arch:AVX512") + set(QT_CFLAGS_AVX512BW "-arch:AVX512") + set(QT_CFLAGS_AVX512VL "-arch:AVX512") + set(QT_CFLAGS_AVX512IFMA "-arch:AVX512") + set(QT_CFLAGS_AVX512VBMI "-arch:AVX512") endif() if(GCC OR CLANG) From 9281abb1bc10db9703d0147fed6d567f6a60c513 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 21 Mar 2019 13:09:14 +0100 Subject: [PATCH 0315/1322] Fix windows build after gui regeneration - vulkan/nolink is not a valid target, instead pass along vulkan include directories to consuming targets, and don't link to the library at all - fix vulkan support target name in the windows qpa dependencies - the wrong opengl dynamic feature was used in the windows qpa (the current way is consistent with qmake, otherwise there were issues with the feature evaluation, because gui feature definitions are not available in the qpa project scope) - fix issue with qfloat16_f16c not being built because of previous subarch issues Change-Id: Ia75fc76a71e516fe8718027063fe554657d4d47b Reviewed-by: Simon Hausmann --- src/corelib/CMakeLists.txt | 22 +++++++++++++------- src/gui/CMakeLists.txt | 10 ++++++--- src/plugins/platforms/windows/CMakeLists.txt | 4 ++-- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ca6893b75fa..3484e2b15e5 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -485,14 +485,20 @@ extend_target(Core CONDITION INTEGRITY # # f16c_cxx = "false" #) -extend_target(Core CONDITION _ss_f16c_cxx - DEFINES - QFLOAT16_INCLUDE_FAST -) -# -#extend_target(Core CONDITION NOT _ss_f16c_cxx -# # F16C_SOURCES = "global/qfloat16_f16c.c" -#) +# special case +# needs refinement for the other compiler specific cases. +if(TEST_arch_${TEST_architecture_arch}_subarch_f16c) + # Equivalent to contains(QT_CPU_FEATURES.$$QT_ARCH, f16c) + extend_target(Core + DEFINES + QFLOAT16_INCLUDE_FAST + ) +else() + add_qt_simd_part(Core SIMD f16c + SOURCES + global/qfloat16_f16c.c + ) +endif() extend_target(Core CONDITION linux_x_ OR hurd_x_ AND NOT cross_compile AND NOT static AND NOT _x_-armcc_x_ DEFINES diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 21a0d7684b2..74c0940bb7e 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -579,10 +579,15 @@ extend_target(Gui CONDITION QT_FEATURE_vulkan vulkan/qvulkanfunctions.cpp vulkan/qvulkaninstance.cpp vulkan/qvulkaninstance.h vulkan/qvulkanwindow.cpp vulkan/qvulkanwindow.h vulkan/qvulkanwindow_p.h - LIBRARIES - vulkan/nolink ) +# special case to include only headers aka QMAKE_USE += vulkan/nolink +if(QT_FEATURE_vulkan) + # Can't use generator expressions https://gitlab.kitware.com/cmake/cmake/issues/19072 + get_target_property(vulkan_includes Vulkan::Vulkan INTERFACE_INCLUDE_DIRECTORIES) + target_include_directories(Gui PUBLIC ${vulkan_includes}) +endif() + #### Keys ignored in scope 61:.:vulkan/vulkan.pri:QT_FEATURE_vulkan: # CONFIG = "generated_privates" # qvkgen_h.variable_out = "HEADERS" @@ -630,7 +635,6 @@ if (QT_FEATURE_vulkan) "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun}" "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p}" "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p_cpp}" - LIBRARIES Vulkan::Vulkan ) endif() diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index cb4da2dab55..33e20c75d13 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -94,7 +94,7 @@ extend_target(qwindows CONDITION QT_FEATURE_vulkan SOURCES qwindowsvulkaninstance.cpp qwindowsvulkaninstance.h LIBRARIES - vulkan_supportPrivate + Qt::VulkanSupportPrivate ) #extend_target(qwindows CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN @@ -126,7 +126,7 @@ extend_target(qwindows CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 qwindowsglcontext.cpp qwindowsglcontext.h ) -extend_target(qwindows CONDITION QT_FEATURE_opengl_dynamic +extend_target(qwindows CONDITION QT_FEATURE_dynamicgl SOURCES qwindowseglcontext.cpp qwindowseglcontext.h ) From 8158a8767c4c0ece37c55c2cc6777267221693ee Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 21 Mar 2019 19:17:41 +0100 Subject: [PATCH 0316/1322] Temporarily disable the opengles2 feature on WIN32 The feature used to be implicitly enabled because qt source ships with ANGLE sources, and thus ANGLE could always be built. Yet because the CMake port of ANGLE is not done yet, and because the feature is implicitly enabled, the build failed when trying to find GLES headers. To provide a nicer out-of-the-box configuring of the Windows build, disable the opengles2 feature on Windows, to default to a desktop GL build. It can be re-enabled once (if) ANGLE porting is done. After this change, you shouldn't need to pass any additional custom FEATURE_foo options to cmake to build qtbase on Windows. Change-Id: I94c96d8ef70cf671d2ce0198311f70b55fa642b1 Reviewed-by: Liang Qi Reviewed-by: Simon Hausmann --- src/gui/configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 157898953e2..1d57ce73283 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -535,7 +535,7 @@ qt_feature("mtdev" PRIVATE ) qt_feature("opengles2" PUBLIC LABEL "OpenGL ES 2.0" - CONDITION WIN32 OR ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND ) + CONDITION NOT WIN32 AND ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND ) ENABLE INPUT_opengl STREQUAL 'es2' DISABLE INPUT_opengl STREQUAL 'desktop' OR INPUT_opengl STREQUAL 'dynamic' OR INPUT_opengl STREQUAL 'no' ) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index eb3fd606fe1..4cbcc981ce8 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -726,6 +726,9 @@ def parseFeature(ctx, feature, data, cm_fh): 'msvc_mp': None, 'optimize_debug': None, 'optimize_size': None, + 'opengles2': { # special case to disable implicit feature on WIN32, until ANGLE is ported + 'condition': 'NOT WIN32 AND ( NOT APPLE_WATCHOS AND NOT QT_FEATURE_opengl_desktop AND GLESv2_FOUND )' + }, 'pkg-config': None, 'posix_fallocate': None, # Only needed for sqlite, which we do not want to build 'posix-libiconv': { From 5fd30d0a189a956e83e66f19beed61efae757e54 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 22 Mar 2019 10:31:04 +0100 Subject: [PATCH 0317/1322] Revert "Fix wrong target in qt_feature_module_begin" It broke builds because the qconfig.h file was created in the wrong directory. This reverts commit 25f67fbb073c8bedf26e165f52abacf3e20a6a94. Change-Id: Ia458ef4193a3985a9ba613d82f679b7df5ca0107 Reviewed-by: Simon Hausmann Reviewed-by: Liang Qi --- cmake/QtBaseGlobalTargets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 5ede1c7b590..73deb51b494 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -39,7 +39,7 @@ target_include_directories(GlobalConfig INTERFACE $ $ ) -qt_feature_module_begin(LIBRARY GlobalConfig +qt_feature_module_begin(LIBRARY Core PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) From 890ddd254087da9a6008e9fe5639ffd3a35f1b8b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 22 Mar 2019 15:17:02 +0100 Subject: [PATCH 0318/1322] Fix AUTOMOC and friends to run only once the tools are built While building on macOS, AUTOMOC sometimes hanged indefinitely. The problem was that AUTOMOC was executed for the qmacstyle plugin before moc was actually built. Because of an upstream bug in CMake, AUTOMOC was caught in a deadlock without reporting that spawning the moc process failed. Specifically if a libuv spawn() call failed, the condition variable for a waiting thread was not notified, and the thread kept waiting forever for the process launch to finish. Fix the dependency by setting the AUTOGEN_TARGET_DEPENDS property on all targets that have AUTOGEN tools enabled. This makes sure that moc and friends are built before they are used. Also add some special cases to disable autogen tools on certain targets to break cycles between targets. Fixes: QTBUG-74636 Change-Id: I6e689e63cba1962525f169f332a58498d173c0a6 Reviewed-by: Simon Hausmann Reviewed-by: Mikhail Svetkin --- cmake/QtBuild.cmake | 1 + src/corelib/CMakeLists.txt | 2 ++ src/tools/uic/CMakeLists.txt | 2 ++ 3 files changed, 5 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index dd9d5b1693e..bc07da27bab 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -321,6 +321,7 @@ function(qt_autogen_tools target) PROPERTIES AUTO${captitalAutogenTool} ON AUTO${captitalAutogenTool}_EXECUTABLE "$") + set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS Qt::${autogen_tool}) endforeach() set_directory_properties(PROPERTIES diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 3484e2b15e5..e1d827d0ee0 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -242,6 +242,8 @@ add_qt_module(Core ZLIB::ZLIB PUBLIC_LIBRARIES # special case: Qt::Platform + DISABLE_AUTOGEN_TOOLS # special case: + uic # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" # ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" # ANDROID_PERMISSIONS = "android.permission.INTERNET" "android.permission.WRITE_EXTERNAL_STORAGE" diff --git a/src/tools/uic/CMakeLists.txt b/src/tools/uic/CMakeLists.txt index 46826b7d52f..15ef92a2b43 100644 --- a/src/tools/uic/CMakeLists.txt +++ b/src/tools/uic/CMakeLists.txt @@ -27,6 +27,8 @@ add_qt_tool(uic QT_UIC_CPP_GENERATOR INCLUDE_DIRECTORIES cpp + DISABLE_AUTOGEN_TOOLS # special case: + uic rcc # QMAKE_TARGET_DESCRIPTION = "Qt User Interface Compiler" # _LOADED = "qt_tool" # _OPTION = "host_build" From eb3d73ffb778e191aa5705fd1867c62809eedf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 25 Mar 2019 15:16:32 +0100 Subject: [PATCH 0319/1322] Speedup run_pro2cmake We can use all cores. Sadly it doesn't balance cores well as corelib.pro takes most of the time anyway, but the speedup is visible from ~15 to 5 min. Change-Id: Id8209c58491b38d19c6e9f1163d366c3e33a182c Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- util/cmake/run_pro2cmake.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 1a3c1581e39..b3a07c75226 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -30,7 +30,9 @@ import glob import os import subprocess +import concurrent.futures import sys +import typing script_path = os.path.dirname(os.path.abspath(__file__)) base_path = os.path.dirname(script_path) @@ -41,20 +43,30 @@ if len(sys.argv) > 1: failed_files = [] -pro_file_count = 0 -for filename in glob.iglob(os.path.join(base_path, '**/*.pro'), - recursive=True): - pro_file_count += 1 - print('{} ({}): Converting: {} ...' - .format(pro_file_count, len(failed_files), filename)) - result = subprocess.run([pro2cmake, os.path.basename(filename)], - cwd=os.path.dirname(filename)) - if result.returncode != 0: - failed_files.append(filename) +all_files = glob.glob(os.path.join(base_path, '**/*.pro'), recursive=True) +files_count = len(all_files) + +with concurrent.futures.ThreadPoolExecutor(initializer=os.nice, initargs=(10,)) as pool: + + def _process_a_file(data: typing.Tuple[str, int, int]) -> typing.Tuple[int, str, str]: + filename, index, total = data + result = subprocess.run((pro2cmake, os.path.basename(filename)), + cwd=os.path.dirname(filename), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout = 'Converted[{}/{}]: {}\n'.format(index, total, filename) + return result.returncode, filename, stdout + result.stdout.decode() + + for return_code, filename, stdout in pool.map(_process_a_file, + zip(all_files, + range(1, files_count + 1), + (files_count for _ in all_files))): + if return_code: + failed_files.append(filename) + print(stdout) if failed_files: print('The following files were not successfully ' - 'converted ({} of {}):'.format(len(failed_files), pro_file_count)) + 'converted ({} of {}):'.format(len(failed_files), files_count)) for f in failed_files: print(' "{}"'.format(f)) From a0a94576fae26bcbbf3823a6ee4b554886e84925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Tue, 26 Mar 2019 10:17:58 +0100 Subject: [PATCH 0320/1322] Fix RemoveOperation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The operation was using an empty set as a base, so it was not really functional. Change-Id: I98fd80c1ede31994857aa1f0c8947ca7b9f76649 Reviewed-by: Tobias Hunger Reviewed-by: JÄ™drzej Nowacki --- util/cmake/pro2cmake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 4c8d2815493..e77d6fdcaf9 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -239,10 +239,13 @@ class RemoveOperation(Operation): def process(self, input): input_set = set(input) + result_set = set(self._value) result = [] for v in self._value: if v in input_set: continue + if v in result_set: + result += [v,] else: result += ['-{}'.format(v), ] return result From 64c6c943c7469c60e8d25c3efd630249740ae2f4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 18 Mar 2019 19:26:24 +0100 Subject: [PATCH 0321/1322] CMake: Add more examples Change-Id: I7a8a3fd0a844a518592957fe07c6e707dd452d5f Reviewed-by: Alexandru Croitor --- examples/CMakeLists.txt | 21 ++++++++- examples/corelib/CMakeLists.txt | 7 +++ examples/corelib/ipc/CMakeLists.txt | 14 ++++++ .../ipc/localfortuneclient/CMakeLists.txt | 17 +++++++ .../ipc/localfortuneserver/CMakeLists.txt | 17 +++++++ .../corelib/ipc/sharedmemory/CMakeLists.txt | 19 ++++++++ examples/corelib/mimetypes/CMakeLists.txt | 6 +++ .../mimetypes/mimetypebrowser/CMakeLists.txt | 21 +++++++++ examples/corelib/serialization/CMakeLists.txt | 5 +++ .../serialization/cbordump/CMakeLists.txt | 19 ++++++++ .../serialization/convert/CMakeLists.txt | 26 +++++++++++ .../serialization/savegame/CMakeLists.txt | 22 +++++++++ examples/corelib/threads/CMakeLists.txt | 9 ++++ .../corelib/threads/mandelbrot/CMakeLists.txt | 25 +++++++++++ .../threads/queuedcustomtype/CMakeLists.txt | 18 ++++++++ .../corelib/threads/semaphores/CMakeLists.txt | 15 +++++++ .../threads/waitconditions/CMakeLists.txt | 15 +++++++ examples/corelib/tools/CMakeLists.txt | 5 +++ .../tools/contiguouscache/CMakeLists.txt | 16 +++++++ .../corelib/tools/customtype/CMakeLists.txt | 16 +++++++ .../tools/customtypesending/CMakeLists.txt | 17 +++++++ examples/dbus/CMakeLists.txt | 13 ++++++ examples/dbus/chat/CMakeLists.txt | 22 +++++++++ examples/dbus/complexpingpong/CMakeLists.txt | 16 +++++++ examples/dbus/listnames/CMakeLists.txt | 22 +++++++++ examples/dbus/pingpong/CMakeLists.txt | 35 +++++++++++++++ .../dbus/remotecontrolledcar/CMakeLists.txt | 4 ++ .../remotecontrolledcar/car/CMakeLists.txt | 19 ++++++++ .../controller/CMakeLists.txt | 19 ++++++++ examples/embedded/CMakeLists.txt | 8 ++++ examples/embedded/digiflip/CMakeLists.txt | 15 +++++++ examples/embedded/flickable/CMakeLists.txt | 16 +++++++ examples/embedded/flightinfo/CMakeLists.txt | 25 +++++++++++ examples/embedded/lightmaps/CMakeLists.txt | 22 +++++++++ examples/embedded/raycasting/CMakeLists.txt | 23 ++++++++++ examples/embedded/styleexample/CMakeLists.txt | 28 ++++++++++++ examples/gui/CMakeLists.txt | 7 +++ examples/gui/analogclock/CMakeLists.txt | 21 +++++++++ examples/gui/openglwindow/CMakeLists.txt | 18 ++++++++ examples/gui/rasterwindow/CMakeLists.txt | 20 +++++++-- examples/network/CMakeLists.txt | 45 +++++++++++++++++++ examples/network/bearermonitor/CMakeLists.txt | 31 +++++++++++++ .../blockingfortuneclient/CMakeLists.txt | 18 ++++++++ .../network/broadcastreceiver/CMakeLists.txt | 17 +++++++ .../network/broadcastsender/CMakeLists.txt | 17 +++++++ examples/network/dnslookup/CMakeLists.txt | 27 +++++++++++ examples/network/download/CMakeLists.txt | 18 ++++++++ .../network/downloadmanager/CMakeLists.txt | 21 +++++++++ examples/network/fortuneclient/CMakeLists.txt | 17 +++++++ examples/network/fortuneserver/CMakeLists.txt | 17 +++++++ examples/network/googlesuggest/CMakeLists.txt | 18 ++++++++ examples/network/http/CMakeLists.txt | 18 ++++++++ examples/network/loopback/CMakeLists.txt | 17 +++++++ .../network/multicastreceiver/CMakeLists.txt | 17 +++++++ .../network/multicastsender/CMakeLists.txt | 17 +++++++ .../network/multistreamclient/CMakeLists.txt | 21 +++++++++ .../network/multistreamserver/CMakeLists.txt | 24 ++++++++++ examples/network/network-chat/CMakeLists.txt | 21 +++++++++ .../network/securesocketclient/CMakeLists.txt | 24 ++++++++++ .../network/secureudpclient/CMakeLists.txt | 22 +++++++++ .../network/secureudpserver/CMakeLists.txt | 22 +++++++++ .../threadedfortuneserver/CMakeLists.txt | 19 ++++++++ examples/network/torrent/CMakeLists.txt | 42 +++++++++++++++++ examples/qpa/CMakeLists.txt | 4 ++ examples/qpa/qrasterwindow/CMakeLists.txt | 15 +++++++ examples/qpa/windows/CMakeLists.txt | 19 ++++++++ examples/qtconcurrent/CMakeLists.txt | 9 ++++ .../qtconcurrent/imagescaling/CMakeLists.txt | 17 +++++++ examples/qtconcurrent/map/CMakeLists.txt | 20 +++++++++ .../progressdialog/CMakeLists.txt | 18 ++++++++ .../qtconcurrent/runfunction/CMakeLists.txt | 19 ++++++++ .../qtconcurrent/wordcount/CMakeLists.txt | 19 ++++++++ examples/qtestlib/CMakeLists.txt | 7 +++ examples/qtestlib/tutorial1/CMakeLists.txt | 16 +++++++ examples/qtestlib/tutorial2/CMakeLists.txt | 16 +++++++ examples/qtestlib/tutorial3/CMakeLists.txt | 16 +++++++ examples/qtestlib/tutorial4/CMakeLists.txt | 16 +++++++ examples/qtestlib/tutorial5/CMakeLists.txt | 16 +++++++ examples/sql/CMakeLists.txt | 17 +++++++ examples/sql/books/CMakeLists.txt | 30 +++++++++++++ examples/sql/cachedtable/CMakeLists.txt | 18 ++++++++ examples/sql/drilldown/CMakeLists.txt | 28 ++++++++++++ examples/sql/masterdetail/CMakeLists.txt | 30 +++++++++++++ examples/sql/querymodel/CMakeLists.txt | 19 ++++++++ .../sql/relationaltablemodel/CMakeLists.txt | 17 +++++++ examples/sql/sqlbrowser/CMakeLists.txt | 29 ++++++++++++ examples/sql/sqlwidgetmapper/CMakeLists.txt | 17 +++++++ examples/sql/tablemodel/CMakeLists.txt | 17 +++++++ 88 files changed, 1637 insertions(+), 5 deletions(-) create mode 100644 examples/corelib/CMakeLists.txt create mode 100644 examples/corelib/ipc/CMakeLists.txt create mode 100644 examples/corelib/ipc/localfortuneclient/CMakeLists.txt create mode 100644 examples/corelib/ipc/localfortuneserver/CMakeLists.txt create mode 100644 examples/corelib/ipc/sharedmemory/CMakeLists.txt create mode 100644 examples/corelib/mimetypes/CMakeLists.txt create mode 100644 examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt create mode 100644 examples/corelib/serialization/CMakeLists.txt create mode 100644 examples/corelib/serialization/cbordump/CMakeLists.txt create mode 100644 examples/corelib/serialization/convert/CMakeLists.txt create mode 100644 examples/corelib/serialization/savegame/CMakeLists.txt create mode 100644 examples/corelib/threads/CMakeLists.txt create mode 100644 examples/corelib/threads/mandelbrot/CMakeLists.txt create mode 100644 examples/corelib/threads/queuedcustomtype/CMakeLists.txt create mode 100644 examples/corelib/threads/semaphores/CMakeLists.txt create mode 100644 examples/corelib/threads/waitconditions/CMakeLists.txt create mode 100644 examples/corelib/tools/CMakeLists.txt create mode 100644 examples/corelib/tools/contiguouscache/CMakeLists.txt create mode 100644 examples/corelib/tools/customtype/CMakeLists.txt create mode 100644 examples/corelib/tools/customtypesending/CMakeLists.txt create mode 100644 examples/dbus/CMakeLists.txt create mode 100644 examples/dbus/chat/CMakeLists.txt create mode 100644 examples/dbus/complexpingpong/CMakeLists.txt create mode 100644 examples/dbus/listnames/CMakeLists.txt create mode 100644 examples/dbus/pingpong/CMakeLists.txt create mode 100644 examples/dbus/remotecontrolledcar/CMakeLists.txt create mode 100644 examples/dbus/remotecontrolledcar/car/CMakeLists.txt create mode 100644 examples/dbus/remotecontrolledcar/controller/CMakeLists.txt create mode 100644 examples/embedded/CMakeLists.txt create mode 100644 examples/embedded/digiflip/CMakeLists.txt create mode 100644 examples/embedded/flickable/CMakeLists.txt create mode 100644 examples/embedded/flightinfo/CMakeLists.txt create mode 100644 examples/embedded/lightmaps/CMakeLists.txt create mode 100644 examples/embedded/raycasting/CMakeLists.txt create mode 100644 examples/embedded/styleexample/CMakeLists.txt create mode 100644 examples/gui/analogclock/CMakeLists.txt create mode 100644 examples/gui/openglwindow/CMakeLists.txt create mode 100644 examples/network/CMakeLists.txt create mode 100644 examples/network/bearermonitor/CMakeLists.txt create mode 100644 examples/network/blockingfortuneclient/CMakeLists.txt create mode 100644 examples/network/broadcastreceiver/CMakeLists.txt create mode 100644 examples/network/broadcastsender/CMakeLists.txt create mode 100644 examples/network/dnslookup/CMakeLists.txt create mode 100644 examples/network/download/CMakeLists.txt create mode 100644 examples/network/downloadmanager/CMakeLists.txt create mode 100644 examples/network/fortuneclient/CMakeLists.txt create mode 100644 examples/network/fortuneserver/CMakeLists.txt create mode 100644 examples/network/googlesuggest/CMakeLists.txt create mode 100644 examples/network/http/CMakeLists.txt create mode 100644 examples/network/loopback/CMakeLists.txt create mode 100644 examples/network/multicastreceiver/CMakeLists.txt create mode 100644 examples/network/multicastsender/CMakeLists.txt create mode 100644 examples/network/multistreamclient/CMakeLists.txt create mode 100644 examples/network/multistreamserver/CMakeLists.txt create mode 100644 examples/network/network-chat/CMakeLists.txt create mode 100644 examples/network/securesocketclient/CMakeLists.txt create mode 100644 examples/network/secureudpclient/CMakeLists.txt create mode 100644 examples/network/secureudpserver/CMakeLists.txt create mode 100644 examples/network/threadedfortuneserver/CMakeLists.txt create mode 100644 examples/network/torrent/CMakeLists.txt create mode 100644 examples/qpa/CMakeLists.txt create mode 100644 examples/qpa/qrasterwindow/CMakeLists.txt create mode 100644 examples/qpa/windows/CMakeLists.txt create mode 100644 examples/qtconcurrent/CMakeLists.txt create mode 100644 examples/qtconcurrent/imagescaling/CMakeLists.txt create mode 100644 examples/qtconcurrent/map/CMakeLists.txt create mode 100644 examples/qtconcurrent/progressdialog/CMakeLists.txt create mode 100644 examples/qtconcurrent/runfunction/CMakeLists.txt create mode 100644 examples/qtconcurrent/wordcount/CMakeLists.txt create mode 100644 examples/qtestlib/CMakeLists.txt create mode 100644 examples/qtestlib/tutorial1/CMakeLists.txt create mode 100644 examples/qtestlib/tutorial2/CMakeLists.txt create mode 100644 examples/qtestlib/tutorial3/CMakeLists.txt create mode 100644 examples/qtestlib/tutorial4/CMakeLists.txt create mode 100644 examples/qtestlib/tutorial5/CMakeLists.txt create mode 100644 examples/sql/CMakeLists.txt create mode 100644 examples/sql/books/CMakeLists.txt create mode 100644 examples/sql/cachedtable/CMakeLists.txt create mode 100644 examples/sql/drilldown/CMakeLists.txt create mode 100644 examples/sql/masterdetail/CMakeLists.txt create mode 100644 examples/sql/querymodel/CMakeLists.txt create mode 100644 examples/sql/relationaltablemodel/CMakeLists.txt create mode 100644 examples/sql/sqlbrowser/CMakeLists.txt create mode 100644 examples/sql/sqlwidgetmapper/CMakeLists.txt create mode 100644 examples/sql/tablemodel/CMakeLists.txt diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4eaab5064f0..71050b5790f 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,22 @@ -if(QT_FEATURE_gui) +add_subdirectory(corelib) +add_subdirectory(embedded) +add_subdirectory(qpa) + +if(TARGET Qt::DBus) + add_subdirectory(dbus) +endif() +if(TARGET Qt::Network) + add_subdirectory(network) +endif() +if(TARGET Qt::Test) + add_subdirectory(qtestlib) +endif() +if(TARGET Qt::Concurrent) + add_subdirectory(qtconcurrent) +endif() +if(TARGET Qt::Sql) + add_subdirectory(sql) +endif() +if(TARGET Qt::Gui) add_subdirectory(gui) endif() diff --git a/examples/corelib/CMakeLists.txt b/examples/corelib/CMakeLists.txt new file mode 100644 index 00000000000..3b61d307d97 --- /dev/null +++ b/examples/corelib/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from corelib.pro. + +add_subdirectory(ipc) +add_subdirectory(mimetypes) +add_subdirectory(serialization) +add_subdirectory(threads) +add_subdirectory(tools) diff --git a/examples/corelib/ipc/CMakeLists.txt b/examples/corelib/ipc/CMakeLists.txt new file mode 100644 index 00000000000..b134a3aa172 --- /dev/null +++ b/examples/corelib/ipc/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from ipc.pro. + + +if(QT_FEATURE_sharedmemory) + add_subdirectory(sharedmemory) +endif() + +if(TARGET Qt::Network) + + if(QT_FEATURE_localserver) + add_subdirectory(localfortuneserver) + add_subdirectory(localfortuneclient) + endif() +endif() diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt new file mode 100644 index 00000000000..39ef3f4e3ff --- /dev/null +++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from localfortuneclient.pro. + +##################################################################### +## localfortuneclient Binary: +##################################################################### + +add_qt_executable(localfortuneclient + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneclient" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneclient" + SOURCES + client.cpp client.h + main.cpp + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt new file mode 100644 index 00000000000..e94028413e8 --- /dev/null +++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from localfortuneserver.pro. + +##################################################################### +## localfortuneserver Binary: +##################################################################### + +add_qt_executable(localfortuneserver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneserver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneserver" + SOURCES + main.cpp + server.cpp server.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt new file mode 100644 index 00000000000..125cfbd2432 --- /dev/null +++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from sharedmemory.pro. + +##################################################################### +## sharedmemory Binary: +##################################################################### + +add_qt_executable(sharedmemory + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/sharedmemory" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/sharedmemory" + SOURCES + dialog.cpp dialog.h dialog.ui + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:sharedmemory.pro:: +# EXAMPLE_FILES = "*.png" diff --git a/examples/corelib/mimetypes/CMakeLists.txt b/examples/corelib/mimetypes/CMakeLists.txt new file mode 100644 index 00000000000..0b31e0db69c --- /dev/null +++ b/examples/corelib/mimetypes/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from mimetypes.pro. + + +if(TARGET Qt::Widgets) + add_subdirectory(mimetypebrowser) +endif() diff --git a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt new file mode 100644 index 00000000000..4bd2b5ca6af --- /dev/null +++ b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from mimetypebrowser.pro. + +##################################################################### +## mimetypebrowser Binary: +##################################################################### + +add_qt_executable(mimetypebrowser + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/mimetypes/mimetypebrowser" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/mimetypes/mimetypebrowser" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + mimetypemodel.cpp mimetypemodel.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:mimetypebrowser.pro:: +# CONFIG = "-app_bundle" "c++11" +# TEMPLATE = "app" diff --git a/examples/corelib/serialization/CMakeLists.txt b/examples/corelib/serialization/CMakeLists.txt new file mode 100644 index 00000000000..a64b5130d2a --- /dev/null +++ b/examples/corelib/serialization/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from serialization.pro. + +add_subdirectory(cbordump) +add_subdirectory(convert) +add_subdirectory(savegame) diff --git a/examples/corelib/serialization/cbordump/CMakeLists.txt b/examples/corelib/serialization/cbordump/CMakeLists.txt new file mode 100644 index 00000000000..b62181a2b7e --- /dev/null +++ b/examples/corelib/serialization/cbordump/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from cbordump.pro. + +##################################################################### +## cbordump Binary: +##################################################################### + +add_qt_executable(cbordump + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/cbordump" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/cbordump" + SOURCES + main.cpp + LIBRARIES + # Remove: gui +) + +#### Keys ignored in scope 1:.:cbordump.pro:: +# CONFIG = "-app_bundle" +# TEMPLATE = "app" diff --git a/examples/corelib/serialization/convert/CMakeLists.txt b/examples/corelib/serialization/convert/CMakeLists.txt new file mode 100644 index 00000000000..4dffb69c5bc --- /dev/null +++ b/examples/corelib/serialization/convert/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from convert.pro. + +##################################################################### +## convert Binary: +##################################################################### + +add_qt_executable(convert + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/convert" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/convert" + SOURCES + cborconverter.cpp cborconverter.h + converter.h + datastreamconverter.cpp datastreamconverter.h + jsonconverter.cpp jsonconverter.h + main.cpp + nullconverter.cpp nullconverter.h + textconverter.cpp textconverter.h + xmlconverter.cpp xmlconverter.h + LIBRARIES + # Remove: gui +) + +#### Keys ignored in scope 1:.:convert.pro:: +# CONFIG = "-app_bundle" +# TEMPLATE = "app" diff --git a/examples/corelib/serialization/savegame/CMakeLists.txt b/examples/corelib/serialization/savegame/CMakeLists.txt new file mode 100644 index 00000000000..175fca270f8 --- /dev/null +++ b/examples/corelib/serialization/savegame/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from savegame.pro. + +##################################################################### +## savegame Binary: +##################################################################### + +add_qt_executable(savegame + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/savegame" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/savegame" + SOURCES + character.cpp character.h + game.cpp game.h + level.cpp level.h + main.cpp + LIBRARIES + # Remove: gui +) + +#### Keys ignored in scope 1:.:savegame.pro:: +# CONFIG = "-app_bundle" +# TEMPLATE = "app" diff --git a/examples/corelib/threads/CMakeLists.txt b/examples/corelib/threads/CMakeLists.txt new file mode 100644 index 00000000000..b13dd16d93c --- /dev/null +++ b/examples/corelib/threads/CMakeLists.txt @@ -0,0 +1,9 @@ +# Generated from threads.pro. + +add_subdirectory(semaphores) +add_subdirectory(waitconditions) + +if(TARGET Qt::Widgets) + add_subdirectory(mandelbrot) + add_subdirectory(queuedcustomtype) +endif() diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt new file mode 100644 index 00000000000..00f27bacd9f --- /dev/null +++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from mandelbrot.pro. + +##################################################################### +## mandelbrot Binary: +##################################################################### + +add_qt_executable(mandelbrot + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/mandelbrot" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/mandelbrot" + SOURCES + main.cpp + mandelbrotwidget.cpp mandelbrotwidget.h + renderthread.cpp renderthread.h + LIBRARIES + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(mandelbrot CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS + LIBRARIES + m +) diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt new file mode 100644 index 00000000000..b86092bf269 --- /dev/null +++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from queuedcustomtype.pro. + +##################################################################### +## queuedcustomtype Binary: +##################################################################### + +add_qt_executable(queuedcustomtype + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/queuedcustomtype" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/queuedcustomtype" + SOURCES + block.cpp block.h + main.cpp + renderthread.cpp renderthread.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/corelib/threads/semaphores/CMakeLists.txt b/examples/corelib/threads/semaphores/CMakeLists.txt new file mode 100644 index 00000000000..d94f1ba5b45 --- /dev/null +++ b/examples/corelib/threads/semaphores/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from semaphores.pro. + +##################################################################### +## semaphores Binary: +##################################################################### + +add_qt_executable(semaphores + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/semaphores" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/semaphores" + SOURCES + semaphores.cpp +) + +#### Keys ignored in scope 1:.:semaphores.pro:: +# CONFIG = "-app_bundle" "console" diff --git a/examples/corelib/threads/waitconditions/CMakeLists.txt b/examples/corelib/threads/waitconditions/CMakeLists.txt new file mode 100644 index 00000000000..0a347c1cdd1 --- /dev/null +++ b/examples/corelib/threads/waitconditions/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from waitconditions.pro. + +##################################################################### +## waitconditions Binary: +##################################################################### + +add_qt_executable(waitconditions + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/waitconditions" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/waitconditions" + SOURCES + waitconditions.cpp +) + +#### Keys ignored in scope 1:.:waitconditions.pro:: +# CONFIG = "-moc" "-app_bundle" "console" diff --git a/examples/corelib/tools/CMakeLists.txt b/examples/corelib/tools/CMakeLists.txt new file mode 100644 index 00000000000..d25014ee3c0 --- /dev/null +++ b/examples/corelib/tools/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from tools.pro. + +add_subdirectory(contiguouscache) +add_subdirectory(customtype) +add_subdirectory(customtypesending) diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt new file mode 100644 index 00000000000..68afb7221de --- /dev/null +++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from contiguouscache.pro. + +##################################################################### +## contiguouscache Binary: +##################################################################### + +add_qt_executable(contiguouscache + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/contiguouscache" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/contiguouscache" + SOURCES + main.cpp + randomlistmodel.cpp randomlistmodel.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt new file mode 100644 index 00000000000..e26846da824 --- /dev/null +++ b/examples/corelib/tools/customtype/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from customtype.pro. + +##################################################################### +## customtype Binary: +##################################################################### + +add_qt_executable(customtype + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtype" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtype" + SOURCES + main.cpp + message.cpp message.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt new file mode 100644 index 00000000000..a069f735072 --- /dev/null +++ b/examples/corelib/tools/customtypesending/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from customtypesending.pro. + +##################################################################### +## customtypesending Binary: +##################################################################### + +add_qt_executable(customtypesending + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtypesending" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtypesending" + SOURCES + main.cpp + message.cpp message.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/dbus/CMakeLists.txt b/examples/dbus/CMakeLists.txt new file mode 100644 index 00000000000..42a3df658ab --- /dev/null +++ b/examples/dbus/CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from dbus.pro. + +add_subdirectory(listnames) +add_subdirectory(pingpong) + +if(QT_FEATURE_process) + add_subdirectory(complexpingpong) +endif() + +if(TARGET Qt::Widgets) + add_subdirectory(chat) + add_subdirectory(remotecontrolledcar) +endif() diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt new file mode 100644 index 00000000000..68abe95da67 --- /dev/null +++ b/examples/dbus/chat/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from chat.pro. + +##################################################################### +## chat Binary: +##################################################################### + +add_qt_executable(chat + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/chat" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/chat" + SOURCES + chat.cpp chat.h + chatmainwindow.ui + chatsetnickname.ui + DBUS_ADAPTOR_SOURCES + org.example.chat.xml + DBUS_INTERFACE_SOURCES + org.example.chat.xml + LIBRARIES + Qt::DBus + Qt::Widgets +) diff --git a/examples/dbus/complexpingpong/CMakeLists.txt b/examples/dbus/complexpingpong/CMakeLists.txt new file mode 100644 index 00000000000..cccb9584af6 --- /dev/null +++ b/examples/dbus/complexpingpong/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from complexpong.pro. + +##################################################################### +## complexpong Binary: +##################################################################### + +add_qt_executable(complexpong + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/complexpingpong" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/complexpingpong" + SOURCES + complexpong.cpp complexpong.h + LIBRARIES + # Remove: gui + Qt::DBus +) diff --git a/examples/dbus/listnames/CMakeLists.txt b/examples/dbus/listnames/CMakeLists.txt new file mode 100644 index 00000000000..eb622b0ef66 --- /dev/null +++ b/examples/dbus/listnames/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from listnames.pro. + +##################################################################### +## listnames Binary: +##################################################################### + +add_qt_executable(listnames + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/listnames" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/listnames" + SOURCES + listnames.cpp + LIBRARIES + # Remove: gui + Qt::DBus +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:listnames.pro:WIN32: +# CONFIG = "console" diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt new file mode 100644 index 00000000000..0979c8d4877 --- /dev/null +++ b/examples/dbus/pingpong/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from pingpong.pro. + +##################################################################### +## ping Binary: +##################################################################### + +add_qt_executable(ping + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" + SOURCES + ping.cpp + ping-common.h + LIBRARIES + # Remove: gui + Qt::DBus +) +##################################################################### +## pong Binary: +##################################################################### + +add_qt_executable(pong + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" + SOURCES + ping-common.h + pong.cpp pong.h + LIBRARIES + # Remove: gui + Qt::DBus +) + +if(WIN32) +endif() diff --git a/examples/dbus/remotecontrolledcar/CMakeLists.txt b/examples/dbus/remotecontrolledcar/CMakeLists.txt new file mode 100644 index 00000000000..4d419199627 --- /dev/null +++ b/examples/dbus/remotecontrolledcar/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from remotecontrolledcar.pro. + +add_subdirectory(car) +add_subdirectory(controller) diff --git a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt new file mode 100644 index 00000000000..a8aed5413ad --- /dev/null +++ b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from car.pro. + +##################################################################### +## car Binary: +##################################################################### + +add_qt_executable(car + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/car" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/car" + SOURCES + car.cpp car.h + main.cpp + DBUS_ADAPTOR_SOURCES + car.xml + LIBRARIES + Qt::DBus + Qt::Widgets +) diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt new file mode 100644 index 00000000000..c9902e2519f --- /dev/null +++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from controller.pro. + +##################################################################### +## controller Binary: +##################################################################### + +add_qt_executable(controller + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/controller" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/controller" + SOURCES + controller.cpp controller.h controller.ui + main.cpp + DBUS_INTERFACE_SOURCES + car.xml + LIBRARIES + Qt::DBus + Qt::Widgets +) diff --git a/examples/embedded/CMakeLists.txt b/examples/embedded/CMakeLists.txt new file mode 100644 index 00000000000..bd7720809a4 --- /dev/null +++ b/examples/embedded/CMakeLists.txt @@ -0,0 +1,8 @@ +# Generated from embedded.pro. + +add_subdirectory(styleexample) +add_subdirectory(raycasting) +add_subdirectory(flickable) +add_subdirectory(digiflip) +add_subdirectory(lightmaps) +add_subdirectory(flightinfo) diff --git a/examples/embedded/digiflip/CMakeLists.txt b/examples/embedded/digiflip/CMakeLists.txt new file mode 100644 index 00000000000..3786ed38a46 --- /dev/null +++ b/examples/embedded/digiflip/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from digiflip.pro. + +##################################################################### +## digiflip Binary: +##################################################################### + +add_qt_executable(digiflip + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/digiflip" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/digiflip" + SOURCES + digiflip.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/embedded/flickable/CMakeLists.txt b/examples/embedded/flickable/CMakeLists.txt new file mode 100644 index 00000000000..20f8eca9f5a --- /dev/null +++ b/examples/embedded/flickable/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from flickable.pro. + +##################################################################### +## flickable Binary: +##################################################################### + +add_qt_executable(flickable + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flickable" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flickable" + SOURCES + flickable.cpp flickable.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/embedded/flightinfo/CMakeLists.txt b/examples/embedded/flightinfo/CMakeLists.txt new file mode 100644 index 00000000000..b7d8441b961 --- /dev/null +++ b/examples/embedded/flightinfo/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from flightinfo.pro. + +##################################################################### +## flightinfo Binary: +##################################################################### + +add_qt_executable(flightinfo + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flightinfo" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flightinfo" + SOURCES + flightinfo.cpp + form.ui + LIBRARIES + Qt::Network + Qt::Widgets +) + +# Resources: +add_qt_resource(flightinfo "flightinfo" PREFIX "/" FILES + aircraft.png) + + +#### Keys ignored in scope 1:.:flightinfo.pro:: +# TEMPLATE = "app" diff --git a/examples/embedded/lightmaps/CMakeLists.txt b/examples/embedded/lightmaps/CMakeLists.txt new file mode 100644 index 00000000000..4779d07adc4 --- /dev/null +++ b/examples/embedded/lightmaps/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from lightmaps.pro. + +##################################################################### +## lightmaps Binary: +##################################################################### + +add_qt_executable(lightmaps + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/lightmaps" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/lightmaps" + SOURCES + lightmaps.cpp lightmaps.h + main.cpp + mapzoom.cpp mapzoom.h + slippymap.cpp slippymap.h + LIBRARIES + Qt::Network + Qt::Widgets +) + +#### Keys ignored in scope 1:.:lightmaps.pro:: +# TEMPLATE = "app" diff --git a/examples/embedded/raycasting/CMakeLists.txt b/examples/embedded/raycasting/CMakeLists.txt new file mode 100644 index 00000000000..3757bb756a1 --- /dev/null +++ b/examples/embedded/raycasting/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from raycasting.pro. + +##################################################################### +## raycasting Binary: +##################################################################### + +add_qt_executable(raycasting + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/raycasting" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/raycasting" + SOURCES + raycasting.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(raycasting "raycasting" PREFIX "/" FILES + textures.png) + + +#### Keys ignored in scope 1:.:raycasting.pro:: +# TEMPLATE = "app" diff --git a/examples/embedded/styleexample/CMakeLists.txt b/examples/embedded/styleexample/CMakeLists.txt new file mode 100644 index 00000000000..9c82adc99de --- /dev/null +++ b/examples/embedded/styleexample/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from styleexample.pro. + +##################################################################### +## styleexample Binary: +##################################################################### + +add_qt_executable(styleexample + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/styleexample" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/styleexample" + SOURCES + main.cpp + stylewidget.cpp stylewidget.h stylewidget.ui + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(styleexample "styleexample" PREFIX "/" FILES + files/add.png + files/application.qss + files/blue.qss + files/khaki.qss + files/nature_1.jpg + files/nostyle.qss + files/remove.png + files/transparent.qss) + diff --git a/examples/gui/CMakeLists.txt b/examples/gui/CMakeLists.txt index ac96b7351c4..7ae4c6bc6a2 100644 --- a/examples/gui/CMakeLists.txt +++ b/examples/gui/CMakeLists.txt @@ -1 +1,8 @@ +# Generated from gui.pro. + +add_subdirectory(analogclock) add_subdirectory(rasterwindow) + +if(TARGET Qt::Gui AND QT_FEATURE_opengl) + add_subdirectory(openglwindow) +endif() diff --git a/examples/gui/analogclock/CMakeLists.txt b/examples/gui/analogclock/CMakeLists.txt new file mode 100644 index 00000000000..99a879c57a6 --- /dev/null +++ b/examples/gui/analogclock/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from analogclock.pro. + +##################################################################### +## analogclock Binary: +##################################################################### + +add_qt_executable(analogclock + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/analogclock" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/analogclock" + SOURCES + ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h + main.cpp + INCLUDE_DIRECTORIES + ../rasterwindow + LIBRARIES # special case + Qt::Gui +) + +#### Keys ignored in scope 1:.:analogclock.pro:: +# CONFIG = "no_batch" diff --git a/examples/gui/openglwindow/CMakeLists.txt b/examples/gui/openglwindow/CMakeLists.txt new file mode 100644 index 00000000000..a59ba143467 --- /dev/null +++ b/examples/gui/openglwindow/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from openglwindow.pro. + +##################################################################### +## openglwindow Binary: +##################################################################### + +add_qt_executable(openglwindow + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/openglwindow" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/openglwindow" + SOURCES + main.cpp + openglwindow.cpp openglwindow.h + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + LIBRARIES # special case + Qt::Gui +) diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt index 667f91c268e..61255f30389 100644 --- a/examples/gui/rasterwindow/CMakeLists.txt +++ b/examples/gui/rasterwindow/CMakeLists.txt @@ -1,6 +1,18 @@ +# Generated from rasterwindow.pro. + +##################################################################### +## rasterwindow Binary: +##################################################################### + add_qt_executable(rasterwindow - SOURCES - main.cpp - rasterwindow.cpp rasterwindow.h - LIBRARIES Qt::Core Qt::Test Qt::Gui + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/rasterwindow" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/rasterwindow" + SOURCES + main.cpp + rasterwindow.cpp rasterwindow.h + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + LIBRARIES # special case + Qt::Gui ) diff --git a/examples/network/CMakeLists.txt b/examples/network/CMakeLists.txt new file mode 100644 index 00000000000..af1f923dc67 --- /dev/null +++ b/examples/network/CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from network.pro. + +add_subdirectory(download) +add_subdirectory(downloadmanager) + +if(NOT INTEGRITY) + add_subdirectory(dnslookup) +endif() + +if(TARGET Qt::Widgets) + add_subdirectory(blockingfortuneclient) + add_subdirectory(broadcastreceiver) + add_subdirectory(broadcastsender) + add_subdirectory(http) + add_subdirectory(loopback) + add_subdirectory(threadedfortuneserver) + add_subdirectory(googlesuggest) + # add_subdirectory(torrent) FIXME: This does not find its ui file:-/ + add_subdirectory(multicastreceiver) + add_subdirectory(multicastsender) + + if(QT_FEATURE_bearermanagement) + add_subdirectory(bearermonitor) + add_subdirectory(fortuneclient) + add_subdirectory(fortuneserver) + + if(QT_FEATURE_processenvironment) + add_subdirectory(network-chat) + endif() + endif() + + if(QT_FEATURE_openssl) + add_subdirectory(securesocketclient) + endif() + + if(QT_FEATURE_dtls) + add_subdirectory(secureudpserver) + add_subdirectory(secureudpclient) + endif() + + if(QT_FEATURE_sctp) + add_subdirectory(multistreamserver) + add_subdirectory(multistreamclient) + endif() +endif() diff --git a/examples/network/bearermonitor/CMakeLists.txt b/examples/network/bearermonitor/CMakeLists.txt new file mode 100644 index 00000000000..001e5c7e2ed --- /dev/null +++ b/examples/network/bearermonitor/CMakeLists.txt @@ -0,0 +1,31 @@ +# Generated from bearermonitor.pro. + +##################################################################### +## bearermonitor Binary: +##################################################################### + +add_qt_executable(bearermonitor + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/bearermonitor" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/bearermonitor" + SOURCES + bearermonitor.cpp bearermonitor.h + bearermonitor_240_320.ui + bearermonitor_640_480.ui + main.cpp + sessionwidget.cpp sessionwidget.h sessionwidget.ui + LIBRARIES + Qt::Gui + Qt::Network + Qt::Widgets +) + +#### Keys ignored in scope 1:.:bearermonitor.pro:: +# CONFIG = "console" + +## Scopes: +##################################################################### + +extend_target(bearermonitor CONDITION WIN32 + LIBRARIES + ws2_32 +) diff --git a/examples/network/blockingfortuneclient/CMakeLists.txt b/examples/network/blockingfortuneclient/CMakeLists.txt new file mode 100644 index 00000000000..bedbf2f6070 --- /dev/null +++ b/examples/network/blockingfortuneclient/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from blockingfortuneclient.pro. + +##################################################################### +## blockingfortuneclient Binary: +##################################################################### + +add_qt_executable(blockingfortuneclient + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/blockingfortuneclient" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/blockingfortuneclient" + SOURCES + blockingclient.cpp blockingclient.h + fortunethread.cpp fortunethread.h + main.cpp + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/broadcastreceiver/CMakeLists.txt b/examples/network/broadcastreceiver/CMakeLists.txt new file mode 100644 index 00000000000..197e56cef05 --- /dev/null +++ b/examples/network/broadcastreceiver/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from broadcastreceiver.pro. + +##################################################################### +## broadcastreceiver Binary: +##################################################################### + +add_qt_executable(broadcastreceiver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastreceiver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastreceiver" + SOURCES + main.cpp + receiver.cpp receiver.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/broadcastsender/CMakeLists.txt b/examples/network/broadcastsender/CMakeLists.txt new file mode 100644 index 00000000000..8fd49d85787 --- /dev/null +++ b/examples/network/broadcastsender/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from broadcastsender.pro. + +##################################################################### +## broadcastsender Binary: +##################################################################### + +add_qt_executable(broadcastsender + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastsender" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastsender" + SOURCES + main.cpp + sender.cpp sender.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/dnslookup/CMakeLists.txt b/examples/network/dnslookup/CMakeLists.txt new file mode 100644 index 00000000000..6ffc633a967 --- /dev/null +++ b/examples/network/dnslookup/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from dnslookup.pro. + +##################################################################### +## dnslookup Binary: +##################################################################### + +add_qt_executable(dnslookup + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/dnslookup" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/dnslookup" + SOURCES + dnslookup.cpp dnslookup.h + LIBRARIES + Qt::Network +) + +#### Keys ignored in scope 1:.:dnslookup.pro:: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:dnslookup.pro:APPLE_OSX: +# CONFIG = "-app_bundle" + +#### Keys ignored in scope 3:.:dnslookup.pro:WIN32: +# CONFIG = "console" diff --git a/examples/network/download/CMakeLists.txt b/examples/network/download/CMakeLists.txt new file mode 100644 index 00000000000..868685fd0a9 --- /dev/null +++ b/examples/network/download/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from download.pro. + +##################################################################### +## download Binary: +##################################################################### + +add_qt_executable(download + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/download" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/download" + SOURCES + main.cpp + LIBRARIES + Qt::Network +) + +#### Keys ignored in scope 1:.:download.pro:: +# CONFIG = "-app_bundle" diff --git a/examples/network/downloadmanager/CMakeLists.txt b/examples/network/downloadmanager/CMakeLists.txt new file mode 100644 index 00000000000..a5ccac9178f --- /dev/null +++ b/examples/network/downloadmanager/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from downloadmanager.pro. + +##################################################################### +## downloadmanager Binary: +##################################################################### + +add_qt_executable(downloadmanager + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/downloadmanager" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/downloadmanager" + SOURCES + downloadmanager.cpp downloadmanager.h + main.cpp + textprogressbar.cpp textprogressbar.h + LIBRARIES + Qt::Network +) + +#### Keys ignored in scope 1:.:downloadmanager.pro:: +# CONFIG = "-app_bundle" +# OTHER_FILES = "debian/changelog" "debian/compat" "debian/control" "debian/copyright" "debian/README" "debian/rules" diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt new file mode 100644 index 00000000000..bbeecf9c642 --- /dev/null +++ b/examples/network/fortuneclient/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from fortuneclient.pro. + +##################################################################### +## fortuneclient Binary: +##################################################################### + +add_qt_executable(fortuneclient + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneclient" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneclient" + SOURCES + client.cpp client.h + main.cpp + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/fortuneserver/CMakeLists.txt b/examples/network/fortuneserver/CMakeLists.txt new file mode 100644 index 00000000000..299f43910f7 --- /dev/null +++ b/examples/network/fortuneserver/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from fortuneserver.pro. + +##################################################################### +## fortuneserver Binary: +##################################################################### + +add_qt_executable(fortuneserver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneserver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneserver" + SOURCES + main.cpp + server.cpp server.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt new file mode 100644 index 00000000000..ef5deedb801 --- /dev/null +++ b/examples/network/googlesuggest/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from googlesuggest.pro. + +##################################################################### +## googlesuggest Binary: +##################################################################### + +add_qt_executable(googlesuggest + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/googlesuggest" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/googlesuggest" + SOURCES + googlesuggest.cpp googlesuggest.h + main.cpp + searchbox.cpp searchbox.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt new file mode 100644 index 00000000000..d1c61f1c98c --- /dev/null +++ b/examples/network/http/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from http.pro. + +##################################################################### +## http Binary: +##################################################################### + +add_qt_executable(http + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/http" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/http" + SOURCES + authenticationdialog.ui + httpwindow.cpp httpwindow.h + main.cpp + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/loopback/CMakeLists.txt b/examples/network/loopback/CMakeLists.txt new file mode 100644 index 00000000000..566b48a76e7 --- /dev/null +++ b/examples/network/loopback/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from loopback.pro. + +##################################################################### +## loopback Binary: +##################################################################### + +add_qt_executable(loopback + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/loopback" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/loopback" + SOURCES + dialog.cpp dialog.h + main.cpp + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/multicastreceiver/CMakeLists.txt b/examples/network/multicastreceiver/CMakeLists.txt new file mode 100644 index 00000000000..11204015f22 --- /dev/null +++ b/examples/network/multicastreceiver/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from multicastreceiver.pro. + +##################################################################### +## multicastreceiver Binary: +##################################################################### + +add_qt_executable(multicastreceiver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastreceiver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastreceiver" + SOURCES + main.cpp + receiver.cpp receiver.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/multicastsender/CMakeLists.txt b/examples/network/multicastsender/CMakeLists.txt new file mode 100644 index 00000000000..e02a6b7145a --- /dev/null +++ b/examples/network/multicastsender/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from multicastsender.pro. + +##################################################################### +## multicastsender Binary: +##################################################################### + +add_qt_executable(multicastsender + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastsender" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastsender" + SOURCES + main.cpp + sender.cpp sender.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/multistreamclient/CMakeLists.txt b/examples/network/multistreamclient/CMakeLists.txt new file mode 100644 index 00000000000..b9f10f3fd5e --- /dev/null +++ b/examples/network/multistreamclient/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from multistreamclient.pro. + +##################################################################### +## multistreamclient Binary: +##################################################################### + +add_qt_executable(multistreamclient + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamclient" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamclient" + SOURCES + chatconsumer.cpp chatconsumer.h + client.cpp client.h + consumer.h + main.cpp + movieconsumer.cpp movieconsumer.h + timeconsumer.cpp timeconsumer.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/multistreamserver/CMakeLists.txt b/examples/network/multistreamserver/CMakeLists.txt new file mode 100644 index 00000000000..34759951782 --- /dev/null +++ b/examples/network/multistreamserver/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from multistreamserver.pro. + +##################################################################### +## multistreamserver Binary: +##################################################################### + +add_qt_executable(multistreamserver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamserver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamserver" + SOURCES + chatprovider.cpp chatprovider.h + main.cpp + movieprovider.cpp movieprovider.h + provider.h + server.cpp server.h + timeprovider.cpp timeprovider.h + LIBRARIES + Qt::Network + Qt::Widgets +) + +#### Keys ignored in scope 1:.:multistreamserver.pro:: +# EXAMPLE_FILES = "animation.gif" diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt new file mode 100644 index 00000000000..56cd632529c --- /dev/null +++ b/examples/network/network-chat/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from network-chat.pro. + +##################################################################### +## network-chat Binary: +##################################################################### + +add_qt_executable(network-chat + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/network-chat" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/network-chat" + SOURCES + chatdialog.cpp chatdialog.h chatdialog.ui + client.cpp client.h + connection.cpp connection.h + main.cpp + peermanager.cpp peermanager.h + server.cpp server.h + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt new file mode 100644 index 00000000000..e6fdd6b2ca4 --- /dev/null +++ b/examples/network/securesocketclient/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from securesocketclient.pro. + +##################################################################### +## securesocketclient Binary: +##################################################################### + +add_qt_executable(securesocketclient + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/securesocketclient" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/securesocketclient" + SOURCES + certificateinfo.cpp certificateinfo.h certificateinfo.ui + main.cpp + sslclient.cpp sslclient.h sslclient.ui + sslerrors.ui + LIBRARIES + Qt::Network + Qt::Widgets +) + +# Resources: +add_qt_resource(securesocketclient "securesocketclient" FILES + encrypted.png) + diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt new file mode 100644 index 00000000000..02dfd77fe07 --- /dev/null +++ b/examples/network/secureudpclient/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from secureudpclient.pro. + +##################################################################### +## secureudpclient Binary: +##################################################################### + +add_qt_executable(secureudpclient + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpclient" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpclient" + SOURCES + addressdialog.cpp addressdialog.h addressdialog.ui + association.cpp association.h + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + LIBRARIES + Qt::Widgets + Qt::Network +) + +#### Keys ignored in scope 1:.:secureudpclient.pro:: +# TEMPLATE = "app" diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt new file mode 100644 index 00000000000..c7d97420ae5 --- /dev/null +++ b/examples/network/secureudpserver/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from secureudpserver.pro. + +##################################################################### +## secureudpserver Binary: +##################################################################### + +add_qt_executable(secureudpserver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpserver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpserver" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + nicselector.cpp nicselector.h nicselector.ui + server.cpp server.h + LIBRARIES + Qt::Widgets + Qt::Network +) + +#### Keys ignored in scope 1:.:secureudpserver.pro:: +# TEMPLATE = "app" diff --git a/examples/network/threadedfortuneserver/CMakeLists.txt b/examples/network/threadedfortuneserver/CMakeLists.txt new file mode 100644 index 00000000000..124ac1d1cce --- /dev/null +++ b/examples/network/threadedfortuneserver/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from threadedfortuneserver.pro. + +##################################################################### +## threadedfortuneserver Binary: +##################################################################### + +add_qt_executable(threadedfortuneserver + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/threadedfortuneserver" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/threadedfortuneserver" + SOURCES + dialog.cpp dialog.h + fortuneserver.cpp fortuneserver.h + fortunethread.cpp fortunethread.h + main.cpp + LIBRARIES + Qt::Network + Qt::Widgets +) diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt new file mode 100644 index 00000000000..f8cbc071ff8 --- /dev/null +++ b/examples/network/torrent/CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from torrent.pro. + +##################################################################### +## torrent Binary: +##################################################################### + +add_qt_executable(torrent + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" + SOURCES + addtorrentdialog.cpp addtorrentdialog.h + bencodeparser.cpp bencodeparser.h + connectionmanager.cpp connectionmanager.h + filemanager.cpp filemanager.h + forms/addtorrentform.ui + main.cpp + mainwindow.cpp mainwindow.h + metainfo.cpp metainfo.h + peerwireclient.cpp peerwireclient.h + ratecontroller.cpp ratecontroller.h + torrentclient.cpp torrentclient.h + torrentserver.cpp torrentserver.h + trackerclient.cpp trackerclient.h + INCLUDE_DIRECTORIES + forms # special case + LIBRARIES + Qt::Network + Qt::Widgets +) + +# Resources: +add_qt_resource(torrent "icons" PREFIX "/" FILES + icons/1downarrow.png + icons/1uparrow.png + icons/bottom.png + icons/exit.png + icons/peertopeer.png + icons/player_pause.png + icons/player_play.png + icons/player_stop.png) + diff --git a/examples/qpa/CMakeLists.txt b/examples/qpa/CMakeLists.txt new file mode 100644 index 00000000000..0ae7f61e57e --- /dev/null +++ b/examples/qpa/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from qpa.pro. + +add_subdirectory(windows) +add_subdirectory(qrasterwindow) diff --git a/examples/qpa/qrasterwindow/CMakeLists.txt b/examples/qpa/qrasterwindow/CMakeLists.txt new file mode 100644 index 00000000000..0eae5b28afa --- /dev/null +++ b/examples/qpa/qrasterwindow/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from qrasterwindow.pro. + +##################################################################### +## qrasterwindow Binary: +##################################################################### + +add_qt_executable(qrasterwindow + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/qrasterwindow" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/qrasterwindow" + SOURCES + main.cpp + LIBRARIES + Qt::Gui # special case +) diff --git a/examples/qpa/windows/CMakeLists.txt b/examples/qpa/windows/CMakeLists.txt new file mode 100644 index 00000000000..55135e02ffe --- /dev/null +++ b/examples/qpa/windows/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from windows.pro. + +##################################################################### +## windows Binary: +##################################################################### + +add_qt_executable(windows + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/windows" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/windows" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::GuiPrivate + Qt::CorePrivate +) + +#### Keys ignored in scope 1:.:windows.pro:: +# CONFIG = "console" diff --git a/examples/qtconcurrent/CMakeLists.txt b/examples/qtconcurrent/CMakeLists.txt new file mode 100644 index 00000000000..13cfed87734 --- /dev/null +++ b/examples/qtconcurrent/CMakeLists.txt @@ -0,0 +1,9 @@ +if(TARGET Qt::Gui) + add_subdirectory(map) +endif() +if(TARGET Qt::Widgets) + add_subdirectory(imagescaling) + add_subdirectory(progressdialog) + add_subdirectory(runfunction) + add_subdirectory(wordcount) +endif() diff --git a/examples/qtconcurrent/imagescaling/CMakeLists.txt b/examples/qtconcurrent/imagescaling/CMakeLists.txt new file mode 100644 index 00000000000..0de3f26c5e4 --- /dev/null +++ b/examples/qtconcurrent/imagescaling/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from imagescaling.pro. + +##################################################################### +## imagescaling Binary: +##################################################################### + +add_qt_executable(imagescaling + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/imagescaling" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/imagescaling" + SOURCES + imagescaling.cpp imagescaling.h + main.cpp + LIBRARIES + Qt::Concurrent + Qt::Widgets +) diff --git a/examples/qtconcurrent/map/CMakeLists.txt b/examples/qtconcurrent/map/CMakeLists.txt new file mode 100644 index 00000000000..147b91236b3 --- /dev/null +++ b/examples/qtconcurrent/map/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from map.pro. + +##################################################################### +## mapdemo Binary: +##################################################################### + +add_qt_executable(mapdemo + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/map" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/map" + SOURCES + main.cpp + LIBRARIES + Qt::Concurrent + Qt::Gui # special case +) + +#### Keys ignored in scope 1:.:map.pro:: +# CONFIG = "-app_bundle" +# TEMPLATE = "app" diff --git a/examples/qtconcurrent/progressdialog/CMakeLists.txt b/examples/qtconcurrent/progressdialog/CMakeLists.txt new file mode 100644 index 00000000000..3aae4af0847 --- /dev/null +++ b/examples/qtconcurrent/progressdialog/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from progressdialog.pro. + +##################################################################### +## progressdialog Binary: +##################################################################### + +add_qt_executable(progressdialog + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/progressdialog" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/progressdialog" + SOURCES + main.cpp + LIBRARIES + Qt::Concurrent + Qt::Widgets +) + +#### Keys ignored in scope 1:.:progressdialog.pro:: +# CONFIG = "console" diff --git a/examples/qtconcurrent/runfunction/CMakeLists.txt b/examples/qtconcurrent/runfunction/CMakeLists.txt new file mode 100644 index 00000000000..c400b44cf61 --- /dev/null +++ b/examples/qtconcurrent/runfunction/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from runfunction.pro. + +##################################################################### +## runfunction Binary: +##################################################################### + +add_qt_executable(runfunction + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction" + SOURCES + main.cpp + LIBRARIES + Qt::Concurrent + Qt::Widgets +) + +#### Keys ignored in scope 1:.:runfunction.pro:: +# CONFIG = "-app_bundle" diff --git a/examples/qtconcurrent/wordcount/CMakeLists.txt b/examples/qtconcurrent/wordcount/CMakeLists.txt new file mode 100644 index 00000000000..9bb2ac58d71 --- /dev/null +++ b/examples/qtconcurrent/wordcount/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from wordcount.pro. + +##################################################################### +## wordcount Binary: +##################################################################### + +add_qt_executable(wordcount + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/wordcount" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/wordcount" + SOURCES + main.cpp + LIBRARIES + Qt::Concurrent + Qt::Widgets +) + +#### Keys ignored in scope 1:.:wordcount.pro:: +# CONFIG = "-app_bundle" diff --git a/examples/qtestlib/CMakeLists.txt b/examples/qtestlib/CMakeLists.txt new file mode 100644 index 00000000000..83e7df57686 --- /dev/null +++ b/examples/qtestlib/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from qtestlib.pro. + +add_subdirectory(tutorial1) +add_subdirectory(tutorial2) +add_subdirectory(tutorial3) +add_subdirectory(tutorial4) +add_subdirectory(tutorial5) diff --git a/examples/qtestlib/tutorial1/CMakeLists.txt b/examples/qtestlib/tutorial1/CMakeLists.txt new file mode 100644 index 00000000000..6e489e329fd --- /dev/null +++ b/examples/qtestlib/tutorial1/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tutorial1.pro. + +##################################################################### +## tutorial1 Binary: +##################################################################### + +add_qt_executable(tutorial1 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial1" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial1" + SOURCES + testqstring.cpp + LIBRARIES + Qt::Widgets + Qt::Test +) diff --git a/examples/qtestlib/tutorial2/CMakeLists.txt b/examples/qtestlib/tutorial2/CMakeLists.txt new file mode 100644 index 00000000000..06288ce50b6 --- /dev/null +++ b/examples/qtestlib/tutorial2/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tutorial2.pro. + +##################################################################### +## tutorial2 Binary: +##################################################################### + +add_qt_executable(tutorial2 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial2" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial2" + SOURCES + testqstring.cpp + LIBRARIES + Qt::Widgets + Qt::Test +) diff --git a/examples/qtestlib/tutorial3/CMakeLists.txt b/examples/qtestlib/tutorial3/CMakeLists.txt new file mode 100644 index 00000000000..79683e0cfcb --- /dev/null +++ b/examples/qtestlib/tutorial3/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tutorial3.pro. + +##################################################################### +## tutorial3 Binary: +##################################################################### + +add_qt_executable(tutorial3 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial3" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial3" + SOURCES + testgui.cpp + LIBRARIES + Qt::Widgets + Qt::Test +) diff --git a/examples/qtestlib/tutorial4/CMakeLists.txt b/examples/qtestlib/tutorial4/CMakeLists.txt new file mode 100644 index 00000000000..2f3d2bb88ac --- /dev/null +++ b/examples/qtestlib/tutorial4/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tutorial4.pro. + +##################################################################### +## tutorial4 Binary: +##################################################################### + +add_qt_executable(tutorial4 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial4" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial4" + SOURCES + testgui.cpp + LIBRARIES + Qt::Widgets + Qt::Test +) diff --git a/examples/qtestlib/tutorial5/CMakeLists.txt b/examples/qtestlib/tutorial5/CMakeLists.txt new file mode 100644 index 00000000000..e4af9b354c5 --- /dev/null +++ b/examples/qtestlib/tutorial5/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tutorial5.pro. + +##################################################################### +## tutorial5 Binary: +##################################################################### + +add_qt_executable(tutorial5 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial5" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial5" + SOURCES + benchmarking.cpp + LIBRARIES + Qt::Widgets + Qt::Test +) diff --git a/examples/sql/CMakeLists.txt b/examples/sql/CMakeLists.txt new file mode 100644 index 00000000000..ca15f22baf2 --- /dev/null +++ b/examples/sql/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from sql.pro. + +add_subdirectory(books) +add_subdirectory(drilldown) +add_subdirectory(cachedtable) +add_subdirectory(querymodel) +add_subdirectory(relationaltablemodel) +add_subdirectory(sqlwidgetmapper) +add_subdirectory(tablemodel) + +if(TARGET Qt::Xml) + add_subdirectory(masterdetail) +endif() + +if(NOT CMAKE_CROSSCOMPILING) # special case + add_subdirectory(sqlbrowser) +endif() diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt new file mode 100644 index 00000000000..e01adc14025 --- /dev/null +++ b/examples/sql/books/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from books.pro. + +##################################################################### +## books Binary: +##################################################################### + +add_qt_executable(books + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/books" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/books" + SOURCES + bookdelegate.cpp bookdelegate.h + bookwindow.cpp bookwindow.h bookwindow.ui + initdb.h + main.cpp + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + LIBRARIES + Qt::Sql + Qt::Widgets + Qt::Widgets +) + +# Resources: +add_qt_resource(books "books" PREFIX "/" FILES + images/star.png) + + +#### Keys ignored in scope 1:.:books.pro:: +# TEMPLATE = "app" diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt new file mode 100644 index 00000000000..8e87a322111 --- /dev/null +++ b/examples/sql/cachedtable/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from cachedtable.pro. + +##################################################################### +## cachedtable Binary: +##################################################################### + +add_qt_executable(cachedtable + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/cachedtable" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/cachedtable" + SOURCES + ../connection.h + main.cpp + tableeditor.cpp tableeditor.h + LIBRARIES + Qt::Sql + Qt::Widgets +) diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt new file mode 100644 index 00000000000..a4301d3474e --- /dev/null +++ b/examples/sql/drilldown/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from drilldown.pro. + +##################################################################### +## drilldown Binary: +##################################################################### + +add_qt_executable(drilldown + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/drilldown" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/drilldown" + SOURCES + ../connection.h + imageitem.cpp imageitem.h + informationwindow.cpp informationwindow.h + main.cpp + view.cpp view.h + LIBRARIES + Qt::Sql + Qt::Widgets +) + +# Resources: +add_qt_resource(drilldown "drilldown" PREFIX "/" FILES + images/qt-creator.png + images/qt-logo.png + images/qt-project.png + images/qt-quick.png) + diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt new file mode 100644 index 00000000000..8c73675e555 --- /dev/null +++ b/examples/sql/masterdetail/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from masterdetail.pro. + +##################################################################### +## masterdetail Binary: +##################################################################### + +add_qt_executable(masterdetail + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/masterdetail" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/masterdetail" + SOURCES + database.h + dialog.cpp dialog.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Sql + Qt::Widgets + Qt::Xml + Qt::Widgets +) + +# Resources: +add_qt_resource(masterdetail "masterdetail" FILES + images/icon.png + images/image.png) + + +#### Keys ignored in scope 1:.:masterdetail.pro:: +# EXAMPLE_FILES = "albumdetails.xml" diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt new file mode 100644 index 00000000000..5c9d48c7f13 --- /dev/null +++ b/examples/sql/querymodel/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from querymodel.pro. + +##################################################################### +## querymodel Binary: +##################################################################### + +add_qt_executable(querymodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/querymodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/querymodel" + SOURCES + ../connection.h + customsqlmodel.cpp customsqlmodel.h + editablesqlmodel.cpp editablesqlmodel.h + main.cpp + LIBRARIES + Qt::Sql + Qt::Widgets +) diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt new file mode 100644 index 00000000000..d31042cc735 --- /dev/null +++ b/examples/sql/relationaltablemodel/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from relationaltablemodel.pro. + +##################################################################### +## relationaltablemodel Binary: +##################################################################### + +add_qt_executable(relationaltablemodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/relationaltablemodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/relationaltablemodel" + SOURCES + ../connection.h + relationaltablemodel.cpp + LIBRARIES + Qt::Sql + Qt::Widgets +) diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt new file mode 100644 index 00000000000..03111e90490 --- /dev/null +++ b/examples/sql/sqlbrowser/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from sqlbrowser.pro. + +##################################################################### +## sqlbrowser Binary: +##################################################################### + +add_qt_executable(sqlbrowser + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlbrowser" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlbrowser" + SOURCES + browser.cpp browser.h + browserwidget.ui + connectionwidget.cpp connectionwidget.h + main.cpp + qsqlconnectiondialog.cpp qsqlconnectiondialog.h qsqlconnectiondialog.ui + LIBRARIES + Qt::Sql + Qt::Widgets +) + +#### Keys ignored in scope 1:.:sqlbrowser.pro:: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:sqlbrowser.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt new file mode 100644 index 00000000000..41d95da21e4 --- /dev/null +++ b/examples/sql/sqlwidgetmapper/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from sqlwidgetmapper.pro. + +##################################################################### +## sqlwidgetmapper Binary: +##################################################################### + +add_qt_executable(sqlwidgetmapper + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlwidgetmapper" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlwidgetmapper" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Sql + Qt::Widgets +) diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt new file mode 100644 index 00000000000..68644a4b3da --- /dev/null +++ b/examples/sql/tablemodel/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from tablemodel.pro. + +##################################################################### +## tablemodel Binary: +##################################################################### + +add_qt_executable(tablemodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/tablemodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/tablemodel" + SOURCES + ../connection.h + tablemodel.cpp + LIBRARIES + Qt::Sql + Qt::Widgets +) From 05ebd62f099b51b160a06e1257007bf437355fae Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Mar 2019 11:26:58 +0100 Subject: [PATCH 0322/1322] .gitignore: Do not ignore stuff in examples for the time being Change-Id: Iccf61b6613c4cd82a10051eac448711400a27ea1 Reviewed-by: Alexandru Croitor --- .gitignore | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ebee7b81ab6..ced19ab58e0 100644 --- a/.gitignore +++ b/.gitignore @@ -60,11 +60,12 @@ qt*-config.pri /src/corelib/global/qfloat16tables.cpp -/examples/*/*/* -!/examples/*/*/*[.]* -!/examples/*/*/README -!/examples/*/doc/* -!/examples/*/doc/*/* +# FIXME: Ignore these again? +# /examples/*/*/* +# !/examples/*/*/*[.]* +# !/examples/*/*/README +# !/examples/*/doc/* +# !/examples/*/doc/*/* /translations/*.qm /translations/*_en.ts From aa50b377a7d904e35cf3a26e4c8a054108011ffd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 20 Mar 2019 13:41:37 +0100 Subject: [PATCH 0323/1322] CMake: Add widgets examples Change-Id: Ib6142b93df066e3658eb189b50ca74c455fe7e56 Reviewed-by: Alexandru Croitor --- examples/CMakeLists.txt | 3 + examples/widgets/CMakeLists.txt | 33 ++++ examples/widgets/animation/CMakeLists.txt | 8 + .../animation/animatedtiles/CMakeLists.txt | 26 ++++ .../widgets/animation/easing/CMakeLists.txt | 23 +++ .../animation/moveblocks/CMakeLists.txt | 15 ++ .../widgets/animation/states/CMakeLists.txt | 25 +++ .../widgets/animation/stickman/CMakeLists.txt | 29 ++++ .../animation/sub-attaq/CMakeLists.txt | 142 ++++++++++++++++++ examples/widgets/desktop/CMakeLists.txt | 4 + .../widgets/desktop/screenshot/CMakeLists.txt | 16 ++ .../widgets/desktop/systray/CMakeLists.txt | 23 +++ examples/widgets/dialogs/CMakeLists.txt | 14 ++ .../dialogs/classwizard/CMakeLists.txt | 27 ++++ .../widgets/dialogs/extension/CMakeLists.txt | 16 ++ .../widgets/dialogs/findfiles/CMakeLists.txt | 16 ++ .../dialogs/licensewizard/CMakeLists.txt | 23 +++ .../dialogs/standarddialogs/CMakeLists.txt | 16 ++ .../widgets/dialogs/tabdialog/CMakeLists.txt | 16 ++ .../dialogs/trivialwizard/CMakeLists.txt | 15 ++ examples/widgets/draganddrop/CMakeLists.txt | 7 + .../draganddrop/draggableicons/CMakeLists.txt | 23 +++ .../draganddrop/draggabletext/CMakeLists.txt | 21 +++ .../draganddrop/dropsite/CMakeLists.txt | 17 +++ .../draganddrop/fridgemagnets/CMakeLists.txt | 22 +++ .../widgets/draganddrop/puzzle/CMakeLists.txt | 26 ++++ examples/widgets/effects/CMakeLists.txt | 4 + .../widgets/effects/blurpicker/CMakeLists.txt | 30 ++++ .../effects/fademessage/CMakeLists.txt | 21 +++ examples/widgets/gestures/CMakeLists.txt | 3 + .../gestures/imagegestures/CMakeLists.txt | 17 +++ examples/widgets/graphicsview/CMakeLists.txt | 20 +++ .../graphicsview/anchorlayout/CMakeLists.txt | 15 ++ .../basicgraphicslayouts/CMakeLists.txt | 22 +++ .../widgets/graphicsview/boxes/CMakeLists.txt | 55 +++++++ .../widgets/graphicsview/chip/CMakeLists.txt | 44 ++++++ .../graphicsview/collidingmice/CMakeLists.txt | 21 +++ .../graphicsview/diagramscene/CMakeLists.txt | 39 +++++ .../graphicsview/dragdroprobot/CMakeLists.txt | 22 +++ .../graphicsview/elasticnodes/CMakeLists.txt | 18 +++ .../embeddeddialogs/CMakeLists.txt | 28 ++++ .../graphicsview/flowlayout/CMakeLists.txt | 20 +++ .../graphicsview/padnavigator/CMakeLists.txt | 43 ++++++ .../simpleanchorlayout/CMakeLists.txt | 15 ++ .../weatheranchorlayout/CMakeLists.txt | 25 +++ examples/widgets/itemviews/CMakeLists.txt | 27 ++++ .../itemviews/addressbook/CMakeLists.txt | 20 +++ .../basicsortfiltermodel/CMakeLists.txt | 16 ++ .../widgets/itemviews/chart/CMakeLists.txt | 30 ++++ .../coloreditorfactory/CMakeLists.txt | 17 +++ .../combowidgetmapper/CMakeLists.txt | 16 ++ .../customsortfiltermodel/CMakeLists.txt | 23 +++ .../widgets/itemviews/dirview/CMakeLists.txt | 15 ++ .../editabletreemodel/CMakeLists.txt | 23 +++ .../itemviews/fetchmore/CMakeLists.txt | 17 +++ .../itemviews/flattreeview/CMakeLists.txt | 15 ++ .../itemviews/frozencolumn/CMakeLists.txt | 21 +++ .../itemviews/interview/CMakeLists.txt | 32 ++++ .../itemviews/pixelator/CMakeLists.txt | 31 ++++ .../widgets/itemviews/puzzle/CMakeLists.txt | 23 +++ .../itemviews/simpledommodel/CMakeLists.txt | 19 +++ .../itemviews/simpletreemodel/CMakeLists.txt | 22 +++ .../simplewidgetmapper/CMakeLists.txt | 16 ++ .../itemviews/spinboxdelegate/CMakeLists.txt | 16 ++ .../itemviews/spreadsheet/CMakeLists.txt | 35 +++++ .../itemviews/stardelegate/CMakeLists.txt | 18 +++ .../itemviews/storageview/CMakeLists.txt | 20 +++ examples/widgets/layouts/CMakeLists.txt | 6 + .../layouts/basiclayouts/CMakeLists.txt | 16 ++ .../layouts/borderlayout/CMakeLists.txt | 17 +++ .../layouts/dynamiclayouts/CMakeLists.txt | 16 ++ .../widgets/layouts/flowlayout/CMakeLists.txt | 17 +++ examples/widgets/mac/CMakeLists.txt | 7 + .../mac/qmaccocoaviewcontainer/CMakeLists.txt | 19 +++ .../mac/qmacnativewidget/CMakeLists.txt | 19 +++ examples/widgets/mainwindows/CMakeLists.txt | 8 + .../mainwindows/application/CMakeLists.txt | 26 ++++ .../mainwindows/dockwidgets/CMakeLists.txt | 32 ++++ .../mainwindows/mainwindow/CMakeLists.txt | 35 +++++ .../widgets/mainwindows/mdi/CMakeLists.txt | 27 ++++ .../widgets/mainwindows/menus/CMakeLists.txt | 16 ++ .../widgets/mainwindows/sdi/CMakeLists.txt | 26 ++++ examples/widgets/painting/CMakeLists.txt | 14 ++ .../widgets/painting/affine/CMakeLists.txt | 23 +++ .../painting/basicdrawing/CMakeLists.txt | 23 +++ .../painting/composition/CMakeLists.txt | 23 +++ .../painting/concentriccircles/CMakeLists.txt | 17 +++ .../widgets/painting/deform/CMakeLists.txt | 21 +++ .../painting/fontsampler/CMakeLists.txt | 25 +++ .../widgets/painting/gradients/CMakeLists.txt | 21 +++ .../painting/imagecomposition/CMakeLists.txt | 22 +++ .../painting/painterpaths/CMakeLists.txt | 26 ++++ .../painting/pathstroke/CMakeLists.txt | 21 +++ .../widgets/painting/shared/CMakeLists.txt | 64 ++++++++ .../painting/transformations/CMakeLists.txt | 17 +++ examples/widgets/richtext/CMakeLists.txt | 6 + .../widgets/richtext/calendar/CMakeLists.txt | 16 ++ .../widgets/richtext/orderform/CMakeLists.txt | 25 +++ .../richtext/syntaxhighlighter/CMakeLists.txt | 17 +++ .../widgets/richtext/textedit/CMakeLists.txt | 75 +++++++++ examples/widgets/scroller/CMakeLists.txt | 3 + .../scroller/graphicsview/CMakeLists.txt | 18 +++ examples/widgets/statemachine/CMakeLists.txt | 11 ++ .../eventtransitions/CMakeLists.txt | 15 ++ .../statemachine/factorial/CMakeLists.txt | 22 +++ .../statemachine/pingpong/CMakeLists.txt | 22 +++ .../widgets/statemachine/rogue/CMakeLists.txt | 17 +++ .../statemachine/trafficlight/CMakeLists.txt | 15 ++ .../statemachine/twowaybutton/CMakeLists.txt | 15 ++ examples/widgets/tools/CMakeLists.txt | 20 +++ examples/widgets/tools/codecs/CMakeLists.txt | 20 +++ .../widgets/tools/completer/CMakeLists.txt | 23 +++ .../tools/customcompleter/CMakeLists.txt | 22 +++ .../widgets/tools/echoplugin/CMakeLists.txt | 4 + .../echoplugin/echowindow/CMakeLists.txt | 33 ++++ .../tools/echoplugin/plugin/CMakeLists.txt | 22 +++ examples/widgets/tools/i18n/CMakeLists.txt | 38 +++++ .../widgets/tools/plugandpaint/CMakeLists.txt | 4 + .../tools/plugandpaint/app/CMakeLists.txt | 29 ++++ .../tools/plugandpaint/plugins/CMakeLists.txt | 4 + .../plugins/basictools/CMakeLists.txt | 29 ++++ .../plugins/extrafilters/CMakeLists.txt | 27 ++++ examples/widgets/tools/regexp/CMakeLists.txt | 16 ++ .../tools/regularexpression/CMakeLists.txt | 21 +++ .../tools/settingseditor/CMakeLists.txt | 22 +++ .../widgets/tools/styleplugin/CMakeLists.txt | 4 + .../tools/styleplugin/plugin/CMakeLists.txt | 32 ++++ .../styleplugin/stylewindow/CMakeLists.txt | 31 ++++ .../tools/treemodelcompleter/CMakeLists.txt | 22 +++ examples/widgets/tools/undo/CMakeLists.txt | 44 ++++++ .../tools/undoframework/CMakeLists.txt | 24 +++ examples/widgets/touch/CMakeLists.txt | 6 + examples/widgets/touch/dials/CMakeLists.txt | 16 ++ .../widgets/touch/fingerpaint/CMakeLists.txt | 25 +++ examples/widgets/touch/knobs/CMakeLists.txt | 16 ++ .../widgets/touch/pinchzoom/CMakeLists.txt | 22 +++ examples/widgets/tutorials/CMakeLists.txt | 7 + .../tutorials/addressbook/CMakeLists.txt | 9 ++ .../addressbook/part1/CMakeLists.txt | 19 +++ .../addressbook/part2/CMakeLists.txt | 19 +++ .../addressbook/part3/CMakeLists.txt | 19 +++ .../addressbook/part4/CMakeLists.txt | 19 +++ .../addressbook/part5/CMakeLists.txt | 20 +++ .../addressbook/part6/CMakeLists.txt | 20 +++ .../addressbook/part7/CMakeLists.txt | 20 +++ .../tutorials/gettingStarted/CMakeLists.txt | 2 + .../gettingStarted/gsQt/CMakeLists.txt | 7 + .../gettingStarted/gsQt/part1/CMakeLists.txt | 15 ++ .../gettingStarted/gsQt/part2/CMakeLists.txt | 15 ++ .../gettingStarted/gsQt/part3/CMakeLists.txt | 15 ++ .../gettingStarted/gsQt/part4/CMakeLists.txt | 15 ++ .../gettingStarted/gsQt/part5/CMakeLists.txt | 15 ++ .../modelview/1_readonly/CMakeLists.txt | 19 +++ .../modelview/2_formatting/CMakeLists.txt | 19 +++ .../modelview/3_changingmodel/CMakeLists.txt | 19 +++ .../modelview/4_headers/CMakeLists.txt | 19 +++ .../tutorials/modelview/5_edit/CMakeLists.txt | 20 +++ .../modelview/6_treeview/CMakeLists.txt | 19 +++ .../modelview/7_selections/CMakeLists.txt | 19 +++ .../tutorials/modelview/CMakeLists.txt | 9 ++ .../widgets/tutorials/notepad/CMakeLists.txt | 49 ++++++ .../widgets/tutorials/widgets/CMakeLists.txt | 6 + .../widgets/childwidget/CMakeLists.txt | 15 ++ .../widgets/nestedlayouts/CMakeLists.txt | 15 ++ .../tutorials/widgets/toplevel/CMakeLists.txt | 15 ++ .../widgets/windowlayout/CMakeLists.txt | 15 ++ examples/widgets/widgets/CMakeLists.txt | 27 ++++ .../widgets/analogclock/CMakeLists.txt | 19 +++ .../widgets/widgets/calculator/CMakeLists.txt | 17 +++ .../widgets/calendarwidget/CMakeLists.txt | 16 ++ .../widgets/charactermap/CMakeLists.txt | 17 +++ .../widgets/widgets/codeeditor/CMakeLists.txt | 16 ++ .../widgets/digitalclock/CMakeLists.txt | 16 ++ .../widgets/elidedlabel/CMakeLists.txt | 21 +++ .../widgets/widgets/groupbox/CMakeLists.txt | 16 ++ examples/widgets/widgets/icons/CMakeLists.txt | 24 +++ .../widgets/imageviewer/CMakeLists.txt | 24 +++ .../widgets/widgets/lineedits/CMakeLists.txt | 16 ++ .../widgets/mousebuttons/CMakeLists.txt | 19 +++ examples/widgets/widgets/movie/CMakeLists.txt | 19 +++ .../widgets/widgets/scribble/CMakeLists.txt | 25 +++ .../widgets/shapedclock/CMakeLists.txt | 16 ++ .../widgets/widgets/sliders/CMakeLists.txt | 17 +++ .../widgets/widgets/spinboxes/CMakeLists.txt | 16 ++ .../widgets/widgets/styles/CMakeLists.txt | 23 +++ .../widgets/widgets/stylesheet/CMakeLists.txt | 56 +++++++ .../widgets/widgets/tablet/CMakeLists.txt | 26 ++++ .../widgets/widgets/tetrix/CMakeLists.txt | 18 +++ .../widgets/widgets/tooltips/CMakeLists.txt | 24 +++ .../widgets/widgets/validators/CMakeLists.txt | 24 +++ .../widgets/widgets/wiggly/CMakeLists.txt | 17 +++ .../widgets/windowflags/CMakeLists.txt | 17 +++ .../widgets/windowcontainer/CMakeLists.txt | 18 +++ src/opengl/CMakeLists.txt | 3 + 194 files changed, 4058 insertions(+) create mode 100644 examples/widgets/CMakeLists.txt create mode 100644 examples/widgets/animation/CMakeLists.txt create mode 100644 examples/widgets/animation/animatedtiles/CMakeLists.txt create mode 100644 examples/widgets/animation/easing/CMakeLists.txt create mode 100644 examples/widgets/animation/moveblocks/CMakeLists.txt create mode 100644 examples/widgets/animation/states/CMakeLists.txt create mode 100644 examples/widgets/animation/stickman/CMakeLists.txt create mode 100644 examples/widgets/animation/sub-attaq/CMakeLists.txt create mode 100644 examples/widgets/desktop/CMakeLists.txt create mode 100644 examples/widgets/desktop/screenshot/CMakeLists.txt create mode 100644 examples/widgets/desktop/systray/CMakeLists.txt create mode 100644 examples/widgets/dialogs/CMakeLists.txt create mode 100644 examples/widgets/dialogs/classwizard/CMakeLists.txt create mode 100644 examples/widgets/dialogs/extension/CMakeLists.txt create mode 100644 examples/widgets/dialogs/findfiles/CMakeLists.txt create mode 100644 examples/widgets/dialogs/licensewizard/CMakeLists.txt create mode 100644 examples/widgets/dialogs/standarddialogs/CMakeLists.txt create mode 100644 examples/widgets/dialogs/tabdialog/CMakeLists.txt create mode 100644 examples/widgets/dialogs/trivialwizard/CMakeLists.txt create mode 100644 examples/widgets/draganddrop/CMakeLists.txt create mode 100644 examples/widgets/draganddrop/draggableicons/CMakeLists.txt create mode 100644 examples/widgets/draganddrop/draggabletext/CMakeLists.txt create mode 100644 examples/widgets/draganddrop/dropsite/CMakeLists.txt create mode 100644 examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt create mode 100644 examples/widgets/draganddrop/puzzle/CMakeLists.txt create mode 100644 examples/widgets/effects/CMakeLists.txt create mode 100644 examples/widgets/effects/blurpicker/CMakeLists.txt create mode 100644 examples/widgets/effects/fademessage/CMakeLists.txt create mode 100644 examples/widgets/gestures/CMakeLists.txt create mode 100644 examples/widgets/gestures/imagegestures/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/anchorlayout/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/boxes/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/chip/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/collidingmice/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/diagramscene/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/elasticnodes/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/flowlayout/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/padnavigator/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt create mode 100644 examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt create mode 100644 examples/widgets/itemviews/CMakeLists.txt create mode 100644 examples/widgets/itemviews/addressbook/CMakeLists.txt create mode 100644 examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt create mode 100644 examples/widgets/itemviews/chart/CMakeLists.txt create mode 100644 examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt create mode 100644 examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt create mode 100644 examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt create mode 100644 examples/widgets/itemviews/dirview/CMakeLists.txt create mode 100644 examples/widgets/itemviews/editabletreemodel/CMakeLists.txt create mode 100644 examples/widgets/itemviews/fetchmore/CMakeLists.txt create mode 100644 examples/widgets/itemviews/flattreeview/CMakeLists.txt create mode 100644 examples/widgets/itemviews/frozencolumn/CMakeLists.txt create mode 100644 examples/widgets/itemviews/interview/CMakeLists.txt create mode 100644 examples/widgets/itemviews/pixelator/CMakeLists.txt create mode 100644 examples/widgets/itemviews/puzzle/CMakeLists.txt create mode 100644 examples/widgets/itemviews/simpledommodel/CMakeLists.txt create mode 100644 examples/widgets/itemviews/simpletreemodel/CMakeLists.txt create mode 100644 examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt create mode 100644 examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt create mode 100644 examples/widgets/itemviews/spreadsheet/CMakeLists.txt create mode 100644 examples/widgets/itemviews/stardelegate/CMakeLists.txt create mode 100644 examples/widgets/itemviews/storageview/CMakeLists.txt create mode 100644 examples/widgets/layouts/CMakeLists.txt create mode 100644 examples/widgets/layouts/basiclayouts/CMakeLists.txt create mode 100644 examples/widgets/layouts/borderlayout/CMakeLists.txt create mode 100644 examples/widgets/layouts/dynamiclayouts/CMakeLists.txt create mode 100644 examples/widgets/layouts/flowlayout/CMakeLists.txt create mode 100644 examples/widgets/mac/CMakeLists.txt create mode 100644 examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt create mode 100644 examples/widgets/mac/qmacnativewidget/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/application/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/dockwidgets/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/mainwindow/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/mdi/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/menus/CMakeLists.txt create mode 100644 examples/widgets/mainwindows/sdi/CMakeLists.txt create mode 100644 examples/widgets/painting/CMakeLists.txt create mode 100644 examples/widgets/painting/affine/CMakeLists.txt create mode 100644 examples/widgets/painting/basicdrawing/CMakeLists.txt create mode 100644 examples/widgets/painting/composition/CMakeLists.txt create mode 100644 examples/widgets/painting/concentriccircles/CMakeLists.txt create mode 100644 examples/widgets/painting/deform/CMakeLists.txt create mode 100644 examples/widgets/painting/fontsampler/CMakeLists.txt create mode 100644 examples/widgets/painting/gradients/CMakeLists.txt create mode 100644 examples/widgets/painting/imagecomposition/CMakeLists.txt create mode 100644 examples/widgets/painting/painterpaths/CMakeLists.txt create mode 100644 examples/widgets/painting/pathstroke/CMakeLists.txt create mode 100644 examples/widgets/painting/shared/CMakeLists.txt create mode 100644 examples/widgets/painting/transformations/CMakeLists.txt create mode 100644 examples/widgets/richtext/CMakeLists.txt create mode 100644 examples/widgets/richtext/calendar/CMakeLists.txt create mode 100644 examples/widgets/richtext/orderform/CMakeLists.txt create mode 100644 examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt create mode 100644 examples/widgets/richtext/textedit/CMakeLists.txt create mode 100644 examples/widgets/scroller/CMakeLists.txt create mode 100644 examples/widgets/scroller/graphicsview/CMakeLists.txt create mode 100644 examples/widgets/statemachine/CMakeLists.txt create mode 100644 examples/widgets/statemachine/eventtransitions/CMakeLists.txt create mode 100644 examples/widgets/statemachine/factorial/CMakeLists.txt create mode 100644 examples/widgets/statemachine/pingpong/CMakeLists.txt create mode 100644 examples/widgets/statemachine/rogue/CMakeLists.txt create mode 100644 examples/widgets/statemachine/trafficlight/CMakeLists.txt create mode 100644 examples/widgets/statemachine/twowaybutton/CMakeLists.txt create mode 100644 examples/widgets/tools/CMakeLists.txt create mode 100644 examples/widgets/tools/codecs/CMakeLists.txt create mode 100644 examples/widgets/tools/completer/CMakeLists.txt create mode 100644 examples/widgets/tools/customcompleter/CMakeLists.txt create mode 100644 examples/widgets/tools/echoplugin/CMakeLists.txt create mode 100644 examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt create mode 100644 examples/widgets/tools/echoplugin/plugin/CMakeLists.txt create mode 100644 examples/widgets/tools/i18n/CMakeLists.txt create mode 100644 examples/widgets/tools/plugandpaint/CMakeLists.txt create mode 100644 examples/widgets/tools/plugandpaint/app/CMakeLists.txt create mode 100644 examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt create mode 100644 examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt create mode 100644 examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt create mode 100644 examples/widgets/tools/regexp/CMakeLists.txt create mode 100644 examples/widgets/tools/regularexpression/CMakeLists.txt create mode 100644 examples/widgets/tools/settingseditor/CMakeLists.txt create mode 100644 examples/widgets/tools/styleplugin/CMakeLists.txt create mode 100644 examples/widgets/tools/styleplugin/plugin/CMakeLists.txt create mode 100644 examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt create mode 100644 examples/widgets/tools/treemodelcompleter/CMakeLists.txt create mode 100644 examples/widgets/tools/undo/CMakeLists.txt create mode 100644 examples/widgets/tools/undoframework/CMakeLists.txt create mode 100644 examples/widgets/touch/CMakeLists.txt create mode 100644 examples/widgets/touch/dials/CMakeLists.txt create mode 100644 examples/widgets/touch/fingerpaint/CMakeLists.txt create mode 100644 examples/widgets/touch/knobs/CMakeLists.txt create mode 100644 examples/widgets/touch/pinchzoom/CMakeLists.txt create mode 100644 examples/widgets/tutorials/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part1/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part2/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part3/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part4/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part5/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part6/CMakeLists.txt create mode 100644 examples/widgets/tutorials/addressbook/part7/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt create mode 100644 examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt create mode 100644 examples/widgets/tutorials/modelview/CMakeLists.txt create mode 100644 examples/widgets/tutorials/notepad/CMakeLists.txt create mode 100644 examples/widgets/tutorials/widgets/CMakeLists.txt create mode 100644 examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt create mode 100644 examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt create mode 100644 examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt create mode 100644 examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt create mode 100644 examples/widgets/widgets/CMakeLists.txt create mode 100644 examples/widgets/widgets/analogclock/CMakeLists.txt create mode 100644 examples/widgets/widgets/calculator/CMakeLists.txt create mode 100644 examples/widgets/widgets/calendarwidget/CMakeLists.txt create mode 100644 examples/widgets/widgets/charactermap/CMakeLists.txt create mode 100644 examples/widgets/widgets/codeeditor/CMakeLists.txt create mode 100644 examples/widgets/widgets/digitalclock/CMakeLists.txt create mode 100644 examples/widgets/widgets/elidedlabel/CMakeLists.txt create mode 100644 examples/widgets/widgets/groupbox/CMakeLists.txt create mode 100644 examples/widgets/widgets/icons/CMakeLists.txt create mode 100644 examples/widgets/widgets/imageviewer/CMakeLists.txt create mode 100644 examples/widgets/widgets/lineedits/CMakeLists.txt create mode 100644 examples/widgets/widgets/mousebuttons/CMakeLists.txt create mode 100644 examples/widgets/widgets/movie/CMakeLists.txt create mode 100644 examples/widgets/widgets/scribble/CMakeLists.txt create mode 100644 examples/widgets/widgets/shapedclock/CMakeLists.txt create mode 100644 examples/widgets/widgets/sliders/CMakeLists.txt create mode 100644 examples/widgets/widgets/spinboxes/CMakeLists.txt create mode 100644 examples/widgets/widgets/styles/CMakeLists.txt create mode 100644 examples/widgets/widgets/stylesheet/CMakeLists.txt create mode 100644 examples/widgets/widgets/tablet/CMakeLists.txt create mode 100644 examples/widgets/widgets/tetrix/CMakeLists.txt create mode 100644 examples/widgets/widgets/tooltips/CMakeLists.txt create mode 100644 examples/widgets/widgets/validators/CMakeLists.txt create mode 100644 examples/widgets/widgets/wiggly/CMakeLists.txt create mode 100644 examples/widgets/widgets/windowflags/CMakeLists.txt create mode 100644 examples/widgets/windowcontainer/CMakeLists.txt diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 71050b5790f..cdbf0c411da 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -20,3 +20,6 @@ endif() if(TARGET Qt::Gui) add_subdirectory(gui) endif() +if(TARGET Qt::Widgets) + add_subdirectory(widgets) +endif() diff --git a/examples/widgets/CMakeLists.txt b/examples/widgets/CMakeLists.txt new file mode 100644 index 00000000000..1b18fc8622a --- /dev/null +++ b/examples/widgets/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from widgets.pro. + +add_subdirectory(animation) +add_subdirectory(desktop) +add_subdirectory(dialogs) +if(QT_FEATURE_draganddrop) # special case + add_subdirectory(draganddrop) +endif() +add_subdirectory(effects) +add_subdirectory(gestures) +add_subdirectory(graphicsview) +add_subdirectory(itemviews) +add_subdirectory(layouts) +add_subdirectory(painting) +add_subdirectory(richtext) +add_subdirectory(scroller) +add_subdirectory(statemachine) +add_subdirectory(tools) +add_subdirectory(touch) +add_subdirectory(tutorials) +add_subdirectory(widgets) + +if(TARGET Qt::Gui AND QT_FEATURE_opengl) + add_subdirectory(windowcontainer) +endif() + +if(QT_FEATURE_cursor) # special case + add_subdirectory(mainwindows) +endif() + +if(APPLE_OSX) + add_subdirectory(mac) +endif() diff --git a/examples/widgets/animation/CMakeLists.txt b/examples/widgets/animation/CMakeLists.txt new file mode 100644 index 00000000000..15f62728da5 --- /dev/null +++ b/examples/widgets/animation/CMakeLists.txt @@ -0,0 +1,8 @@ +# Generated from animation.pro. + +add_subdirectory(animatedtiles) +add_subdirectory(easing) +add_subdirectory(moveblocks) +add_subdirectory(states) +add_subdirectory(stickman) +add_subdirectory(sub-attaq) diff --git a/examples/widgets/animation/animatedtiles/CMakeLists.txt b/examples/widgets/animation/animatedtiles/CMakeLists.txt new file mode 100644 index 00000000000..0af95adcf8a --- /dev/null +++ b/examples/widgets/animation/animatedtiles/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from animatedtiles.pro. + +##################################################################### +## animatedtiles Binary: +##################################################################### + +add_qt_executable(animatedtiles + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/animatedtiles" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/animatedtiles" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(animatedtiles "animatedtiles" FILES + images/Time-For-Lunch-2.jpg + images/centered.png + images/ellipse.png + images/figure8.png + images/kinetic.png + images/random.png + images/tile.png) + diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt new file mode 100644 index 00000000000..ba391d082b4 --- /dev/null +++ b/examples/widgets/animation/easing/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from easing.pro. + +##################################################################### +## easing Binary: +##################################################################### + +add_qt_executable(easing + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/easing" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/easing" + SOURCES + animation.h + form.ui + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(easing "easing" FILES + images/qt-logo.png) + diff --git a/examples/widgets/animation/moveblocks/CMakeLists.txt b/examples/widgets/animation/moveblocks/CMakeLists.txt new file mode 100644 index 00000000000..5cbb8f49368 --- /dev/null +++ b/examples/widgets/animation/moveblocks/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from moveblocks.pro. + +##################################################################### +## moveblocks Binary: +##################################################################### + +add_qt_executable(moveblocks + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/moveblocks" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/moveblocks" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/animation/states/CMakeLists.txt b/examples/widgets/animation/states/CMakeLists.txt new file mode 100644 index 00000000000..52a93577896 --- /dev/null +++ b/examples/widgets/animation/states/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from states.pro. + +##################################################################### +## states Binary: +##################################################################### + +add_qt_executable(states + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/states" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/states" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(states "states" FILES + accessories-dictionary.png + akregator.png + digikam.png + help-browser.png + k3b.png + kchart.png) + diff --git a/examples/widgets/animation/stickman/CMakeLists.txt b/examples/widgets/animation/stickman/CMakeLists.txt new file mode 100644 index 00000000000..f6045982328 --- /dev/null +++ b/examples/widgets/animation/stickman/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from stickman.pro. + +##################################################################### +## stickman Binary: +##################################################################### + +add_qt_executable(stickman + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/stickman" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/stickman" + SOURCES + animation.cpp animation.h + graphicsview.cpp graphicsview.h + lifecycle.cpp lifecycle.h + main.cpp + node.cpp node.h + rectbutton.cpp rectbutton.h + stickman.cpp stickman.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(stickman "stickman" FILES + animations/chilling.bin + animations/dancing.bin + animations/dead.bin + animations/jumping.bin) + diff --git a/examples/widgets/animation/sub-attaq/CMakeLists.txt b/examples/widgets/animation/sub-attaq/CMakeLists.txt new file mode 100644 index 00000000000..e7cb602e190 --- /dev/null +++ b/examples/widgets/animation/sub-attaq/CMakeLists.txt @@ -0,0 +1,142 @@ +# Generated from sub-attaq.pro. + +##################################################################### +## sub-attaq Binary: +##################################################################### + +add_qt_executable(sub-attaq + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/sub-attaq" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/sub-attaq" + SOURCES + animationmanager.cpp animationmanager.h + boat.cpp boat.h boat_p.h + bomb.cpp bomb.h + graphicsscene.cpp graphicsscene.h + main.cpp + mainwindow.cpp mainwindow.h + pixmapitem.cpp pixmapitem.h + progressitem.cpp progressitem.h + qanimationstate.cpp qanimationstate.h + states.cpp states.h + submarine.cpp submarine.h submarine_p.h + textinformationitem.cpp textinformationitem.h + torpedo.cpp torpedo.h + LIBRARIES + Qt::Widgets +) + +# Resources: +set_source_files_properties("pics/big/background.png" + PROPERTIES alias "big/background") +set_source_files_properties("pics/big/boat.png" + PROPERTIES alias "big/boat") +set_source_files_properties("pics/big/bomb.png" + PROPERTIES alias "big/bomb") +set_source_files_properties("pics/big/explosion/boat/step1.png" + PROPERTIES alias "big/explosion/boat/step1") +set_source_files_properties("pics/big/explosion/boat/step2.png" + PROPERTIES alias "big/explosion/boat/step2") +set_source_files_properties("pics/big/explosion/boat/step3.png" + PROPERTIES alias "big/explosion/boat/step3") +set_source_files_properties("pics/big/explosion/boat/step4.png" + PROPERTIES alias "big/explosion/boat/step4") +set_source_files_properties("pics/big/explosion/submarine/step1.png" + PROPERTIES alias "big/explosion/submarine/step1") +set_source_files_properties("pics/big/explosion/submarine/step2.png" + PROPERTIES alias "big/explosion/submarine/step2") +set_source_files_properties("pics/big/explosion/submarine/step3.png" + PROPERTIES alias "big/explosion/submarine/step3") +set_source_files_properties("pics/big/explosion/submarine/step4.png" + PROPERTIES alias "big/explosion/submarine/step4") +set_source_files_properties("pics/big/submarine.png" + PROPERTIES alias "big/submarine") +set_source_files_properties("pics/big/surface.png" + PROPERTIES alias "big/surface") +set_source_files_properties("pics/big/torpedo.png" + PROPERTIES alias "big/torpedo") +set_source_files_properties("pics/scalable/boat.svg" + PROPERTIES alias "boat") +set_source_files_properties("pics/scalable/sub-attaq.svg" + PROPERTIES alias "all") +set_source_files_properties("pics/scalable/submarine.svg" + PROPERTIES alias "submarine") +set_source_files_properties("pics/scalable/torpedo.svg" + PROPERTIES alias "torpedo") +set_source_files_properties("pics/small/background.png" + PROPERTIES alias "small/background") +set_source_files_properties("pics/small/boat.png" + PROPERTIES alias "small/boat") +set_source_files_properties("pics/small/bomb.png" + PROPERTIES alias "small/bomb") +set_source_files_properties("pics/small/submarine.png" + PROPERTIES alias "small/submarine") +set_source_files_properties("pics/small/surface.png" + PROPERTIES alias "small/surface") +set_source_files_properties("pics/small/torpedo.png" + PROPERTIES alias "small/torpedo") +set_source_files_properties("pics/welcome/logo-a.png" + PROPERTIES alias "logo-a") +set_source_files_properties("pics/welcome/logo-a2.png" + PROPERTIES alias "logo-a2") +set_source_files_properties("pics/welcome/logo-b.png" + PROPERTIES alias "logo-b") +set_source_files_properties("pics/welcome/logo-dash.png" + PROPERTIES alias "logo-dash") +set_source_files_properties("pics/welcome/logo-excl.png" + PROPERTIES alias "logo-excl") +set_source_files_properties("pics/welcome/logo-q.png" + PROPERTIES alias "logo-q") +set_source_files_properties("pics/welcome/logo-s.png" + PROPERTIES alias "logo-s") +set_source_files_properties("pics/welcome/logo-t.png" + PROPERTIES alias "logo-t") +set_source_files_properties("pics/welcome/logo-t2.png" + PROPERTIES alias "logo-t2") +set_source_files_properties("pics/welcome/logo-u.png" + PROPERTIES alias "logo-u") +add_qt_resource(sub-attaq "subattaq" PREFIX "/" FILES + data.xml + pics/big/background.png + pics/big/boat.png + pics/big/bomb.png + pics/big/explosion/boat/step1.png + pics/big/explosion/boat/step2.png + pics/big/explosion/boat/step3.png + pics/big/explosion/boat/step4.png + pics/big/explosion/submarine/step1.png + pics/big/explosion/submarine/step2.png + pics/big/explosion/submarine/step3.png + pics/big/explosion/submarine/step4.png + pics/big/submarine.png + pics/big/surface.png + pics/big/torpedo.png + pics/scalable/boat.svg + pics/scalable/sub-attaq.svg + pics/scalable/submarine.svg + pics/scalable/torpedo.svg + pics/small/background.png + pics/small/boat.png + pics/small/bomb.png + pics/small/submarine.png + pics/small/surface.png + pics/small/torpedo.png + pics/welcome/logo-a.png + pics/welcome/logo-a2.png + pics/welcome/logo-b.png + pics/welcome/logo-dash.png + pics/welcome/logo-excl.png + pics/welcome/logo-q.png + pics/welcome/logo-s.png + pics/welcome/logo-t.png + pics/welcome/logo-t2.png + pics/welcome/logo-u.png) + + +## Scopes: +##################################################################### + +extend_target(sub-attaq CONDITION TARGET Qt::OpenGL + LIBRARIES + Qt::OpenGL +) diff --git a/examples/widgets/desktop/CMakeLists.txt b/examples/widgets/desktop/CMakeLists.txt new file mode 100644 index 00000000000..a50d3c2f0ab --- /dev/null +++ b/examples/widgets/desktop/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from desktop.pro. + +add_subdirectory(screenshot) +add_subdirectory(systray) diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt new file mode 100644 index 00000000000..1956e3800e0 --- /dev/null +++ b/examples/widgets/desktop/screenshot/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from screenshot.pro. + +##################################################################### +## screenshot Binary: +##################################################################### + +add_qt_executable(screenshot + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/screenshot" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/screenshot" + SOURCES + main.cpp + screenshot.cpp screenshot.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt new file mode 100644 index 00000000000..9f5d05e7516 --- /dev/null +++ b/examples/widgets/desktop/systray/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from systray.pro. + +##################################################################### +## systray Binary: +##################################################################### + +add_qt_executable(systray + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/systray" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/systray" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(systray "systray" PREFIX "/" FILES + images/bad.png + images/heart.png + images/trash.png) + diff --git a/examples/widgets/dialogs/CMakeLists.txt b/examples/widgets/dialogs/CMakeLists.txt new file mode 100644 index 00000000000..c9d6823adcf --- /dev/null +++ b/examples/widgets/dialogs/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from dialogs.pro. + +add_subdirectory(extension) +add_subdirectory(findfiles) +if(TARGET Qt::PrintSupport AND QT_FEATURE_wizard) # special case + add_subdirectory(licensewizard) +endif() +add_subdirectory(standarddialogs) +add_subdirectory(tabdialog) + +if(QT_FEATURE_wizard) # special case + add_subdirectory(classwizard) + add_subdirectory(trivialwizard) +endif() diff --git a/examples/widgets/dialogs/classwizard/CMakeLists.txt b/examples/widgets/dialogs/classwizard/CMakeLists.txt new file mode 100644 index 00000000000..6d1cf9bab8c --- /dev/null +++ b/examples/widgets/dialogs/classwizard/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from classwizard.pro. + +##################################################################### +## classwizard Binary: +##################################################################### + +add_qt_executable(classwizard + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/classwizard" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/classwizard" + SOURCES + classwizard.cpp classwizard.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(classwizard "classwizard" FILES + images/background.png + images/banner.png + images/logo1.png + images/logo2.png + images/logo3.png + images/watermark1.png + images/watermark2.png) + diff --git a/examples/widgets/dialogs/extension/CMakeLists.txt b/examples/widgets/dialogs/extension/CMakeLists.txt new file mode 100644 index 00000000000..400cf239894 --- /dev/null +++ b/examples/widgets/dialogs/extension/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from extension.pro. + +##################################################################### +## extension Binary: +##################################################################### + +add_qt_executable(extension + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/extension" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/extension" + SOURCES + finddialog.cpp finddialog.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/dialogs/findfiles/CMakeLists.txt b/examples/widgets/dialogs/findfiles/CMakeLists.txt new file mode 100644 index 00000000000..26442a71b1f --- /dev/null +++ b/examples/widgets/dialogs/findfiles/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from findfiles.pro. + +##################################################################### +## findfiles Binary: +##################################################################### + +add_qt_executable(findfiles + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/findfiles" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/findfiles" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt new file mode 100644 index 00000000000..78b8cb7f51d --- /dev/null +++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from licensewizard.pro. + +##################################################################### +## licensewizard Binary: +##################################################################### + +add_qt_executable(licensewizard + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/licensewizard" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/licensewizard" + SOURCES + licensewizard.cpp licensewizard.h + main.cpp + LIBRARIES + Qt::Widgets + Qt::PrintSupport +) + +# Resources: +add_qt_resource(licensewizard "licensewizard" FILES + images/logo.png + images/watermark.png) + diff --git a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt new file mode 100644 index 00000000000..3c0ddc0199b --- /dev/null +++ b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from standarddialogs.pro. + +##################################################################### +## standarddialogs Binary: +##################################################################### + +add_qt_executable(standarddialogs + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/standarddialogs" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/standarddialogs" + SOURCES + dialog.cpp dialog.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/dialogs/tabdialog/CMakeLists.txt b/examples/widgets/dialogs/tabdialog/CMakeLists.txt new file mode 100644 index 00000000000..a8cbbb4b4e7 --- /dev/null +++ b/examples/widgets/dialogs/tabdialog/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tabdialog.pro. + +##################################################################### +## tabdialog Binary: +##################################################################### + +add_qt_executable(tabdialog + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/tabdialog" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/tabdialog" + SOURCES + main.cpp + tabdialog.cpp tabdialog.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt new file mode 100644 index 00000000000..2deae77c0d7 --- /dev/null +++ b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from trivialwizard.pro. + +##################################################################### +## trivialwizard Binary: +##################################################################### + +add_qt_executable(trivialwizard + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/trivialwizard" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/trivialwizard" + SOURCES + trivialwizard.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/draganddrop/CMakeLists.txt b/examples/widgets/draganddrop/CMakeLists.txt new file mode 100644 index 00000000000..fbad523a73d --- /dev/null +++ b/examples/widgets/draganddrop/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from draganddrop.pro. + +add_subdirectory(draggableicons) +add_subdirectory(draggabletext) +add_subdirectory(dropsite) +add_subdirectory(fridgemagnets) +add_subdirectory(puzzle) diff --git a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt new file mode 100644 index 00000000000..62a7be0cef8 --- /dev/null +++ b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from draggableicons.pro. + +##################################################################### +## draggableicons Binary: +##################################################################### + +add_qt_executable(draggableicons + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggableicons" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggableicons" + SOURCES + dragwidget.cpp dragwidget.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(draggableicons "draggableicons" FILES + images/boat.png + images/car.png + images/house.png) + diff --git a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt new file mode 100644 index 00000000000..96ec5feff6a --- /dev/null +++ b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from draggabletext.pro. + +##################################################################### +## draggabletext Binary: +##################################################################### + +add_qt_executable(draggabletext + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggabletext" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggabletext" + SOURCES + dragwidget.cpp dragwidget.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(draggabletext "draggabletext" PREFIX "/dictionary" FILES + words.txt) + diff --git a/examples/widgets/draganddrop/dropsite/CMakeLists.txt b/examples/widgets/draganddrop/dropsite/CMakeLists.txt new file mode 100644 index 00000000000..0d541337509 --- /dev/null +++ b/examples/widgets/draganddrop/dropsite/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from dropsite.pro. + +##################################################################### +## dropsite Binary: +##################################################################### + +add_qt_executable(dropsite + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/dropsite" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/dropsite" + SOURCES + droparea.cpp droparea.h + dropsitewindow.cpp dropsitewindow.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt new file mode 100644 index 00000000000..fcd7f3da15b --- /dev/null +++ b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from fridgemagnets.pro. + +##################################################################### +## fridgemagnets Binary: +##################################################################### + +add_qt_executable(fridgemagnets + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/fridgemagnets" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/fridgemagnets" + SOURCES + draglabel.cpp draglabel.h + dragwidget.cpp dragwidget.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(fridgemagnets "fridgemagnets" PREFIX "/dictionary" FILES + words.txt) + diff --git a/examples/widgets/draganddrop/puzzle/CMakeLists.txt b/examples/widgets/draganddrop/puzzle/CMakeLists.txt new file mode 100644 index 00000000000..2622dd068e3 --- /dev/null +++ b/examples/widgets/draganddrop/puzzle/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from puzzle.pro. + +##################################################################### +## puzzle Binary: +##################################################################### + +add_qt_executable(puzzle + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/puzzle" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/puzzle" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + pieceslist.cpp pieceslist.h + puzzlewidget.cpp puzzlewidget.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(puzzle "puzzle" PREFIX "/images" FILES + example.jpg) + + +#### Keys ignored in scope 1:.:puzzle.pro:: +# QMAKE_PROJECT_NAME = "dndpuzzle" diff --git a/examples/widgets/effects/CMakeLists.txt b/examples/widgets/effects/CMakeLists.txt new file mode 100644 index 00000000000..6e8a892de13 --- /dev/null +++ b/examples/widgets/effects/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from effects.pro. + +add_subdirectory(blurpicker) +add_subdirectory(fademessage) diff --git a/examples/widgets/effects/blurpicker/CMakeLists.txt b/examples/widgets/effects/blurpicker/CMakeLists.txt new file mode 100644 index 00000000000..f534c47102f --- /dev/null +++ b/examples/widgets/effects/blurpicker/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from blurpicker.pro. + +##################################################################### +## blurpicker Binary: +##################################################################### + +add_qt_executable(blurpicker + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/blurpicker" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/blurpicker" + SOURCES + blureffect.cpp blureffect.h + blurpicker.cpp blurpicker.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(blurpicker "blurpicker" PREFIX "/" FILES + images/accessories-calculator.png + images/accessories-text-editor.png + images/background.jpg + images/help-browser.png + images/internet-group-chat.png + images/internet-mail.png + images/internet-web-browser.png + images/office-calendar.png + images/system-users.png) + diff --git a/examples/widgets/effects/fademessage/CMakeLists.txt b/examples/widgets/effects/fademessage/CMakeLists.txt new file mode 100644 index 00000000000..838a10022ed --- /dev/null +++ b/examples/widgets/effects/fademessage/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from fademessage.pro. + +##################################################################### +## fademessage Binary: +##################################################################### + +add_qt_executable(fademessage + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/fademessage" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/fademessage" + SOURCES + fademessage.cpp fademessage.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(fademessage "fademessage" PREFIX "/" FILES + background.jpg) + diff --git a/examples/widgets/gestures/CMakeLists.txt b/examples/widgets/gestures/CMakeLists.txt new file mode 100644 index 00000000000..0f9f95b72ff --- /dev/null +++ b/examples/widgets/gestures/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from gestures.pro. + +add_subdirectory(imagegestures) diff --git a/examples/widgets/gestures/imagegestures/CMakeLists.txt b/examples/widgets/gestures/imagegestures/CMakeLists.txt new file mode 100644 index 00000000000..4862654314a --- /dev/null +++ b/examples/widgets/gestures/imagegestures/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from imagegestures.pro. + +##################################################################### +## imagegestures Binary: +##################################################################### + +add_qt_executable(imagegestures + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/gestures/imagegestures" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/gestures/imagegestures" + SOURCES + imagewidget.cpp imagewidget.h + main.cpp + mainwidget.cpp mainwidget.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/graphicsview/CMakeLists.txt b/examples/widgets/graphicsview/CMakeLists.txt new file mode 100644 index 00000000000..19f60011e5c --- /dev/null +++ b/examples/widgets/graphicsview/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from graphicsview.pro. + +add_subdirectory(chip) +add_subdirectory(elasticnodes) +add_subdirectory(embeddeddialogs) +add_subdirectory(collidingmice) +add_subdirectory(padnavigator) +add_subdirectory(basicgraphicslayouts) +add_subdirectory(diagramscene) +if(QT_FEATURE_cursor AND QT_FEATURE_draganddrop) + add_subdirectory(dragdroprobot) +endif() +add_subdirectory(flowlayout) +add_subdirectory(anchorlayout) +add_subdirectory(simpleanchorlayout) +add_subdirectory(weatheranchorlayout) + +if(TARGET Qt::OpenGL AND NOT QT_FEATURE_opengles2 AND NOT QT_FEATURE_dynamicgl) + add_subdirectory(boxes) +endif() diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt new file mode 100644 index 00000000000..8149f967840 --- /dev/null +++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from anchorlayout.pro. + +##################################################################### +## anchorlayout Binary: +##################################################################### + +add_qt_executable(anchorlayout + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/anchorlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/anchorlayout" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt new file mode 100644 index 00000000000..d285a35ecc8 --- /dev/null +++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from basicgraphicslayouts.pro. + +##################################################################### +## basicgraphicslayouts Binary: +##################################################################### + +add_qt_executable(basicgraphicslayouts + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/basicgraphicslayouts" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/basicgraphicslayouts" + SOURCES + layoutitem.cpp layoutitem.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(basicgraphicslayouts "basicgraphicslayouts" FILES + images/block.png) + diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt new file mode 100644 index 00000000000..10ff8b5b476 --- /dev/null +++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt @@ -0,0 +1,55 @@ +# Generated from boxes.pro. + +find_package(WrapOpenGL) + +##################################################################### +## boxes Binary: +##################################################################### + +add_qt_executable(boxes + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/boxes" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/boxes" + SOURCES + 3rdparty/fbm.c 3rdparty/fbm.h + glbuffers.cpp glbuffers.h + glextensions.cpp glextensions.h + gltrianglemesh.h + main.cpp + qtbox.cpp qtbox.h + roundedbox.cpp roundedbox.h + scene.cpp scene.h + trackball.cpp trackball.h + LIBRARIES + Qt::OpenGL + Qt::Widgets + WrapOpenGL +) + +# Resources: +add_qt_resource(boxes "boxes" PREFIX "/res/boxes" FILES + basic.fsh + basic.vsh + cubemap_negx.jpg + cubemap_negy.jpg + cubemap_negz.jpg + cubemap_posx.jpg + cubemap_posy.jpg + cubemap_posz.jpg + dotted.fsh + fresnel.fsh + glass.fsh + granite.fsh + marble.fsh + parameters.par + qt-logo.jpg + qt-logo.png + reflection.fsh + refraction.fsh + smiley.png + square.jpg + wood.fsh) + + +## Scopes: +##################################################################### diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt new file mode 100644 index 00000000000..566a8aae02c --- /dev/null +++ b/examples/widgets/graphicsview/chip/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from chip.pro. + +##################################################################### +## chip Binary: +##################################################################### + +add_qt_executable(chip + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/chip" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/chip" + SOURCES + chip.cpp chip.h + main.cpp + mainwindow.cpp mainwindow.h + view.cpp view.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(chip "images" FILES + fileprint.png + qt4logo.png + rotateleft.png + rotateright.png + zoomin.png + zoomout.png) + + +## Scopes: +##################################################################### + +extend_target(chip CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) + +extend_target(chip CONDITION TARGET Qt::OpenGL + LIBRARIES + Qt::OpenGL +) + +#### Keys ignored in scope 4:.:chip.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt new file mode 100644 index 00000000000..5455bec89e4 --- /dev/null +++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from collidingmice.pro. + +##################################################################### +## collidingmice Binary: +##################################################################### + +add_qt_executable(collidingmice + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/collidingmice" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/collidingmice" + SOURCES + main.cpp + mouse.cpp mouse.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(collidingmice "mice" PREFIX "/" FILES + images/cheese.jpg) + diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt new file mode 100644 index 00000000000..fb3ff6c712e --- /dev/null +++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt @@ -0,0 +1,39 @@ +# Generated from diagramscene.pro. + +##################################################################### +## diagramscene Binary: +##################################################################### + +add_qt_executable(diagramscene + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/diagramscene" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/diagramscene" + SOURCES + arrow.cpp arrow.h + diagramitem.cpp diagramitem.h + diagramscene.cpp diagramscene.h + diagramtextitem.cpp diagramtextitem.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(diagramscene "diagramscene" FILES + images/background1.png + images/background2.png + images/background3.png + images/background4.png + images/bold.png + images/bringtofront.png + images/delete.png + images/floodfill.png + images/italic.png + images/linecolor.png + images/linepointer.png + images/pointer.png + images/sendtoback.png + images/textpointer.png + images/underline.png) + diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt new file mode 100644 index 00000000000..76932368e81 --- /dev/null +++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from dragdroprobot.pro. + +##################################################################### +## dragdroprobot Binary: +##################################################################### + +add_qt_executable(dragdroprobot + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/dragdroprobot" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/dragdroprobot" + SOURCES + coloritem.cpp coloritem.h + main.cpp + robot.cpp robot.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(dragdroprobot "robot" PREFIX "/" FILES + images/head.png) + diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt new file mode 100644 index 00000000000..d1c10327b08 --- /dev/null +++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from elasticnodes.pro. + +##################################################################### +## elasticnodes Binary: +##################################################################### + +add_qt_executable(elasticnodes + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/elasticnodes" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/elasticnodes" + SOURCES + edge.cpp edge.h + graphwidget.cpp graphwidget.h + main.cpp + node.cpp node.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt new file mode 100644 index 00000000000..d31e15102e4 --- /dev/null +++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from embeddeddialogs.pro. + +##################################################################### +## embeddeddialogs Binary: +##################################################################### + +add_qt_executable(embeddeddialogs + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/embeddeddialogs" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/embeddeddialogs" + SOURCES + customproxy.cpp customproxy.h + embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(embeddeddialogs "embeddeddialogs" FILES + No-Ones-Laughing-3.jpg) + + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:embeddeddialogs.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt new file mode 100644 index 00000000000..2d313ff700e --- /dev/null +++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from flowlayout.pro. + +##################################################################### +## flowlayout Binary: +##################################################################### + +add_qt_executable(flowlayout + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/flowlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/flowlayout" + SOURCES + flowlayout.cpp flowlayout.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:flowlayout.pro:: +# QMAKE_PROJECT_NAME = "flowlayout_graphicsview" diff --git a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt new file mode 100644 index 00000000000..ad879d3a8b2 --- /dev/null +++ b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt @@ -0,0 +1,43 @@ +# Generated from padnavigator.pro. + +##################################################################### +## padnavigator Binary: +##################################################################### + +add_qt_executable(padnavigator + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/padnavigator" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/padnavigator" + SOURCES + flippablepad.cpp flippablepad.h + form.ui + main.cpp + padnavigator.cpp padnavigator.h + roundrectitem.cpp roundrectitem.h + splashitem.cpp splashitem.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(padnavigator "padnavigator" FILES + images/artsfftscope.png + images/blue_angle_swirl.jpg + images/kontact_contacts.png + images/kontact_journal.png + images/kontact_mail.png + images/kontact_notes.png + images/kopeteavailable.png + images/metacontact_online.png + images/minitools.png) + + +#### Keys ignored in scope 1:.:padnavigator.pro:: +# CONFIG = "console" + +## Scopes: +##################################################################### + +extend_target(padnavigator CONDITION TARGET Qt::OpenGL + LIBRARIES + Qt::OpenGL +) diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt new file mode 100644 index 00000000000..87e4742b44c --- /dev/null +++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from simpleanchorlayout.pro. + +##################################################################### +## simpleanchorlayout Binary: +##################################################################### + +add_qt_executable(simpleanchorlayout + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/simpleanchorlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/simpleanchorlayout" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt new file mode 100644 index 00000000000..5a20bbdb2e5 --- /dev/null +++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from weatheranchorlayout.pro. + +##################################################################### +## weatheranchorlayout Binary: +##################################################################### + +add_qt_executable(weatheranchorlayout + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/weatheranchorlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/weatheranchorlayout" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(weatheranchorlayout "weatheranchorlayout" FILES + images/5days.jpg + images/details.jpg + images/place.jpg + images/tabbar.jpg + images/title.jpg + images/weather-few-clouds.png) + diff --git a/examples/widgets/itemviews/CMakeLists.txt b/examples/widgets/itemviews/CMakeLists.txt new file mode 100644 index 00000000000..a1bd0c4dca8 --- /dev/null +++ b/examples/widgets/itemviews/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from itemviews.pro. + +add_subdirectory(addressbook) +add_subdirectory(basicsortfiltermodel) +add_subdirectory(chart) +add_subdirectory(coloreditorfactory) +add_subdirectory(combowidgetmapper) +add_subdirectory(customsortfiltermodel) +add_subdirectory(dirview) +add_subdirectory(editabletreemodel) +add_subdirectory(fetchmore) +add_subdirectory(flattreeview) +add_subdirectory(frozencolumn) +add_subdirectory(interview) +add_subdirectory(pixelator) +if(QT_FEATURE_draganddrop) # special case + add_subdirectory(puzzle) +endif() +if(TARGET Qt::Xml) # special case + add_subdirectory(simpledommodel) +endif() +add_subdirectory(simpletreemodel) +add_subdirectory(simplewidgetmapper) +add_subdirectory(spinboxdelegate) +add_subdirectory(spreadsheet) +add_subdirectory(stardelegate) +add_subdirectory(storageview) diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt new file mode 100644 index 00000000000..cee0ef70e24 --- /dev/null +++ b/examples/widgets/itemviews/addressbook/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from addressbook.pro. + +##################################################################### +## addressbook Binary: +##################################################################### + +add_qt_executable(addressbook + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/addressbook" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/addressbook" + SOURCES + adddialog.cpp adddialog.h + addresswidget.cpp addresswidget.h + main.cpp + mainwindow.cpp mainwindow.h + newaddresstab.cpp newaddresstab.h + tablemodel.cpp tablemodel.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt new file mode 100644 index 00000000000..6da9a73867d --- /dev/null +++ b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from basicsortfiltermodel.pro. + +##################################################################### +## basicsortfiltermodel Binary: +##################################################################### + +add_qt_executable(basicsortfiltermodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/basicsortfiltermodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/basicsortfiltermodel" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt new file mode 100644 index 00000000000..9d707d1ec60 --- /dev/null +++ b/examples/widgets/itemviews/chart/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from chart.pro. + +##################################################################### +## chart Binary: +##################################################################### + +add_qt_executable(chart + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/chart" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/chart" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + pieview.cpp pieview.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(chart "chart" PREFIX "/Charts" FILES + qtdata.cht) + + +## Scopes: +##################################################################### + +extend_target(chart CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS + LIBRARIES + m +) diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt new file mode 100644 index 00000000000..317489e6e26 --- /dev/null +++ b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from coloreditorfactory.pro. + +##################################################################### +## coloreditorfactory Binary: +##################################################################### + +add_qt_executable(coloreditorfactory + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/coloreditorfactory" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/coloreditorfactory" + SOURCES + colorlisteditor.cpp colorlisteditor.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt new file mode 100644 index 00000000000..326df33ba29 --- /dev/null +++ b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from combowidgetmapper.pro. + +##################################################################### +## combowidgetmapper Binary: +##################################################################### + +add_qt_executable(combowidgetmapper + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/combowidgetmapper" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/combowidgetmapper" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt new file mode 100644 index 00000000000..6cbfa84ae1e --- /dev/null +++ b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from customsortfiltermodel.pro. + +##################################################################### +## customsortfiltermodel Binary: +##################################################################### + +add_qt_executable(customsortfiltermodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/customsortfiltermodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/customsortfiltermodel" + SOURCES + filterwidget.cpp filterwidget.h + main.cpp + mysortfilterproxymodel.cpp mysortfilterproxymodel.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(customsortfiltermodel "customsortfiltermodel" PREFIX "/" FILES + images/find.png) + diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt new file mode 100644 index 00000000000..5ad3455249f --- /dev/null +++ b/examples/widgets/itemviews/dirview/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from dirview.pro. + +##################################################################### +## dirview Binary: +##################################################################### + +add_qt_executable(dirview + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/dirview" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/dirview" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt new file mode 100644 index 00000000000..699dfb17330 --- /dev/null +++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from editabletreemodel.pro. + +##################################################################### +## editabletreemodel Binary: +##################################################################### + +add_qt_executable(editabletreemodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/editabletreemodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/editabletreemodel" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + treeitem.cpp treeitem.h + treemodel.cpp treemodel.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(editabletreemodel "editabletreemodel" PREFIX "/" FILES + default.txt) + diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt new file mode 100644 index 00000000000..d3f25783027 --- /dev/null +++ b/examples/widgets/itemviews/fetchmore/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from fetchmore.pro. + +##################################################################### +## fetchmore Binary: +##################################################################### + +add_qt_executable(fetchmore + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/fetchmore" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/fetchmore" + SOURCES + filelistmodel.cpp filelistmodel.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt new file mode 100644 index 00000000000..c8bffce9708 --- /dev/null +++ b/examples/widgets/itemviews/flattreeview/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from flattreeview.pro. + +##################################################################### +## flattreeview Binary: +##################################################################### + +add_qt_executable(flattreeview + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/flattreeview" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/flattreeview" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt new file mode 100644 index 00000000000..11e8a1e471b --- /dev/null +++ b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from frozencolumn.pro. + +##################################################################### +## frozencolumn Binary: +##################################################################### + +add_qt_executable(frozencolumn + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/frozencolumn" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/frozencolumn" + SOURCES + freezetablewidget.cpp freezetablewidget.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(frozencolumn "grades" PREFIX "/" FILES + grades.txt) + diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt new file mode 100644 index 00000000000..d970348bc6a --- /dev/null +++ b/examples/widgets/itemviews/interview/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from interview.pro. + +##################################################################### +## interview Binary: +##################################################################### + +add_qt_executable(interview + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/interview" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/interview" + SOURCES + main.cpp + model.cpp model.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(interview "interview" PREFIX "/" FILES + images/folder.png + images/interview.png + images/services.png) + + +#### Keys ignored in scope 1:.:interview.pro:: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:interview.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt new file mode 100644 index 00000000000..fc29cde3b1f --- /dev/null +++ b/examples/widgets/itemviews/pixelator/CMakeLists.txt @@ -0,0 +1,31 @@ +# Generated from pixelator.pro. + +##################################################################### +## pixelator Binary: +##################################################################### + +add_qt_executable(pixelator + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/pixelator" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/pixelator" + SOURCES + imagemodel.cpp imagemodel.h + main.cpp + mainwindow.cpp mainwindow.h + pixeldelegate.cpp pixeldelegate.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(pixelator "images" FILES + images/qt.png) + + +## Scopes: +##################################################################### + +extend_target(pixelator CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt new file mode 100644 index 00000000000..a105278418e --- /dev/null +++ b/examples/widgets/itemviews/puzzle/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from puzzle.pro. + +##################################################################### +## puzzle Binary: +##################################################################### + +add_qt_executable(puzzle_itemview # special case + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + piecesmodel.cpp piecesmodel.h + puzzlewidget.cpp puzzlewidget.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(puzzle_itemview "puzzle" PREFIX "/images" FILES # special case + example.jpg) + diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt new file mode 100644 index 00000000000..25142870495 --- /dev/null +++ b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from simpledommodel.pro. + +##################################################################### +## simpledommodel Binary: +##################################################################### + +add_qt_executable(simpledommodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpledommodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpledommodel" + SOURCES + domitem.cpp domitem.h + dommodel.cpp dommodel.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Xml + Qt::Widgets +) diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt new file mode 100644 index 00000000000..1b50a3508c2 --- /dev/null +++ b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from simpletreemodel.pro. + +##################################################################### +## simpletreemodel Binary: +##################################################################### + +add_qt_executable(simpletreemodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpletreemodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpletreemodel" + SOURCES + main.cpp + treeitem.cpp treeitem.h + treemodel.cpp treemodel.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(simpletreemodel "simpletreemodel" FILES + default.txt) + diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt new file mode 100644 index 00000000000..849f7e29695 --- /dev/null +++ b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from simplewidgetmapper.pro. + +##################################################################### +## simplewidgetmapper Binary: +##################################################################### + +add_qt_executable(simplewidgetmapper + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simplewidgetmapper" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simplewidgetmapper" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt new file mode 100644 index 00000000000..b8c24f591c7 --- /dev/null +++ b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from spinboxdelegate.pro. + +##################################################################### +## spinboxdelegate Binary: +##################################################################### + +add_qt_executable(spinboxdelegate + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spinboxdelegate" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spinboxdelegate" + SOURCES + delegate.cpp delegate.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt new file mode 100644 index 00000000000..498164c1cd9 --- /dev/null +++ b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from spreadsheet.pro. + +##################################################################### +## spreadsheet Binary: +##################################################################### + +add_qt_executable(spreadsheet + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spreadsheet" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spreadsheet" + SOURCES + main.cpp + printview.cpp printview.h + spreadsheet.cpp spreadsheet.h + spreadsheetdelegate.cpp spreadsheetdelegate.h + spreadsheetitem.cpp spreadsheetitem.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(spreadsheet "spreadsheet" PREFIX "/" FILES + images/interview.png) + + +## Scopes: +##################################################################### + +extend_target(spreadsheet CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) + +#### Keys ignored in scope 3:.:spreadsheet.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt new file mode 100644 index 00000000000..0b94a12fb67 --- /dev/null +++ b/examples/widgets/itemviews/stardelegate/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from stardelegate.pro. + +##################################################################### +## stardelegate Binary: +##################################################################### + +add_qt_executable(stardelegate + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/stardelegate" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/stardelegate" + SOURCES + main.cpp + stardelegate.cpp stardelegate.h + stareditor.cpp stareditor.h + starrating.cpp starrating.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt new file mode 100644 index 00000000000..efad83e1a11 --- /dev/null +++ b/examples/widgets/itemviews/storageview/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from storageview.pro. + +##################################################################### +## storageview Binary: +##################################################################### + +add_qt_executable(storageview + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/storageview" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/storageview" + SOURCES + main.cpp + storagemodel.cpp storagemodel.h + LIBRARIES + Qt::Gui + Qt::Widgets +) + +#### Keys ignored in scope 1:.:storageview.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/layouts/CMakeLists.txt b/examples/widgets/layouts/CMakeLists.txt new file mode 100644 index 00000000000..eaca6692480 --- /dev/null +++ b/examples/widgets/layouts/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from layouts.pro. + +add_subdirectory(basiclayouts) +add_subdirectory(borderlayout) +add_subdirectory(dynamiclayouts) +add_subdirectory(flowlayout) diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt new file mode 100644 index 00000000000..28ac6a48b20 --- /dev/null +++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from basiclayouts.pro. + +##################################################################### +## basiclayouts Binary: +##################################################################### + +add_qt_executable(basiclayouts + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/basiclayouts" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/basiclayouts" + SOURCES + dialog.cpp dialog.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt new file mode 100644 index 00000000000..72cf6002a25 --- /dev/null +++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from borderlayout.pro. + +##################################################################### +## borderlayout Binary: +##################################################################### + +add_qt_executable(borderlayout + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/borderlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/borderlayout" + SOURCES + borderlayout.cpp borderlayout.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt new file mode 100644 index 00000000000..47f935bf688 --- /dev/null +++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from dynamiclayouts.pro. + +##################################################################### +## dynamiclayouts Binary: +##################################################################### + +add_qt_executable(dynamiclayouts + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/dynamiclayouts" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/dynamiclayouts" + SOURCES + dialog.cpp dialog.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt new file mode 100644 index 00000000000..a887abb93e8 --- /dev/null +++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from flowlayout.pro. + +##################################################################### +## flowlayout Binary: +##################################################################### + +add_qt_executable(flowlayout_layout # special case + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/flowlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/flowlayout" + SOURCES + flowlayout.cpp flowlayout.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/mac/CMakeLists.txt b/examples/widgets/mac/CMakeLists.txt new file mode 100644 index 00000000000..82038acfae7 --- /dev/null +++ b/examples/widgets/mac/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from mac.pro. + + +if(APPLE_OSX) + add_subdirectory(qmaccocoaviewcontainer) + add_subdirectory(qmacnativewidget) +endif() diff --git a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt new file mode 100644 index 00000000000..52d1db1d9e7 --- /dev/null +++ b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qmaccocoaviewcontainer.pro. + +##################################################################### +## qmaccocoaviewcontainer Binary: +##################################################################### + +add_qt_executable(qmaccocoaviewcontainer + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmaccocoaviewcontainer" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmaccocoaviewcontainer" + SOURCES + main.mm + LIBRARIES + Qt::Widgets + ${FWAppKit} +) + +#### Keys ignored in scope 1:.:qmaccocoaviewcontainer.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt new file mode 100644 index 00000000000..9708fae762a --- /dev/null +++ b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qmacnativewidget.pro. + +##################################################################### +## qmacnativewidget Binary: +##################################################################### + +add_qt_executable(qmacnativewidget + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmacnativewidget" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmacnativewidget" + SOURCES + main.mm + LIBRARIES + Qt::Widgets + ${FWAppKit} +) + +#### Keys ignored in scope 1:.:qmacnativewidget.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/mainwindows/CMakeLists.txt b/examples/widgets/mainwindows/CMakeLists.txt new file mode 100644 index 00000000000..8bb5f52f924 --- /dev/null +++ b/examples/widgets/mainwindows/CMakeLists.txt @@ -0,0 +1,8 @@ +# Generated from mainwindows.pro. + +add_subdirectory(application) +add_subdirectory(dockwidgets) +add_subdirectory(mainwindow) +add_subdirectory(mdi) +add_subdirectory(menus) +add_subdirectory(sdi) diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt new file mode 100644 index 00000000000..8a9bdea2c20 --- /dev/null +++ b/examples/widgets/mainwindows/application/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from application.pro. + +##################################################################### +## application Binary: +##################################################################### + +add_qt_executable(application + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/application" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/application" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(application "application" FILES + images/copy.png + images/cut.png + images/new.png + images/open.png + images/paste.png + images/save.png) + diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt new file mode 100644 index 00000000000..e8fd580fd86 --- /dev/null +++ b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from dockwidgets.pro. + +##################################################################### +## dockwidgets Binary: +##################################################################### + +add_qt_executable(dockwidgets + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/dockwidgets" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/dockwidgets" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(dockwidgets "dockwidgets" FILES + images/new.png + images/print.png + images/save.png + images/undo.png) + + +## Scopes: +##################################################################### + +extend_target(dockwidgets CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt new file mode 100644 index 00000000000..df1d9b63556 --- /dev/null +++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from mainwindow.pro. + +##################################################################### +## mainwindow Binary: +##################################################################### + +add_qt_executable(mainwindow + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mainwindow" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mainwindow" + SOURCES + colorswatch.cpp colorswatch.h + main.cpp + mainwindow.cpp mainwindow.h + toolbar.cpp toolbar.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(mainwindow "mainwindow" PREFIX "/res" FILES + qt.png + titlebarCenter.png + titlebarLeft.png + titlebarRight.png) + + +#### Keys ignored in scope 1:.:mainwindow.pro:: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:mainwindow.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt new file mode 100644 index 00000000000..c20acbdfca5 --- /dev/null +++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from mdi.pro. + +##################################################################### +## mdi Binary: +##################################################################### + +add_qt_executable(mdi + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mdi" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mdi" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + mdichild.cpp mdichild.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(mdi "mdi" FILES + images/copy.png + images/cut.png + images/new.png + images/open.png + images/paste.png + images/save.png) + diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt new file mode 100644 index 00000000000..6d7e471a8c5 --- /dev/null +++ b/examples/widgets/mainwindows/menus/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from menus.pro. + +##################################################################### +## menus Binary: +##################################################################### + +add_qt_executable(menus + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/menus" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/menus" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt new file mode 100644 index 00000000000..8391aa0cbc8 --- /dev/null +++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from sdi.pro. + +##################################################################### +## sdi Binary: +##################################################################### + +add_qt_executable(sdi + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/sdi" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/sdi" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(sdi "sdi" FILES + images/copy.png + images/cut.png + images/new.png + images/open.png + images/paste.png + images/save.png) + diff --git a/examples/widgets/painting/CMakeLists.txt b/examples/widgets/painting/CMakeLists.txt new file mode 100644 index 00000000000..e7d612da3b9 --- /dev/null +++ b/examples/widgets/painting/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from painting.pro. + +add_subdirectory(shared) # special case +add_subdirectory(basicdrawing) +add_subdirectory(concentriccircles) +add_subdirectory(affine) +# add_subdirectory(composition) # FIXME: Seems buggy wrt. usesOpenGL function +add_subdirectory(deform) +add_subdirectory(gradients) +add_subdirectory(pathstroke) +add_subdirectory(imagecomposition) +add_subdirectory(painterpaths) +add_subdirectory(transformations) +add_subdirectory(fontsampler) diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt new file mode 100644 index 00000000000..cda43296dd1 --- /dev/null +++ b/examples/widgets/painting/affine/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from affine.pro. + +##################################################################### +## affine Binary: +##################################################################### + +add_qt_executable(affine + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/affine" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/affine" + SOURCES + main.cpp + xform.cpp xform.h + # INCLUDE_DIRECTORIES ../shared # special case + LIBRARIES # special case + painting_shared +) + +# Resources: +add_qt_resource(affine "affine" PREFIX "/res/affine" FILES + bg1.jpg + xform.cpp + xform.html) diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt new file mode 100644 index 00000000000..176149dad54 --- /dev/null +++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from basicdrawing.pro. + +##################################################################### +## basicdrawing Binary: +##################################################################### + +add_qt_executable(basicdrawing + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/basicdrawing" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/basicdrawing" + SOURCES + main.cpp + renderarea.cpp renderarea.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(basicdrawing "basicdrawing" FILES + images/brick.png + images/qt-logo.png) + diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt new file mode 100644 index 00000000000..1e83bc48147 --- /dev/null +++ b/examples/widgets/painting/composition/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from composition.pro. + +##################################################################### +## composition Binary: +##################################################################### + +add_qt_executable(composition + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/composition" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/composition" + SOURCES + composition.cpp composition.h + main.cpp + LIBRARIES # special case + painting_shared +) + +# Resources: +add_qt_resource(composition "composition" PREFIX "/res/composition" FILES + composition.cpp + composition.html + flower.jpg + flower_alpha.jpg) diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt new file mode 100644 index 00000000000..a2305782a55 --- /dev/null +++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from concentriccircles.pro. + +##################################################################### +## concentriccircles Binary: +##################################################################### + +add_qt_executable(concentriccircles + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/concentriccircles" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/concentriccircles" + SOURCES + circlewidget.cpp circlewidget.h + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt new file mode 100644 index 00000000000..67622da25d7 --- /dev/null +++ b/examples/widgets/painting/deform/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from deform.pro. + +##################################################################### +## deform Binary: +##################################################################### + +add_qt_executable(deform + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/deform" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/deform" + SOURCES + main.cpp + pathdeform.cpp pathdeform.h + LIBRARIES # special case + painting_shared +) + +# Resources: +add_qt_resource(deform "deform" PREFIX "/res/deform" FILES + pathdeform.cpp + pathdeform.html) diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt new file mode 100644 index 00000000000..a32b10589f7 --- /dev/null +++ b/examples/widgets/painting/fontsampler/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from fontsampler.pro. + +##################################################################### +## fontsampler Binary: +##################################################################### + +add_qt_executable(fontsampler + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/fontsampler" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/fontsampler" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + mainwindowbase.ui + LIBRARIES + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(fontsampler CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt new file mode 100644 index 00000000000..0d5553b986c --- /dev/null +++ b/examples/widgets/painting/gradients/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from gradients.pro. + +##################################################################### +## gradients Binary: +##################################################################### + +add_qt_executable(gradients + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients" + SOURCES + gradients.cpp gradients.h + main.cpp + LIBRARIES # special case + painting_shared +) + +# Resources: +add_qt_resource(gradients "gradients" PREFIX "/res/gradients" FILES + gradients.cpp + gradients.html) diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt new file mode 100644 index 00000000000..eed2bede43e --- /dev/null +++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from imagecomposition.pro. + +##################################################################### +## imagecomposition Binary: +##################################################################### + +add_qt_executable(imagecomposition + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/imagecomposition" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/imagecomposition" + SOURCES + imagecomposer.cpp imagecomposer.h + main.cpp + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(imagecomposition "imagecomposition" FILES + images/butterfly.png + images/checker.png) + diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt new file mode 100644 index 00000000000..13dd321a529 --- /dev/null +++ b/examples/widgets/painting/painterpaths/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from painterpaths.pro. + +##################################################################### +## painterpaths Binary: +##################################################################### + +add_qt_executable(painterpaths + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/painterpaths" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/painterpaths" + SOURCES + main.cpp + renderarea.cpp renderarea.h + window.cpp window.h + LIBRARIES + Qt::Widgets + painting_shared # special case +) + +## Scopes: +##################################################################### + +extend_target(painterpaths CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS + LIBRARIES + m +) diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt new file mode 100644 index 00000000000..150a1baa834 --- /dev/null +++ b/examples/widgets/painting/pathstroke/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from pathstroke.pro. + +##################################################################### +## pathstroke Binary: +##################################################################### + +add_qt_executable(pathstroke + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke" + SOURCES + main.cpp + pathstroke.cpp pathstroke.h + LIBRARIES # special case + painting_shared +) + +# Resources: +add_qt_resource(pathstroke "pathstroke" PREFIX "/res/pathstroke" FILES + pathstroke.cpp + pathstroke.html) diff --git a/examples/widgets/painting/shared/CMakeLists.txt b/examples/widgets/painting/shared/CMakeLists.txt new file mode 100644 index 00000000000..a7bec2789b6 --- /dev/null +++ b/examples/widgets/painting/shared/CMakeLists.txt @@ -0,0 +1,64 @@ +# special case: Entire file! + +# special case: +add_library(painting_shared OBJECT) +qt_manual_moc(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/ +target_sources(painting_shared PRIVATE + arthurstyle.cpp arthurstyle.h + arthurwidgets.cpp arthurwidgets.h + hoverpoints.cpp hoverpoints.h + ${moc_files} +) +target_link_libraries(painting_shared PUBLIC Qt::Widgets) +target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") + + +# Resources: +add_qt_resource(painting_shared "shared" PREFIX "/res" FILES + images/button_normal_cap_left.png + images/button_normal_cap_right.png + images/button_normal_stretch.png + images/button_pressed_cap_left.png + images/button_pressed_cap_right.png + images/button_pressed_stretch.png + images/frame_bottom.png + images/frame_bottomleft.png + images/frame_bottomright.png + images/frame_left.png + images/frame_right.png + images/frame_top.png + images/frame_topleft.png + images/frame_topright.png + images/groupframe_bottom_left.png + images/groupframe_bottom_right.png + images/groupframe_bottom_stretch.png + images/groupframe_left_stretch.png + images/groupframe_right_stretch.png + images/groupframe_top_stretch.png + images/groupframe_topleft.png + images/groupframe_topright.png + images/line_dash_dot.png + images/line_dash_dot_dot.png + images/line_dashed.png + images/line_dotted.png + images/line_solid.png + images/radiobutton-on.png + images/radiobutton_off.png + images/radiobutton_on.png + images/slider_bar.png + images/slider_thumb_on.png + images/title_cap_left.png + images/title_cap_right.png + images/title_stretch.png) + + +## Scopes: +##################################################################### + +extend_target(painting_shared CONDITION TARGET Qt::OpenGL OR QT_FEATURE_opengles2 + DEFINES + QT_OPENGL_SUPPORT + LIBRARIES + Qt::OpenGL + Qt::Widgets +) diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt new file mode 100644 index 00000000000..a3c3130c323 --- /dev/null +++ b/examples/widgets/painting/transformations/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from transformations.pro. + +##################################################################### +## transformations Binary: +##################################################################### + +add_qt_executable(transformations + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/transformations" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/transformations" + SOURCES + main.cpp + renderarea.cpp renderarea.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/richtext/CMakeLists.txt b/examples/widgets/richtext/CMakeLists.txt new file mode 100644 index 00000000000..adb98e38f96 --- /dev/null +++ b/examples/widgets/richtext/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from richtext.pro. + +add_subdirectory(calendar) +add_subdirectory(orderform) +add_subdirectory(syntaxhighlighter) +add_subdirectory(textedit) diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt new file mode 100644 index 00000000000..8d26479929a --- /dev/null +++ b/examples/widgets/richtext/calendar/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from calendar.pro. + +##################################################################### +## calendar Binary: +##################################################################### + +add_qt_executable(calendar + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/calendar" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/calendar" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/richtext/orderform/CMakeLists.txt b/examples/widgets/richtext/orderform/CMakeLists.txt new file mode 100644 index 00000000000..5f12e98cdfe --- /dev/null +++ b/examples/widgets/richtext/orderform/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from orderform.pro. + +##################################################################### +## orderform Binary: +##################################################################### + +add_qt_executable(orderform + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/orderform" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/orderform" + SOURCES + detailsdialog.cpp detailsdialog.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(orderform CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt new file mode 100644 index 00000000000..afffcc639b1 --- /dev/null +++ b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from syntaxhighlighter.pro. + +##################################################################### +## syntaxhighlighter Binary: +##################################################################### + +add_qt_executable(syntaxhighlighter + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/syntaxhighlighter" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/syntaxhighlighter" + SOURCES + highlighter.cpp highlighter.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/richtext/textedit/CMakeLists.txt b/examples/widgets/richtext/textedit/CMakeLists.txt new file mode 100644 index 00000000000..9166f6748a2 --- /dev/null +++ b/examples/widgets/richtext/textedit/CMakeLists.txt @@ -0,0 +1,75 @@ +# Generated from textedit.pro. + +##################################################################### +## textedit Binary: +##################################################################### + +add_qt_executable(textedit + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/textedit" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/textedit" + SOURCES + main.cpp + textedit.cpp textedit.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(textedit "textedit" PREFIX "/" FILES + example.html + images/logo32.png + images/mac/editcopy.png + images/mac/editcut.png + images/mac/editpaste.png + images/mac/editredo.png + images/mac/editundo.png + images/mac/exportpdf.png + images/mac/filenew.png + images/mac/fileopen.png + images/mac/fileprint.png + images/mac/filesave.png + images/mac/textbold.png + images/mac/textcenter.png + images/mac/textitalic.png + images/mac/textjustify.png + images/mac/textleft.png + images/mac/textright.png + images/mac/textunder.png + images/mac/zoomin.png + images/mac/zoomout.png + images/win/editcopy.png + images/win/editcut.png + images/win/editpaste.png + images/win/editredo.png + images/win/editundo.png + images/win/exportpdf.png + images/win/filenew.png + images/win/fileopen.png + images/win/fileprint.png + images/win/filesave.png + images/win/textbold.png + images/win/textcenter.png + images/win/textitalic.png + images/win/textjustify.png + images/win/textleft.png + images/win/textright.png + images/win/textunder.png + images/win/zoomin.png + images/win/zoomout.png) + + +#### Keys ignored in scope 1:.:textedit.pro:: +# EXAMPLE_FILES = "textedit.qdoc" +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +extend_target(textedit CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) + +#### Keys ignored in scope 3:.:textedit.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/scroller/CMakeLists.txt b/examples/widgets/scroller/CMakeLists.txt new file mode 100644 index 00000000000..f663cd98904 --- /dev/null +++ b/examples/widgets/scroller/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from scroller.pro. + +add_subdirectory(graphicsview) diff --git a/examples/widgets/scroller/graphicsview/CMakeLists.txt b/examples/widgets/scroller/graphicsview/CMakeLists.txt new file mode 100644 index 00000000000..0f25d6b71cb --- /dev/null +++ b/examples/widgets/scroller/graphicsview/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from graphicsview.pro. + +##################################################################### +## graphicsview Binary: +##################################################################### + +add_qt_executable(graphicsview + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/scroller/graphicsview" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/scroller/graphicsview" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:graphicsview.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/statemachine/CMakeLists.txt b/examples/widgets/statemachine/CMakeLists.txt new file mode 100644 index 00000000000..8527fcbc690 --- /dev/null +++ b/examples/widgets/statemachine/CMakeLists.txt @@ -0,0 +1,11 @@ +# Generated from statemachine.pro. + +add_subdirectory(factorial) +add_subdirectory(pingpong) + +if(TARGET Qt::Widgets) + add_subdirectory(eventtransitions) + add_subdirectory(rogue) + add_subdirectory(trafficlight) + add_subdirectory(twowaybutton) +endif() diff --git a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt new file mode 100644 index 00000000000..0fc20f59ae5 --- /dev/null +++ b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from eventtransitions.pro. + +##################################################################### +## eventtransitions Binary: +##################################################################### + +add_qt_executable(eventtransitions + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/eventtransitions" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/eventtransitions" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/statemachine/factorial/CMakeLists.txt b/examples/widgets/statemachine/factorial/CMakeLists.txt new file mode 100644 index 00000000000..e38995220e5 --- /dev/null +++ b/examples/widgets/statemachine/factorial/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from factorial.pro. + +##################################################################### +## factorial Binary: +##################################################################### + +add_qt_executable(factorial + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/factorial" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/factorial" + SOURCES + main.cpp +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:factorial.pro:WIN32: +# CONFIG = "console" + +#### Keys ignored in scope 3:.:factorial.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/examples/widgets/statemachine/pingpong/CMakeLists.txt b/examples/widgets/statemachine/pingpong/CMakeLists.txt new file mode 100644 index 00000000000..b911bd727f9 --- /dev/null +++ b/examples/widgets/statemachine/pingpong/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from pingpong.pro. + +##################################################################### +## pingpong Binary: +##################################################################### + +add_qt_executable(pingpong + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/pingpong" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/pingpong" + SOURCES + main.cpp +) + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:pingpong.pro:WIN32: +# CONFIG = "console" + +#### Keys ignored in scope 3:.:pingpong.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/examples/widgets/statemachine/rogue/CMakeLists.txt b/examples/widgets/statemachine/rogue/CMakeLists.txt new file mode 100644 index 00000000000..a6a1a473e1d --- /dev/null +++ b/examples/widgets/statemachine/rogue/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from rogue.pro. + +##################################################################### +## rogue Binary: +##################################################################### + +add_qt_executable(rogue + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/rogue" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/rogue" + SOURCES + main.cpp + movementtransition.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/statemachine/trafficlight/CMakeLists.txt b/examples/widgets/statemachine/trafficlight/CMakeLists.txt new file mode 100644 index 00000000000..52f9fb3c6cf --- /dev/null +++ b/examples/widgets/statemachine/trafficlight/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from trafficlight.pro. + +##################################################################### +## trafficlight Binary: +##################################################################### + +add_qt_executable(trafficlight + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/trafficlight" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/trafficlight" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt new file mode 100644 index 00000000000..c5f14b75143 --- /dev/null +++ b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from twowaybutton.pro. + +##################################################################### +## twowaybutton Binary: +##################################################################### + +add_qt_executable(twowaybutton + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/twowaybutton" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/twowaybutton" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tools/CMakeLists.txt b/examples/widgets/tools/CMakeLists.txt new file mode 100644 index 00000000000..90ac6fe86f7 --- /dev/null +++ b/examples/widgets/tools/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from tools.pro. + +add_subdirectory(codecs) +add_subdirectory(completer) +add_subdirectory(customcompleter) +if(QT_FEATURE_translation) # special case + add_subdirectory(i18n) +endif() +add_subdirectory(regexp) +add_subdirectory(regularexpression) +add_subdirectory(settingseditor) +add_subdirectory(styleplugin) +add_subdirectory(treemodelcompleter) +add_subdirectory(undo) +add_subdirectory(undoframework) + +if(QT_FEATURE_library) # special case + add_subdirectory(echoplugin) + add_subdirectory(plugandpaint) +endif() diff --git a/examples/widgets/tools/codecs/CMakeLists.txt b/examples/widgets/tools/codecs/CMakeLists.txt new file mode 100644 index 00000000000..fbf2e4e1a0d --- /dev/null +++ b/examples/widgets/tools/codecs/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from codecs.pro. + +##################################################################### +## codecs Binary: +##################################################################### + +add_qt_executable(codecs + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/codecs" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/codecs" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + previewform.cpp previewform.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:codecs.pro:: +# EXAMPLE_FILES = "encodedfiles" diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt new file mode 100644 index 00000000000..b39b4f262dc --- /dev/null +++ b/examples/widgets/tools/completer/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from completer.pro. + +##################################################################### +## completer Binary: +##################################################################### + +add_qt_executable(completer + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/completer" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/completer" + SOURCES + fsmodel.cpp fsmodel.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(completer "completer" PREFIX "/" FILES + resources/countries.txt + resources/wordlist.txt) + diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt new file mode 100644 index 00000000000..04f8035ff33 --- /dev/null +++ b/examples/widgets/tools/customcompleter/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from customcompleter.pro. + +##################################################################### +## customcompleter Binary: +##################################################################### + +add_qt_executable(customcompleter + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/customcompleter" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/customcompleter" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + textedit.cpp textedit.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(customcompleter "customcompleter" PREFIX "/" FILES + resources/wordlist.txt) + diff --git a/examples/widgets/tools/echoplugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/CMakeLists.txt new file mode 100644 index 00000000000..b848e08e722 --- /dev/null +++ b/examples/widgets/tools/echoplugin/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from echoplugin.pro. + +add_subdirectory(echowindow) +add_subdirectory(plugin) diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt new file mode 100644 index 00000000000..3c9082db07a --- /dev/null +++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt @@ -0,0 +1,33 @@ +# Generated from echowindow.pro. + +##################################################################### +## echoplugin Binary: +##################################################################### + +add_qt_executable(echoplugin + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin" + SOURCES + echointerface.h + echowindow.cpp echowindow.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:echowindow.pro:: +# CONFIG = "install_ok" +# QMAKE_PROJECT_NAME = "echopluginwindow" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:echowindow.pro:CONFIG(debug,release OR debug): +# DESTDIR = "../debug/" + +#### Keys ignored in scope 4:.:echowindow.pro:CONFIG(release,release OR debug): +# DESTDIR = "../release/" + +#### Keys ignored in scope 5:.:echowindow.pro:else: +# DESTDIR = "../" diff --git a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt new file mode 100644 index 00000000000..7250a7e0a6a --- /dev/null +++ b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from plugin.pro. + +##################################################################### +## qtLibraryTargetechoplugin Module: +##################################################################### + +add_qt_plugin(echoplugin_plugin TYPE plugin # special case + SOURCES + echoplugin.cpp echoplugin.h + INCLUDE_DIRECTORIES + ../echowindow + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:plugin.pro:: +# CONFIG = "plugin" "install_ok" +# DESTDIR = "../plugins" +# EXAMPLE_FILES = "echoplugin.json" +# INSTALLS = "target" +# TEMPLATE = "lib" +# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/echoplugin/plugins" diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt new file mode 100644 index 00000000000..033362bb4c0 --- /dev/null +++ b/examples/widgets/tools/i18n/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from i18n.pro. + +##################################################################### +## i18n Binary: +##################################################################### + +add_qt_executable(i18n + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/i18n" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/i18n" + SOURCES + languagechooser.cpp languagechooser.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(i18n "i18n" FILES + translations/i18n_ar.qm + translations/i18n_cs.qm + translations/i18n_de.qm + translations/i18n_el.qm + translations/i18n_en.qm + translations/i18n_eo.qm + translations/i18n_fr.qm + translations/i18n_it.qm + translations/i18n_jp.qm + translations/i18n_ko.qm + translations/i18n_no.qm + translations/i18n_ru.qm + translations/i18n_sv.qm + translations/i18n_zh.qm) + + +#### Keys ignored in scope 1:.:i18n.pro:: +# TRANSLATIONS = "translations/i18n_ar.ts" "translations/i18n_cs.ts" "translations/i18n_de.ts" "translations/i18n_el.ts" "translations/i18n_en.ts" "translations/i18n_eo.ts" "translations/i18n_fr.ts" "translations/i18n_it.ts" "translations/i18n_jp.ts" "translations/i18n_ko.ts" "translations/i18n_no.ts" "translations/i18n_ru.ts" "translations/i18n_sv.ts" "translations/i18n_zh.ts" diff --git a/examples/widgets/tools/plugandpaint/CMakeLists.txt b/examples/widgets/tools/plugandpaint/CMakeLists.txt new file mode 100644 index 00000000000..2bde4718b23 --- /dev/null +++ b/examples/widgets/tools/plugandpaint/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from plugandpaint.pro. + +add_subdirectory(plugins) +add_subdirectory(app) diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt new file mode 100644 index 00000000000..e5bbbacec29 --- /dev/null +++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from app.pro. + +##################################################################### +## plugandpaint Binary: +##################################################################### + +add_qt_executable(plugandpaint + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/plugandpaint" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/plugandpaint" + SOURCES + interfaces.h + main.cpp + mainwindow.cpp mainwindow.h + paintarea.cpp paintarea.h + plugindialog.cpp plugindialog.h + LIBRARIES + Qt::Widgets + pnp_basictools # special case +) + +#### Keys ignored in scope 1:.:app.pro:: +# CONFIG = "install_ok" +# DESTDIR = ".." + +## Scopes: +##################################################################### + +# special case: Remove the rest diff --git a/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt new file mode 100644 index 00000000000..1e63da97ca6 --- /dev/null +++ b/examples/widgets/tools/plugandpaint/plugins/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from plugins.pro. + +add_subdirectory(basictools) +add_subdirectory(extrafilters) diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt new file mode 100644 index 00000000000..f736d09d419 --- /dev/null +++ b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from basictools.pro. + +##################################################################### +## qtLibraryTargetpnp_basictools Module: +##################################################################### + +add_qt_plugin(pnp_basictools # special case + STATIC # special case + OUTPUT_DIRECTORY ../../plugins # special case + INSTALL_DIRECTORY ../../plugins # special case + SOURCES + basictoolsplugin.cpp basictoolsplugin.h + INCLUDE_DIRECTORIES + ../../app + LIBRARIES + Qt::Widgets +) + +# CONFIG = "plugin" "static" "install_ok" +# DESTDIR = "../../plugins" +# INSTALLS = "target" +# TEMPLATE = "lib" +# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:basictools.pro:APPLE_UIKIT: +# CONFIG = "debug_and_release" diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt new file mode 100644 index 00000000000..a0447c833ed --- /dev/null +++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from extrafilters.pro. + +##################################################################### +## qtLibraryTargetpnp_extrafilters Module: +##################################################################### + +add_qt_plugin(pnp_extrafilters_plugin TYPE plugin # special case + SOURCES + extrafiltersplugin.cpp extrafiltersplugin.h + INCLUDE_DIRECTORIES + ../../app + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:extrafilters.pro:: +# CONFIG = "plugin" "install_ok" +# DESTDIR = "../../plugins" +# INSTALLS = "target" +# TEMPLATE = "lib" +# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:extrafilters.pro:APPLE_UIKIT: +# CONFIG = "debug_and_release" diff --git a/examples/widgets/tools/regexp/CMakeLists.txt b/examples/widgets/tools/regexp/CMakeLists.txt new file mode 100644 index 00000000000..da729f5f5b3 --- /dev/null +++ b/examples/widgets/tools/regexp/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from regexp.pro. + +##################################################################### +## regexp Binary: +##################################################################### + +add_qt_executable(regexp + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regexp" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regexp" + SOURCES + main.cpp + regexpdialog.cpp regexpdialog.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt new file mode 100644 index 00000000000..e9dcb977a2f --- /dev/null +++ b/examples/widgets/tools/regularexpression/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from regularexpression.pro. + +##################################################################### +## regularexpression Binary: +##################################################################### + +add_qt_executable(regularexpression + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regularexpression" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regularexpression" + SOURCES + main.cpp + regularexpressiondialog.cpp regularexpressiondialog.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(regularexpression "regularexpression" FILES + images/copy.png) + diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt new file mode 100644 index 00000000000..ce260da3589 --- /dev/null +++ b/examples/widgets/tools/settingseditor/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from settingseditor.pro. + +##################################################################### +## settingseditor Binary: +##################################################################### + +add_qt_executable(settingseditor + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/settingseditor" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/settingseditor" + SOURCES + locationdialog.cpp locationdialog.h + main.cpp + mainwindow.cpp mainwindow.h + settingstree.cpp settingstree.h + variantdelegate.cpp variantdelegate.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:settingseditor.pro:: +# EXAMPLE_FILES = "inifiles" diff --git a/examples/widgets/tools/styleplugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/CMakeLists.txt new file mode 100644 index 00000000000..630c3703f82 --- /dev/null +++ b/examples/widgets/tools/styleplugin/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from styleplugin.pro. + +add_subdirectory(stylewindow) +add_subdirectory(plugin) diff --git a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt new file mode 100644 index 00000000000..c311799d302 --- /dev/null +++ b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt @@ -0,0 +1,32 @@ +# Generated from plugin.pro. + +##################################################################### +## mplestyleplugin Module: +##################################################################### + +add_qt_plugin(simplestyleplugin TYPE style # special case + SOURCES + simplestyle.cpp simplestyle.h + simplestyleplugin.cpp simplestyleplugin.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:plugin.pro:: +# CONFIG = "plugin" "install_ok" +# EXAMPLE_FILES = "simplestyle.json" +# INSTALLS = "target" +# TEMPLATE = "lib" +# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/styleplugin/styles" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:plugin.pro:CONFIG(debug,release OR debug): +# DESTDIR = "../debug/styles/" + +#### Keys ignored in scope 4:.:plugin.pro:CONFIG(release,release OR debug): +# DESTDIR = "../release/styles/" + +#### Keys ignored in scope 5:.:plugin.pro:else: +# DESTDIR = "../styles/" diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt new file mode 100644 index 00000000000..a6d6a56874e --- /dev/null +++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt @@ -0,0 +1,31 @@ +# Generated from stylewindow.pro. + +##################################################################### +## styleplugin Binary: +##################################################################### + +add_qt_executable(styleplugin + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin" + SOURCES + main.cpp + stylewindow.cpp stylewindow.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:stylewindow.pro:: +# CONFIG = "install_ok" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:stylewindow.pro:debug: +# DESTDIR = "../debug/" + +#### Keys ignored in scope 4:.:stylewindow.pro:release: +# DESTDIR = "../release/" + +#### Keys ignored in scope 5:.:stylewindow.pro:else: +# DESTDIR = "../" diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt new file mode 100644 index 00000000000..ab4d60f290b --- /dev/null +++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from treemodelcompleter.pro. + +##################################################################### +## treemodelcompleter Binary: +##################################################################### + +add_qt_executable(treemodelcompleter + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/treemodelcompleter" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/treemodelcompleter" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + treemodelcompleter.cpp treemodelcompleter.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(treemodelcompleter "treemodelcompleter" PREFIX "/" FILES + resources/treemodel.txt) + diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt new file mode 100644 index 00000000000..751026bd626 --- /dev/null +++ b/examples/widgets/tools/undo/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from undo.pro. + +##################################################################### +## undo Binary: +##################################################################### + +add_qt_executable(undo + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undo" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undo" + SOURCES + commands.cpp commands.h + document.cpp document.h + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(undo "undo" PREFIX "/" FILES + icons/background.png + icons/blue.png + icons/circle.png + icons/exit.png + icons/fileclose.png + icons/filenew.png + icons/fileopen.png + icons/filesave.png + icons/green.png + icons/ok.png + icons/rectangle.png + icons/red.png + icons/redo.png + icons/remove.png + icons/triangle.png + icons/undo.png) + + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:undo.pro:build_all AND NOT build_pass: +# CONFIG = "-build_all" "release" diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt new file mode 100644 index 00000000000..0689d0df085 --- /dev/null +++ b/examples/widgets/tools/undoframework/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from undoframework.pro. + +##################################################################### +## undoframework Binary: +##################################################################### + +add_qt_executable(undoframework + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undoframework" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undoframework" + SOURCES + commands.cpp commands.h + diagramitem.cpp diagramitem.h + diagramscene.cpp diagramscene.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(undoframework "undoframework" FILES + images/cross.png) + diff --git a/examples/widgets/touch/CMakeLists.txt b/examples/widgets/touch/CMakeLists.txt new file mode 100644 index 00000000000..06b72cada7f --- /dev/null +++ b/examples/widgets/touch/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from touch.pro. + +add_subdirectory(pinchzoom) +add_subdirectory(fingerpaint) +add_subdirectory(knobs) +add_subdirectory(dials) diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt new file mode 100644 index 00000000000..0266bc4e3b8 --- /dev/null +++ b/examples/widgets/touch/dials/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from dials.pro. + +##################################################################### +## dials Binary: +##################################################################### + +add_qt_executable(dials + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/dials" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/dials" + SOURCES + dials.ui + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt new file mode 100644 index 00000000000..82ec8cd91e7 --- /dev/null +++ b/examples/widgets/touch/fingerpaint/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from fingerpaint.pro. + +##################################################################### +## fingerpaint Binary: +##################################################################### + +add_qt_executable(fingerpaint + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/fingerpaint" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/fingerpaint" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + scribblearea.cpp scribblearea.h + LIBRARIES + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(fingerpaint CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt new file mode 100644 index 00000000000..e8976db270b --- /dev/null +++ b/examples/widgets/touch/knobs/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from knobs.pro. + +##################################################################### +## knobs Binary: +##################################################################### + +add_qt_executable(knobs + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/knobs" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/knobs" + SOURCES + knob.cpp knob.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt new file mode 100644 index 00000000000..92d7b4c3b31 --- /dev/null +++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from pinchzoom.pro. + +##################################################################### +## pinchzoom Binary: +##################################################################### + +add_qt_executable(pinchzoom + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/pinchzoom" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/pinchzoom" + SOURCES + graphicsview.cpp graphicsview.h + main.cpp + mouse.cpp mouse.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(pinchzoom "mice" PREFIX "/" FILES + images/cheese.jpg) + diff --git a/examples/widgets/tutorials/CMakeLists.txt b/examples/widgets/tutorials/CMakeLists.txt new file mode 100644 index 00000000000..c2fa4a81d78 --- /dev/null +++ b/examples/widgets/tutorials/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from tutorials.pro. + +add_subdirectory(addressbook) +add_subdirectory(widgets) +add_subdirectory(modelview) +add_subdirectory(gettingStarted) +add_subdirectory(notepad) diff --git a/examples/widgets/tutorials/addressbook/CMakeLists.txt b/examples/widgets/tutorials/addressbook/CMakeLists.txt new file mode 100644 index 00000000000..a8823d059a7 --- /dev/null +++ b/examples/widgets/tutorials/addressbook/CMakeLists.txt @@ -0,0 +1,9 @@ +# Generated from addressbook.pro. + +add_subdirectory(part1) +add_subdirectory(part2) +add_subdirectory(part3) +add_subdirectory(part4) +add_subdirectory(part5) +add_subdirectory(part6) +add_subdirectory(part7) diff --git a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt new file mode 100644 index 00000000000..dcfc424a24a --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from part1.pro. + +##################################################################### +## part1 Binary: +##################################################################### + +add_qt_executable(part1 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part1" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part1" + SOURCES + addressbook.cpp addressbook.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part1.pro:: +# QMAKE_PROJECT_NAME = "ab_part1" diff --git a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt new file mode 100644 index 00000000000..b9fe9307ee5 --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from part2.pro. + +##################################################################### +## part2 Binary: +##################################################################### + +add_qt_executable(part2 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part2" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part2" + SOURCES + addressbook.cpp addressbook.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part2.pro:: +# QMAKE_PROJECT_NAME = "ab_part2" diff --git a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt new file mode 100644 index 00000000000..f83a8c5379a --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from part3.pro. + +##################################################################### +## part3 Binary: +##################################################################### + +add_qt_executable(part3 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part3" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part3" + SOURCES + addressbook.cpp addressbook.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part3.pro:: +# QMAKE_PROJECT_NAME = "ab_part3" diff --git a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt new file mode 100644 index 00000000000..0dee5fab9ab --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from part4.pro. + +##################################################################### +## part4 Binary: +##################################################################### + +add_qt_executable(part4 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part4" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part4" + SOURCES + addressbook.cpp addressbook.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part4.pro:: +# QMAKE_PROJECT_NAME = "ab_part4" diff --git a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt new file mode 100644 index 00000000000..564f044ba88 --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from part5.pro. + +##################################################################### +## part5 Binary: +##################################################################### + +add_qt_executable(part5 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part5" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part5" + SOURCES + addressbook.cpp addressbook.h + finddialog.cpp finddialog.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part5.pro:: +# QMAKE_PROJECT_NAME = "ab_part5" diff --git a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt new file mode 100644 index 00000000000..375f1f0612f --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from part6.pro. + +##################################################################### +## part6 Binary: +##################################################################### + +add_qt_executable(part6 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part6" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part6" + SOURCES + addressbook.cpp addressbook.h + finddialog.cpp finddialog.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part6.pro:: +# QMAKE_PROJECT_NAME = "ab_part6" diff --git a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt new file mode 100644 index 00000000000..1ccd87fff54 --- /dev/null +++ b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from part7.pro. + +##################################################################### +## part7 Binary: +##################################################################### + +add_qt_executable(part7 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part7" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part7" + SOURCES + addressbook.cpp addressbook.h + finddialog.cpp finddialog.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:part7.pro:: +# QMAKE_PROJECT_NAME = "ab_part7" diff --git a/examples/widgets/tutorials/gettingStarted/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/CMakeLists.txt new file mode 100644 index 00000000000..2aa8163029f --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/CMakeLists.txt @@ -0,0 +1,2 @@ +# Generated from gettingStarted.pro. + diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt new file mode 100644 index 00000000000..7a9ade8511f --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/gsQt/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from gsqt.pro. + +add_subdirectory(part1) +add_subdirectory(part2) +add_subdirectory(part3) +add_subdirectory(part4) +add_subdirectory(part5) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt new file mode 100644 index 00000000000..c39133d235e --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from part1.pro. + +##################################################################### +## part1 Binary: +##################################################################### + +add_qt_executable(part1 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part1" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part1" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt new file mode 100644 index 00000000000..ff9ddd6584d --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from part2.pro. + +##################################################################### +## part2 Binary: +##################################################################### + +add_qt_executable(part2 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part2" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part2" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt new file mode 100644 index 00000000000..2564472be6e --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from part3.pro. + +##################################################################### +## part3 Binary: +##################################################################### + +add_qt_executable(part3 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part3" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part3" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt new file mode 100644 index 00000000000..473b803044e --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from part4.pro. + +##################################################################### +## part4 Binary: +##################################################################### + +add_qt_executable(part4 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part4" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part4" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt new file mode 100644 index 00000000000..93d2ea4175a --- /dev/null +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from part5.pro. + +##################################################################### +## part5 Binary: +##################################################################### + +add_qt_executable(part5 + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part5" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part5" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt new file mode 100644 index 00000000000..1edda802f9d --- /dev/null +++ b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from 1_readonly.pro. + +##################################################################### +## mv_readonly Binary: +##################################################################### + +add_qt_executable(mv_readonly + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/1_readonly" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/1_readonly" + SOURCES + main.cpp + mymodel.cpp mymodel.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:1_readonly.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt new file mode 100644 index 00000000000..3235275d6aa --- /dev/null +++ b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from 2_formatting.pro. + +##################################################################### +## mv_formatting Binary: +##################################################################### + +add_qt_executable(mv_formatting + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/2_formatting" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/2_formatting" + SOURCES + main.cpp + mymodel.cpp mymodel.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:2_formatting.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt new file mode 100644 index 00000000000..746bafc19a9 --- /dev/null +++ b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from 3_changingmodel.pro. + +##################################################################### +## mv_changingmodel Binary: +##################################################################### + +add_qt_executable(mv_changingmodel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/3_changingmodel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/3_changingmodel" + SOURCES + main.cpp + mymodel.cpp mymodel.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:3_changingmodel.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt new file mode 100644 index 00000000000..ef7e0a501be --- /dev/null +++ b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from 4_headers.pro. + +##################################################################### +## mv_headers Binary: +##################################################################### + +add_qt_executable(mv_headers + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/4_headers" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/4_headers" + SOURCES + main.cpp + mymodel.cpp mymodel.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:4_headers.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt new file mode 100644 index 00000000000..2ce884a7fef --- /dev/null +++ b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from 5_edit.pro. + +##################################################################### +## mv_edit Binary: +##################################################################### + +add_qt_executable(mv_edit + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/5_edit" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/5_edit" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + mymodel.cpp mymodel.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:5_edit.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt new file mode 100644 index 00000000000..1d5a9425e5a --- /dev/null +++ b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from 6_treeview.pro. + +##################################################################### +## mv_tree Binary: +##################################################################### + +add_qt_executable(mv_tree + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/6_treeview" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/6_treeview" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:6_treeview.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt new file mode 100644 index 00000000000..0560dc7a604 --- /dev/null +++ b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from 7_selections.pro. + +##################################################################### +## mv_selections Binary: +##################################################################### + +add_qt_executable(mv_selections + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/7_selections" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/7_selections" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:7_selections.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/tutorials/modelview/CMakeLists.txt b/examples/widgets/tutorials/modelview/CMakeLists.txt new file mode 100644 index 00000000000..10f2cf6ecf7 --- /dev/null +++ b/examples/widgets/tutorials/modelview/CMakeLists.txt @@ -0,0 +1,9 @@ +# Generated from modelview.pro. + +add_subdirectory(1_readonly) +add_subdirectory(2_formatting) +add_subdirectory(3_changingmodel) +add_subdirectory(4_headers) +add_subdirectory(5_edit) +add_subdirectory(6_treeview) +add_subdirectory(7_selections) diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt new file mode 100644 index 00000000000..9dcf98fe4cf --- /dev/null +++ b/examples/widgets/tutorials/notepad/CMakeLists.txt @@ -0,0 +1,49 @@ +# Generated from notepad.pro. + +##################################################################### +## notepad Binary: +##################################################################### + +add_qt_executable(notepad + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad" + SOURCES + main.cpp + notepad.cpp notepad.h notepad.ui + LIBRARIES # special case + Qt::Widgets +) + +# Resources: +add_qt_resource(notepad "notepad" PREFIX "/" FILES + images/bold.png + images/copy.png + images/create.png + images/cut.png + images/edit_redo.png + images/edit_undo.png + images/exit.png + images/font.png + images/info.png + images/italic.png + images/new.png + images/open.png + images/paste.png + images/pencil.png + images/print.png + images/save.png + images/save_as.png + images/underline.png) + + +#### Keys ignored in scope 1:.:notepad.pro:: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +extend_target(notepad CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/tutorials/widgets/CMakeLists.txt b/examples/widgets/tutorials/widgets/CMakeLists.txt new file mode 100644 index 00000000000..1f4afee7809 --- /dev/null +++ b/examples/widgets/tutorials/widgets/CMakeLists.txt @@ -0,0 +1,6 @@ +# Generated from widgets.pro. + +add_subdirectory(toplevel) +add_subdirectory(childwidget) +add_subdirectory(windowlayout) +add_subdirectory(nestedlayouts) diff --git a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt new file mode 100644 index 00000000000..823098c9fc4 --- /dev/null +++ b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from childwidget.pro. + +##################################################################### +## childwidget Binary: +##################################################################### + +add_qt_executable(childwidget + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/childwidget" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/childwidget" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt new file mode 100644 index 00000000000..7f88c89d80e --- /dev/null +++ b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from nestedlayouts.pro. + +##################################################################### +## nestedlayouts Binary: +##################################################################### + +add_qt_executable(nestedlayouts + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/nestedlayouts" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/nestedlayouts" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt new file mode 100644 index 00000000000..2ef630033b6 --- /dev/null +++ b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from toplevel.pro. + +##################################################################### +## toplevel Binary: +##################################################################### + +add_qt_executable(toplevel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/toplevel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/toplevel" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt new file mode 100644 index 00000000000..157865b68c2 --- /dev/null +++ b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt @@ -0,0 +1,15 @@ +# Generated from windowlayout.pro. + +##################################################################### +## windowlayout Binary: +##################################################################### + +add_qt_executable(windowlayout + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/windowlayout" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/windowlayout" + SOURCES + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/CMakeLists.txt b/examples/widgets/widgets/CMakeLists.txt new file mode 100644 index 00000000000..8daf6a69aec --- /dev/null +++ b/examples/widgets/widgets/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from widgets.pro. + +add_subdirectory(analogclock) +add_subdirectory(calculator) +add_subdirectory(calendarwidget) +add_subdirectory(charactermap) +add_subdirectory(codeeditor) +add_subdirectory(digitalclock) +add_subdirectory(elidedlabel) +add_subdirectory(groupbox) +add_subdirectory(icons) +add_subdirectory(imageviewer) +add_subdirectory(lineedits) +add_subdirectory(movie) +add_subdirectory(mousebuttons) +add_subdirectory(scribble) +add_subdirectory(shapedclock) +add_subdirectory(sliders) +add_subdirectory(spinboxes) +add_subdirectory(styles) +add_subdirectory(stylesheet) +add_subdirectory(tablet) +add_subdirectory(tetrix) +add_subdirectory(tooltips) +add_subdirectory(validators) +add_subdirectory(wiggly) +add_subdirectory(windowflags) diff --git a/examples/widgets/widgets/analogclock/CMakeLists.txt b/examples/widgets/widgets/analogclock/CMakeLists.txt new file mode 100644 index 00000000000..890a3002945 --- /dev/null +++ b/examples/widgets/widgets/analogclock/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from analogclock.pro. + +##################################################################### +## analogclock Binary: +##################################################################### + +add_qt_executable(analogclock_widgets # special case + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/analogclock" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/analogclock" + SOURCES + analogclock.cpp analogclock.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:analogclock.pro:: +# QMAKE_PROJECT_NAME = "widgets_analogclock" diff --git a/examples/widgets/widgets/calculator/CMakeLists.txt b/examples/widgets/widgets/calculator/CMakeLists.txt new file mode 100644 index 00000000000..b4f58b4f39a --- /dev/null +++ b/examples/widgets/widgets/calculator/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from calculator.pro. + +##################################################################### +## calculator Binary: +##################################################################### + +add_qt_executable(calculator + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calculator" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calculator" + SOURCES + button.cpp button.h + calculator.cpp calculator.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/calendarwidget/CMakeLists.txt b/examples/widgets/widgets/calendarwidget/CMakeLists.txt new file mode 100644 index 00000000000..463fce38495 --- /dev/null +++ b/examples/widgets/widgets/calendarwidget/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from calendarwidget.pro. + +##################################################################### +## calendarwidget Binary: +##################################################################### + +add_qt_executable(calendarwidget + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calendarwidget" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calendarwidget" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/charactermap/CMakeLists.txt b/examples/widgets/widgets/charactermap/CMakeLists.txt new file mode 100644 index 00000000000..a09b63a4f72 --- /dev/null +++ b/examples/widgets/widgets/charactermap/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from charactermap.pro. + +##################################################################### +## charactermap Binary: +##################################################################### + +add_qt_executable(charactermap + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/charactermap" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/charactermap" + SOURCES + characterwidget.cpp characterwidget.h + main.cpp + mainwindow.cpp mainwindow.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/codeeditor/CMakeLists.txt b/examples/widgets/widgets/codeeditor/CMakeLists.txt new file mode 100644 index 00000000000..7c29d383ffb --- /dev/null +++ b/examples/widgets/widgets/codeeditor/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from codeeditor.pro. + +##################################################################### +## codeeditor Binary: +##################################################################### + +add_qt_executable(codeeditor + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/codeeditor" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/codeeditor" + SOURCES + codeeditor.cpp codeeditor.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/digitalclock/CMakeLists.txt b/examples/widgets/widgets/digitalclock/CMakeLists.txt new file mode 100644 index 00000000000..b85528a1e82 --- /dev/null +++ b/examples/widgets/widgets/digitalclock/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from digitalclock.pro. + +##################################################################### +## digitalclock Binary: +##################################################################### + +add_qt_executable(digitalclock + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/digitalclock" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/digitalclock" + SOURCES + digitalclock.cpp digitalclock.h + main.cpp + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/elidedlabel/CMakeLists.txt b/examples/widgets/widgets/elidedlabel/CMakeLists.txt new file mode 100644 index 00000000000..b894e186926 --- /dev/null +++ b/examples/widgets/widgets/elidedlabel/CMakeLists.txt @@ -0,0 +1,21 @@ +# Generated from elidedlabel.pro. + +##################################################################### +## elidedlabel Binary: +##################################################################### + +add_qt_executable(elidedlabel + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/elidedlabel" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/elidedlabel" + SOURCES + elidedlabel.cpp elidedlabel.h + main.cpp + testwidget.cpp testwidget.h + LIBRARIES + Qt::Gui + Qt::Widgets +) + +#### Keys ignored in scope 1:.:elidedlabel.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/widgets/groupbox/CMakeLists.txt b/examples/widgets/widgets/groupbox/CMakeLists.txt new file mode 100644 index 00000000000..1d77ab37dce --- /dev/null +++ b/examples/widgets/widgets/groupbox/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from groupbox.pro. + +##################################################################### +## groupbox Binary: +##################################################################### + +add_qt_executable(groupbox + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/groupbox" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/groupbox" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/icons/CMakeLists.txt b/examples/widgets/widgets/icons/CMakeLists.txt new file mode 100644 index 00000000000..34d9bcec94c --- /dev/null +++ b/examples/widgets/widgets/icons/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from icons.pro. + +##################################################################### +## icons Binary: +##################################################################### + +add_qt_executable(icons + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/icons" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/icons" + SOURCES + iconpreviewarea.cpp iconpreviewarea.h + iconsizespinbox.cpp iconsizespinbox.h + imagedelegate.cpp imagedelegate.h + main.cpp + mainwindow.cpp mainwindow.h + DEFINES + SRCDIR=\\\"/\\\" + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:icons.pro:: +# EXAMPLE_FILES = "images/*" diff --git a/examples/widgets/widgets/imageviewer/CMakeLists.txt b/examples/widgets/widgets/imageviewer/CMakeLists.txt new file mode 100644 index 00000000000..4684653e645 --- /dev/null +++ b/examples/widgets/widgets/imageviewer/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from imageviewer.pro. + +##################################################################### +## imageviewer Binary: +##################################################################### + +add_qt_executable(imageviewer + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/imageviewer" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/imageviewer" + SOURCES + imageviewer.cpp imageviewer.h + main.cpp + LIBRARIES + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(imageviewer CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/widgets/lineedits/CMakeLists.txt b/examples/widgets/widgets/lineedits/CMakeLists.txt new file mode 100644 index 00000000000..59406a703d7 --- /dev/null +++ b/examples/widgets/widgets/lineedits/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from lineedits.pro. + +##################################################################### +## lineedits Binary: +##################################################################### + +add_qt_executable(lineedits + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/lineedits" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/lineedits" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/mousebuttons/CMakeLists.txt b/examples/widgets/widgets/mousebuttons/CMakeLists.txt new file mode 100644 index 00000000000..6ec817458cc --- /dev/null +++ b/examples/widgets/widgets/mousebuttons/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from mousebuttons.pro. + +##################################################################### +## mousebuttons Binary: +##################################################################### + +add_qt_executable(mousebuttons + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/mousebuttons" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/mousebuttons" + SOURCES + buttontester.cpp buttontester.h + main.cpp + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:mousebuttons.pro:: +# TEMPLATE = "app" diff --git a/examples/widgets/widgets/movie/CMakeLists.txt b/examples/widgets/widgets/movie/CMakeLists.txt new file mode 100644 index 00000000000..0df3465feab --- /dev/null +++ b/examples/widgets/widgets/movie/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from movie.pro. + +##################################################################### +## movie Binary: +##################################################################### + +add_qt_executable(movie + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/movie" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/movie" + SOURCES + main.cpp + movieplayer.cpp movieplayer.h + LIBRARIES + Qt::Widgets +) + +#### Keys ignored in scope 1:.:movie.pro:: +# EXAMPLE_FILES = "animation.gif" diff --git a/examples/widgets/widgets/scribble/CMakeLists.txt b/examples/widgets/widgets/scribble/CMakeLists.txt new file mode 100644 index 00000000000..d9b22923369 --- /dev/null +++ b/examples/widgets/widgets/scribble/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from scribble.pro. + +##################################################################### +## scribble Binary: +##################################################################### + +add_qt_executable(scribble + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/scribble" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/scribble" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + scribblearea.cpp scribblearea.h + LIBRARIES + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(scribble CONDITION TARGET Qt::PrintSupport + LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/widgets/shapedclock/CMakeLists.txt b/examples/widgets/widgets/shapedclock/CMakeLists.txt new file mode 100644 index 00000000000..ab199d69817 --- /dev/null +++ b/examples/widgets/widgets/shapedclock/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from shapedclock.pro. + +##################################################################### +## shapedclock Binary: +##################################################################### + +add_qt_executable(shapedclock + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/shapedclock" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/shapedclock" + SOURCES + main.cpp + shapedclock.cpp shapedclock.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/sliders/CMakeLists.txt b/examples/widgets/widgets/sliders/CMakeLists.txt new file mode 100644 index 00000000000..a064ad5a4aa --- /dev/null +++ b/examples/widgets/widgets/sliders/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from sliders.pro. + +##################################################################### +## sliders Binary: +##################################################################### + +add_qt_executable(sliders + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/sliders" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/sliders" + SOURCES + main.cpp + slidersgroup.cpp slidersgroup.h + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/spinboxes/CMakeLists.txt b/examples/widgets/widgets/spinboxes/CMakeLists.txt new file mode 100644 index 00000000000..8635f06a8e7 --- /dev/null +++ b/examples/widgets/widgets/spinboxes/CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from spinboxes.pro. + +##################################################################### +## spinboxes Binary: +##################################################################### + +add_qt_executable(spinboxes + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/spinboxes" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/spinboxes" + SOURCES + main.cpp + window.cpp window.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/styles/CMakeLists.txt b/examples/widgets/widgets/styles/CMakeLists.txt new file mode 100644 index 00000000000..d33d90a5bc6 --- /dev/null +++ b/examples/widgets/widgets/styles/CMakeLists.txt @@ -0,0 +1,23 @@ +# Generated from styles.pro. + +##################################################################### +## styles Binary: +##################################################################### + +add_qt_executable(styles + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/styles" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/styles" + SOURCES + main.cpp + norwegianwoodstyle.cpp norwegianwoodstyle.h + widgetgallery.cpp widgetgallery.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(styles "styles" FILES + images/woodbackground.png + images/woodbutton.png) + diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt new file mode 100644 index 00000000000..dfb52a1a47e --- /dev/null +++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt @@ -0,0 +1,56 @@ +# Generated from stylesheet.pro. + +##################################################################### +## stylesheet Binary: +##################################################################### + +add_qt_executable(stylesheet + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/stylesheet" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/stylesheet" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + stylesheeteditor.cpp stylesheeteditor.h stylesheeteditor.ui + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(stylesheet "stylesheet" PREFIX "/" FILES + images/checkbox_checked.png + images/checkbox_checked_hover.png + images/checkbox_checked_pressed.png + images/checkbox_unchecked.png + images/checkbox_unchecked_hover.png + images/checkbox_unchecked_pressed.png + images/down_arrow.png + images/down_arrow_disabled.png + images/frame.png + images/pagefold.png + images/pushbutton.png + images/pushbutton_hover.png + images/pushbutton_pressed.png + images/radiobutton_checked.png + images/radiobutton_checked_hover.png + images/radiobutton_checked_pressed.png + images/radiobutton_unchecked.png + images/radiobutton_unchecked_hover.png + images/radiobutton_unchecked_pressed.png + images/sizegrip.png + images/spindown.png + images/spindown_hover.png + images/spindown_off.png + images/spindown_pressed.png + images/spinup.png + images/spinup_hover.png + images/spinup_off.png + images/spinup_pressed.png + images/up_arrow.png + images/up_arrow_disabled.png + layouts/default.ui + layouts/pagefold.ui + qss/coffee.qss + qss/default.qss + qss/pagefold.qss) + diff --git a/examples/widgets/widgets/tablet/CMakeLists.txt b/examples/widgets/widgets/tablet/CMakeLists.txt new file mode 100644 index 00000000000..f23fe7ec718 --- /dev/null +++ b/examples/widgets/widgets/tablet/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from tablet.pro. + +##################################################################### +## qttablet Binary: +##################################################################### + +add_qt_executable(qttablet + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tablet" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tablet" + SOURCES + main.cpp + mainwindow.cpp mainwindow.h + tabletapplication.cpp tabletapplication.h + tabletcanvas.cpp tabletcanvas.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(qttablet "images" FILES + images/cursor-airbrush.png + images/cursor-eraser.png + images/cursor-felt-marker.png + images/cursor-pencil.png) + diff --git a/examples/widgets/widgets/tetrix/CMakeLists.txt b/examples/widgets/widgets/tetrix/CMakeLists.txt new file mode 100644 index 00000000000..002667a6b93 --- /dev/null +++ b/examples/widgets/widgets/tetrix/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from tetrix.pro. + +##################################################################### +## tetrix Binary: +##################################################################### + +add_qt_executable(tetrix + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tetrix" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tetrix" + SOURCES + main.cpp + tetrixboard.cpp tetrixboard.h + tetrixpiece.cpp tetrixpiece.h + tetrixwindow.cpp tetrixwindow.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/tooltips/CMakeLists.txt b/examples/widgets/widgets/tooltips/CMakeLists.txt new file mode 100644 index 00000000000..02d773858a3 --- /dev/null +++ b/examples/widgets/widgets/tooltips/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from tooltips.pro. + +##################################################################### +## tooltips Binary: +##################################################################### + +add_qt_executable(tooltips + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tooltips" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tooltips" + SOURCES + main.cpp + shapeitem.cpp shapeitem.h + sortingbox.cpp sortingbox.h + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(tooltips "tooltips" FILES + images/circle.png + images/square.png + images/triangle.png) + diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt new file mode 100644 index 00000000000..a1770d53377 --- /dev/null +++ b/examples/widgets/widgets/validators/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from validators.pro. + +##################################################################### +## validators Binary: +##################################################################### + +add_qt_executable(validators + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/validators" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/validators" + SOURCES + ledwidget.cpp ledwidget.h + localeselector.cpp localeselector.h + main.cpp + validators.ui + LIBRARIES + Qt::Widgets +) + +# Resources: +add_qt_resource(validators "validators" PREFIX "/" FILES + ledoff.png + ledon.png) + diff --git a/examples/widgets/widgets/wiggly/CMakeLists.txt b/examples/widgets/widgets/wiggly/CMakeLists.txt new file mode 100644 index 00000000000..cc8c0befbf4 --- /dev/null +++ b/examples/widgets/widgets/wiggly/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from wiggly.pro. + +##################################################################### +## wiggly Binary: +##################################################################### + +add_qt_executable(wiggly + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/wiggly" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/wiggly" + SOURCES + dialog.cpp dialog.h + main.cpp + wigglywidget.cpp wigglywidget.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/widgets/windowflags/CMakeLists.txt b/examples/widgets/widgets/windowflags/CMakeLists.txt new file mode 100644 index 00000000000..aa2eff00888 --- /dev/null +++ b/examples/widgets/widgets/windowflags/CMakeLists.txt @@ -0,0 +1,17 @@ +# Generated from windowflags.pro. + +##################################################################### +## windowflags Binary: +##################################################################### + +add_qt_executable(windowflags + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/windowflags" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/windowflags" + SOURCES + controllerwindow.cpp controllerwindow.h + main.cpp + previewwindow.cpp previewwindow.h + LIBRARIES + Qt::Widgets +) diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt new file mode 100644 index 00000000000..88dc37ea5e7 --- /dev/null +++ b/examples/widgets/windowcontainer/CMakeLists.txt @@ -0,0 +1,18 @@ +# Generated from windowcontainer.pro. + +##################################################################### +## windowcontainer Binary: +##################################################################### + +add_qt_executable(windowcontainer + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/windowcontainer" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/windowcontainer" + SOURCES + ../../gui/openglwindow/openglwindow.cpp ../../gui/openglwindow/openglwindow.h + windowcontainer.cpp + INCLUDE_DIRECTORIES + ../../gui/openglwindow + LIBRARIES + Qt::Widgets +) diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index f67fea4d160..64c8d86aa57 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -30,6 +30,9 @@ add_qt_module(OpenGL Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate + PUBLIC_LIBRARIES # special case + Qt::Core + Qt::Gui ) ## Scopes: From 9ba702bea9c12b45c746cac53d843717162545e1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 7 Mar 2019 15:17:07 +0100 Subject: [PATCH 0324/1322] CMake: Re-generate widgets Change-Id: I3722092aaf4ff5d131223057d73f9cbb82982a98 Reviewed-by: Alexandru Croitor --- src/widgets/CMakeLists.txt | 268 ++++++++++++++++++++++++++++++------- 1 file changed, 223 insertions(+), 45 deletions(-) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index b3847f430a5..afb1cd8e714 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from widgets.pro. ##################################################################### -## QtWidgets Module: +## Widgets Module: ##################################################################### add_qt_module(Widgets @@ -38,7 +38,7 @@ add_qt_module(Widgets styles/qpixmapstyle.cpp styles/qpixmapstyle_p.h styles/qpixmapstyle_p_p.h styles/qproxystyle.cpp styles/qproxystyle.h styles/qproxystyle_p.h - styles/qstyle.cpp styles/qstyle.h styles/qstyle.qrc + styles/qstyle.cpp styles/qstyle.h styles/qstyleanimation.cpp styles/qstyleanimation_p.h styles/qstylefactory.cpp styles/qstylefactory.h styles/qstylehelper.cpp styles/qstylehelper_p.h @@ -56,46 +56,240 @@ add_qt_module(Widgets DEFINES QT_NO_USING_NAMESPACE INCLUDE_DIRECTORIES - dialogs/ + dialogs LIBRARIES Qt::CorePrivate Qt::GuiPrivate - PUBLIC_LIBRARIES + PUBLIC_LIBRARIES # special case Qt::Core Qt::Gui + # CONFIG = "$$MODULE_CONFIG" "qt_tracepoints" + # KERNEL_P = "kernel" + # MODULE_CONFIG = "uic" + # MODULE_PLUGIN_TYPES = "styles" + # PRECOMPILED_HEADER = "kernel/qt_widgets_pch.h" + # QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtWidgets.dynlist" + # QMAKE_LIBS = "$$QMAKE_LIBS_GUI" + # TRACEPOINT_PROVIDER = "$$PWD/qtwidgets.tracepoints" + # _LOADED = "qt_module" ) -add_dependencies(Widgets Qt::uic) +add_dependencies(Widgets Qt::uic) # special case + +# Resources: +add_qt_resource(Widgets "qstyle" PREFIX "/qt-project.org/styles/commonstyle" BASE "styles" FILES + images/cdr-128.png + images/cdr-16.png + images/cdr-32.png + images/cleartext-16.png + images/cleartext-32.png + images/closedock-10.png + images/closedock-16.png + images/closedock-20.png + images/closedock-32.png + images/closedock-48.png + images/closedock-64.png + images/computer-16.png + images/computer-32.png + images/desktop-16.png + images/desktop-32.png + images/dirclosed-128.png + images/dirclosed-16.png + images/dirclosed-32.png + images/dirlink-128.png + images/dirlink-16.png + images/dirlink-32.png + images/diropen-128.png + images/diropen-16.png + images/diropen-32.png + images/down-128.png + images/down-16.png + images/down-32.png + images/dvd-128.png + images/dvd-16.png + images/dvd-32.png + images/file-128.png + images/file-16.png + images/file-32.png + images/filecontents-128.png + images/filecontents-16.png + images/filecontents-32.png + images/fileinfo-128.png + images/fileinfo-16.png + images/fileinfo-32.png + images/filelink-128.png + images/filelink-16.png + images/filelink-32.png + images/floppy-128.png + images/floppy-16.png + images/floppy-32.png + images/fontbitmap-16.png + images/fonttruetype-16.png + images/fusion_groupbox.png + images/harddrive-128.png + images/harddrive-16.png + images/harddrive-32.png + images/left-128.png + images/left-16.png + images/left-32.png + images/media-pause-16.png + images/media-pause-32.png + images/media-play-16.png + images/media-play-32.png + images/media-seek-backward-16.png + images/media-seek-backward-32.png + images/media-seek-forward-16.png + images/media-seek-forward-32.png + images/media-skip-backward-16.png + images/media-skip-backward-32.png + images/media-skip-forward-16.png + images/media-skip-forward-32.png + images/media-stop-16.png + images/media-stop-32.png + images/media-volume-16.png + images/media-volume-muted-16.png + images/networkdrive-128.png + images/networkdrive-16.png + images/networkdrive-32.png + images/newdirectory-128.png + images/newdirectory-16.png + images/newdirectory-32.png + images/normalizedockup-10.png + images/normalizedockup-16.png + images/normalizedockup-20.png + images/normalizedockup-32.png + images/normalizedockup-48.png + images/normalizedockup-64.png + images/parentdir-128.png + images/parentdir-16.png + images/parentdir-32.png + images/refresh-24.png + images/refresh-32.png + images/right-128.png + images/right-16.png + images/right-32.png + images/standardbutton-apply-128.png + images/standardbutton-apply-16.png + images/standardbutton-apply-32.png + images/standardbutton-cancel-128.png + images/standardbutton-cancel-16.png + images/standardbutton-cancel-32.png + images/standardbutton-clear-128.png + images/standardbutton-clear-16.png + images/standardbutton-clear-32.png + images/standardbutton-close-128.png + images/standardbutton-close-16.png + images/standardbutton-close-32.png + images/standardbutton-closetab-16.png + images/standardbutton-closetab-down-16.png + images/standardbutton-closetab-hover-16.png + images/standardbutton-delete-128.png + images/standardbutton-delete-16.png + images/standardbutton-delete-32.png + images/standardbutton-help-128.png + images/standardbutton-help-16.png + images/standardbutton-help-32.png + images/standardbutton-no-128.png + images/standardbutton-no-16.png + images/standardbutton-no-32.png + images/standardbutton-ok-128.png + images/standardbutton-ok-16.png + images/standardbutton-ok-32.png + images/standardbutton-open-128.png + images/standardbutton-open-16.png + images/standardbutton-open-32.png + images/standardbutton-save-128.png + images/standardbutton-save-16.png + images/standardbutton-save-32.png + images/standardbutton-yes-128.png + images/standardbutton-yes-16.png + images/standardbutton-yes-32.png + images/stop-24.png + images/stop-32.png + images/titlebar-contexthelp-16.png + images/titlebar-contexthelp-32.png + images/titlebar-contexthelp-48.png + images/titlebar-max-16.png + images/titlebar-max-32.png + images/titlebar-max-48.png + images/titlebar-min-16.png + images/titlebar-min-32.png + images/titlebar-min-48.png + images/titlebar-shade-16.png + images/titlebar-shade-32.png + images/titlebar-shade-48.png + images/titlebar-unshade-16.png + images/titlebar-unshade-32.png + images/titlebar-unshade-48.png + images/toolbar-ext-h-16.png + images/toolbar-ext-h-32.png + images/toolbar-ext-h-8.png + images/toolbar-ext-h-rtl-16.png + images/toolbar-ext-h-rtl-32.png + images/toolbar-ext-h-rtl-8.png + images/toolbar-ext-v-10.png + images/toolbar-ext-v-20.png + images/toolbar-ext-v-5.png + images/trash-128.png + images/trash-16.png + images/trash-32.png + images/up-128.png + images/up-16.png + images/up-32.png + images/viewdetailed-128.png + images/viewdetailed-16.png + images/viewdetailed-32.png + images/viewlist-128.png + images/viewlist-16.png + images/viewlist-32.png) +set_source_files_properties("styles/images/closedock-down-macstyle-16.png" + PROPERTIES alias "images/closedock-down-16.png") +set_source_files_properties("styles/images/closedock-macstyle-16.png" + PROPERTIES alias "images/closedock-16.png") +set_source_files_properties("styles/images/dockdock-down-macstyle-16.png" + PROPERTIES alias "images/dockdock-down-16.png") +set_source_files_properties("styles/images/dockdock-macstyle-16.png" + PROPERTIES alias "images/dockdock-16.png") +set_source_files_properties("styles/images/toolbar-ext-macstyle.png" + PROPERTIES alias "images/toolbar-ext.png") +set_source_files_properties("styles/images/toolbar-ext-macstyle@2x.png" + PROPERTIES alias "images/toolbar-ext@2x.png") +add_qt_resource(Widgets "qstyle1" PREFIX "/qt-project.org/styles/macstyle" BASE "styles" FILES + images/closedock-down-macstyle-16.png + images/closedock-macstyle-16.png + images/dockdock-down-macstyle-16.png + images/dockdock-macstyle-16.png + images/toolbar-ext-macstyle.png + images/toolbar-ext-macstyle@2x.png) + ## Scopes: ##################################################################### -# -#extend_target(Widgets CONDITION MSVC -#) -# -#extend_target(Widgets CONDITION (MSVC) AND (equals(QT_ARCH, i386)) -#) -# -#extend_target(Widgets CONDITION APPLE_OSX -#) + +extend_target(Widgets CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x65000000" +) extend_target(Widgets CONDITION APPLE_OSX + SOURCES + kernel/qmacgesturerecognizer.cpp kernel/qmacgesturerecognizer_p.h + util/qscroller_mac.mm + widgets/qmaccocoaviewcontainer_mac.h widgets/qmaccocoaviewcontainer_mac.mm + widgets/qmacnativewidget_mac.h widgets/qmacnativewidget_mac.mm LIBRARIES ${FWAppKit} z ) -extend_target(Widgets CONDITION APPLE_OSX AND (*-mwerks) - INCLUDE_DIRECTORIES - compat -) +# extend_target(Widgets CONDITION ((APPLE_OSX) AND (APPLE_OSX)) AND (_x_-mwerks) # special case extend_target(Widgets CONDITION WIN32 INCLUDE_DIRECTORIES ../3rdparty/wintab ) -extend_target(Widgets CONDITION (WIN32) AND (NOT WINRT) +extend_target(Widgets CONDITION WIN32 AND NOT WINRT LIBRARIES shell32 uxtheme @@ -108,17 +302,10 @@ extend_target(Widgets CONDITION QT_FEATURE_graphicseffect effects/qpixmapfilter.cpp effects/qpixmapfilter_p.h ) # -#extend_target(Widgets CONDITION contains(DEFINES,QT_EVAL) -#) -# #extend_target(Widgets CONDITION testcocoon +# # _LOADED = "testcocoon" #) -extend_target(Widgets CONDITION APPLE_OSX - SOURCES - kernel/qmacgesturerecognizer.cpp kernel/qmacgesturerecognizer_p.h -) - extend_target(Widgets CONDITION QT_FEATURE_opengl SOURCES kernel/qopenglwidget.cpp kernel/qopenglwidget.h @@ -377,13 +564,7 @@ extend_target(Widgets CONDITION QT_FEATURE_widgettextcontrol widgets/qwidgettextcontrol_p_p.h ) -extend_target(Widgets CONDITION APPLE_OSX - SOURCES - widgets/qmaccocoaviewcontainer_mac.h widgets/qmaccocoaviewcontainer_mac.mm - widgets/qmacnativewidget_mac.h widgets/qmacnativewidget_mac.mm -) - -extend_target(Widgets CONDITION (APPLE_OSX) AND (QT_FEATURE_menu OR QT_FEATURE_menubar) +extend_target(Widgets CONDITION APPLE_OSX AND (QT_FEATURE_menu OR QT_FEATURE_menubar) SOURCES widgets/qmenu_mac.mm ) @@ -432,9 +613,14 @@ extend_target(Widgets CONDITION QT_FEATURE_inputdialog extend_target(Widgets CONDITION QT_FEATURE_messagebox SOURCES - dialogs/qmessagebox.cpp dialogs/qmessagebox.h dialogs/qmessagebox.qrc + dialogs/qmessagebox.cpp dialogs/qmessagebox.h ) +# Resources: +add_qt_resource(Widgets "qmessagebox" PREFIX "/qt-project.org/qmessagebox" BASE "dialogs" FILES + images/qtlogo-64.png) + + extend_target(Widgets CONDITION QT_FEATURE_progressdialog SOURCES dialogs/qprogressdialog.cpp dialogs/qprogressdialog.h @@ -445,7 +631,7 @@ extend_target(Widgets CONDITION QT_FEATURE_wizard dialogs/qwizard.cpp dialogs/qwizard.h ) -extend_target(Widgets CONDITION (QT_FEATURE_wizard) AND (WIN32) +extend_target(Widgets CONDITION QT_FEATURE_wizard AND WIN32 SOURCES dialogs/qwizard_win.cpp dialogs/qwizard_win_p.h ) @@ -461,7 +647,7 @@ extend_target(Widgets CONDITION QT_FEATURE_accessibility accessible/simplewidgets.cpp accessible/simplewidgets_p.h ) -extend_target(Widgets CONDITION (QT_FEATURE_accessibility) AND (QT_FEATURE_itemviews) +extend_target(Widgets CONDITION QT_FEATURE_accessibility AND QT_FEATURE_itemviews SOURCES accessible/itemviews.cpp accessible/itemviews_p.h ) @@ -587,11 +773,6 @@ extend_target(Widgets CONDITION NOT QT_FEATURE_xcb util/qsystemtrayicon_qpa.cpp ) -extend_target(Widgets CONDITION APPLE_OSX - SOURCES - util/qscroller_mac.mm -) - extend_target(Widgets CONDITION QT_FEATURE_statemachine SOURCES statemachine/qguistatemachine.cpp @@ -605,9 +786,6 @@ extend_target(Widgets CONDITION QT_FEATURE_qeventtransition statemachine/qmouseeventtransition.cpp statemachine/qmouseeventtransition.h ) -# Enable Evaluation based on QT_EVAL variable being set from the outside: -extend_target(Widgets CONDITION QT_EVAL LIBRARIES Qt_Evaluation) - qt_create_tracepoints(Widgets ./qtwidgets.tracepoints) From 72404ef3e1e5ad3513986308d26f4af48ba9d28d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Mar 2019 13:32:34 +0100 Subject: [PATCH 0325/1322] CMake: allow custom plugin output/install directories Only require TYPE if no OUTPUT_DIRECTORY, ARCHIVE_INSTALL_DIRECTORY and INSTALL_DIRECTORY is provided. Change-Id: I6db1cfaa576bfa3ee3dc8ecf81db20e3afcd61e2 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 43 ++++++++++++++----- .../plugins/basictools/CMakeLists.txt | 1 + 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index bc07da27bab..0d2c05bbfee 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -665,6 +665,17 @@ function(add_qt_module target) ) endfunction() +function(qt_internal_check_directory_or_type name dir type default result_var) + if ("x${dir}" STREQUAL x) + if("x${type}" STREQUAL x) + message(FATAL_ERROR "add_qt_plugin called without setting either TYPE or ${name}.") + endif() + set(${result_var} "${default}" PARENT_SCOPE) + else() + set(${result_var} "${dir}" PARENT_SCOPE) + endif() +endfunction() + # This is the main entry point for defining Qt plugins. # A CMake target is created with the given target. The TYPE parameter is needed to place the @@ -672,18 +683,29 @@ endfunction() function(add_qt_plugin target) qt_internal_module_info(module "${target}") - qt_parse_all_arguments(arg "add_qt_plugin" "" "TYPE" "${__default_private_args};${__default_public_args}" ${ARGN}) - if (NOT DEFINED arg_TYPE) - message(FATAL_ERROR "add_qt_plugin called without setting a TYPE.") - endif() + qt_parse_all_arguments(arg "add_qt_plugin" "STATIC" + "TYPE;OUTPUT_DIRECTORY;INSTALL_DIRECTORY;ARCHIVE_INSTALL_DIRECTORY" + "${__default_private_args};${__default_public_args}" ${ARGN}) - add_library("${target}") + qt_internal_check_directory_or_type(OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" "${arg_TYPE}" + "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" output_directory) + qt_internal_check_directory_or_type(INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}" "${arg_TYPE}" + "${INSTALL_PLUGINSDIR}/${arg_TYPE}" install_directory) + qt_internal_check_directory_or_type(ARCHIVE_INSTALL_DIRECTORY + "${arg_ARCHIVE_INSTALL_DIRECTORY}" "${arg_TYPE}" + "${INSTALL_LIBDIR}/${arg_TYPE}" archive_install_directory) + + if(arg_STATIC) + add_library("${target}" STATIC) + else() + add_library("${target}") + endif() qt_internal_add_target_aliases("${target}") set_target_properties("${target}" PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") + LIBRARY_OUTPUT_DIRECTORY "${output_directory}" + RUNTIME_OUTPUT_DIRECTORY "${output_directory}" + ARCHIVE_OUTPUT_DIRECTORY "${output_directory}") qt_internal_library_deprecation_level(deprecation_define) @@ -730,9 +752,8 @@ function(add_qt_plugin target) endif() install(TARGETS "${target}" EXPORT "${target}Targets" - LIBRARY DESTINATION ${INSTALL_PLUGINSDIR}/${arg_TYPE} - ARCHIVE DESTINATION ${INSTALL_LIBDIR}/${arg_TYPE} - ) + LIBRARY DESTINATION "${install_directory}" + ARCHIVE DESTINATION "${archive_install_directory}") install(EXPORT "${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${INSTALL_LIBDIR}/cmake) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt index f736d09d419..a059d0deab1 100644 --- a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt @@ -8,6 +8,7 @@ add_qt_plugin(pnp_basictools # special case STATIC # special case OUTPUT_DIRECTORY ../../plugins # special case INSTALL_DIRECTORY ../../plugins # special case + ARCHIVE_INSTALL_DIRECTORY ../../plugins # special case SOURCES basictoolsplugin.cpp basictoolsplugin.h INCLUDE_DIRECTORIES From 7406c124cb0c967adba0b4bc02d7b2af6d989fac Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Mar 2019 13:39:43 +0100 Subject: [PATCH 0326/1322] CMake: Set QT_STATICPLUGIN for static plugins Change-Id: I5439935b5db2babd47cdc85647e464fe845279cf Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0d2c05bbfee..956fbf9ad10 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -713,6 +713,11 @@ function(add_qt_plugin target) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) + set(static_plugin_define "") + if (arg_STATIC OR NOT QT_BUILD_SHARED_LIBS) + set(static_plugin_define "QT_STATICPLUGIN") + endif() + extend_target("${target}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES @@ -731,6 +736,7 @@ function(add_qt_plugin target) QT_BUILDING_QT QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" + "${static_plugin_define}" QT_PLUGIN PUBLIC_DEFINES QT_${module_upper}_LIB @@ -747,10 +753,6 @@ function(add_qt_plugin target) MOC_OPTIONS ${arg_MOC_OPTIONS} ) - if(NOT ${QT_BUILD_SHARED_LIBS}) - extend_target("${target}" DEFINES QT_STATICPLUGIN) - endif() - install(TARGETS "${target}" EXPORT "${target}Targets" LIBRARY DESTINATION "${install_directory}" ARCHIVE DESTINATION "${archive_install_directory}") From 8fa9a987ea7bb25ef96d325a8fbbb8031e9ada63 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 26 Mar 2019 19:59:06 +0100 Subject: [PATCH 0327/1322] Install test executables into $prefix/tests instead of $prefix/bin The install path takes into account the path structure of the source directory, so that not all tests are bunched up into /tests, but rather /tests/auto/foo/bar. Change-Id: I5e32d2e41ae8f095f4eac6654973508efd598df0 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 956fbf9ad10..f7d12c96ef7 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -826,6 +826,7 @@ endfunction() function(add_qt_test name) qt_parse_all_arguments(arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) set(path "${CMAKE_CURRENT_BINARY_DIR}") + file(RELATIVE_PATH test_relative_src_dir ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_qt_executable("${name}" OUTPUT_DIRECTORY "${path}" @@ -840,6 +841,7 @@ function(add_qt_test name) LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} + INSTALL_DIRECTORY ${test_relative_src_dir} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") From 89f34ee42a6f54e528533e673faa7e5fd371af4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Tue, 26 Mar 2019 14:12:09 +0100 Subject: [PATCH 0328/1322] Fix turned logic in RemoveOperation It is regression caused by a0a94576fae26bcbbf3823a6ee4b554886e84925 ("Fix RemoveOperation"). Add unit test for all operation types to make sure this code actually works:-) Change-Id: I97c94cb3411f05de89422e3fa2222f2217a09e49 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 16 +++++--- util/cmake/tests/test_operations.py | 57 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100755 util/cmake/tests/test_operations.py diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index e77d6fdcaf9..676ed4b406e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -239,15 +239,19 @@ class RemoveOperation(Operation): def process(self, input): input_set = set(input) - result_set = set(self._value) + value_set = set(self._value) result = [] - for v in self._value: - if v in input_set: - continue - if v in result_set: + + # Add everything that is not going to get removed: + for v in input: + if v not in value_set: result += [v,] - else: + + # Add everything else with removal marker: + for v in self._value: + if v not in input_set: result += ['-{}'.format(v), ] + return result def __repr__(self): diff --git a/util/cmake/tests/test_operations.py b/util/cmake/tests/test_operations.py new file mode 100755 index 00000000000..3ea2f76a431 --- /dev/null +++ b/util/cmake/tests/test_operations.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from pro2cmake import AddOperation, SetOperation, UniqueAddOperation, RemoveOperation + +def test_add_operation(): + op = AddOperation(['bar', 'buz']) + + result = op.process(['foo', 'bar']) + assert ['foo', 'bar', 'bar', 'buz'] == result + + +def test_uniqueadd_operation(): + op = UniqueAddOperation(['bar', 'buz']) + + result = op.process(['foo', 'bar']) + assert ['foo', 'bar', 'buz'] == result + + +def test_set_operation(): + op = SetOperation(['bar', 'buz']) + + result = op.process(['foo', 'bar']) + assert ['bar', 'buz'] == result + + +def test_remove_operation(): + op = RemoveOperation(['bar', 'buz']) + + result = op.process(['foo', 'bar']) + assert ['foo', '-buz'] == result From 601c840973e91987c492f4b312215ff17a95e837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 28 Mar 2019 08:29:53 +0100 Subject: [PATCH 0329/1322] Do not validate file existence if path contains variables We do not need to validate everything, while converting project files. Some checks can be left to building step. It fixes some false positive NOTFOUND errors. Change-Id: I81ff2421fdea13add0bfc03086152a47bce39908 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 676ed4b406e..60fd6297fb3 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -166,6 +166,13 @@ def map_source_to_cmake(source: str, base_dir: str, if os.path.exists(os.path.join(base_dir, source)): return source + variable_pattern = re.compile(r'\$\{[A-Za-z0-9_]+\}') + match = re.match(variable_pattern, source) + if match: + # a complex, variable based path, skipping validation + # or resolving + return source + for v in vpath: fullpath = os.path.join(v, source) if os.path.exists(fullpath): From ce9a1434670196c151c34ce5e0f7ed0718f4215f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 25 Mar 2019 17:30:16 +0100 Subject: [PATCH 0330/1322] Do not overwrite CMakeLists.txt when running run_pro2cmake One directory may contain many pro files. The generator was happily generating the same CMakeLists.txt for all of them (overwriting). This patch implements a different logic. It tries to find the main pro file and skips others assuming that somehow implicitly they will be incorporated (for example through SUBDIRS). Change-Id: Ie07d75e900a96dd48bf981a896c9dfb920f39a23 Reviewed-by: Tobias Hunger --- util/cmake/run_pro2cmake.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index b3a07c75226..47bc6b661f6 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -41,9 +41,33 @@ pro2cmake = os.path.join(script_path, 'pro2cmake.py') if len(sys.argv) > 1: base_path = os.path.abspath(sys.argv[1]) -failed_files = [] -all_files = glob.glob(os.path.join(base_path, '**/*.pro'), recursive=True) +def find_all_pro_files(): + + def sorter(pro_file: str) -> str: + """ Sorter that tries to prioritize main pro files in a directory. """ + pro_file_without_suffix = pro_file.rsplit('/', 1)[-1][:-4] + dir_name = os.path.dirname(pro_file) + if dir_name.endswith('/' + pro_file_without_suffix): + return dir_name + return dir_name + "/__" + pro_file + + all_files = [] + previous_dir_name: str = None + for pro_file in sorted(glob.glob(os.path.join(base_path, '**/*.pro'), + recursive=True), + key=sorter): + dir_name = os.path.dirname(pro_file) + if dir_name == previous_dir_name: + print("Skipping:", pro_file) + else: + all_files.append(pro_file) + previous_dir_name = dir_name + return all_files + + +failed_files = [] +all_files = find_all_pro_files() files_count = len(all_files) with concurrent.futures.ThreadPoolExecutor(initializer=os.nice, initargs=(10,)) as pool: From a697df786d44b5a9b6fa1de74c807fd8142c4791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 28 Mar 2019 13:25:04 +0100 Subject: [PATCH 0331/1322] Fix exception when parsing tests.pro The ParseResults may be a nested list of list. Now the code doesn't raise exceptions, but it fails in do_include as includes that doesn't provide resolved path will fail. Anyway step in the right direction. Change-Id: Ice44e4c10d221293cc6c1facca30abd5495791be Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 60fd6297fb3..bdc277fa0a7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -629,8 +629,18 @@ class QmakeParser: Operation = Key('key') + pp.Optional(LC) \ + Op('operation') + pp.Optional(LC) \ + Values('value') - CallArgs = pp.Optional(LC) + pp.nestedExpr() - CallArgs.setParseAction(lambda x: ' '.join(chain(*x))) + CallArgs = pp.Optional(LC) + pp.nestedExpr()\ + + def parse_call_args(results): + out = '' + for item in chain(*results): + if isinstance(item, str): + out += item + else: + out += "(" + parse_call_args(item) + ")" + return out + + CallArgs.setParseAction(parse_call_args) Load = pp.Keyword('load') + CallArgs('loaded') Include = pp.Keyword('include') + CallArgs('included') Option = pp.Keyword('option') + CallArgs('option') From f375876d1ad63b22c2dc8839e42baf7cc4a7d442 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:47:53 +0100 Subject: [PATCH 0332/1322] CMake: Map libudev to PkgConfig::Libudev Change-Id: Iac5d0fbf336f0c3905a3dca20524f90432227cf4 Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index b50289e97d0..6933c6aedd8 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -223,6 +223,7 @@ libray_mapping = { 'libpng' : 'PNG::PNG', 'libproxy': 'LibProxy::LibProxy', 'librt': 'WrapRt', + 'libudev': 'PkgConfig::Libudev', 'pcre2': 'PCRE2', 'sqlite': 'SQLite3', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', From 2b5e3590ca1b251f31587c9e837278d50b9fd85f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:56:33 +0100 Subject: [PATCH 0333/1322] CMake: Map fontconfig to Fontconfig::Fontconfig Change-Id: I2761ef23cffefbee57da6bb1a07d06b2232d1c57 Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 6933c6aedd8..7c6d2dc802f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -213,6 +213,7 @@ def substitute_platform(platform: str) -> str: libray_mapping = { 'drm': 'Libdrm::Libdrm', 'doubleconversion': 'double-conversion', + 'fontconfig': 'Fontconfig::Fontconfig', 'freetype': 'Freetype::Freetype', 'gbm': 'gbm::gbm', 'glib': 'GLIB2::GLIB2', From 2268d171cdd7135af7b8a64e47e4e3b152ac15ce Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:02:01 +0100 Subject: [PATCH 0334/1322] CMake: Map tslib, mtdev, libinput and xkbcommen_evdev Change-Id: If144a8969904b63a3de3884370baaeca1cb4242a Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 7c6d2dc802f..8264ba2065e 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -221,12 +221,15 @@ libray_mapping = { 'icu': 'ICU::i18n ICU::uc ICU::data', 'libatomic': 'Atomic', 'libdl': '${CMAKE_DL_LIBS}', + 'libinput': 'Libinput::Libinput', 'libpng' : 'PNG::PNG', 'libproxy': 'LibProxy::LibProxy', 'librt': 'WrapRt', 'libudev': 'PkgConfig::Libudev', + 'mtdev': 'PkgConfig::Mtdev', 'pcre2': 'PCRE2', 'sqlite': 'SQLite3', + 'tslib': 'PkgConfig::Tslib', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', 'xcb_icccm': 'XCB::ICCCM', 'xcb_image': 'XCB::IMAGE', @@ -243,6 +246,7 @@ libray_mapping = { 'xcb_xinput': 'XCB::XINPUT', 'xcb_xkb': 'XCB::XKB', 'xcb_xlib': 'X11::XCB', + 'xkbcommon_evdev': 'XKB::XKB', 'xkbcommon_x11': 'XKB::XKB', 'xkbcommon': 'XKB::XKB', 'xrender': 'XCB::RENDER', From 0c5b63207be3881a71c7aefc049155879dfb7ec0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:24:44 +0100 Subject: [PATCH 0335/1322] CMake: Map atspi2 to PkgConfig::ATSPI2 Change-Id: Ifd21eb278e06a6166ab87106c442d8ec94d92dc5 Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 8264ba2065e..9f535036083 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -211,6 +211,7 @@ def substitute_platform(platform: str) -> str: libray_mapping = { + 'atspi': 'PkgConfig::ATSPI2', 'drm': 'Libdrm::Libdrm', 'doubleconversion': 'double-conversion', 'fontconfig': 'Fontconfig::Fontconfig', From 8533e3d9e70d4374bdd8e6136885d558bfb80677 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:57:10 +0100 Subject: [PATCH 0336/1322] CMake: Remove 3rdparty/kwin/FindFontconfig.cmake The one shipped with cmake is more modern:-) Change-Id: I024769825467734ff1527e91df4cf5dfc38cbe68 Reviewed-by: Albert Astals Cid --- cmake/3rdparty/kwin/FindFontconfig.cmake | 50 ------------------------ 1 file changed, 50 deletions(-) delete mode 100644 cmake/3rdparty/kwin/FindFontconfig.cmake diff --git a/cmake/3rdparty/kwin/FindFontconfig.cmake b/cmake/3rdparty/kwin/FindFontconfig.cmake deleted file mode 100644 index d95e46b4844..00000000000 --- a/cmake/3rdparty/kwin/FindFontconfig.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# - Try to find the Fontconfig -# Once done this will define -# -# FONTCONFIG_FOUND - system has Fontconfig -# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers -# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG -# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG - -# Copyright (c) 2006,2007 Laurent Montel, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - - -if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) - - # in cache already - set(FONTCONFIG_FOUND TRUE) - -else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) - - if (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - find_package(PkgConfig) - pkg_check_modules(PC_FONTCONFIG QUIET fontconfig) - - set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER}) - endif (NOT WIN32) - - find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h - PATHS - ${PC_FONTCONFIG_INCLUDEDIR} - ${PC_FONTCONFIG_INCLUDE_DIRS} - /usr/X11/include - ) - - find_library(FONTCONFIG_LIBRARIES NAMES fontconfig - PATHS - ${PC_FONTCONFIG_LIBDIR} - ${PC_FONTCONFIG_LIBRARY_DIRS} - ) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR ) - - mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR) - -endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR) - From 337c06b1d8def58733cc2a75e80270eb76ca461d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 13:57:38 +0100 Subject: [PATCH 0337/1322] CMake: Re-generate platformsupport/themes Change-Id: I5310b5a399bf8078193b2218aebc07096446e83f Reviewed-by: Albert Astals Cid --- src/platformsupport/themes/CMakeLists.txt | 42 +++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/platformsupport/themes/CMakeLists.txt b/src/platformsupport/themes/CMakeLists.txt index db9f84a5b76..865624bd395 100644 --- a/src/platformsupport/themes/CMakeLists.txt +++ b/src/platformsupport/themes/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from themes.pro. ##################################################################### -## QtThemeSupport Module: +## ThemeSupport Module: ##################################################################### add_qt_module(ThemeSupport @@ -15,41 +15,41 @@ add_qt_module(ThemeSupport Qt::GuiPrivate ) +#### Keys ignored in scope 1:.:themes.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "theme_support" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### -# -#extend_target(ThemeSupport CONDITION if(unix -#) -extend_target(ThemeSupport CONDITION (UNIX AND (NOT APPLE_UIKIT)) OR QT_FEATURE_xcb +extend_target(ThemeSupport CONDITION QT_FEATURE_xcb OR (UNIX AND NOT APPLE_UIKIT) SOURCES genericunix/qgenericunixthemes.cpp genericunix/qgenericunixthemes_p.h ) -extend_target(ThemeSupport CONDITION ((UNIX AND (NOT APPLE_UIKIT)) OR QT_FEATURE_xcb) AND QT_FEATURE_dbus +extend_target(ThemeSupport CONDITION QT_FEATURE_dbus AND (QT_FEATURE_xcb OR UNIX) AND (QT_FEATURE_xcb OR NOT APPLE_UIKIT) SOURCES - genericunix/dbusmenu/qdbusmenuadaptor.cpp genericunix/dbusmenu/qdbusmenuadaptor.cpp genericunix/dbusmenu/qdbusmenuadaptor_p.h genericunix/dbusmenu/qdbusmenuadaptor_p.h - genericunix/dbusmenu/qdbusmenubar.cpp genericunix/dbusmenu/qdbusmenubar.cpp genericunix/dbusmenu/qdbusmenubar_p.h genericunix/dbusmenu/qdbusmenubar_p.h - genericunix/dbusmenu/qdbusmenuconnection.cpp genericunix/dbusmenu/qdbusmenuconnection.cpp genericunix/dbusmenu/qdbusmenuconnection_p.h genericunix/dbusmenu/qdbusmenuconnection_p.h - genericunix/dbusmenu/qdbusmenuregistrarproxy.cpp genericunix/dbusmenu/qdbusmenuregistrarproxy.cpp genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h - genericunix/dbusmenu/qdbusmenutypes.cpp genericunix/dbusmenu/qdbusmenutypes.cpp genericunix/dbusmenu/qdbusmenutypes_p.h genericunix/dbusmenu/qdbusmenutypes_p.h - genericunix/dbusmenu/qdbusplatformmenu.cpp genericunix/dbusmenu/qdbusplatformmenu.cpp genericunix/dbusmenu/qdbusplatformmenu_p.h genericunix/dbusmenu/qdbusplatformmenu_p.h + genericunix/dbusmenu/qdbusmenuadaptor.cpp genericunix/dbusmenu/qdbusmenuadaptor_p.h + genericunix/dbusmenu/qdbusmenubar.cpp genericunix/dbusmenu/qdbusmenubar_p.h + genericunix/dbusmenu/qdbusmenuconnection.cpp genericunix/dbusmenu/qdbusmenuconnection_p.h + genericunix/dbusmenu/qdbusmenuregistrarproxy.cpp genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h + genericunix/dbusmenu/qdbusmenutypes.cpp genericunix/dbusmenu/qdbusmenutypes_p.h + genericunix/dbusmenu/qdbusplatformmenu.cpp genericunix/dbusmenu/qdbusplatformmenu_p.h INCLUDE_DIRECTORIES - genericunix/dbusmenu/ - genericunix/dbusmenu/ + genericunix/dbusmenu LIBRARIES Qt::DBus ) -extend_target(ThemeSupport CONDITION ((UNIX AND (NOT APPLE_UIKIT)) OR QT_FEATURE_xcb) AND QT_FEATURE_dbus AND QT_FEATURE_systemtrayicon +extend_target(ThemeSupport CONDITION QT_FEATURE_dbus AND QT_FEATURE_systemtrayicon AND (QT_FEATURE_xcb OR UNIX) AND (QT_FEATURE_xcb OR NOT APPLE_UIKIT) SOURCES - genericunix/dbustray/qdbustrayicon.cpp genericunix/dbustray/qdbustrayicon.cpp genericunix/dbustray/qdbustrayicon_p.h genericunix/dbustray/qdbustrayicon_p.h - genericunix/dbustray/qdbustraytypes.cpp genericunix/dbustray/qdbustraytypes.cpp genericunix/dbustray/qdbustraytypes_p.h genericunix/dbustray/qdbustraytypes_p.h - genericunix/dbustray/qstatusnotifieritemadaptor.cpp genericunix/dbustray/qstatusnotifieritemadaptor.cpp genericunix/dbustray/qstatusnotifieritemadaptor_p.h genericunix/dbustray/qstatusnotifieritemadaptor_p.h - genericunix/dbustray/qxdgnotificationproxy.cpp genericunix/dbustray/qxdgnotificationproxy.cpp genericunix/dbustray/qxdgnotificationproxy_p.h genericunix/dbustray/qxdgnotificationproxy_p.h + genericunix/dbustray/qdbustrayicon.cpp genericunix/dbustray/qdbustrayicon_p.h + genericunix/dbustray/qdbustraytypes.cpp genericunix/dbustray/qdbustraytypes_p.h + genericunix/dbustray/qstatusnotifieritemadaptor.cpp genericunix/dbustray/qstatusnotifieritemadaptor_p.h + genericunix/dbustray/qxdgnotificationproxy.cpp genericunix/dbustray/qxdgnotificationproxy_p.h INCLUDE_DIRECTORIES - genericunix/dbustray/ - genericunix/dbustray/ + genericunix/dbustray LIBRARIES Qt::DBus ) From 8d4a15c68fe51572dae31287822bda377dea2388 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 13:58:21 +0100 Subject: [PATCH 0338/1322] CMake: Re-generate platformsupport/edid Change-Id: Ib043c387a67b0a05448fe5a9bf0ef6adbbfd369f Reviewed-by: Albert Astals Cid --- src/platformsupport/edid/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/edid/CMakeLists.txt b/src/platformsupport/edid/CMakeLists.txt index c5f55624c8d..3c9668527e1 100644 --- a/src/platformsupport/edid/CMakeLists.txt +++ b/src/platformsupport/edid/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from edid.pro. ##################################################################### -## QtEdidSupport Module: +## EdidSupport Module: ##################################################################### add_qt_module(EdidSupport @@ -13,3 +13,9 @@ add_qt_module(EdidSupport LIBRARIES Qt::CorePrivate ) + +#### Keys ignored in scope 1:.:edid.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "edid_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" From 63389cad18dd0ebdefb43cd63564caa4213312dd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:00:54 +0100 Subject: [PATCH 0339/1322] CMake: Re-generate platformsupport/eventdispatcher Change-Id: Ib2c502cc4f2e7b91304ec4d0b4f1702327890dfb Reviewed-by: Albert Astals Cid --- .../eventdispatchers/CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt index f8898ea6725..ba0d71f03b6 100644 --- a/src/platformsupport/eventdispatchers/CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -1,10 +1,8 @@ -# Generated from eventdispatchers.pro. - -find_package(GLIB2) -set_package_properties(GLib PROPERTIES TYPE OPTIONAL) +find_package(GLIB2) # special case +set_package_properties(GLib PROPERTIES TYPE OPTIONAL) # special case ##################################################################### -## QtEventDispatcherSupport Module: +## EventDispatcherSupport Module: ##################################################################### add_qt_module(EventDispatcherSupport @@ -16,6 +14,12 @@ add_qt_module(EventDispatcherSupport Qt::GuiPrivate ) +#### Keys ignored in scope 1:.:eventdispatchers.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "eventdispatcher_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -26,7 +30,7 @@ extend_target(EventDispatcherSupport CONDITION UNIX qunixeventdispatcher_qpa_p.h ) -extend_target(EventDispatcherSupport CONDITION NOT UNIX +extend_target(EventDispatcherSupport CONDITION WIN32 SOURCES qwindowsguieventdispatcher.cpp qwindowsguieventdispatcher_p.h ) From 143c3e6ea1c896ee62fe5a413e9133c26cfc073d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:48:11 +0100 Subject: [PATCH 0340/1322] CMake: Re-generate platformsupport/devicediscovery Change-Id: I817532202f070120498894b0b1dd9d92fc4e1bfa Reviewed-by: Albert Astals Cid --- src/platformsupport/devicediscovery/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platformsupport/devicediscovery/CMakeLists.txt b/src/platformsupport/devicediscovery/CMakeLists.txt index 9cfbb073ca0..cfb06cd3eb0 100644 --- a/src/platformsupport/devicediscovery/CMakeLists.txt +++ b/src/platformsupport/devicediscovery/CMakeLists.txt @@ -14,6 +14,12 @@ add_qt_module(DeviceDiscoverySupport Qt::CorePrivate ) +#### Keys ignored in scope 1:.:devicediscovery.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "devicediscovery_support" +# QT_FOR_CONFIG = "gui-private" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### From 43ff4aa5b842f5d02fbcd03854e0d13de9b4ad53 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:49:06 +0100 Subject: [PATCH 0341/1322] CMake: Re-generate platformsupport/fbconvenience Change-Id: I8cf1ac15e38529117346fdd17f29fb1e6be20a68 Reviewed-by: Albert Astals Cid --- src/platformsupport/fbconvenience/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platformsupport/fbconvenience/CMakeLists.txt b/src/platformsupport/fbconvenience/CMakeLists.txt index ddb6dc99e30..bb283979db7 100644 --- a/src/platformsupport/fbconvenience/CMakeLists.txt +++ b/src/platformsupport/fbconvenience/CMakeLists.txt @@ -18,3 +18,9 @@ add_qt_module(FbSupport Qt::CorePrivate Qt::GuiPrivate ) + +#### Keys ignored in scope 1:.:fbconvenience.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "fb_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" From fdb480c8e3a967aa26c167e6248d5c5f943785eb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:59:26 +0100 Subject: [PATCH 0342/1322] CMake: Re-generate platformsupport/services Change-Id: Ibe7d56e81640a41e093cf4936207fa96fd61a4f9 Reviewed-by: Albert Astals Cid --- src/platformsupport/services/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/services/CMakeLists.txt b/src/platformsupport/services/CMakeLists.txt index afa5bc166de..3169332381a 100644 --- a/src/platformsupport/services/CMakeLists.txt +++ b/src/platformsupport/services/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from services.pro. ##################################################################### -## QtServiceSupport Module: +## ServiceSupport Module: ##################################################################### add_qt_module(ServiceSupport @@ -15,6 +15,12 @@ add_qt_module(ServiceSupport Qt::GuiPrivate ) +#### Keys ignored in scope 1:.:services.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "service_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### From dc0b1dc67c669693f71020a57048d86d8b5330fa Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:11:17 +0100 Subject: [PATCH 0343/1322] CMake: Re-generate platformsupport/input Change-Id: I4f3c4d6d0db2cb8d5a4cb2b71a7d7e08f043b88c Reviewed-by: Albert Astals Cid --- src/platformsupport/input/CMakeLists.txt | 31 +++++++++--------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt index 43fb26d3034..bcd96a9cdba 100644 --- a/src/platformsupport/input/CMakeLists.txt +++ b/src/platformsupport/input/CMakeLists.txt @@ -1,16 +1,7 @@ -# Generated from input.pro. - -find_package(Libinput) -set_package_properties(Libinput PROPERTIES TYPE OPTIONAL) - -find_package(XKB) -set_package_properties(XKB PROPERTIES TYPE OPTIONAL) - -find_package(Tslib) -set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) - -find_package(Mtdev) -set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) +find_package(Libinput) # special case +find_package(XKB) # special case +find_package(Tslib) # special case +find_package(Mtdev) # special case ##################################################################### ## InputSupport Module: @@ -22,14 +13,16 @@ add_qt_module(InputSupport QT_NO_CAST_FROM_ASCII LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::DeviceDiscoverySupportPrivate - # CONFIG = "static" "internal_module" - # MODULE = "input_support" - # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" - # _LOADED = "qt_module" + Qt::GuiPrivate ) +#### Keys ignored in scope 1:.:input.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "input_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -83,8 +76,8 @@ extend_target(InputSupport CONDITION QT_FEATURE_libinput INCLUDE_DIRECTORIES libinput/../shared LIBRARIES - PkgConfig::Libudev Libinput::Libinput + PkgConfig::Libudev ) extend_target(InputSupport CONDITION QT_FEATURE_libinput AND QT_FEATURE_xkbcommon_evdev From 71125665cfc2fbf0374a43188f6fdd22d03ee199 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:11:54 +0100 Subject: [PATCH 0344/1322] CMake: Re-generate platformsupport/accessibility Change-Id: I3d29bc6db570d918dee5925ac370c4dd2cc16aa8 Reviewed-by: Albert Astals Cid --- src/platformsupport/accessibility/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/accessibility/CMakeLists.txt b/src/platformsupport/accessibility/CMakeLists.txt index 453e2d1ab8d..14b24aba560 100644 --- a/src/platformsupport/accessibility/CMakeLists.txt +++ b/src/platformsupport/accessibility/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from accessibility.pro. ##################################################################### -## QtAccessibilitySupport Module: +## AccessibilitySupport Module: ##################################################################### add_qt_module(AccessibilitySupport @@ -14,3 +14,8 @@ add_qt_module(AccessibilitySupport Qt::CorePrivate Qt::GuiPrivate ) + +#### Keys ignored in scope 1:.:accessibility.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "accessibility_support" +# _LOADED = "qt_module" From feeae8e27ff01987078f894fe2f5e7144d935394 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:32:46 +0100 Subject: [PATCH 0345/1322] CMake: Re-generate platformsupport/linuxaccessibility Change-Id: I1737fbfbdb3a139a9296cc0b446014b3aaa583a1 Reviewed-by: Albert Astals Cid --- .../linuxaccessibility/CMakeLists.txt | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt index 81e32e26667..5478c9f773b 100644 --- a/src/platformsupport/linuxaccessibility/CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -1,4 +1,8 @@ -find_package(ATSPI2 REQUIRED) +find_package(ATSPI2 REQUIRED) # special case + +##################################################################### +## LinuxAccessibilitySupport Module: +##################################################################### add_qt_module(LinuxAccessibilitySupport STATIC @@ -10,6 +14,16 @@ add_qt_module(LinuxAccessibilitySupport constant_mappings.cpp constant_mappings_p.h dbusconnection.cpp dbusconnection_p.h struct_marshallers.cpp struct_marshallers_p.h + DBUS_ADAPTOR_SOURCES + dbusxml/Cache.xml + dbusxml/DeviceEventController.xml + DBUS_ADAPTOR_FLAGS + "-i" "struct_marshallers_p.h" + DBUS_INTERFACE_SOURCES + dbusxml/Bus.xml + dbusxml/Socket.xml + DBUS_INTERFACE_FLAGS + "-i" "struct_marshallers_p.h" DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES @@ -18,9 +32,10 @@ add_qt_module(LinuxAccessibilitySupport Qt::DBus Qt::GuiPrivate PkgConfig::ATSPI2 - DBUS_ADAPTOR_SOURCES dbusxml/Cache.xml dbusxml/DeviceEventController.xml - DBUS_ADAPTOR_FLAGS -i struct_marshallers_p.h - DBUS_INTERFACE_SOURCES dbusxml/Socket.xml dbusxml/Bus.xml - DBUS_INTERFACE_FLAGS -i struct_marshallers_p.h ) +#### Keys ignored in scope 1:.:linuxaccessibility.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "linuxaccessibility_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" From 828f2965e78a2178266ec3b54f922ccea324693d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:08:00 +0100 Subject: [PATCH 0346/1322] CMake: pro2cmake.py: deduplicate and sort libraries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I924cfac365a0b4ba18c2579820bc37729f1ea8d9 Reviewed-by: Jędrzej Nowacki --- util/cmake/pro2cmake.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index bdc277fa0a7..66edf5bd19b 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -910,8 +910,9 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, dependencies += scope.expand('QMAKE_USE_PRIVATE') + scope.expand('QMAKE_USE') \ + scope.expand('LIBS_PRIVATE') + scope.expand('LIBS') if dependencies: - cm_fh.write('{} LIBRARIES\n'.format(ind)) + dependencies_to_print = [] is_framework = False + for d in dependencies: if d == '-framework': is_framework = True @@ -925,9 +926,14 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, d = '# Remove: {}'.format(d[1:]) else: d = substitute_libs(d) - cm_fh.write('{} {}\n'.format(ind, d)) + dependencies_to_print.append(d) is_framework = False + if dependencies_to_print: + cm_fh.write('{} LIBRARIES\n'.format(ind)) + for d in sorted(list(set(dependencies_to_print))): + cm_fh.write('{} {}\n'.format(ind, d)) + compile_options = scope.get('QMAKE_CXXFLAGS') if compile_options: cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind)) From 61ec3d0b6e7c77c91449cc52a218fdab6a490896 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:16:05 +0100 Subject: [PATCH 0347/1322] CMake: Map psql to PostgreSQL::PostgreSQL Change-Id: I8332d2120e8b629c8722b5c9a95b47950b327d4c Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 9f535036083..24c2f143ab3 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -229,6 +229,7 @@ libray_mapping = { 'libudev': 'PkgConfig::Libudev', 'mtdev': 'PkgConfig::Mtdev', 'pcre2': 'PCRE2', + 'psql': 'PostgreSQL::PostgreSQL', 'sqlite': 'SQLite3', 'tslib': 'PkgConfig::Tslib', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', From 1ac36d4bc22da0cd7defad392c7619cd194da2d8 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:34:22 +0100 Subject: [PATCH 0348/1322] CMake: Map glx_support and glx_supportPrivate Change-Id: I777ea84a080a6856961d644a0290e4d73e07c518 Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 24c2f143ab3..42e978bb71f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -218,6 +218,8 @@ libray_mapping = { 'freetype': 'Freetype::Freetype', 'gbm': 'gbm::gbm', 'glib': 'GLIB2::GLIB2', + 'glx_support': 'Qt::GlxSupport', + 'glx_supportPrivate': 'Qt::GlxSupportPrivate', 'harfbuzz': 'harfbuzz::harfbuzz', 'icu': 'ICU::i18n ICU::uc ICU::data', 'libatomic': 'Atomic', From b0d4ac8498b18e9ba89aaa51b8ec143dd0e8ae36 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:21:23 +0100 Subject: [PATCH 0349/1322] CMake: Map SQLite3 to SQLite::SQLite3 Fix sqlite maping while at it. Change-Id: I712ca562fa362a7f5857047346e8b3083f901bfb Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 42e978bb71f..d5e0dd006e9 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -232,7 +232,8 @@ libray_mapping = { 'mtdev': 'PkgConfig::Mtdev', 'pcre2': 'PCRE2', 'psql': 'PostgreSQL::PostgreSQL', - 'sqlite': 'SQLite3', + 'sqlite': 'SQLite::SQLite3', + 'SQLite3': 'SQLite::SQLite3', 'tslib': 'PkgConfig::Tslib', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', 'xcb_icccm': 'XCB::ICCCM', From 6a834a0c595b70d888724610e6d4ad05826e7117 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:18:19 +0100 Subject: [PATCH 0350/1322] CMake: Map odbc to ODBC::ODBC Change-Id: I55cf506cca87ac3e3fe9e0e1803f5118b46bf818 Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index d5e0dd006e9..56bd1419c8c 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -230,6 +230,7 @@ libray_mapping = { 'librt': 'WrapRt', 'libudev': 'PkgConfig::Libudev', 'mtdev': 'PkgConfig::Mtdev', + 'odbc': 'ODBC::ODBC', 'pcre2': 'PCRE2', 'psql': 'PostgreSQL::PostgreSQL', 'sqlite': 'SQLite::SQLite3', From b9a3217c41560ee4a296797a394620761ca3a471 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:23:34 +0100 Subject: [PATCH 0351/1322] CMake: pro2cmake.py: Handle $$PWD better Change-Id: I2e28b652c60d3490138ae0548b32d010faccc5a4 Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 66edf5bd19b..900914eab3c 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -550,6 +550,9 @@ class Scope(object): return [result] def expand(self, key: str) -> typing.List[str]: + if key == 'PWD': + return os.path.relpath(self.currentdir, self.basedir) + value = self.get(key, []) result: typing.List[str] = [] assert isinstance(value, list) From 75658794e4a016090abd664b36acb5e4fdbbc802 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:24:05 +0100 Subject: [PATCH 0352/1322] CMake: pro2cmake.py: Improve handling of dbus interfaces/adaptor sources Change-Id: I3b642e1ae31996a81618e312183f4cc168bbbe1b Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 900914eab3c..043b9568e8a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -881,12 +881,14 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, dbus_adaptors = scope.expand('DBUS_ADAPTORS') if dbus_adaptors: + dbus_adaptors = [map_source_to_cmake(s, scope.basedir, vpath) for s in dbus_adaptors] cm_fh.write('{} DBUS_ADAPTOR_SOURCES\n'.format(ind)) for d in sort_sources(dbus_adaptors): cm_fh.write('{} {}\n'.format(ind, d)) dbus_interfaces = scope.expand('DBUS_INTERFACES') if dbus_interfaces: + dbus_interfaces = [map_source_to_cmake(s, scope.basedir, vpath) for s in dbus_interfaces] cm_fh.write('{} DBUS_INTERFACE_SOURCES\n'.format(ind)) for d in sort_sources(dbus_interfaces): cm_fh.write('{} {}\n'.format(ind, d)) From 03a64ab80dd31b0c0963801a3bf929093ddb8c05 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:31:07 +0100 Subject: [PATCH 0353/1322] CMake: pro2cmake.py: Handle QDBUSXML2CPP_*_HEADER_FLAGS Change-Id: Ib5d34a6bf550a11154109064e4e718d0c79c722b Reviewed-by: Albert Astals Cid --- util/cmake/pro2cmake.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 043b9568e8a..7a6e6abbae4 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -885,6 +885,10 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, cm_fh.write('{} DBUS_ADAPTOR_SOURCES\n'.format(ind)) for d in sort_sources(dbus_adaptors): cm_fh.write('{} {}\n'.format(ind, d)) + dbus_adaptor_flags = scope.expand('QDBUSXML2CPP_ADAPTOR_HEADER_FLAGS') + if dbus_adaptor_flags: + cm_fh.write('{} DBUS_ADAPTOR_FLAGS\n'.format(ind)) + cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_adaptor_flags))) dbus_interfaces = scope.expand('DBUS_INTERFACES') if dbus_interfaces: @@ -892,6 +896,10 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, cm_fh.write('{} DBUS_INTERFACE_SOURCES\n'.format(ind)) for d in sort_sources(dbus_interfaces): cm_fh.write('{} {}\n'.format(ind, d)) + dbus_interface_flags = scope.expand('QDBUSXML2CPP_INTERFACE_HEADER_FLAGS') + if dbus_interface_flags: + cm_fh.write('{} DBUS_INTERFACE_FLAGS\n'.format(ind)) + cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_interface_flags))) defines = scope.expand('DEFINES') if defines: From eb1e7442061e658de7dc80db455326595731f6dd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 14:58:49 +0100 Subject: [PATCH 0354/1322] CMake: Re-generate platformsupport/fontdatabases Change-Id: I20e7043c77fbbbd882d6bf8cb0a05dfb32eb2ede Reviewed-by: Albert Astals Cid --- .../fontdatabases/CMakeLists.txt | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 4a410e0c011..9622000ab53 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -1,11 +1,10 @@ -# Generated from fontdatabases.pro. +find_package(Freetype) # special case +find_package(Fontconfig) # special case ##################################################################### ## FontDatabaseSupport Module: ##################################################################### -find_package(Freetype) # Special case - add_qt_module(FontDatabaseSupport STATIC DEFINES @@ -13,12 +12,14 @@ add_qt_module(FontDatabaseSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate - # CONFIG = "static" "internal_module" - # MODULE = "fontdatabase_support" - # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" - # _LOADED = "qt_module" ) +#### Keys ignored in scope 1:.:fontdatabases.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "fontdatabase_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -31,11 +32,12 @@ extend_target(FontDatabaseSupport CONDITION APPLE ${FWCoreGraphics} ${FWCoreText} ${FWFoundation} - ${FWAppKit} # Special case - - # CONFIG = "watchos_coretext" + ${FWUIKit} ) +#### Keys ignored in scope 2:.:fontdatabases.pro:APPLE: +# CONFIG = "watchos_coretext" + extend_target(FontDatabaseSupport CONDITION APPLE AND QT_FEATURE_freetype SOURCES freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h @@ -43,6 +45,11 @@ extend_target(FontDatabaseSupport CONDITION APPLE AND QT_FEATURE_freetype Freetype::Freetype ) +extend_target(FontDatabaseSupport CONDITION APPLE_OSX + LIBRARIES + ${FWAppKit} +) + extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype SOURCES freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h @@ -61,7 +68,7 @@ extend_target(FontDatabaseSupport CONDITION QT_FEATURE_fontconfig AND UNIX fontconfig/qfontconfigdatabase.cpp fontconfig/qfontconfigdatabase_p.h fontconfig/qfontenginemultifontconfig.cpp fontconfig/qfontenginemultifontconfig_p.h LIBRARIES - fontconfig + Fontconfig::Fontconfig ) extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT @@ -71,10 +78,10 @@ extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT windows/qwindowsnativeimage.cpp windows/qwindowsnativeimage_p.h LIBRARIES Qt::GuiPrivate - ole32 - gdi32 - user32 advapi32 + gdi32 + ole32 + user32 ) extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 AND NOT WINRT @@ -109,6 +116,6 @@ extend_target(FontDatabaseSupport CONDITION WINRT __WRL_NO_DEFAULT_LIB__ LIBRARIES Qt::GuiPrivate - ws2_32 dwrite + ws2_32 ) From 3b362e766f4f9c9852ae0c62d0e756cd55caf25c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 11:48:01 +0100 Subject: [PATCH 0355/1322] CMake: Re-generate platformsupport/windowsuiautomation Change-Id: I5c422b0052af0570de4331215fe78a7e956649e9 Reviewed-by: Albert Astals Cid --- src/platformsupport/windowsuiautomation/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/windowsuiautomation/CMakeLists.txt b/src/platformsupport/windowsuiautomation/CMakeLists.txt index 542a7369669..84c118258e6 100644 --- a/src/platformsupport/windowsuiautomation/CMakeLists.txt +++ b/src/platformsupport/windowsuiautomation/CMakeLists.txt @@ -21,7 +21,9 @@ add_qt_module(WindowsUIAutomationSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate - # CONFIG = "static" "internal_module" - # MODULE = "windowsuiautomation_support" - # _LOADED = "qt_module" ) + +#### Keys ignored in scope 1:.:windowsuiautomation.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "windowsuiautomation_support" +# _LOADED = "qt_module" From 49777d0d4fc5b1589e80e786b2ea6b1da0e65ac5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 11:49:58 +0100 Subject: [PATCH 0356/1322] CMake: Re-generate platformsupport/vkconvenience Change-Id: I231274316f1cd834ec6d34e51231829dd825643b Reviewed-by: Albert Astals Cid --- src/platformsupport/vkconvenience/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt index ced2db5e206..23d7c6ffecc 100644 --- a/src/platformsupport/vkconvenience/CMakeLists.txt +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -1,12 +1,9 @@ -# Generated from vkconvenience.pro. +find_package(Vulkan) # special case ##################################################################### ## VulkanSupport Module: ##################################################################### -# Special case. -find_package(Vulkan) - add_qt_module(VulkanSupport STATIC SOURCES @@ -16,5 +13,11 @@ add_qt_module(VulkanSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate - Vulkan::Vulkan + Vulkan::Vulkan # special case ) + +#### Keys ignored in scope 1:.:vkconvenience.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "vulkan_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" From 95142af5bdd757da151ad95312b44372bb529c6b Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 11:52:26 +0100 Subject: [PATCH 0357/1322] CMake: Re-generate platformsupport/kmsconvenience Change-Id: If0d734f80f3c6252c6cd7dedcba77352ee909178 Reviewed-by: Albert Astals Cid --- src/platformsupport/kmsconvenience/CMakeLists.txt | 13 ++++++++----- .../kmsconvenience/kmsconvenience.pro | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/platformsupport/kmsconvenience/CMakeLists.txt b/src/platformsupport/kmsconvenience/CMakeLists.txt index 62ea0dbc4b4..cf006fbeed8 100644 --- a/src/platformsupport/kmsconvenience/CMakeLists.txt +++ b/src/platformsupport/kmsconvenience/CMakeLists.txt @@ -1,20 +1,23 @@ -# Generated from kmsconvenience.pro. +find_package(Libdrm) # special case ##################################################################### ## KmsSupport Module: ##################################################################### -find_package(Libdrm) - add_qt_module(KmsSupport STATIC SOURCES qkmsdevice.cpp qkmsdevice_p.h DEFINES QT_NO_CAST_FROM_ASCII + PUBLIC_LIBRARIES # special case + Libdrm::Libdrm LIBRARIES Qt::CorePrivate Qt::GuiPrivate - PUBLIC_LIBRARIES - Libdrm::Libdrm ) + +#### Keys ignored in scope 1:.:kmsconvenience.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "kms_support" +# _LOADED = "qt_module" diff --git a/src/platformsupport/kmsconvenience/kmsconvenience.pro b/src/platformsupport/kmsconvenience/kmsconvenience.pro index 5ea2e3f208f..0c5a20a2393 100644 --- a/src/platformsupport/kmsconvenience/kmsconvenience.pro +++ b/src/platformsupport/kmsconvenience/kmsconvenience.pro @@ -6,7 +6,7 @@ CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII -HEADERS += +HEADERS += \ qkmsdevice_p.h SOURCES += \ From b7d3bb8c3a7a0f52fb4927e8f4af0adfcee95948 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 11:53:42 +0100 Subject: [PATCH 0358/1322] CMake: Re-generate platformsupport/eglconvenience Change-Id: I0e159dad3efc812be7fad7637901822f9a29fb88 Reviewed-by: Albert Astals Cid --- .../eglconvenience/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/platformsupport/eglconvenience/CMakeLists.txt b/src/platformsupport/eglconvenience/CMakeLists.txt index af5d277f7a9..2cbc02073c4 100644 --- a/src/platformsupport/eglconvenience/CMakeLists.txt +++ b/src/platformsupport/eglconvenience/CMakeLists.txt @@ -1,6 +1,4 @@ -# Generated from eglconvenience.pro. - -find_package(EGL) +find_package(EGL) # special case ##################################################################### ## EglSupport Module: @@ -16,16 +14,18 @@ add_qt_module(EglSupport QT_NO_CAST_FROM_ASCII QT_EGL_NO_X11 LIBRARIES + ${CMAKE_DL_LIBS} Qt::CorePrivate Qt::GuiPrivate - EGL::EGL - ${CMAKE_DL_LIBS} - # CONFIG = "static" "internal_module" "egl" - # MODULE = "egl_support" - # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" - # _LOADED = "qt_module" + EGL::EGL # special case ) +#### Keys ignored in scope 1:.:eglconvenience.pro:: +# CONFIG = "static" "internal_module" "egl" +# MODULE = "egl_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### From 4cf7ec0665001c9eee6bd947a698032022cddd0d Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 11:54:22 +0100 Subject: [PATCH 0359/1322] CMake: Re-generate platformsupport/platformcompositor Change-Id: I4efe3cc2920c0efe83f8e2b7028020558a78c778 Reviewed-by: Albert Astals Cid --- src/platformsupport/platformcompositor/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/platformsupport/platformcompositor/CMakeLists.txt b/src/platformsupport/platformcompositor/CMakeLists.txt index e6b7ab1f933..a8696be5cd8 100644 --- a/src/platformsupport/platformcompositor/CMakeLists.txt +++ b/src/platformsupport/platformcompositor/CMakeLists.txt @@ -15,3 +15,8 @@ add_qt_module(PlatformCompositorSupport Qt::CorePrivate Qt::GuiPrivate ) + +#### Keys ignored in scope 1:.:platformcompositor.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "platformcompositor_support" +# _LOADED = "qt_module" From ff15f3681254337fe1f16c8cfea2c9a7daad1716 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 11:57:13 +0100 Subject: [PATCH 0360/1322] CMake: Re-generate platformsupport/glxconvenience Change-Id: I1a8c376df4a29ca6d38f60b20a961a8706f246ba Reviewed-by: Albert Astals Cid --- .../glxconvenience/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/platformsupport/glxconvenience/CMakeLists.txt b/src/platformsupport/glxconvenience/CMakeLists.txt index 022b6068339..6bc3e1629ee 100644 --- a/src/platformsupport/glxconvenience/CMakeLists.txt +++ b/src/platformsupport/glxconvenience/CMakeLists.txt @@ -1,7 +1,5 @@ -# Generated from glxconvenience.pro. - -find_package(X11) -find_package(OpenGL) +find_package(X11) # special case +find_package(OpenGL) # special case ##################################################################### ## GlxSupport Module: @@ -14,11 +12,13 @@ add_qt_module(GlxSupport DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES + OpenGL::GLX # special case Qt::CorePrivate Qt::GuiPrivate - X11::X11 - OpenGL::GLX - # CONFIG = "static" "internal_module" - # MODULE = "glx_support" - # _LOADED = "qt_module" + X11::X11 # special case ) + +#### Keys ignored in scope 1:.:glxconvenience.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "glx_support" +# _LOADED = "qt_module" From 4a9ea61705a8ca6ca715eda1099a639b51bffcb9 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:01:29 +0100 Subject: [PATCH 0361/1322] CMake: Re-generate platformsupport/graphics Change-Id: Ib144f7ab7d73e408fb73e1c52e92d03377c890c5 Reviewed-by: Albert Astals Cid --- src/platformsupport/graphics/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/graphics/CMakeLists.txt b/src/platformsupport/graphics/CMakeLists.txt index c3b8e8e64d3..9deca9d7c76 100644 --- a/src/platformsupport/graphics/CMakeLists.txt +++ b/src/platformsupport/graphics/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from graphics.pro. ##################################################################### -## QtGraphicsSupport Module: +## GraphicsSupport Module: ##################################################################### add_qt_module(GraphicsSupport @@ -14,3 +14,8 @@ add_qt_module(GraphicsSupport Qt::CorePrivate Qt::GuiPrivate ) + +#### Keys ignored in scope 1:.:graphics.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "graphics_support" +# _LOADED = "qt_module" From a660bf9aa3fff3f45b5ffce55e2b720ad748834e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:16:41 +0100 Subject: [PATCH 0362/1322] CMake: Re-generate plugins/sqldrivers/psql Change-Id: If02ae8f616600d49cbbcd2aee298395d03b68a8f Reviewed-by: Albert Astals Cid --- src/plugins/sqldrivers/psql/CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/sqldrivers/psql/CMakeLists.txt b/src/plugins/sqldrivers/psql/CMakeLists.txt index f87a8108b1d..dfbeaba6de3 100644 --- a/src/plugins/sqldrivers/psql/CMakeLists.txt +++ b/src/plugins/sqldrivers/psql/CMakeLists.txt @@ -1,9 +1,7 @@ -# Generated from psql.pro. - # FIXME cmake FindPostgreSQL is more exhaustive than the check we have for libpq-fe.h # it also checks for catalog/pg_type.h which is a more internal include, we should # add a way to tell cmake FindPostgreSQL to optionally only look for the libpq-fe.h one -find_package(PostgreSQL) +find_package(PostgreSQL) # special case ##################################################################### ## qsqlpsql Plugin: @@ -18,10 +16,13 @@ add_qt_plugin(qsqlpsql QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII LIBRARIES + PostgreSQL::PostgreSQL + Qt::Core Qt::CorePrivate Qt::SqlPrivate - PostgreSQL::PostgreSQL - # OTHER_FILES = "psql.json" - # PLUGIN_CLASS_NAME = "QPSQLDriverPlugin" - # _LOADED = "qt_plugin" ) + +#### Keys ignored in scope 1:.:psql.pro:: +# OTHER_FILES = "psql.json" +# PLUGIN_CLASS_NAME = "QPSQLDriverPlugin" +# _LOADED = "qt_plugin" From dfe734567cc7b998f4b9cc3e8c1239b44e8c482c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:18:30 +0100 Subject: [PATCH 0363/1322] CMake: Re-generate plugins/sqldrivers/odbc Change-Id: I95184ab2202f2fd1d87a7182303549557a6cdd87 Reviewed-by: Albert Astals Cid --- src/plugins/sqldrivers/odbc/CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/sqldrivers/odbc/CMakeLists.txt b/src/plugins/sqldrivers/odbc/CMakeLists.txt index 792edb4c82b..c3c52f526c3 100644 --- a/src/plugins/sqldrivers/odbc/CMakeLists.txt +++ b/src/plugins/sqldrivers/odbc/CMakeLists.txt @@ -1,6 +1,4 @@ -# Generated from odbc.pro. - -find_package(ODBC) +find_package(ODBC) # special case ##################################################################### ## qsqlodbc Plugin: @@ -15,14 +13,17 @@ add_qt_plugin(qsqlodbc QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII LIBRARIES + ODBC::ODBC + Qt::Core Qt::CorePrivate Qt::SqlPrivate - ODBC::ODBC - # OTHER_FILES = "odbc.json" - # PLUGIN_CLASS_NAME = "QODBCDriverPlugin" - # _LOADED = "qt_plugin" ) +#### Keys ignored in scope 1:.:odbc.pro:: +# OTHER_FILES = "odbc.json" +# PLUGIN_CLASS_NAME = "QODBCDriverPlugin" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### From 9e37f8844bc244b9ff5f99b82ccd6ee1dcb8ada8 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:24:43 +0100 Subject: [PATCH 0364/1322] CMake: Re-generate plugins/bearer/generic Change-Id: I1962b813ab64ac7d577d8645239e9bd0f1140947 Reviewed-by: Albert Astals Cid --- src/plugins/bearer/generic/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/bearer/generic/CMakeLists.txt b/src/plugins/bearer/generic/CMakeLists.txt index b275ddf01aa..822cd12b19c 100644 --- a/src/plugins/bearer/generic/CMakeLists.txt +++ b/src/plugins/bearer/generic/CMakeLists.txt @@ -15,11 +15,13 @@ add_qt_plugin(qgenericbearer LIBRARIES Qt::CorePrivate Qt::NetworkPrivate - # OTHER_FILES = "generic.json" - # PLUGIN_CLASS_NAME = "QGenericEnginePlugin" - # _LOADED = "qt_plugin" ) +#### Keys ignored in scope 1:.:generic.pro:: +# OTHER_FILES = "generic.json" +# PLUGIN_CLASS_NAME = "QGenericEnginePlugin" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### From 107dc7568ecff168136fb59fcb9b72fcd6308215 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:25:22 +0100 Subject: [PATCH 0365/1322] CMake: Re-generate plugins/bearer/connman Change-Id: I68f81b269573e2beaa7fce33adee9c090fae318a Reviewed-by: Albert Astals Cid --- src/plugins/bearer/connman/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/bearer/connman/CMakeLists.txt b/src/plugins/bearer/connman/CMakeLists.txt index f2ad6846027..08f286aee15 100644 --- a/src/plugins/bearer/connman/CMakeLists.txt +++ b/src/plugins/bearer/connman/CMakeLists.txt @@ -15,9 +15,11 @@ add_qt_plugin(qconnmanbearer qconnmanservice_linux.cpp qconnmanservice_linux_p.h LIBRARIES Qt::Core - Qt::NetworkPrivate Qt::DBus - # OTHER_FILES = "connman.json" - # PLUGIN_CLASS_NAME = "QConnmanEnginePlugin" - # _LOADED = "qt_plugin" + Qt::NetworkPrivate ) + +#### Keys ignored in scope 1:.:connman.pro:: +# OTHER_FILES = "connman.json" +# PLUGIN_CLASS_NAME = "QConnmanEnginePlugin" +# _LOADED = "qt_plugin" From dba2cc84aec0460ae163022b24dcd7f18b92335f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:26:00 +0100 Subject: [PATCH 0366/1322] CMake: Re-generate plugins/bearer/networkmanager Change-Id: I70ef85e4c758d76c23012da981c6f583c179dd02 Reviewed-by: Albert Astals Cid --- src/plugins/bearer/networkmanager/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/bearer/networkmanager/CMakeLists.txt b/src/plugins/bearer/networkmanager/CMakeLists.txt index 44323620d19..62c0b2a98b2 100644 --- a/src/plugins/bearer/networkmanager/CMakeLists.txt +++ b/src/plugins/bearer/networkmanager/CMakeLists.txt @@ -15,9 +15,11 @@ add_qt_plugin(qnmbearer qnetworkmanagerservice.cpp qnetworkmanagerservice.h LIBRARIES Qt::Core - Qt::NetworkPrivate Qt::DBus - # OTHER_FILES = "networkmanager.json" - # PLUGIN_CLASS_NAME = "QNetworkManagerEnginePlugin" - # _LOADED = "qt_plugin" + Qt::NetworkPrivate ) + +#### Keys ignored in scope 1:.:networkmanager.pro:: +# OTHER_FILES = "networkmanager.json" +# PLUGIN_CLASS_NAME = "QNetworkManagerEnginePlugin" +# _LOADED = "qt_plugin" From dde95a3bdb14e4c71a9284671b8eb67347fa488f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:28:45 +0100 Subject: [PATCH 0367/1322] CMake: Re-generate plugins/platforms/minimal Change-Id: I1f5f3e9f2e3ba4505ff3c9572223ca9d2b043a0e Reviewed-by: Albert Astals Cid --- src/plugins/platforms/minimal/CMakeLists.txt | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt index 12d5bdeab1e..0c3e44e2f1f 100644 --- a/src/plugins/platforms/minimal/CMakeLists.txt +++ b/src/plugins/platforms/minimal/CMakeLists.txt @@ -1,6 +1,4 @@ -# Generated from minimal.pro. - -find_package(Freetype) +find_package(Freetype) # special case ##################################################################### ## qminimal Plugin: @@ -16,14 +14,16 @@ add_qt_plugin(qminimal QT_NO_FOREACH LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate - # OTHER_FILES = "minimal.json" - # PLUGIN_CLASS_NAME = "QMinimalIntegrationPlugin" - # _LOADED = "qt_plugin" + Qt::GuiPrivate ) +#### Keys ignored in scope 1:.:minimal.pro:: +# OTHER_FILES = "minimal.json" +# PLUGIN_CLASS_NAME = "QMinimalIntegrationPlugin" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### @@ -31,7 +31,6 @@ extend_target(qminimal CONDITION QT_FEATURE_freetype LIBRARIES Freetype::Freetype ) -# -#extend_target(qminimal CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) + +#### Keys ignored in scope 3:.:minimal.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" From 2d1bc2dd6f5663d3e25974ab3746194df0a1cdeb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:35:08 +0100 Subject: [PATCH 0368/1322] CMake: Re-generate plugins/platforms/offscreen Change-Id: Ie26bed794881835278f3874e318d00affad8aa05 Reviewed-by: Albert Astals Cid --- .../platforms/offscreen/CMakeLists.txt | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index d5bff05451c..1cb5f0a4568 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -1,7 +1,5 @@ # Generated from offscreen.pro. -find_package(X11) - ##################################################################### ## qoffscreen Plugin: ##################################################################### @@ -17,14 +15,16 @@ add_qt_plugin(qoffscreen QT_NO_FOREACH LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate - # OTHER_FILES = "offscreen.json" - # PLUGIN_CLASS_NAME = "QOffscreenIntegrationPlugin" - # _LOADED = "qt_plugin" + Qt::GuiPrivate ) +#### Keys ignored in scope 1:.:offscreen.pro:: +# OTHER_FILES = "offscreen.json" +# PLUGIN_CLASS_NAME = "QOffscreenIntegrationPlugin" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### @@ -35,11 +35,10 @@ extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND NOT Qt::GlxSupportPrivate ) -extend_target(qoffscreen CONDITION NOT QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR NOT QT_FEATURE_xlib +extend_target(qoffscreen CONDITION QT_FEATURE_opengles2 OR NOT QT_FEATURE_opengl OR NOT QT_FEATURE_xlib SOURCES qoffscreenintegration_dummy.cpp ) -# -#extend_target(qoffscreen CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) + +#### Keys ignored in scope 4:.:offscreen.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" From c4bdddf9176791992268f736b2798889c608026c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:11:04 +0100 Subject: [PATCH 0369/1322] CMake: Re-generate printsupport Change-Id: I8c859dad17dbb18694f52c4c87bf20d55f490099 Reviewed-by: Albert Astals Cid --- src/printsupport/CMakeLists.txt | 52 +++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index 13f4a380360..714859a8eb0 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -27,12 +27,15 @@ add_qt_module(PrintSupport Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate - PUBLIC_LIBRARIES Qt::Gui # manual: for QPageSize - # MODULE_PLUGIN_TYPES = "printsupport" - # QMAKE_LIBS = "$$QMAKE_LIBS_PRINTSUPPORT" - # _LOADED = "qt_module" + PUBLIC_LIBRARIES # special case + Qt::Gui ) +#### Keys ignored in scope 1:.:printsupport.pro:: +# MODULE_PLUGIN_TYPES = "printsupport" +# QMAKE_LIBS = "$$QMAKE_LIBS_PRINTSUPPORT" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -49,10 +52,10 @@ extend_target(PrintSupport CONDITION WIN32 extend_target(PrintSupport CONDITION WIN32 AND NOT WINRT LIBRARIES - winspool comdlg32 gdi32 user32 + winspool ) extend_target(PrintSupport CONDITION QT_FEATURE_cups AND UNIX AND NOT APPLE @@ -70,9 +73,46 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printdialog dialogs/qabstractprintdialog.cpp dialogs/qabstractprintdialog.h dialogs/qabstractprintdialog_p.h dialogs/qpagesetupdialog.cpp dialogs/qpagesetupdialog.h dialogs/qpagesetupdialog_p.h dialogs/qpagesetupwidget.ui - dialogs/qprintdialog.h dialogs/qprintdialog.qrc + dialogs/qprintdialog.h ) +# Resources: +add_qt_resource(PrintSupport "qprintdialog" PREFIX "/qt-project.org/dialogs/qprintpreviewdialog" BASE "dialogs" FILES + images/fit-page-24.png + images/fit-page-32.png + images/fit-width-24.png + images/fit-width-32.png + images/go-first-24.png + images/go-first-32.png + images/go-last-24.png + images/go-last-32.png + images/go-next-24.png + images/go-next-32.png + images/go-previous-24.png + images/go-previous-32.png + images/layout-landscape-24.png + images/layout-landscape-32.png + images/layout-portrait-24.png + images/layout-portrait-32.png + images/page-setup-24.png + images/page-setup-32.png + images/print-24.png + images/print-32.png + images/view-page-multi-24.png + images/view-page-multi-32.png + images/view-page-one-24.png + images/view-page-one-32.png + images/view-page-sided-24.png + images/view-page-sided-32.png + images/zoom-in-24.png + images/zoom-in-32.png + images/zoom-out-24.png + images/zoom-out-32.png) +add_qt_resource(PrintSupport "qprintdialog1" PREFIX "/qt-project.org/dialogs/qprintdialog" BASE "dialogs" FILES + images/status-color.png + images/status-gray-scale.png) + + extend_target(PrintSupport CONDITION APPLE_OSX AND QT_FEATURE_printdialog SOURCES dialogs/qpagesetupdialog_mac.mm From 5c05c46e929e367ee024ce115d1f68945c8b344a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 26 Mar 2019 14:01:53 +0100 Subject: [PATCH 0370/1322] CMake: Set define for default QPA platform This is used to set the default QPA platform and without it all Gui applications trigger an assert in QString:-/ This is way simpler than going through configure.json. Change-Id: I2c053e95c0f7e99e97a0b2918d8e4ac13d3494fd Reviewed-by: Alexandru Croitor --- src/gui/CMakeLists.txt | 1 + src/gui/configure.cmake | 2 -- util/cmake/configurejson2cmake.py | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 74c0940bb7e..d429ce9a8ad 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -230,6 +230,7 @@ add_qt_module(Gui DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_QPA_DEFAULT_PLATFORM_NAME="${QT_QPA_DEFAULT_PLATFORM}" LIBRARIES Qt::CorePrivate ZLIB::ZLIB diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 1d57ce73283..8d2417d7d02 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -930,5 +930,3 @@ qt_feature("whatsthis" PUBLIC PURPOSE "Supports displaying \"What's this\" help." ) qt_feature_definition("whatsthis" "QT_NO_WHATSTHIS" NEGATE VALUE "1") - -qt_extra_definition("QT_QPA_DEFAULT_PLATFORM" "${QT_QPA_DEFAULT_PLATFORM}" PUBLIC) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 4cbcc981ce8..1edb4b44a15 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -1008,9 +1008,6 @@ def processJson(dir, ctx, data): cm_fh.write('qt_extra_definition("QT_VERSION_MINOR" ${PROJECT_VERSION_MINOR} PUBLIC)\n') cm_fh.write('qt_extra_definition("QT_VERSION_PATCH" ${PROJECT_VERSION_PATCH} PUBLIC)\n') - if ctx.get('module') == 'gui': - cm_fh.write('\nqt_extra_definition("QT_QPA_DEFAULT_PLATFORM" "${QT_QPA_DEFAULT_PLATFORM}" PUBLIC)\n') - # do this late: processSubconfigs(dir, ctx, data) From 72e0f74e31a7d293a8c4f440a564efe6d1352cb7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 13:24:48 +0100 Subject: [PATCH 0371/1322] CMake: Re-generate opengl Change-Id: I8aca37a7f07ced03500779c708374f7553684c37 Reviewed-by: Alexandru Croitor --- src/opengl/CMakeLists.txt | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 64c8d86aa57..5999e2a63bd 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from opengl.pro. ##################################################################### -## QtOpenGL Module: +## OpenGL Module: ##################################################################### add_qt_module(OpenGL @@ -30,28 +30,31 @@ add_qt_module(OpenGL Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate + WrapOpenGL # special case PUBLIC_LIBRARIES # special case Qt::Core Qt::Gui ) +#### Keys ignored in scope 1:.:opengl.pro:: +# _LOADED = "qt_module" + ## Scopes: ##################################################################### -# -#extend_target(OpenGL CONDITION MSVC -#) -# -#extend_target(OpenGL CONDITION (MSVC) AND (equals(QT_ARCH, i386)) -#) -# -#extend_target(OpenGL CONDITION solaris-cc* -#) -# -#extend_target(OpenGL CONDITION QT_FEATURE_opengl -#) -# -#extend_target(OpenGL CONDITION QT_FEATURE_opengles2 -#) + +extend_target(OpenGL CONDITION MSVC AND (TEST_architecture STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x63000000" +) + +#### Keys ignored in scope 3:.:opengl.pro:solaris-cc_x_: +# QMAKE_CXXFLAGS_RELEASE = "--O2" + +#### Keys ignored in scope 4:.:opengl.pro:QT_FEATURE_opengl: +# CONFIG = "opengl" + +#### Keys ignored in scope 5:.:opengl.pro:QT_FEATURE_opengles2: +# CONFIG = "opengles2" extend_target(OpenGL CONDITION QT_FEATURE_graphicseffect SOURCES From e2e4525f7841d95c531218297ef0d57b6280aa3d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 2 Apr 2019 14:13:27 +0200 Subject: [PATCH 0372/1322] Fix simplification of conditions involving apple Previously a condition like APPLE AND (NOT APPLE_OSX) got simplified to APPLE, which is wrong. This happened by accident due to some sub-family simplifications involving BSD, which APPLE was part of. Technically APPLE is BSD derived, but for the purposes of the conversion script consider APPLE not to be a BSD (hopefully there should be no cases of using the bsd scope for apple machines in qmake files. Also regenerate the fontdatabase project, where the issue was found. Change-Id: I18dcf4f29ffbff48c183ba95ca2a2e5cd5325d86 Reviewed-by: Tobias Hunger --- src/platformsupport/fontdatabases/CMakeLists.txt | 6 +++++- util/cmake/pro2cmake.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 9622000ab53..be1047eb13c 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -32,7 +32,6 @@ extend_target(FontDatabaseSupport CONDITION APPLE ${FWCoreGraphics} ${FWCoreText} ${FWFoundation} - ${FWUIKit} ) #### Keys ignored in scope 2:.:fontdatabases.pro:APPLE: @@ -50,6 +49,11 @@ extend_target(FontDatabaseSupport CONDITION APPLE_OSX ${FWAppKit} ) +extend_target(FontDatabaseSupport CONDITION APPLE AND NOT APPLE_OSX + LIBRARIES + ${FWUIKit} +) + extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype SOURCES freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 7a6e6abbae4..9173f84901f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1069,7 +1069,7 @@ def _recursive_simplify(expr): windowses = ('WIN32', 'WINRT') apples = ('APPLE_OSX', 'APPLE_UIKIT', 'APPLE_IOS', 'APPLE_TVOS', 'APPLE_WATCHOS',) - bsds = ('APPLE', 'FREEBSD', 'OPENBSD', 'NETBSD',) + bsds = ('FREEBSD', 'OPENBSD', 'NETBSD',) androids = ('ANDROID', 'ANDROID_EMBEDDED') unixes = ('APPLE', *apples, 'BSD', *bsds, 'LINUX', *androids, 'HAIKU', From 15f5a347fe0010f640b5451804ecb96c23bcf4a3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 26 Mar 2019 19:37:01 +0100 Subject: [PATCH 0373/1322] Add a debug suffix to libraries and plugins on macOS and Windows This is especially important on macOS when doing a debug build, because QPluginLoader is looking for the cocoa QPA plugin suffixed with "_debug" when executing a test or example. Change-Id: Ief23b3a82c567c16ab9dd30d04d1729031262d7d Reviewed-by: Tobias Hunger --- cmake/QtSetup.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index caf908b4c9d..c7d6f50b738 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -10,6 +10,14 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") # Set the possible values of build type for cmake-gui endif() +# Appends a 'debug postfix' to library targets (not executables) +# e.g. lib/libQt5DBus_debug.5.12.0.dylib +if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") +elseif(APPLE) + set(CMAKE_DEBUG_POSTFIX "_debug") +endif() + ## Force C++ standard, do not fall back, do not use compiler extensions set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) From 1aff970c49713eb13bc3b8ace8dbdc4cb4a2f379 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:00:31 +0100 Subject: [PATCH 0374/1322] CMake: Re-generate platformsupport/clipboard Change-Id: If05ae02f363a4a9ef6193f7f8822dcbbc58e1738 Reviewed-by: Albert Astals Cid Reviewed-by: Alexandru Croitor --- src/CMakeLists.txt | 1 + src/platformsupport/clipboard/CMakeLists.txt | 17 ++++++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8bde1f760ba..030ff2fe025 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,6 +6,7 @@ if(APPLE) find_library(FWDiskArbitration DiskArbitration) find_library(FWFoundation Foundation) find_library(FWIOKit IOKit) + find_library(FWImageIO ImageIO) find_library(FWMobileCoreServices MobileCoreServices) find_library(FWSecurity Security) find_library(FWSystemConfiguration SystemConfiguration) diff --git a/src/platformsupport/clipboard/CMakeLists.txt b/src/platformsupport/clipboard/CMakeLists.txt index 5c960c14771..97ffe79043b 100644 --- a/src/platformsupport/clipboard/CMakeLists.txt +++ b/src/platformsupport/clipboard/CMakeLists.txt @@ -1,13 +1,9 @@ # Generated from clipboard.pro. ##################################################################### -## QtClipboardSupport Module: +## ClipboardSupport Module: ##################################################################### -find_library(FWAppKit AppKit) -find_library(FWImageIO ImageIO) -find_library(FWCoreFoundation CoreFoundation) - add_qt_module(ClipboardSupport STATIC SOURCES @@ -15,13 +11,20 @@ add_qt_module(ClipboardSupport DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES + ${FWImageIO} Qt::CorePrivate Qt::Gui ) +#### Keys ignored in scope 1:.:clipboard.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "clipboard_support" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### -extend_target(ClipboardSupport CONDITION APPLE - LIBRARIES ${FWAppKit} ${FWImageIO} ${FWCoreFoundation} +extend_target(ClipboardSupport CONDITION APPLE_OSX + LIBRARIES + ${FWAppKit} ) From e3b2ff001416f2f924143c6b79b7f67f9f7e2305 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:09:45 +0100 Subject: [PATCH 0375/1322] CMake: Re-generate testlib Change-Id: Id3e6a3ff325ed55ac20a93683260ef3366c0ddab Reviewed-by: Alexandru Croitor --- src/testlib/CMakeLists.txt | 71 +++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index ed8d2c8df74..509748e51e5 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -1,11 +1,11 @@ +# Generated from testlib.pro. + ##################################################################### ## Test Module: ##################################################################### add_qt_module(Test - # Typically the Qt module name results in qt${module}-config.h, but - # testlib is an exception where QtTest uses qttestlib-config.h. - CONFIG_MODULE_NAME "testlib" + CONFIG_MODULE_NAME testlib # special case SOURCES qabstracttestlogger.cpp qasciikey.cpp @@ -48,42 +48,65 @@ add_qt_module(Test qttestglobal.h qxmltestlogger.cpp qxunittestlogger.cpp - LIBRARIES - Qt::CorePrivate - PUBLIC_LIBRARIES - Qt::Core DEFINES + QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII QT_NO_FOREACH QT_NO_DATASTREAM + QT_BUILD_TESTLIB_LIB # special case + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES # special case + Qt::Core ) -# Typically the module name is also the define symbol, but testlib works -# differently and uses QT_BUILD_TESTLIB_LIB, derived from the name testlib.pro. -set_target_properties(Test PROPERTIES DEFINE_SYMBOL QT_BUILD_TESTLIB_LIB) +#### Keys ignored in scope 1:.:testlib.pro:: +# CONFIG = "exceptions" +# MODULE_CONFIG = "console" "testlib_defines" +# _LOADED = "qt_module" -### Platform support: +## Scopes: ##################################################################### -extend_target(Test CONDITION APPLE - SOURCES - qappletestlogger.cpp qappletestlogger_p.h - LIBRARIES ${FWSecurity} - # FIXME: Skip XCTEST support, disabled in qmake build system +#### Keys ignored in scope 2:.:testlib.pro:UNIX AND NOT embedded: +# QMAKE_PKGCONFIG_DESCRIPTION = "Qt" "Unit" "Testing" "Library" + +extend_target(Test CONDITION QT_FEATURE_itemmodeltester + SOURCES + qabstractitemmodeltester.cpp qabstractitemmodeltester.h +) + +extend_target(Test CONDITION embedded + COMPILE_OPTIONS + "-fno-rtti" ) extend_target(Test CONDITION APPLE_OSX - SOURCES qtestutil_macos.mm qtestutil_macos_p.h - LIBRARIES ${FWFoundation} ${FWApplicationServices} ${FWIOKit} + SOURCES + qappletestlogger.cpp qappletestlogger_p.h + qtestutil_macos.mm qtestutil_macos_p.h + LIBRARIES + ${FWApplicationServices} + ${FWFoundation} + ${FWIOKit} + ${FWSecurity} ) +# special case: Do not bother with disabld stuff: +# extend_target(Test CONDITION (APPLE_OSX) AND (OFF AND NOT lessThan(QMAKE_XCODE_VERSION, "6.0")) ... +# extend_target(Test CONDITION ((APPLE_OSX) AND (OFF AND NOT lessThan(QMAKE_XCODE_VERSION, "6.0"))) AND (NOT QMAKE_MAC_SDK_PLATFORM_PATH_ISEMPTY) ... -### Feature support: -##################################################################### +#### Keys ignored in scope 8:.:testlib.pro:NOT QMAKE_MAC_SDK_PLATFORM_PATH_ISEMPTY: +# MODULE_CONFIG = "xctest" +# platform_dev_frameworks_path = "$${QMAKE_MAC_SDK_PLATFORM_PATH}/Developer/Library/Frameworks" -## itemmodeltester: -extend_target(Test CONDITION QT_FEATURE_itemmodeltester - SOURCES qabstractitemmodeltester.cpp qabstractitemmodeltester.h -) +#### Keys ignored in scope 9:.:testlib.pro:NOT TARGET Qt::Gui: +# HEADERSCLEAN_EXCLUDE = "qtest_gui.h" "qtestaccessible.h" "qtestkeyboard.h" "qtestmouse.h" "qtesttouch.h" + +#### Keys ignored in scope 10:.:testlib.pro:NOT TARGET Qt::Widgets: +# HEADERSCLEAN_EXCLUDE = "qtest_widgets.h" + +#### Keys ignored in scope 11:.:testlib.pro:NOT TARGET Qt::Network: +# HEADERSCLEAN_EXCLUDE = "qtest_network.h" add_qt_docs(./doc/qttestlib.qdocconf) From 0be63eeba7a4f57122614b24a88938b52ea1948f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 29 Mar 2019 12:21:56 +0100 Subject: [PATCH 0376/1322] CMake: Re-generate plugins/sqldrivers/sqlite Change-Id: I795c9d6045eb34e9d517cf25337b4e31d3ad0284 Reviewed-by: Albert Astals Cid Reviewed-by: Alexandru Croitor --- src/plugins/sqldrivers/sqlite/CMakeLists.txt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/plugins/sqldrivers/sqlite/CMakeLists.txt b/src/plugins/sqldrivers/sqlite/CMakeLists.txt index 77a112a4067..4034f3f4e06 100644 --- a/src/plugins/sqldrivers/sqlite/CMakeLists.txt +++ b/src/plugins/sqldrivers/sqlite/CMakeLists.txt @@ -1,7 +1,5 @@ # Generated from sqlite.pro. -find_package(SQLite3) - ##################################################################### ## qsqlite Plugin: ##################################################################### @@ -15,11 +13,20 @@ add_qt_plugin(qsqlite QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII LIBRARIES + Qt::Core Qt::CorePrivate Qt::SqlPrivate SQLite::SQLite3 - # OTHER_FILES = "sqlite.json" - # PLUGIN_CLASS_NAME = "QSQLiteDriverPlugin" - # QT_FOR_CONFIG = "sqldrivers-private" - # _LOADED = "qt_plugin" ) + +#### Keys ignored in scope 1:.:sqlite.pro:: +# OTHER_FILES = "sqlite.json" +# PLUGIN_CLASS_NAME = "QSQLiteDriverPlugin" +# QT_FOR_CONFIG = "sqldrivers-private" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +# special case: Remove dead stuff +# extend_target(qsqlite CONDITION (NOT (ON)) AND (CONFIG(release,debug OR release)) ... From 29f5c0ee702e291bb6e158a2d971aac7b5485059 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 2 Apr 2019 11:27:36 +0200 Subject: [PATCH 0377/1322] CMake: Map cups to Cups::Cups, vulkan_support_private to Qt::VulkanSupportPrivate Change-Id: Id03942becb08ca3ece589479ffe515f68034ddd4 Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 56bd1419c8c..80ef80ccb62 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -141,6 +141,7 @@ def map_qt_base_library(lib: str) -> str: 'uitools': 'Qt::UiTools', 'virtualkeyboard': 'Qt::VirtualKeyboard', 'vkconvenience': 'Qt::VulkanSupport', + 'vulkan_supportPrivate': 'Qt::VulkanSupportPrivate', 'webchannel': 'Qt::WebChannel', 'webengine': 'Qt::WebEngine', 'webenginewidgets': 'Qt::WebEngineWidgets', @@ -212,6 +213,7 @@ def substitute_platform(platform: str) -> str: libray_mapping = { 'atspi': 'PkgConfig::ATSPI2', + 'cups': 'Cups::Cups', 'drm': 'Libdrm::Libdrm', 'doubleconversion': 'double-conversion', 'fontconfig': 'Fontconfig::Fontconfig', @@ -236,6 +238,7 @@ libray_mapping = { 'sqlite': 'SQLite::SQLite3', 'SQLite3': 'SQLite::SQLite3', 'tslib': 'PkgConfig::Tslib', + 'vulkan_supportPrivate': 'Qt::VulkanSupportPrivate', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', 'xcb_icccm': 'XCB::ICCCM', 'xcb_image': 'XCB::IMAGE', From 8a9962aba8274ebf211ffa872ed840a2afd1740e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 2 Apr 2019 11:36:39 +0200 Subject: [PATCH 0378/1322] CMake: Add FindCups.cmake from upstream cmake This FindCups defines a target, which the FindCups.cmake in the currently required CMake version does not:-/ Change-Id: I76c5bb72ece80415db1971e4f2079682126fde36 Todo: Remove again once we depend on CMake 3.15. Reviewed-by: Alexandru Croitor --- cmake/FindCups.cmake | 98 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 cmake/FindCups.cmake diff --git a/cmake/FindCups.cmake b/cmake/FindCups.cmake new file mode 100644 index 00000000000..7a78100aaeb --- /dev/null +++ b/cmake/FindCups.cmake @@ -0,0 +1,98 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindCups +-------- + +Find the CUPS printing system. + +Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which +features this function (i.e. at least 1.1.19) + +Imported targets +^^^^^^^^^^^^^^^^ + +This module defines :prop_tgt:`IMPORTED` target ``Cups::Cups``, if Cups has +been found. + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +``CUPS_FOUND`` + true if CUPS headers and libraries were found +``CUPS_INCLUDE_DIRS`` + the directory containing the Cups headers +``CUPS_LIBRARIES`` + the libraries to link against to use CUPS. +``CUPS_VERSION_STRING`` + the version of CUPS found (since CMake 2.8.8) + +Cache variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``CUPS_INCLUDE_DIR`` + the directory containing the Cups headers +#]=======================================================================] + +find_path(CUPS_INCLUDE_DIR cups/cups.h ) + +find_library(CUPS_LIBRARIES NAMES cups ) + +if (CUPS_INCLUDE_DIR AND CUPS_LIBRARIES AND CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) + include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake) + cmake_push_check_state() + set(CMAKE_REQUIRED_QUIET ${Cups_FIND_QUIETLY}) + + # ippDeleteAttribute is new in cups-1.1.19 (and used by kdeprint) + CHECK_LIBRARY_EXISTS(cups ippDeleteAttribute "" CUPS_HAS_IPP_DELETE_ATTRIBUTE) + cmake_pop_check_state() +endif () + +if (CUPS_INCLUDE_DIR AND EXISTS "${CUPS_INCLUDE_DIR}/cups/cups.h") + file(STRINGS "${CUPS_INCLUDE_DIR}/cups/cups.h" cups_version_str + REGEX "^#[\t ]*define[\t ]+CUPS_VERSION_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") + + unset(CUPS_VERSION_STRING) + foreach(VPART MAJOR MINOR PATCH) + foreach(VLINE ${cups_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+CUPS_VERSION_${VPART}[\t ]+([0-9]+)$") + set(CUPS_VERSION_PART "${CMAKE_MATCH_1}") + if(CUPS_VERSION_STRING) + string(APPEND CUPS_VERSION_STRING ".${CUPS_VERSION_PART}") + else() + set(CUPS_VERSION_STRING "${CUPS_VERSION_PART}") + endif() + endif() + endforeach() + endforeach() +endif () + +include(FindPackageHandleStandardArgs) + +if (CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups + REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR CUPS_HAS_IPP_DELETE_ATTRIBUTE + VERSION_VAR CUPS_VERSION_STRING) +else () + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Cups + REQUIRED_VARS CUPS_LIBRARIES CUPS_INCLUDE_DIR + VERSION_VAR CUPS_VERSION_STRING) +endif () + +mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES) + +if (CUPS_FOUND) + set(CUPS_INCLUDE_DIRS "${CUPS_INCLUDE_DIR}") + if (NOT TARGET Cups::Cups) + add_library(Cups::Cups INTERFACE IMPORTED) + set_target_properties(Cups::Cups PROPERTIES + INTERFACE_LINK_LIBRARIES "${CUPS_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${CUPS_INCLUDE_DIR}") + endif () +endif () From bd0f9b61fd15f180306b4483d7d17d8fa5e641ee Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 2 Apr 2019 11:37:50 +0200 Subject: [PATCH 0379/1322] CMake: Re-generate plugins/platforms/cocoa Change-Id: I6d37e018a114ba90690a6fbd8d5af71f6d1b31fd Reviewed-by: Alexandru Croitor --- src/CMakeLists.txt | 5 ++ src/plugins/platforms/cocoa/CMakeLists.txt | 84 ++++++++++++---------- 2 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 030ff2fe025..8a6be71073f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,13 +1,18 @@ if(APPLE) find_library(FWAppKit AppKit) find_library(FWApplicationServices ApplicationServices) + find_library(FWCarbon Carbon) find_library(FWCoreFoundation CoreFoundation) find_library(FWCoreServices CoreServices) + find_library(FWCoreVideo CoreVideo) + find_library(FWcups cups) find_library(FWDiskArbitration DiskArbitration) find_library(FWFoundation Foundation) find_library(FWIOKit IOKit) find_library(FWImageIO ImageIO) + find_library(FWMetal Metal) find_library(FWMobileCoreServices MobileCoreServices) + find_library(FWQuartzCore QuartzCore) find_library(FWSecurity Security) find_library(FWSystemConfiguration SystemConfiguration) find_library(FWUIKit UIKit) diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 66cc2bcd892..20f90ea95dc 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -1,12 +1,10 @@ -find_package(OpenGL) -find_library(FWAppkit AppKit) -find_library(FWCoreServices CoreServices) -find_library(FWCarbon Carbon) -find_library(FWIOKit IOKit) -find_library(FWQuartzCore QuartzCore) -find_library(FWCoreVideo CoreVideo) -find_library(FWMetal Metal) -find_library(FWcups cups) +# special case: +find_package(Cups) +find_package(WrapOpenGL) + +##################################################################### +## qcocoa Plugin: +##################################################################### add_qt_plugin(qcocoa TYPE platforms @@ -46,70 +44,82 @@ add_qt_plugin(qcocoa qnswindow.h qnswindow.mm qnswindowdelegate.h qnswindowdelegate.mm LIBRARIES - Qt::CorePrivate - Qt::GuiPrivate + ${FWcups} + ${FWAppKit} + ${FWCarbon} + ${FWCoreServices} + ${FWCoreVideo} + ${FWIOKit} + ${FWMetal} + ${FWQuartzCore} + Cups::Cups Qt::AccessibilitySupportPrivate Qt::ClipboardSupportPrivate - Qt::ThemeSupportPrivate + Qt::CorePrivate Qt::FontDatabaseSupportPrivate Qt::GraphicsSupportPrivate - Qt::PlatformHeaders - ${FWAppKit} - ${FWCoreServices} - ${FWCarbon} - ${FWIOKit} - ${FWQuartzCore} - ${FWCoreVideo} - ${FWMetal} - ${FWcups} + Qt::GuiPrivate + Qt::ThemeSupportPrivate ) -add_qt_resource(qcocoa qcocoaresources PREFIX "/qt-project.org/mac/cursors" - FILES images/spincursor.png images/waitcursor.png images/sizeallcursor.png -) +# Resources: +add_qt_resource(qcocoa "qcocoaresources" PREFIX "/qt-project.org/mac/cursors" FILES + images/sizeallcursor.png + images/spincursor.png + images/waitcursor.png) -extend_target(qcocoa CONDITION QT_FEATURE_opengl + +#### Keys ignored in scope 1:.:cocoa.pro:: +# CONFIG = "no_app_extension_api_only" +# OTHER_FILES = "cocoa.json" +# PLUGIN_CLASS_NAME = "QCocoaIntegrationPlugin" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +extend_target(qcocoa CONDITION QT_FEATURE_opengl # special case SOURCES qcocoaglcontext.h qcocoaglcontext.mm LIBRARIES - OpenGL::GL + WrapOpenGL ) extend_target(qcocoa CONDITION QT_FEATURE_vulkan SOURCES qcocoavulkaninstance.h qcocoavulkaninstance.mm -) - -extend_target(qcocoa CONDITION QT_FEATURE_vulkan LIBRARIES - vulkan_support_private + Qt::VulkanSupportPrivate ) -extend_target(qcocoa CONDITION QT_FEATURE_widgets +extend_target(qcocoa CONDITION TARGET Qt::Widgets SOURCES qcocoaprintdevice.h qcocoaprintdevice.mm qcocoaprintersupport.h qcocoaprintersupport.mm qpaintengine_mac.mm qpaintengine_mac_p.h qprintengine_mac.mm qprintengine_mac_p.h LIBRARIES - Qt::WidgetsPrivate Qt::PrintSupportPrivate + Qt::WidgetsPrivate ) -extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_colordialog) +#### Keys ignored in scope 5:.:cocoa.pro:TARGET Qt::Widgets: +# QT_FOR_CONFIG = "widgets" + +extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_colordialog) SOURCES qcocoacolordialoghelper.h qcocoacolordialoghelper.mm ) -extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_filedialog) +extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_filedialog) SOURCES qcocoafiledialoghelper.h qcocoafiledialoghelper.mm ) -extend_target(qcocoa CONDITION (QT_FEATURE_widgets) AND (QT_FEATURE_fontdialog) +extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_fontdialog) SOURCES qcocoafontdialoghelper.h qcocoafontdialoghelper.mm ) -#extend_target(qcocoa CONDITION NOT equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN) -#) +#### Keys ignored in scope 9:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" From 11f217d21b7b5848e13bb0091855d50fbcbda3ce Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 2 Apr 2019 13:43:11 +0200 Subject: [PATCH 0380/1322] CMake: Re-generate plugins/platforms/windows Change-Id: I53f10995792d01e8f04cdb8f37fcf347132aa4fa Reviewed-by: Albert Astals Cid --- src/plugins/platforms/windows/CMakeLists.txt | 104 +++++++++++-------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index 33e20c75d13..84f5ab1ce00 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -7,14 +7,17 @@ add_qt_plugin(qwindows TYPE platforms SOURCES - openglblacklists.qrc + main.cpp qtwindowsglobal.h qwin10helpers.cpp qwin10helpers.h + qwindowsbackingstore.cpp qwindowsbackingstore.h qwindowscombase.h qwindowscontext.cpp qwindowscontext.h qwindowscursor.cpp qwindowscursor.h qwindowsdialoghelpers.cpp qwindowsdialoghelpers.h qwindowsdropdataobject.cpp qwindowsdropdataobject.h + qwindowsgdiintegration.cpp qwindowsgdiintegration.h + qwindowsgdinativeinterface.cpp qwindowsgdinativeinterface.h qwindowsinputcontext.cpp qwindowsinputcontext.h qwindowsintegration.cpp qwindowsintegration.h qwindowsinternalmimedata.cpp qwindowsinternalmimedata.h @@ -31,41 +34,45 @@ add_qt_plugin(qwindows qwindowstheme.cpp qwindowstheme.h qwindowsthreadpoolrunner.h qwindowswindow.cpp qwindowswindow.h - main.cpp - qwindowsbackingstore.cpp qwindowsbackingstore.h - qwindowsgdiintegration.cpp qwindowsgdiintegration.h - qwindowsgdinativeinterface.cpp qwindowsgdinativeinterface.h DEFINES QT_NO_CAST_FROM_ASCII QT_NO_FOREACH LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate + Qt::GuiPrivate Qt::ThemeSupportPrivate - gdi32 - dwmapi - ole32 - user32 - winspool - imm32 - winmm - oleaut32 - shlwapi - shell32 advapi32 + dwmapi + gdi32 + imm32 + ole32 + oleaut32 + shell32 + shlwapi + user32 + winmm + winspool wtsapi32 - # OTHER_FILES = "windows.json" - # PLUGIN_CLASS_NAME = "QWindowsIntegrationPlugin" - # QT_FOR_CONFIG = "gui" - # _LOADED = "qt_plugin" ) +# Resources: +set_source_files_properties("openglblacklists/default.json" + PROPERTIES alias "default.json") +add_qt_resource(qwindows "openglblacklists" PREFIX "/qt-project.org/windows/openglblacklists" FILES + openglblacklists/default.json) + + +#### Keys ignored in scope 1:.:windows.pro:: +# OTHER_FILES = "windows.json" +# PLUGIN_CLASS_NAME = "QWindowsIntegrationPlugin" +# QT_FOR_CONFIG = "gui" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### -# TODO extend_target(qwindows CONDITION QT_FEATURE_accessibility SOURCES uiautomation/qwindowsuiaaccessibility.cpp uiautomation/qwindowsuiaaccessibility.h @@ -89,17 +96,15 @@ extend_target(qwindows CONDITION QT_FEATURE_accessibility Qt::AccessibilitySupportPrivate ) -# Special case, disable vulkan for now because headers can't be found. extend_target(qwindows CONDITION QT_FEATURE_vulkan SOURCES qwindowsvulkaninstance.cpp qwindowsvulkaninstance.h LIBRARIES - Qt::VulkanSupportPrivate + Qt::VulkanSupportPrivate ) -#extend_target(qwindows CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) +#### Keys ignored in scope 4:.:windows.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" extend_target(qwindows CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl AND NOT QT_FEATURE_opengles2 LIBRARIES @@ -158,15 +163,34 @@ extend_target(qwindows CONDITION QT_FEATURE_sessionmanager qwindowssessionmanager.cpp qwindowssessionmanager.h ) -extend_target(qwindows CONDITION QT_FEATURE_imageformat_png - SOURCES - cursors.qrc -) +# Resources: +add_qt_resource(qwindows "cursors" PREFIX "/qt-project.org/windows/cursors" FILES + images/closedhandcursor_32.png + images/closedhandcursor_48.png + images/closedhandcursor_64.png + images/dragcopycursor_32.png + images/dragcopycursor_48.png + images/dragcopycursor_64.png + images/draglinkcursor_32.png + images/draglinkcursor_48.png + images/draglinkcursor_64.png + images/dragmovecursor_32.png + images/dragmovecursor_48.png + images/dragmovecursor_64.png + images/openhandcursor_32.png + images/openhandcursor_48.png + images/openhandcursor_64.png + images/splithcursor_32.png + images/splithcursor_48.png + images/splithcursor_64.png + images/splitvcursor_32.png + images/splitvcursor_48.png + images/splitvcursor_64.png) -# TODO -extend_target(qwindows CONDITION (QT_FEATURE_accessibility) + +extend_target(qwindows CONDITION (QT_FEATURE_accessibility) AND (TARGET windowsuiautomation_supportPrivate) LIBRARIES - Qt::WindowsUIAutomationSupportPrivate + windowsuiautomation_supportPrivate ) extend_target(qwindows CONDITION QT_FEATURE_accessibility AND mingw @@ -174,14 +198,6 @@ extend_target(qwindows CONDITION QT_FEATURE_accessibility AND mingw uuid ) -#extend_target(qwindows CONDITION QT_FEATURE_combined_angle_lib -# DEFINES -# LIBEGL_NAME= -# LIBGLESV2_NAME= -#) - -#extend_target(qwindows CONDITION NOT QT_FEATURE_combined_angle_lib -# DEFINES -# LIBEGL_NAME= -# LIBGLESV2_NAME= -#) +# special case: +# extend_target(qwindows CONDITION QT_FEATURE_combined_angle_lib ... +# extend_target(qwindows CONDITION NOT QT_FEATURE_combined_angle_lib ... From 9a7de16fac8d4f2bcbc635db4a83ac78380287fc Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 2 Apr 2019 13:46:58 +0200 Subject: [PATCH 0381/1322] CMake: Re-generate plugins/platforms/eglfs Change-Id: I62651eac0eede77f1b7fa86e198f71b0ea1da2c7 Reviewed-by: Albert Astals Cid --- src/plugins/platforms/eglfs/CMakeLists.txt | 71 ++++++++++------------ 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index e508745da81..5a4639ddd3b 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from eglfs.pro. - find_package(EGL) find_package(WrapOpenGL) @@ -23,21 +21,23 @@ add_qt_module(EglFSDeviceIntegration api LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::DeviceDiscoverySupportPrivate + Qt::EglSupportPrivate Qt::EventDispatcherSupportPrivate + Qt::FbSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::GuiPrivate Qt::ServiceSupportPrivate Qt::ThemeSupportPrivate - Qt::FontDatabaseSupportPrivate - Qt::FbSupportPrivate - Qt::EglSupportPrivate - EGL::EGL - WrapOpenGL - # CONFIG = "internal_module" "egl" - # MODULE = "eglfsdeviceintegration" - # _LOADED = "qt_module" + EGL::EGL # special case + WrapOpenGL # special case ) +#### Keys ignored in scope 2:.:./eglfsdeviceintegration.pro:: +# CONFIG = "internal_module" "egl" +# MODULE = "eglfsdeviceintegration" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -51,26 +51,18 @@ extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::PlatformCompositorSupp Qt::PlatformCompositorSupportPrivate ) -# TODO -# extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_PLATFORM_HOOKS_SOURCES_ISEMPTY -# DEFINES -# EGLFS_PLATFORM_HOOKS -# ) +# special case: +# extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_PLATFORM_HOOKS_SOURCES_ISEMPTY ... +# extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_DEVICE_INTEGRATION_ISEMPTY ... -# TODO -# extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_DEVICE_INTEGRATION_ISEMPTY -# DEFINES -# EGLFS_PREFERRED_PLUGIN= -# ) -# -#extend_target(EglFSDeviceIntegration CONDITION use_gold_linker -# # CONFIG = "no_linker_version_script" -#) +#### Keys ignored in scope 7:.:./eglfsdeviceintegration.pro:use_gold_linker: +# CONFIG = "no_linker_version_script" + +# Resources: +add_qt_resource(EglFSDeviceIntegration "cursor" FILES + cursor-atlas.png + cursor.json) -extend_target(EglFSDeviceIntegration CONDITION NOT DEFINES___contains___QT_NO_CURSOR - SOURCES - cursor.qrc -) extend_target(EglFSDeviceIntegration CONDITION QT_FEATURE_opengl SOURCES @@ -90,20 +82,21 @@ add_qt_plugin(qeglfs INCLUDE_DIRECTORIES api LIBRARIES - Qt::CorePrivate + Qt::CorePrivate # special case Qt::EglFSDeviceIntegrationPrivate - EGL::EGL - # CONFIG = "egl" - # OTHER_FILES = "$$PWD/eglfs.json" - # PLUGIN_CLASS_NAME = "QEglFSIntegrationPlugin" - # _LOADED = "qt_plugin" + EGL::EGL # special case ) +#### Keys ignored in scope 11:.:./eglfs-plugin.pro:: +# CONFIG = "egl" +# OTHER_FILES = "$$PWD/eglfs.json" +# PLUGIN_CLASS_NAME = "QEglFSIntegrationPlugin" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### -# -#extend_target(qeglfs CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) +#### Keys ignored in scope 12:.:./eglfs-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" add_subdirectory(deviceintegration) + From 547c7f8ca5c13564460c4c47611c9681ad8b022b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 2 Apr 2019 16:03:18 +0200 Subject: [PATCH 0382/1322] Fix architecture conditions The actual variable that contains the architecture is TEST_architecture_arch. TEST_architecture only contains the value if the test was performed or not. Fix the conversion script and all the generated files. Change-Id: Icb3480832cab894948f4fef03b8bc8187cab6152 Reviewed-by: Tobias Hunger --- src/concurrent/CMakeLists.txt | 2 +- src/corelib/CMakeLists.txt | 2 +- src/gui/CMakeLists.txt | 2 +- src/network/CMakeLists.txt | 2 +- src/opengl/CMakeLists.txt | 2 +- src/sql/CMakeLists.txt | 2 +- src/widgets/CMakeLists.txt | 2 +- src/xml/CMakeLists.txt | 2 +- util/cmake/pro2cmake.py | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index e0e069d322f..25ca44ddbfd 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -36,7 +36,7 @@ add_qt_module(Concurrent ## Scopes: ##################################################################### -extend_target(Concurrent CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(Concurrent CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x66000000" ) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index e1d827d0ee0..2059ec6f0c2 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -366,7 +366,7 @@ endif() # # MODULE_DEFINES = "QT_NAMESPACE=$$QT_NAMESPACE" #) -extend_target(Core CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x67000000" ) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index d429ce9a8ad..6a8bdb2d315 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -529,7 +529,7 @@ extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 #### Keys ignored in scope 43:.:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: # CONFIG = "no_clang_integrated_as" -extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT (TEST_architecture STREQUAL "arm64") +extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT (TEST_architecture_arch STREQUAL "arm64") DEFINES ENABLE_PIXMAN_DRAWHELPERS ) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index bfcf89bad21..b5a3088018b 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -68,7 +68,7 @@ add_qt_module(Network ## Scopes: ##################################################################### -extend_target(Network CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(Network CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x64000000" ) diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 5999e2a63bd..acc4cdda9a3 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -42,7 +42,7 @@ add_qt_module(OpenGL ## Scopes: ##################################################################### -extend_target(OpenGL CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(OpenGL CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x63000000" ) diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index 8581f80d01a..d438b784460 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -35,7 +35,7 @@ add_qt_module(Sql ## Scopes: ##################################################################### -extend_target(Sql CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(Sql CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x62000000" ) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index afb1cd8e714..a92da0f32ec 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -266,7 +266,7 @@ add_qt_resource(Widgets "qstyle1" PREFIX "/qt-project.org/styles/macstyle" BASE ## Scopes: ##################################################################### -extend_target(Widgets CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(Widgets CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x65000000" ) diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt index 08914676409..7ce740476c8 100644 --- a/src/xml/CMakeLists.txt +++ b/src/xml/CMakeLists.txt @@ -21,7 +21,7 @@ add_qt_module(Xml ## Scopes: ##################################################################### -extend_target(Xml CONDITION MSVC AND (TEST_architecture STREQUAL "i386") +extend_target(Xml CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x61000000" ) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9173f84901f..6e1f6095140 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1175,9 +1175,9 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', def map_to_cmake_condition(condition: str) -> str: condition = re.sub(r'\bQT_ARCH___equals___([a-zA-Z_0-9]*)', - r'(TEST_architecture STREQUAL "\1")', condition) + r'(TEST_architecture_arch STREQUAL "\1")', condition) condition = re.sub(r'\bQT_ARCH___contains___([a-zA-Z_0-9]*)', - r'(TEST_architecture STREQUAL "\1")', condition) + r'(TEST_architecture_arch STREQUAL "\1")', condition) return condition From bb04a85bdfa26f879daddac23d6b191d4bbd7a54 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 3 Apr 2019 11:33:28 +0200 Subject: [PATCH 0383/1322] Stop installing unnecessary things This includes: - tests - tools that are only used duing the Qt build (tracegen and qfloat16-tables) Change-Id: I3a5f678682b5b9318012568a9e4dcdda0967f89b Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 25 ++++++++++++++++-------- src/tools/qfloat16-tables/CMakeLists.txt | 1 + src/tools/tracegen/CMakeLists.txt | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f7d12c96ef7..3c373ac8627 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -770,7 +770,7 @@ endfunction() # Please consider to use a more specific version target like the one created # by add_qt_test or add_qt_tool below. function(add_qt_executable name) - qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP;NO_INSTALL" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x") set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") @@ -816,9 +816,11 @@ function(add_qt_executable name) MACOSX_BUNDLE "${arg_GUI}" ) - install(TARGETS "${name}" - RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}" - BUNDLE DESTINATION "${arg_INSTALL_DIRECTORY}") + if(NOT arg_NO_INSTALL) + install(TARGETS "${name}" + RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}" + BUNDLE DESTINATION "${arg_INSTALL_DIRECTORY}") + endif() endfunction() @@ -826,9 +828,9 @@ endfunction() function(add_qt_test name) qt_parse_all_arguments(arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) set(path "${CMAKE_CURRENT_BINARY_DIR}") - file(RELATIVE_PATH test_relative_src_dir ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) add_qt_executable("${name}" + NO_INSTALL OUTPUT_DIRECTORY "${path}" SOURCES "${arg_SOURCES}" INCLUDE_DIRECTORIES @@ -841,7 +843,6 @@ function(add_qt_test name) LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} - INSTALL_DIRECTORY ${test_relative_src_dir} ) add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") @@ -879,7 +880,7 @@ function(add_qt_tool name) return() endif() - qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP" "" "${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP;NO_INSTALL" "" "${__default_private_args}" ${ARGN}) set(disable_autogen_tools "${arg_DISABLE_AUTOGEN_TOOLS}") if (arg_BOOTSTRAP) @@ -894,8 +895,14 @@ function(add_qt_tool name) set(bootstrap BOOTSTRAP) endif() + set(no_install "") + if(arg_NO_INSTALL) + set(no_install NO_INSTALL) + endif() + add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" ${bootstrap} + ${no_install} SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES ${arg_INCLUDE_DIRECTORIES} @@ -908,7 +915,9 @@ function(add_qt_tool name) ) qt_internal_add_target_aliases("${name}") - install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) + if(NOT arg_NO_INSTALL) + install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) + endif() endfunction() diff --git a/src/tools/qfloat16-tables/CMakeLists.txt b/src/tools/qfloat16-tables/CMakeLists.txt index f437ccc8db9..304264f16f8 100644 --- a/src/tools/qfloat16-tables/CMakeLists.txt +++ b/src/tools/qfloat16-tables/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_tool(qfloat16-tables BOOTSTRAP + NO_INSTALL SOURCES gen_qfloat16_tables.cpp # CONFIG = "force_bootstrap" diff --git a/src/tools/tracegen/CMakeLists.txt b/src/tools/tracegen/CMakeLists.txt index bfb33d77c51..1300b0c3bca 100644 --- a/src/tools/tracegen/CMakeLists.txt +++ b/src/tools/tracegen/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_tool(tracegen BOOTSTRAP + NO_INSTALL SOURCES etw.cpp etw.h helpers.cpp helpers.h From 9947909bfa5b5503004cd3f26d100ea4dfc4eb45 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 27 Mar 2019 17:21:53 +0100 Subject: [PATCH 0384/1322] cmake: Put the test helpers binaries in their parent folder Makes qtextcodec test succeed Like qmake does qt_test_helper.prf says " If an auto test needs a helper application, this helper should be put into the same directory as the test itself. " Change-Id: I02cb36d2237cdb72912c943250b843c33ffcd64a Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3c373ac8627..57fa6badf19 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -856,7 +856,7 @@ endfunction() # This function creates an executable for use as helper program with tests. Some # tests launch separate programs to test certainly input/output behavior. function(add_qt_test_helper name) - add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ${ARGN}) + add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.." ${ARGN}) endfunction() From 067d5dc027c134a7f822253fba59a1f4b5646955 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 5 Apr 2019 17:23:16 +0200 Subject: [PATCH 0385/1322] cmake: Run tests from their build dir It's what the qmake build does Change-Id: I99663735859941b56c2211898908d61bc6c4b48f Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 57fa6badf19..40ec1fca596 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -845,7 +845,7 @@ function(add_qt_test name) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) - add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") + add_test(NAME "${name}" COMMAND "${name}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${arg_RUN_SERIAL}") set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "PATH=${path}${QT_PATH_SEPARATOR}${CMAKE_CURRENT_BINARY_DIR}${QT_PATH_SEPARATOR}$ENV{PATH}") From 867956a8432e16670c5ffdbcd97020622c58d08e Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 27 Mar 2019 17:51:05 +0100 Subject: [PATCH 0386/1322] cmake: Build qcommandlineparser/testhelper Change-Id: I1042e85575b39df18bcaaff7b57acc15d8552e6d Reviewed-by: Alexandru Croitor --- .../tools/qcommandlineparser/CMakeLists.txt | 2 ++ .../testhelper/CMakeLists.txt | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/auto/corelib/tools/qcommandlineparser/testhelper/CMakeLists.txt diff --git a/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt b/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt index 33d254a0340..f4a38ed52d0 100644 --- a/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt +++ b/tests/auto/corelib/tools/qcommandlineparser/CMakeLists.txt @@ -1 +1,3 @@ +add_subdirectory(testhelper) + add_qt_test(tst_qcommandlineparser SOURCES tst_qcommandlineparser.cpp) diff --git a/tests/auto/corelib/tools/qcommandlineparser/testhelper/CMakeLists.txt b/tests/auto/corelib/tools/qcommandlineparser/testhelper/CMakeLists.txt new file mode 100644 index 00000000000..d93193ac646 --- /dev/null +++ b/tests/auto/corelib/tools/qcommandlineparser/testhelper/CMakeLists.txt @@ -0,0 +1,20 @@ +# Generated from qcommandlineparser_test_helper.pro. + +##################################################################### +## qcommandlineparser_test_helper Binary: +##################################################################### + +# special case +add_qt_test_helper(qcommandlineparser_test_helper + SOURCES + qcommandlineparser_test_helper.cpp +) + +# special case +set_target_properties(qcommandlineparser_test_helper PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + + +#### Keys ignored in scope 1:tests/auto/corelib/tools/qcommandlineparser/testhelper:tests/auto/corelib/tools/qcommandlineparser/testhelper/qcommandlineparser_test_helper.pro:: +# CONFIG = "console" "-app_bundle" +# DESTDIR = "./" From 5691d2f47b19cde0cec76747ceca0a275292bfd0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 3 Apr 2019 15:09:31 +0200 Subject: [PATCH 0387/1322] Fix yocto cross build When cross-compiling Qt using a Yocto sysroot, if the sysroot already contains an installed Qt version, and a project (library or executable) does not explicitly link against all of its Qt dependencies, the cross linker will try to find a suitable library in the sysroot ./lib folder. This mighy lead to issues, because the linker will pick up an installed Qt library which might have different symbol versioning, and thus cause linker errors. This happened with the print support module. Make sure the print support module explicitly links against the newly built Qt modules. Task-number: QTBUG-74133 Change-Id: I876b1507c655673831e78dcfe737a5ede2a8c087 Reviewed-by: Simon Hausmann --- src/printsupport/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index 714859a8eb0..b23a61e55d7 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -29,6 +29,7 @@ add_qt_module(PrintSupport Qt::WidgetsPrivate PUBLIC_LIBRARIES # special case Qt::Gui + Qt::Widgets ) #### Keys ignored in scope 1:.:printsupport.pro:: From e0b414448653e722f3e7255a9b8522be961ceb91 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Apr 2019 14:37:33 +0200 Subject: [PATCH 0388/1322] Force feature_summary to fail when a required package is not found Apparently calling set_package_properties with TYPE REQUIRED and then calling feature_summary with FATAL_ON_MISSING_REQUIRED_PACKAGES and PACKAGES_NOT_FOUND is not enough to make CMake fail when not finding a required package. You have to explicitly set REQUIRED_PACKAGES_NOT_FOUND to force feature_summary to fail when a package is not found. Do this, and also explicitly add the rest of the NOT FOUND cases, to get a slightly clearer overview what kind of packages were not found. Task-number: QTBUG-74133 Change-Id: Id21af13dafafe0a458cff479e8abbc6aa7e6a3f7 Reviewed-by: Tobias Hunger --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1eab8afcca9..b43a6622850 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,4 +53,9 @@ endif() include(QtPostProcess) ## Print a feature summary: -feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) +feature_summary(WHAT PACKAGES_FOUND + REQUIRED_PACKAGES_NOT_FOUND + RECOMMENDED_PACKAGES_NOT_FOUND + OPTIONAL_PACKAGES_NOT_FOUND + RUNTIME_PACKAGES_NOT_FOUND + FATAL_ON_MISSING_REQUIRED_PACKAGES) From f896a5019af2a2853f9fcd7048c63ca3015d5fec Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 5 Apr 2019 11:17:24 +0200 Subject: [PATCH 0389/1322] Stop installing test helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests and their helpers should only be used in the build directory. Change-Id: I5aa9fcf734b6b3667f91df7c84d083f944c452c9 Reviewed-by: Jędrzej Nowacki Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 40ec1fca596..da5b8d0afb1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -856,7 +856,7 @@ endfunction() # This function creates an executable for use as helper program with tests. Some # tests launch separate programs to test certainly input/output behavior. function(add_qt_test_helper name) - add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.." ${ARGN}) + add_qt_executable("${name}" NO_INSTALL OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.." ${ARGN}) endfunction() From 4f07e711c9dbe80165ee62a6fdaa97b124f37155 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 5 Apr 2019 14:40:43 +0200 Subject: [PATCH 0390/1322] Add script to print out list of unconverted .pro files Also prints some statistics. Change-Id: Ieb55618c0d39604ca76d7a44390e61e02824a01f Reviewed-by: Tobias Hunger --- util/cmake/pro_conversion_rate.py | 218 ++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100755 util/cmake/pro_conversion_rate.py diff --git a/util/cmake/pro_conversion_rate.py b/util/cmake/pro_conversion_rate.py new file mode 100755 index 00000000000..740e834ca5e --- /dev/null +++ b/util/cmake/pro_conversion_rate.py @@ -0,0 +1,218 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2019 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +from __future__ import annotations + +""" +This utility script shows statistics about +converted .pro -> CMakeLists.txt files. + +To execute: python3 pro_conversion_rate.py +where can be any qt source directory. For better statistics, +specify a module root source dir (like ./qtbase or ./qtsvg). + +""" + +from argparse import ArgumentParser + +import os +import typing +from timeit import default_timer + + +def _parse_commandline(): + parser = ArgumentParser(description='Find pro files for which there are no CMakeLists.txt.') + parser.add_argument('source_directory', metavar='', type=str, + help='The source directory') + + return parser.parse_args() + + +class Blacklist: + """ Class to check if a certain dir_name / dir_path is blacklisted """ + + def __init__(self, names: typing.List[str], path_parts: typing.List[str]): + self.names = names + self.path_parts = path_parts + + # The lookup algorithm + self.lookup = self.is_blacklisted_part + self.tree = None + + try: + # If package is available, use Aho-Corasick algorithm, + from ahocorapy.keywordtree import KeywordTree + self.tree = KeywordTree(case_insensitive=True) + + for p in self.path_parts: + self.tree.add(p) + self.tree.finalize() + + self.lookup = self.is_blacklisted_part_aho + except ImportError: + pass + + def is_blacklisted(self, dir_name: str, dir_path: str) -> bool: + # First check if exact dir name is blacklisted. + if dir_name in self.names: + return True + + # Check if a path part is blacklisted (e.g. util/cmake) + return self.lookup(dir_path) + + def is_blacklisted_part(self, dir_path: str) -> bool: + if any(part in dir_path for part in self.path_parts): + return True + return False + + def is_blacklisted_part_aho(self, dir_path: str) -> bool: + return self.tree.search(dir_path) is not None + + +def recursive_scan(path: str, extension: str, result_paths: typing.List[str], blacklist: Blacklist): + """ Find files ending with a certain extension, filtering out blacklisted entries """ + try: + for entry in os.scandir(path): + entry: os.DirEntry = entry + + if entry.is_file() and entry.path.endswith(extension): + result_paths.append(entry.path) + elif entry.is_dir(): + if blacklist.is_blacklisted(entry.name, entry.path): + continue + recursive_scan(entry.path, extension, result_paths, blacklist) + except Exception as e: + print(e) + + +def check_for_cmake_project(pro_path: str) -> bool: + pro_dir_name = os.path.dirname(pro_path) + cmake_project_path = os.path.join(pro_dir_name, "CMakeLists.txt") + return os.path.exists(cmake_project_path) + + +def compute_stats(src_path: str, pros_with_missing_project: typing.List[str], + total_pros: int, existing_pros: int, missing_pros: int) -> dict: + stats = {} + stats['total projects'] = {'label': 'Total pro files found', + 'value': total_pros} + stats['existing projects'] = {'label': 'Existing CMakeLists.txt files found', + 'value': existing_pros} + stats['missing projects'] = {'label': 'Missing CMakeLists.txt files found', + 'value': missing_pros} + stats['missing examples'] = {'label': 'Missing examples', 'value': 0} + stats['missing tests'] = {'label': 'Missing tests', 'value': 0} + stats['missing src'] = {'label': 'Missing src/**/**', 'value': 0} + stats['missing plugins'] = {'label': 'Missing plugins', 'value': 0} + + for p in pros_with_missing_project: + rel_path = os.path.relpath(p, src_path) + if rel_path.startswith("examples"): + stats['missing examples']['value'] += 1 + elif rel_path.startswith("tests"): + stats['missing tests']['value'] += 1 + elif rel_path.startswith(os.path.join("src", "plugins")): + stats['missing plugins']['value'] += 1 + elif rel_path.startswith("src"): + stats['missing src']['value'] += 1 + + for stat in stats: + if stats[stat]['value'] > 0: + stats[stat]['percentage'] = round(stats[stat]['value'] * 100 / total_pros, 2) + return stats + + +def print_stats(src_path: str, pros_with_missing_project: typing.List[str], stats: dict, + scan_time: float, script_time: float): + + if stats['total projects']['value'] == 0: + print("No .pro files found. Did you specify a correct source path?") + return + + if stats['total projects']['value'] == stats['existing projects']['value']: + print("All projects were converted.") + else: + print("Missing CMakeLists.txt files for the following projects: \n") + + for p in pros_with_missing_project: + rel_path = os.path.relpath(p, src_path) + print(rel_path) + + print("\nStatistics: \n") + + for stat in stats: + if stats[stat]['value'] > 0: + print("{:<40}: {} ({}%)".format(stats[stat]['label'], + stats[stat]['value'], + stats[stat]['percentage'])) + + print("\n{:<40}: {:.10f} seconds".format("Scan time", scan_time)) + print("{:<40}: {:.10f} seconds".format("Total script time", script_time)) + + +def main(): + args = _parse_commandline() + src_path = os.path.abspath(args.source_directory) + pro_paths = [] + + extension = ".pro" + + blacklist_names = ["config.tests", "doc", "3rdparty", "angle"] + blacklist_path_parts = [ + os.path.join("util", "cmake") + ] + + script_start_time = default_timer() + blacklist = Blacklist(blacklist_names, blacklist_path_parts) + + scan_time_start = default_timer() + recursive_scan(src_path, extension, pro_paths, blacklist) + scan_time_end = default_timer() + scan_time = scan_time_end - scan_time_start + + total_pros = len(pro_paths) + + pros_with_missing_project = [] + for pro_path in pro_paths: + if not check_for_cmake_project(pro_path): + pros_with_missing_project.append(pro_path) + + missing_pros = len(pros_with_missing_project) + existing_pros = total_pros - missing_pros + + stats = compute_stats(src_path, pros_with_missing_project, total_pros, existing_pros, + missing_pros) + script_end_time = default_timer() + script_time = script_end_time - script_start_time + + print_stats(src_path, pros_with_missing_project, stats, scan_time, script_time) + + +if __name__ == '__main__': + main() From 81542ffb91c9139f67386bc08aac6cf75218e0b4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 11:59:34 +0200 Subject: [PATCH 0391/1322] CMake: Map linuxaccessibility_supportPrivate to Qt::LASP Change-Id: I6066f69c74c39fb97a286eb92748b5c4172b1efd Reviewed-by: Simon Hausmann --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 80ef80ccb62..b2f06d1a341 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -231,6 +231,7 @@ libray_mapping = { 'libproxy': 'LibProxy::LibProxy', 'librt': 'WrapRt', 'libudev': 'PkgConfig::Libudev', + 'linuxaccessibility_supportPrivate': 'Qt::LinuxAccessibilitySupportPrivate', 'mtdev': 'PkgConfig::Mtdev', 'odbc': 'ODBC::ODBC', 'pcre2': 'PCRE2', From 9365a015316d3eb663c36c25b2c391b38050b77f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 4 Apr 2019 10:38:13 +0200 Subject: [PATCH 0392/1322] CMake: pro2cmake.py: Fix typing information Change-Id: Iaa6ea69c3c72eb1b626a976fcdb16243f15c609e Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6e1f6095140..e3afce9c1b5 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -92,7 +92,7 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '') -> str: full_resource_name = resource_name + (str(resource_count) if resource_count > 0 else '') - files: Dict[str, str] = {} + files: typing.Dict[str, str] = {} for file in resource: path = file.text assert path From 77a465ea2d9d13c742ca35bd155732fcd8af0972 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 4 Apr 2019 10:38:46 +0200 Subject: [PATCH 0393/1322] CMake: pro2cmake.py: Better handling of debug features Improve way that debug features are detected. Change-Id: Ic0f0e74885e6d1e7f236c9efe4c77482ac212dbc Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index e3afce9c1b5..0403961cbd7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -332,11 +332,13 @@ class Scope(object): @property def merge_debug(self) -> bool: - return self.getString('PRO2CMAKE_MERGE_DEBUG', None) != None + merge = self.getString('PRO2CMAKE_MERGE_DEBUG').lower() + return merge and (merge == '1' or merge == 'on' or merge == 'yes' or merge == 'true') @property def scope_debug(self) -> bool: - return self.getString('PRO2CMAKE_SCOPE_DEBUG', None) != None + merge = self.getString('PRO2CMAKE_SCOPE_DEBUG').lower() + return merge and (merge == '1' or merge == 'on' or merge == 'yes' or merge == 'true') @property def parent(self) -> typing.Optional[Scope]: From 52f676bf6602053336dff9bf9b00b40dad14ae4f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 11:28:49 +0200 Subject: [PATCH 0394/1322] CMake: pro2cmake.py: Better representation of scopes as str Include the current directory in the scope __repr__ output to make it easier to understand where things wrt. include or file names go wrong. Change-Id: I09a6c17c6d8d547f1f64801bcde3c2e10c925ee1 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0403961cbd7..de715bbfef3 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -301,8 +301,10 @@ class Scope(object): def __repr__(self): debug_mark = ' [MERGE_DEBUG]' if self.merge_debug else '' - return '{}:{}:{}:{}{}'.format(self._scope_id, self._basedir, self._file, - self._condition or '', debug_mark) + return '{}:{}:{}:{}:{}'.format(self._scope_id, + self._basedir, self._currentdir, + self._file, self._condition or '', + debug_mark) def reset_visited_keys(self): self._visited_keys = set() From 9d83b54015cd089fe8b59c660ca8dfa9e5ab84fb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 13:54:56 +0100 Subject: [PATCH 0395/1322] CMake: pro2cmake.py: Fix handling of file paths This patch makes sure to store unchanged filenames as taken from qmake into the scopes it creates. The scopes are then kept longer: Merging/including scopes is handled by adding the scope to a private _included_children member of the parent scope. The methods to access data from scopes are then changed to take the _included_children into account and a new "get_files" method is added, that does all the necessary mapping to handle scope-dependent things like $$PWD, etc. This makes sure src/network is converted correctly incl. all the .pri-files it includes as well as src/platformsupport/themes.pro. Both have been troublesome before. Change-Id: I28e92b7bcee1b91b248c17201c2729a54a3ce4a1 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 329 +++++++++++++++++++++------------------- 1 file changed, 173 insertions(+), 156 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index de715bbfef3..9f40194d0a6 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -139,29 +139,28 @@ def spaces(indent: int) -> str: return ' ' * indent -def map_to_file(f: str, top_dir: str, current_dir: str, - want_absolute_path: bool = False) -> typing.Optional[str]: - if f.startswith('$$PWD/') or f == '$$PWD': # INCLUDEPATH += $$PWD - return os.path.join(os.path.relpath(current_dir, top_dir), f[6:]) - if f.startswith('$$OUT_PWD/'): - return "${CMAKE_CURRENT_BUILD_DIR}/" + f[10:] - if f.startswith("./"): - return os.path.join(current_dir, f) if current_dir != '.' else f[2:] - if want_absolute_path and not os.path.isabs(f): - return os.path.join(current_dir, f) +def map_to_file(f: str, scope: Scope, *, is_include: bool = False) -> str: + assert('$$' not in f) + + if f.startswith('${'): # Some cmake variable is prepended + return f + + base_dir = scope.currentdir if is_include else scope.basedir + f = os.path.join(base_dir, f) + + while f.startswith('./'): + f = f[2:] return f -def map_source_to_cmake(source: str, base_dir: str, - vpath: typing.List[str]) -> str: - if not source or source == '$$NO_PCH_SOURCES': +def handle_vpath(source: str, base_dir: str, vpath: typing.List[str]) -> str: + assert('$$' not in source) + + if not source: return '' - if source.startswith('$$PWD/'): - return source[6:] - if source.startswith('./'): - return source[2:] - if source == '.': - return "${CMAKE_CURRENT_SOURCE_DIR}" + + if not vpath: + return source if os.path.exists(os.path.join(base_dir, source)): return source @@ -190,7 +189,7 @@ class Operation: else: self._value = [str(value), ] - def process(self, input): + def process(self, input, transformer): assert(False) def __repr__(self): @@ -213,19 +212,19 @@ class Operation: class AddOperation(Operation): - def process(self, input): - return input + self._value + def process(self, input, transformer): + return input + transformer(self._value) def __repr__(self): return '+({})'.format(self._dump()) class UniqueAddOperation(Operation): - def process(self, input): + def process(self, input, transformer): result = input - for v in self._value: + for v in transformer(self._value): if v not in result: - result += [v, ] + result.append(v) return result def __repr__(self): @@ -233,8 +232,11 @@ class UniqueAddOperation(Operation): class SetOperation(Operation): - def process(self, input): - return self._value + def process(self, input, transformer): + if transformer: + return list(transformer(self._value)) + else: + return self._value def __repr__(self): return '=({})'.format(self._dump()) @@ -244,7 +246,7 @@ class RemoveOperation(Operation): def __init__(self, value): super().__init__(value) - def process(self, input): + def process(self, input, transformer): input_set = set(input) value_set = set(self._value) result = [] @@ -255,7 +257,7 @@ class RemoveOperation(Operation): result += [v,] # Add everything else with removal marker: - for v in self._value: + for v in transformer(self._value): if v not in input_set: result += ['-{}'.format(v), ] @@ -295,51 +297,26 @@ class Scope(object): self._file = file self._condition = map_condition(condition) self._children = [] # type: typing.List[Scope] + self._included_children = [] # type: typing.List[Scope] self._operations = copy.deepcopy(operations) self._visited_keys = set() # type: typing.Set[str] self._total_condition = None # type: typing.Optional[str] def __repr__(self): - debug_mark = ' [MERGE_DEBUG]' if self.merge_debug else '' return '{}:{}:{}:{}:{}'.format(self._scope_id, self._basedir, self._currentdir, - self._file, self._condition or '', - debug_mark) + self._file, self._condition or '') def reset_visited_keys(self): self._visited_keys = set() def merge(self, other: 'Scope') -> None: assert self != other - merge_debug = self.merge_debug or other.merge_debug - if merge_debug: - print('..... [MERGE_DEBUG]: Merging scope {}:'.format(other)) - other.dump(indent=1) - print('..... [MERGE_DEBUG]: ... into scope {}:'.format(self)) - self.dump(indent=1) - - for c in other._children: - self._add_child(c) - - for key in other._operations.keys(): - if key in self._operations: - self._operations[key] += other._operations[key] - else: - self._operations[key] = other._operations[key] - - if merge_debug: - print('..... [MERGE_DEBUG]: Result scope {}:'.format(self)) - self.dump(indent=1) - print('..... [MERGE_DEBUG]: <>') - - @property - def merge_debug(self) -> bool: - merge = self.getString('PRO2CMAKE_MERGE_DEBUG').lower() - return merge and (merge == '1' or merge == 'on' or merge == 'yes' or merge == 'true') + self._included_children.append(other) @property def scope_debug(self) -> bool: - merge = self.getString('PRO2CMAKE_SCOPE_DEBUG').lower() + merge = self.get_string('PRO2CMAKE_SCOPE_DEBUG').lower() return merge and (merge == '1' or merge == 'on' or merge == 'yes' or merge == 'true') @property @@ -394,12 +371,6 @@ class Scope(object): value = statement.get('value', []) assert key != '' - if key in ('HEADERS', 'SOURCES', 'INCLUDEPATH', 'RESOURCES',) \ - or key.endswith('_HEADERS') \ - or key.endswith('_SOURCES'): - value = [map_to_file(v, scope.basedir, - scope.currentdir) for v in value] - if operation == '=': scope._append_operation(key, SetOperation(value)) elif operation == '-=': @@ -440,10 +411,7 @@ class Scope(object): included = statement.get('included', None) if included: scope._append_operation('_INCLUDED', - UniqueAddOperation( - map_to_file(included, - scope.basedir, - scope.currentdir))) + UniqueAddOperation(included)) continue scope.settle_condition() @@ -487,7 +455,10 @@ class Scope(object): @property def children(self) -> typing.List['Scope']: - return self._children + result = list(self._children) + for include_scope in self._included_children: + result += include_scope._children + return result def dump(self, *, indent: int = 0) -> None: ind = ' ' * indent @@ -508,6 +479,19 @@ class Scope(object): else: for c in self._children: c.dump(indent=indent + 1) + print('{} Includes:'.format(ind)) + if not self._included_children: + print('{} -- NONE --'.format(ind)) + else: + for c in self._included_children: + c.dump(indent=indent + 1) + + def dump_structure(self, *, type: str = 'ROOT', indent: int = 0) -> None: + print('{}{}: {}'.format(spaces(indent), type, self)) + for i in self._included_children: + i.dump_structure(type='INCL', indent=indent + 1) + for i in self._children: + i.dump_structure(type='CHLD', indent=indent + 1) @property def keys(self): @@ -517,21 +501,64 @@ class Scope(object): def visited_keys(self): return self._visited_keys - def get(self, key: str, default=None) -> typing.List[str]: + def _evalOps(self, key: str, + transformer: typing.Optional[typing.Callable[[Scope, typing.List[str]], typing.List[str]]], + result: typing.List[str]) \ + -> typing.List[str]: self._visited_keys.add(key) - result = [] # type: typing.List[str] + + if transformer: + op_transformer = lambda files: transformer(self, files) + else: + op_transformer = lambda files: files for op in self._operations.get(key, []): - result = op.process(result) + result = op.process(result, op_transformer) + + for ic in self._included_children: + result = list(ic._evalOps(key, transformer, result)) + return result - def getString(self, key: str, default: str = '') -> str: - v = self.get(key, default) + def get(self, key: str, *, ignore_includes: bool = False) -> typing.List[str]: + if key == 'PWD': + return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] + if key == 'OUT_PWD': + return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] + + return self._evalOps(key, None, []) + + def get_string(self, key: str, default: str = '') -> str: + v = self.get(key) if len(v) == 0: return default assert len(v) == 1 return v[0] + def _map_files(self, files: typing.List[str], *, + use_vpath: bool = True, is_include: bool = False) -> typing.List[str]: + + expanded_files = [] # typing.List[str] + for f in files: + expanded_files += self._expand_value(f) + + mapped_files = list(map(lambda f: map_to_file(f, self, is_include=is_include), expanded_files)) + + if use_vpath: + result = list(map(lambda f: handle_vpath(f, self.basedir, self.get('VPATH')), mapped_files)) + else: + result = mapped_files + + # strip ${CMAKE_CURRENT_SOURCE_DIR}: + result = list(map(lambda f: f[28:] if f.startswith('${CMAKE_CURRENT_SOURCE_DIR}/') else f, result)) + + return result + + def get_files(self, key: str, *, use_vpath: bool = False, + is_include: bool = False) -> typing.List[str]: + transformer = lambda scope, files: scope._map_files(files, use_vpath=use_vpath, is_include=is_include) + return list(self._evalOps(key, transformer, [])) + def _expand_value(self, value: str) -> typing.List[str]: result = value pattern = re.compile(r'\$\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?') @@ -539,7 +566,7 @@ class Scope(object): while match: old_result = result if match.group(0) == value: - return self.get(match.group(1), []) + return self.get(match.group(1)) replacement = self.expand(match.group(1)) replacement_str = replacement[0] if replacement else '' @@ -548,16 +575,13 @@ class Scope(object): + result[match.end():] if result == old_result: - return result # Do not go into infinite loop + return [result,] # Do not go into infinite loop match = re.search(pattern, result) - return [result] + return [result,] def expand(self, key: str) -> typing.List[str]: - if key == 'PWD': - return os.path.relpath(self.currentdir, self.basedir) - - value = self.get(key, []) + value = self.get(key) result: typing.List[str] = [] assert isinstance(value, list) for v in value: @@ -565,25 +589,25 @@ class Scope(object): return result def expandString(self, key: str) -> str: - result = self._expand_value(self.getString(key)) + result = self._expand_value(self.get_string(key)) assert len(result) == 1 return result[0] @property def TEMPLATE(self) -> str: - return self.getString('TEMPLATE', 'app') + return self.get_string('TEMPLATE', 'app') def _rawTemplate(self) -> str: - return self.getString('TEMPLATE') + return self.get_string('TEMPLATE') @property def TARGET(self) -> str: - return self.getString('TARGET') \ + return self.get_string('TARGET') \ or os.path.splitext(os.path.basename(self.file))[0] @property def _INCLUDED(self) -> typing.List[str]: - return self.get('_INCLUDED', []) + return self.get('_INCLUDED') class QmakeParser: @@ -765,8 +789,7 @@ def map_condition(condition: str) -> str: part) if feature: if (feature.group(1) == "qtHaveModule"): - part = 'TARGET {}'.format(map_qt_library( - feature.group(2))) + part = 'TARGET {}'.format(map_qt_library(feature.group(2))) else: feature = featureName(feature.group(2)) if feature.startswith('system_') and substitute_libs(feature[7:]) != feature[7:]: @@ -788,14 +811,13 @@ def map_condition(condition: str) -> str: def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, indent: int = 0) -> None: ind = ' ' * indent - for sd in scope.get('SUBDIRS', []): - full_sd = os.path.join(scope.basedir, sd) - if os.path.isdir(full_sd): + for sd in scope.get_files('SUBDIRS'): + if os.path.isdir(sd): cm_fh.write('{}add_subdirectory({})\n'.format(ind, sd)) - elif os.path.isfile(full_sd): - subdir_result = parseProFile(full_sd, debug=False) + elif os.path.isfile(sd): + subdir_result = parseProFile(sd, debug=False) subdir_scope \ - = Scope.FromDict(scope, full_sd, + = Scope.FromDict(scope, sd, subdir_result.asDict().get('statements'), '', scope.basedir) @@ -820,7 +842,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, cm_fh.write('{}endif()\n'.format(ind)) -def sort_sources(sources) -> typing.List[str]: +def sort_sources(sources: typing.List[str]) -> typing.List[str]: to_sort = {} # type: typing.Dict[str, typing.List[str]] for s in sources: if s is None: @@ -859,47 +881,53 @@ def write_scope_header(cm_fh: typing.IO[str], *, indent: int = 0): '##########################\n'.format(spaces(indent))) +def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, + keys: typing.List[str], indent: int = 0, *, + header: str = '', footer: str = ''): + ind = spaces(indent) + + # collect sources + sources: typing.List[str] = [] + for key in keys: + sources += scope.get_files(key, use_vpath=True) + + if not sources: + return + + cm_fh.write(header) + extra_indent = '' + if cmake_parameter: + cm_fh.write('{} {}\n'.format(ind, cmake_parameter)) + extra_indent = ' ' + for s in sort_sources(sources): + cm_fh.write('{} {}{}\n'.format(ind, extra_indent, s)) + cm_fh.write(footer) + + def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0, known_libraries=set()): ind = spaces(indent) # mark RESOURCES as visited: - scope.get('RESOURCES', '') + scope.get('RESOURCES') - plugin_type = scope.get('PLUGIN_TYPE') + plugin_type = scope.get_string('PLUGIN_TYPE') if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) - vpath = scope.expand('VPATH') + source_keys: typing.List[str] = [] + write_source_file_list(cm_fh, scope, 'SOURCES', + ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'], + indent) - sources = scope.expand('SOURCES') + scope.expand('HEADERS') \ - + scope.expand('OBJECTIVE_SOURCES') + scope.expand('NO_PCH_SOURCES') \ - + scope.expand('FORMS') - - sources = [map_source_to_cmake(s, scope.basedir, vpath) for s in sources] - if sources: - cm_fh.write('{} SOURCES\n'.format(ind)) - for l in sort_sources(sources): - cm_fh.write('{} {}\n'.format(ind, l)) - - dbus_adaptors = scope.expand('DBUS_ADAPTORS') - if dbus_adaptors: - dbus_adaptors = [map_source_to_cmake(s, scope.basedir, vpath) for s in dbus_adaptors] - cm_fh.write('{} DBUS_ADAPTOR_SOURCES\n'.format(ind)) - for d in sort_sources(dbus_adaptors): - cm_fh.write('{} {}\n'.format(ind, d)) + write_source_file_list(cm_fh, scope, 'DBUS_ADAPTOR_SOURCES', ['DBUS_ADAPTORS',], indent) dbus_adaptor_flags = scope.expand('QDBUSXML2CPP_ADAPTOR_HEADER_FLAGS') if dbus_adaptor_flags: cm_fh.write('{} DBUS_ADAPTOR_FLAGS\n'.format(ind)) cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_adaptor_flags))) - dbus_interfaces = scope.expand('DBUS_INTERFACES') - if dbus_interfaces: - dbus_interfaces = [map_source_to_cmake(s, scope.basedir, vpath) for s in dbus_interfaces] - cm_fh.write('{} DBUS_INTERFACE_SOURCES\n'.format(ind)) - for d in sort_sources(dbus_interfaces): - cm_fh.write('{} {}\n'.format(ind, d)) + write_source_file_list(cm_fh, scope, 'DBUS_INTERFACE_SOURCES', ['DBUS_INTERFACES',], indent) dbus_interface_flags = scope.expand('QDBUSXML2CPP_INTERFACE_HEADER_FLAGS') if dbus_interface_flags: cm_fh.write('{} DBUS_INTERFACE_FLAGS\n'.format(ind)) @@ -912,12 +940,11 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, d = d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') cm_fh.write('{} {}\n'.format(ind, d)) - includes = scope.expand('INCLUDEPATH') + includes = scope.get_files('INCLUDEPATH') if includes: cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) for i in includes: i = i.rstrip('/') or ('/') - i = map_source_to_cmake(i, scope.basedir, vpath) cm_fh.write('{} {}\n'.format(ind, i)) dependencies = [map_qt_library(q) for q in scope.expand('QT') @@ -1189,15 +1216,13 @@ def write_resources(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in vpath = scope.expand('VPATH') # Handle QRC files by turning them into add_qt_resource: - resources = scope.expand('RESOURCES') + resources = scope.get_files('RESOURCES') qrc_output = '' if resources: qrc_only = True for r in resources: if r.endswith('.qrc'): - qrc_output += process_qrc_file(target, - map_source_to_cmake(r, scope.basedir, vpath), - scope.basedir) + qrc_output += process_qrc_file(target, r, scope.basedir) else: qrc_only = False @@ -1267,18 +1292,14 @@ def write_simd_part(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in for simd in simd_options: SIMD = simd.upper(); - sources = scope.get('{}_HEADERS'.format(SIMD), []) \ - + scope.get('{}_SOURCES'.format(SIMD), []) \ - + scope.get('{}_C_SOURCES'.format(SIMD), []) \ - + scope.get('{}_ASM'.format(SIMD), []) - - if not sources: - continue - - cm_fh.write('{}add_qt_simd_part({} SIMD {}\n'.format(ind, target, simd)) - cm_fh.write('{} SOURCES\n'.format(ind)) - cm_fh.write('{} {}\n'.format(ind, '\n{} '.format(ind).join(sources))) - cm_fh.write('{})\n\n'.format(ind)) + write_source_file_list(cm_fh, scope, 'SOURCES', + ['{}_HEADERS'.format(SIMD), + '{}_SOURCES'.format(SIMD), + '{}_C_SOURCES'.format(SIMD), + '{}_ASM'.format(SIMD)], + indent, + header = '{}add_qt_simd_part({} SIMD {}\n'.format(ind, target, simd), + footer = '{})\n\n'.format(ind)) def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, @@ -1294,7 +1315,6 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, total_scopes = len(scopes) # Merge scopes based on their conditions: scopes = merge_scopes(scopes) - print("xxxxxx {} scopes, {} after merging!".format(total_scopes, len(scopes))) assert len(scopes) assert scopes[0].total_condition == 'ON' @@ -1355,10 +1375,9 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, known_libraries={'Qt::Core', }, extra_keys=[]) if 'qt_tracepoints' in scope.get('CONFIG'): - tracepoints = map_to_file(scope.getString('TRACEPOINT_PROVIDER'), - scope.basedir, scope.currentdir) + tracepoints = scope.get_files('TRACEPOINT_PROVIDER') cm_fh.write('\n\n{}qt_create_tracepoints({} {})\n' - .format(spaces(indent), module_name[2:], tracepoints)) + .format(spaces(indent), module_name[2:], ' '.join(tracepoints))) def write_tool(cm_fh: typing.IO[str], scope: Scope, *, @@ -1389,7 +1408,7 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, extra = ['GUI',] if gui else[] - target_path = scope.getString('target.path') + target_path = scope.get_string('target.path') if target_path: target_path = target_path.replace('$$[QT_INSTALL_EXAMPLES]', '${INSTALL_EXAMPLESDIR}') extra.append('OUTPUT_DIRECTORY "{}"'.format(target_path)) @@ -1414,13 +1433,13 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, assert scope.TEMPLATE in ('app', 'lib') is_lib = scope.TEMPLATE == 'lib' - is_plugin = any('qt_plugin' == s for s in scope.get('_LOADED', [])) + is_plugin = any('qt_plugin' == s for s in scope.get('_LOADED')) - if is_lib or 'qt_module' in scope.get('_LOADED', []): + if is_lib or 'qt_module' in scope.get('_LOADED'): write_module(cm_fh, scope, indent=indent) elif is_plugin: write_plugin(cm_fh, scope, indent=indent) - elif 'qt_tool' in scope.get('_LOADED', []): + elif 'qt_tool' in scope.get('_LOADED'): write_tool(cm_fh, scope, indent=indent) else: if 'testcase' in scope.get('CONFIG') \ @@ -1430,12 +1449,12 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, gui = 'console' not in scope.get('CONFIG') write_binary(cm_fh, scope, gui, indent=indent) - docs = scope.getString("QMAKE_DOCS") - if docs: - cm_fh.write("\n{}add_qt_docs({})\n" - .format(spaces(indent), - map_to_file(docs, scope.basedir, - scope.currentdir))) + ind = spaces(indent) + write_source_file_list(cm_fh, scope, '', + ['QMAKE_DOCS',], + indent, + header = '{}add_qt_docs(\n'.format(ind), + footer = '{})\n'.format(ind)) def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, @@ -1462,9 +1481,7 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: for c in scope.children: do_include(c) - for i in scope._INCLUDED: - dir = scope.basedir - include_file = i + for include_file in scope.get_files('_INCLUDED', is_include=True): if not include_file: continue if not os.path.isfile(include_file): @@ -1475,7 +1492,7 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: include_scope \ = Scope.FromDict(None, include_file, include_result.asDict().get('statements'), - '', dir) # This scope will be merged into scope! + '', scope.basedir) # This scope will be merged into scope! do_include(include_scope) From 8c28c8546555c135b642f2a845c26815b085a427 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 14:00:59 +0200 Subject: [PATCH 0396/1322] CMake: pro2cmake.py: Strip '-D' from compile options Change-Id: I8239d36dc6af1b5eeded7f293dd6c151c10e289f Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9f40194d0a6..1cb3691f146 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -982,6 +982,8 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, if compile_options: cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind)) for co in compile_options: + if co.startswith('-D'): + co = co[2:] cm_fh.write('{} "{}"\n'.format(ind, co)) link_options = scope.get('QMAKE_LFLAGS') From 3cf92ab183eec9caadcba4ababcf7ea644f711dd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 14:44:34 +0200 Subject: [PATCH 0397/1322] CMake: pro2cmake.py: Better separation between public and private libraries Change-Id: I95a941ae92a77e049437d3cdd7d06eece11588f4 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 97 ++++++++++++++++++++++++++++------------- 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 1cb3691f146..402589451e4 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -904,6 +904,68 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, cm_fh.write(footer) +def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, + dependencies: typing.List[str], *, indent: int = 0): + dependencies_to_print = [] + is_framework = False + + for d in dependencies: + if d == '-framework': + is_framework = True + continue + if is_framework: + d = '${FW%s}' % d + if d.startswith('-l'): + d = d[2:] + + if d.startswith('-'): + d = '# Remove: {}'.format(d[1:]) + else: + d = substitute_libs(d) + dependencies_to_print.append(d) + is_framework = False + + if dependencies_to_print: + ind = spaces(indent) + cm_fh.write('{} {}\n'.format(ind, cmake_keyword)) + for d in sorted(list(set(dependencies_to_print))): + cm_fh.write('{} {}\n'.format(ind, d)) + + + +def write_library_section(cm_fh: typing.IO[str], scope: Scope, + public: typing.List[str], + private: typing.List[str], + mixed: typing.List[str], *, + indent: int = 0, known_libraries=set()): + public_dependencies = [] # typing.List[str] + private_dependencies = [] # typing.List[str] + + for key in public: + public_dependencies += [map_qt_library(q) for q in scope.expand(key) + if map_qt_library(q) not in known_libraries] + for key in private: + private_dependencies += [map_qt_library(q) for q in scope.expand(key) + if map_qt_library(q) not in known_libraries] + for key in mixed: + for lib in scope.expand(key): + if map_qt_library(lib) in known_libraries: + continue + + if lib.endswith('-private'): + mapped_lib_name = map_qt_base_library(lib[0:-8]) + if mapped_lib_name: + private_dependencies.append(mapped_lib_name + 'Private') + public_dependencies.append(mapped_lib_name) + continue + + public_dependencies.append(lib) + + write_library_list(cm_fh, 'LIBRARIES', private_dependencies, indent=indent) + write_library_list(cm_fh, 'PUBLIC_LIBRARIES', public_dependencies, indent=indent) + + + def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0, known_libraries=set()): ind = spaces(indent) @@ -947,36 +1009,11 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, i = i.rstrip('/') or ('/') cm_fh.write('{} {}\n'.format(ind, i)) - dependencies = [map_qt_library(q) for q in scope.expand('QT') - if map_qt_library(q) not in known_libraries] - dependencies += [map_qt_library(q) for q in scope.expand('QT_FOR_PRIVATE') - if map_qt_library(q) not in known_libraries] - dependencies += scope.expand('QMAKE_USE_PRIVATE') + scope.expand('QMAKE_USE') \ - + scope.expand('LIBS_PRIVATE') + scope.expand('LIBS') - if dependencies: - dependencies_to_print = [] - is_framework = False - - for d in dependencies: - if d == '-framework': - is_framework = True - continue - if is_framework: - d = '${FW%s}' % d - if d.startswith('-l'): - d = d[2:] - - if d.startswith('-'): - d = '# Remove: {}'.format(d[1:]) - else: - d = substitute_libs(d) - dependencies_to_print.append(d) - is_framework = False - - if dependencies_to_print: - cm_fh.write('{} LIBRARIES\n'.format(ind)) - for d in sorted(list(set(dependencies_to_print))): - cm_fh.write('{} {}\n'.format(ind, d)) + write_library_section(cm_fh, scope, + ['QMAKE_USE', 'LIBS'], + ['QT_FOR_PRIVATE', 'QMAKE_USE_PRIVATE', 'LIBS_PRIVATE'], + ['QT',], + indent=indent, known_libraries=known_libraries) compile_options = scope.get('QMAKE_CXXFLAGS') if compile_options: From 3bc9586e617447be4453a7e882e7898ffdd7d8b6 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 14:45:01 +0200 Subject: [PATCH 0398/1322] CMake: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINES Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 402589451e4..34921b4e375 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -996,6 +996,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_interface_flags))) defines = scope.expand('DEFINES') + defines += [d[2:] for d in scope.expand('QMAKE_CXXFLAGS') if d.startswith('-D')] if defines: cm_fh.write('{} DEFINES\n'.format(ind)) for d in defines: @@ -1015,12 +1016,10 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, ['QT',], indent=indent, known_libraries=known_libraries) - compile_options = scope.get('QMAKE_CXXFLAGS') + compile_options = [d for d in scope.expand('QMAKE_CXXFLAGS') if not d.startswith('-D')] if compile_options: cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind)) for co in compile_options: - if co.startswith('-D'): - co = co[2:] cm_fh.write('{} "{}"\n'.format(ind, co)) link_options = scope.get('QMAKE_LFLAGS') From 9afc605eb5dea636d3805b0a4e14294030595da3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 8 Apr 2019 16:07:23 +0200 Subject: [PATCH 0399/1322] CMake: Fix mappings in helper.py Some of the Qt names were wrong. Fix them and remove the work-arounds in the library mappings. Change-Id: I9b9afa3fb35c578e5c8d9cdef77224eb072ec8da Reviewed-by: Simon Hausmann --- util/cmake/helper.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index b2f06d1a341..5a22ff523d8 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -69,7 +69,7 @@ def map_qt_base_library(lib: str) -> str: 'fbconvenience': 'Qt::FbSupport', 'fontdatabase_support': 'Qt::FontDatabaseSupport', 'gamepad': 'Qt::Gamepad', - 'glxconvenience': 'Qt::GlxSupport', + 'glx_support': 'Qt::GlxSupport', 'graphics_support': 'Qt::GraphicsSupport', 'gsttools': 'Qt::MultimediaGstTools', 'gui': 'Qt::Gui', @@ -82,7 +82,7 @@ def map_qt_base_library(lib: str) -> str: 'kms_support': 'Qt::KmsSupport', 'launcher-lib': 'Qt::AppManLauncher', 'lib': 'Qt::Designer', - 'linuxaccessibility': 'Qt::LinuxAccessibilitySupport', + 'linuxaccessibility_support': 'Qt::LinuxAccessibilitySupport', 'location': 'Qt::Location', 'logic': 'Qt::3DLogic', 'macextras': 'Qt::MacExtras', @@ -140,8 +140,7 @@ def map_qt_base_library(lib: str) -> str: 'uiplugin': 'Qt::UiPlugin', 'uitools': 'Qt::UiTools', 'virtualkeyboard': 'Qt::VirtualKeyboard', - 'vkconvenience': 'Qt::VulkanSupport', - 'vulkan_supportPrivate': 'Qt::VulkanSupportPrivate', + 'vulkan_support': 'Qt::VulkanSupport', 'webchannel': 'Qt::WebChannel', 'webengine': 'Qt::WebEngine', 'webenginewidgets': 'Qt::WebEngineWidgets', @@ -231,7 +230,6 @@ libray_mapping = { 'libproxy': 'LibProxy::LibProxy', 'librt': 'WrapRt', 'libudev': 'PkgConfig::Libudev', - 'linuxaccessibility_supportPrivate': 'Qt::LinuxAccessibilitySupportPrivate', 'mtdev': 'PkgConfig::Mtdev', 'odbc': 'ODBC::ODBC', 'pcre2': 'PCRE2', @@ -239,7 +237,6 @@ libray_mapping = { 'sqlite': 'SQLite::SQLite3', 'SQLite3': 'SQLite::SQLite3', 'tslib': 'PkgConfig::Tslib', - 'vulkan_supportPrivate': 'Qt::VulkanSupportPrivate', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', 'xcb_icccm': 'XCB::ICCCM', 'xcb_image': 'XCB::IMAGE', From f0cc730197a490afb7372c8122f2eccea85ba7d1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 3 Apr 2019 15:15:33 +0200 Subject: [PATCH 0400/1322] Fix FindWrapOpenGL to choose the correct GL implementation The find_package() call for WrapOpenGL was moved to the beginning of the src/gui project file. This was incorrect, because the features were not yet computed at that time, and the find module was incorrectly always choosing the Desktop GL implementation. Move the find_package() after the add_qt_module() call. Amends 4f736db08c43fdbe4cfea8da7bf12fac5a0ec6ce. Task-number: QTBUG-74133 Change-Id: Ice1da8f23275843c7285ec748e6d673edbffffac Reviewed-by: Tobias Hunger --- src/gui/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 6a8bdb2d315..b3d0f9fcb53 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,8 +1,6 @@ # special case: set(OpenGL_GL_PREFERENCE GLVND) -find_package(WrapOpenGL) # special case - ##################################################################### ## Gui Module: ##################################################################### @@ -441,6 +439,14 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h ) +# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf +# acted like WrapOpenGL: direct linkage against either libGLESv2 or +# libGL, depending on the opengl _feature_. This is done by hand now +# here (where the feature is available). +# DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not +# available until the add_qt_module call. +find_package(WrapOpenGL) # special case + extend_target(Gui CONDITION QT_FEATURE_opengl SOURCES kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h From 341729db15ff52b037141092d462b1c92a7f669a Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 9 Apr 2019 10:42:31 +0200 Subject: [PATCH 0401/1322] cmake: use WindowsUIAutomationSupportPrivate for windows plugin Change-Id: Ie7d74ff3431b1ac9bac4255d561ae2c2fb28550a Reviewed-by: Alexandru Croitor --- src/plugins/platforms/windows/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index 84f5ab1ce00..c665d75af77 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -188,9 +188,9 @@ add_qt_resource(qwindows "cursors" PREFIX "/qt-project.org/windows/cursors" FILE images/splitvcursor_64.png) -extend_target(qwindows CONDITION (QT_FEATURE_accessibility) AND (TARGET windowsuiautomation_supportPrivate) +extend_target(qwindows CONDITION (QT_FEATURE_accessibility) AND (TARGET WindowsUIAutomationSupportPrivate) LIBRARIES - windowsuiautomation_supportPrivate + Qt::WindowsUIAutomationSupportPrivate ) extend_target(qwindows CONDITION QT_FEATURE_accessibility AND mingw From 511124bf1d297f8561cbca3b768ef24a12eb36cb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 9 Apr 2019 11:35:18 +0200 Subject: [PATCH 0402/1322] CMake: pro2cmake.py: Fix plugin type only prints first letter Change-Id: Ib8989d2c13199d804d0c069903ca1c5eb61763e6 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 34921b4e375..9399be5f336 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -976,7 +976,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, plugin_type = scope.get_string('PLUGIN_TYPE') if plugin_type: - cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type[0])) + cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type)) source_keys: typing.List[str] = [] write_source_file_list(cm_fh, scope, 'SOURCES', From f233249207441d173565364ff04a7adc8d010c97 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 9 Apr 2019 11:30:50 +0200 Subject: [PATCH 0403/1322] CMake: FindATSPI2: Ignore repeated attempts to find ATSPI2 Change-Id: I4d6f59d144910d2f194f73e3b9bc8a5cc6726bcd Reviewed-by: Alexandru Croitor --- cmake/FindATSPI2.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/FindATSPI2.cmake b/cmake/FindATSPI2.cmake index eb87a33e84f..4e1ade0d077 100644 --- a/cmake/FindATSPI2.cmake +++ b/cmake/FindATSPI2.cmake @@ -1,3 +1,5 @@ include(FindPkgConfig) -pkg_check_modules(ATSPI2 atspi-2 IMPORTED_TARGET) +if(NOT TARGET PkgConfig::ATSPI2) + pkg_check_modules(ATSPI2 atspi-2 IMPORTED_TARGET) +endif() From b7a55b09313b8566709fbec9c67ea385a6480b1e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Apr 2019 17:03:36 +0200 Subject: [PATCH 0404/1322] On second thought, install tracegen and qfloat16-tables tools They are not needed per se for a host build, but they are still needed for a cross build (because we don't build tools in that case). Task-number: QTBUG-74133 Change-Id: I891e3852c6846119956982a7bdbf449ad7c4836c Reviewed-by: Tobias Hunger --- src/tools/qfloat16-tables/CMakeLists.txt | 1 - src/tools/tracegen/CMakeLists.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/src/tools/qfloat16-tables/CMakeLists.txt b/src/tools/qfloat16-tables/CMakeLists.txt index 304264f16f8..f437ccc8db9 100644 --- a/src/tools/qfloat16-tables/CMakeLists.txt +++ b/src/tools/qfloat16-tables/CMakeLists.txt @@ -6,7 +6,6 @@ add_qt_tool(qfloat16-tables BOOTSTRAP - NO_INSTALL SOURCES gen_qfloat16_tables.cpp # CONFIG = "force_bootstrap" diff --git a/src/tools/tracegen/CMakeLists.txt b/src/tools/tracegen/CMakeLists.txt index 1300b0c3bca..bfb33d77c51 100644 --- a/src/tools/tracegen/CMakeLists.txt +++ b/src/tools/tracegen/CMakeLists.txt @@ -6,7 +6,6 @@ add_qt_tool(tracegen BOOTSTRAP - NO_INSTALL SOURCES etw.cpp etw.h helpers.cpp helpers.h From 677a7a3066c91f93f523aca7d630af679b329eba Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 9 Apr 2019 13:20:19 +0200 Subject: [PATCH 0405/1322] CMake: Fix mappings in helper.py - WUIAS This amends 9afc605eb5dea636d3805b0a4e14294030595da3. Change-Id: If246811d267d091c692875a1645c96767f781010 Reviewed-by: Tobias Hunger --- util/cmake/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 5a22ff523d8..f5573c3facc 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -148,7 +148,7 @@ def map_qt_base_library(lib: str) -> str: 'webview': 'Qt::WebView', 'widgets': 'Qt::Widgets', 'window-lib': 'Qt::AppManWindow', - 'windowsuiautomation': 'Qt::WindowsUIAutomationSupport', + 'windowsuiautomation_support': 'Qt::WindowsUIAutomationSupport', 'winextras': 'Qt::WinExtras', 'x11extras': 'Qt::X11Extras', 'xcb_qpa_lib': 'Qt::XcbQpa', From e7c992755ea4826b0271bb408ae5d7a011e0e19f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 8 Apr 2019 17:10:23 +0200 Subject: [PATCH 0406/1322] Turn off linker version script support on macOS The test erroneously succeeds on macOS with an XCode generator. Explicitly set the test result to be turned off. Change-Id: Id6fcb96f420f611517e81cc3697f1c88b508bd7c Reviewed-by: Tobias Hunger --- cmake/QtBaseConfigureTests.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index 5a345cbc3c6..7a5502bc651 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -121,6 +121,13 @@ VERS_1; endif() file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") + # For some reason the linker command line written by the XCode generator, which is + # subsequently executed by xcodebuild, ignores the linker flag, and thus the test + # seemingly succeeds. Explicitly disable the version script test on darwin platforms. + if(APPLE) + set(HAVE_LD_VERSION_SCRIPT OFF) + endif() + set(TEST_ld_version_script "${HAVE_LD_VERSION_SCRIPT}" CACHE INTERNAL "linker version script support") endfunction() From be0cf9f8d7bb23936301eadd2af1e4172d1b9f0e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 9 Apr 2019 15:31:21 +0200 Subject: [PATCH 0407/1322] Regenerate cocoa platform plugin Change-Id: I701b6c20566448074f3a51cef698c89a3b6e21eb Reviewed-by: Tobias Hunger --- src/plugins/platforms/cocoa/CMakeLists.txt | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 20f90ea95dc..2f1ae9a565a 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -44,7 +44,14 @@ add_qt_plugin(qcocoa qnswindow.h qnswindow.mm qnswindowdelegate.h qnswindowdelegate.mm LIBRARIES - ${FWcups} + Qt::AccessibilitySupportPrivate + Qt::ClipboardSupportPrivate + Qt::CorePrivate + Qt::FontDatabaseSupportPrivate + Qt::GraphicsSupportPrivate + Qt::GuiPrivate + Qt::ThemeSupportPrivate + PUBLIC_LIBRARIES ${FWAppKit} ${FWCarbon} ${FWCoreServices} @@ -53,13 +60,13 @@ add_qt_plugin(qcocoa ${FWMetal} ${FWQuartzCore} Cups::Cups - Qt::AccessibilitySupportPrivate - Qt::ClipboardSupportPrivate - Qt::CorePrivate - Qt::FontDatabaseSupportPrivate - Qt::GraphicsSupportPrivate - Qt::GuiPrivate - Qt::ThemeSupportPrivate + Qt::AccessibilitySupport + Qt::ClipboardSupport + Qt::Core + Qt::FontDatabaseSupport + Qt::GraphicsSupport + Qt::Gui + Qt::ThemeSupport ) # Resources: @@ -69,7 +76,7 @@ add_qt_resource(qcocoa "qcocoaresources" PREFIX "/qt-project.org/mac/cursors" FI images/waitcursor.png) -#### Keys ignored in scope 1:.:cocoa.pro:: +#### Keys ignored in scope 1:.:.:./cocoa.pro:: # CONFIG = "no_app_extension_api_only" # OTHER_FILES = "cocoa.json" # PLUGIN_CLASS_NAME = "QCocoaIntegrationPlugin" @@ -90,6 +97,8 @@ extend_target(qcocoa CONDITION QT_FEATURE_vulkan qcocoavulkaninstance.h qcocoavulkaninstance.mm LIBRARIES Qt::VulkanSupportPrivate + PUBLIC_LIBRARIES + Qt::VulkanSupport ) extend_target(qcocoa CONDITION TARGET Qt::Widgets @@ -101,9 +110,12 @@ extend_target(qcocoa CONDITION TARGET Qt::Widgets LIBRARIES Qt::PrintSupportPrivate Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::PrintSupport + Qt::Widgets ) -#### Keys ignored in scope 5:.:cocoa.pro:TARGET Qt::Widgets: +#### Keys ignored in scope 5:.:.:./cocoa.pro:TARGET Qt::Widgets: # QT_FOR_CONFIG = "widgets" extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_colordialog) @@ -121,5 +133,5 @@ extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_fontdialog) qcocoafontdialoghelper.h qcocoafontdialoghelper.mm ) -#### Keys ignored in scope 9:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 9:.:.:./cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" From 92b0d7b9110dde7db56f10d7c34a21876fb27fe3 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 28 Mar 2019 15:25:17 +0100 Subject: [PATCH 0408/1322] CMake: Support /nolink libraries Add a helper function to QtBuild that generates Foo_nolink versions of Foo library targets. Map 'Foo/nolink' libs found in qmake to Foo_nolink. Automatically run helper function to create _nolink targets as part of extend_target. Change-Id: I4c23ea68b3037d23c9a31d4ac272a6bd0565f7c0 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 38 +++++++++++++++++++++ src/network/CMakeLists.txt | 69 +++++++++++++++++++------------------- util/cmake/helper.py | 7 +++- util/cmake/pro2cmake.py | 2 +- 4 files changed, 79 insertions(+), 37 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index da5b8d0afb1..5a323264e91 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -156,6 +156,37 @@ macro(assert) endmacro() +function(qt_create_nolink_target target) + if(NOT TARGET "${target}") + message(FATAL_ERROR "${target} does not exist when trying to build a nolink target.") + endif() + get_target_property(type "${target}" TYPE) + if(type STREQUAL EXECUTABLE) + message(FATAL_ERROR "${target} must be a library of some kind.") + endif() + if(type STREQUAL OBJECT_LIBRARY) + message(FATAL_ERROR "${target} must not be an object library.") + endif() + + set(nolink_target "${target}_nolink") + if(NOT TARGET "${nolink_target}") + string(REPLACE ":" "_" base_target "__${nolink_target}") + add_library("${base_target}" INTERFACE) + target_include_directories("${base_target}" INTERFACE + $) + target_include_directories("${base_target}" INTERFACE SYSTEM + $) + target_compile_definitions("${base_target}" INTERFACE + $) + target_compile_options("${base_target}" INTERFACE + $) + target_compile_features("${base_target}" INTERFACE + $) + + add_library("${nolink_target}" ALIAS "${base_target}") + endif() +endfunction() + function(qt_ensure_perl) if(DEFINED HOST_PERL) return() @@ -357,6 +388,13 @@ function(extend_target target) list(APPEND dbus_sources "${sources}") endforeach() + foreach(lib ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES}) + string(REGEX REPLACE "_nolink$" "" base_lib "${lib}") + if(NOT base_lib STREQUAL lib) + qt_create_nolink_target("${base_lib}") + endif() + endforeach() + target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) if (arg_COMPILE_FLAGS) set_source_files_properties(${arg_SOURCES} PROPERTIES COMPILE_FLAGS "${arg_COMPILE_FLAGS}") diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index b5a3088018b..180afb7cc52 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from network.pro. - ##################################################################### ## Network Module: ##################################################################### @@ -55,16 +53,17 @@ add_qt_module(Network kernel LIBRARIES Qt::CorePrivate - ZLIB::ZLIB # special case - PUBLIC_LIBRARIES # special case + ZLIB::ZLIB # special case + PUBLIC_LIBRARIES Qt::Core - # MODULE_PLUGIN_TYPES = "bearer" - # MODULE_WINRT_CAPABILITIES = "internetClient" "internetClientServer" "privateNetworkClientServer" - # PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" - # QMAKE_LIBS = "$$QMAKE_LIBS_NETWORK" - # _LOADED = "qt_module" ) +#### Keys ignored in scope 1:.:.:network.pro:: +# MODULE_PLUGIN_TYPES = "bearer" +# MODULE_WINRT_CAPABILITIES = "internetClient" "internetClientServer" "privateNetworkClientServer" +# QMAKE_LIBS = "$$QMAKE_LIBS_NETWORK" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -72,13 +71,12 @@ extend_target(Network CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386" LINK_OPTIONS "/BASE:0x64000000" ) -# -#extend_target(Network CONDITION QT_FEATURE_bearermanagement -# # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroidBearer.jar" -# # ANDROID_LIB_DEPENDENCIES = "plugins/bearer/libqandroidbearer.so" -# # ANDROID_PERMISSIONS = "android.permission.ACCESS_NETWORK_STATE" -# # MODULE_PLUGIN_TYPES = "bearer" -#) + +#### Keys ignored in scope 3:.:.:network.pro:QT_FEATURE_bearermanagement: +# ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroidBearer.jar" +# ANDROID_LIB_DEPENDENCIES = "plugins/bearer/libqandroidbearer.so" +# ANDROID_PERMISSIONS = "android.permission.ACCESS_NETWORK_STATE" +# MODULE_PLUGIN_TYPES = "bearer" extend_target(Network CONDITION QT_FEATURE_ftp SOURCES @@ -101,8 +99,8 @@ extend_target(Network CONDITION APPLE_OSX SOURCES kernel/qnetworkproxy_mac.cpp LIBRARIES - ${FWSecurity} ${FWCoreFoundation} + ${FWSecurity} ) extend_target(Network CONDITION WASM @@ -168,6 +166,7 @@ extend_target(Network CONDITION UNIX AND NOT QT_FEATURE_linux_netlink extend_target(Network CONDITION ANDROID AND QT_FEATURE_dnslookup SOURCES + # kernel/qdnslookup_unix.cpp # special case: No more need to remove this kernel/qdnslookup_android.cpp ) @@ -182,9 +181,9 @@ extend_target(Network CONDITION WIN32 AND NOT WINRT kernel/qnetworkproxy_win.cpp socket/qnativesocketengine_win.cpp LIBRARIES + advapi32 dnsapi iphlpapi - advapi32 ) extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32 AND NOT WINRT @@ -218,8 +217,8 @@ extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT APPLE_OSX AND (UNIX SOURCES kernel/qnetworkproxy_libproxy.cpp LIBRARIES - LibProxy::LibProxy ${CMAKE_DL_LIBS} + LibProxy::LibProxy ) extend_target(Network CONDITION NOT APPLE_OSX AND NOT QT_FEATURE_libproxy AND (UNIX OR WINRT) @@ -343,8 +342,8 @@ extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_opensslv11 AND ssl/qsslcontext_openssl11.cpp ssl/qsslsocket_openssl11.cpp ssl/qsslsocket_openssl11_symbols_p.h - DEFINES # special case - "OPENSSL_API_COMPAT=0x10100000L" + DEFINES + OPENSSL_API_COMPAT=0x10100000L ) extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_opensslv11 @@ -363,14 +362,16 @@ extend_target(Network CONDITION ANDROID AND QT_FEATURE_openssl AND QT_FEATURE_ss SOURCES ssl/qsslsocket_openssl_android.cpp ) -# -#extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_openssl_linked AND QT_FEATURE_ssl -# # QMAKE_USE_FOR_PRIVATE = "openssl" -#) -# -#extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_openssl_linked -# # QMAKE_USE_FOR_PRIVATE = "openssl/nolink" -#) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_openssl_linked AND QT_FEATURE_ssl + LIBRARIES + OpenSSL::SSL +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_openssl_linked + LIBRARIES + OpenSSL::SSL_nolink +) extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 SOURCES @@ -379,10 +380,8 @@ extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 crypt32 ) -# Special case, from mkspecs/common/msvc-desktop.conf -extend_target(Network CONDITION WIN32 - LIBRARIES - ws2_32 -) +extend_target(Network CONDITION WIN32 LIBRARIES ws2_32) # special case: mkspecs/common/msvc-desktop.conf -add_qt_docs(./doc/qtnetwork.qdocconf) +add_qt_docs( + ./doc/qtnetwork.qdocconf +) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index f5573c3facc..9de01df32f0 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -232,6 +232,7 @@ libray_mapping = { 'libudev': 'PkgConfig::Libudev', 'mtdev': 'PkgConfig::Mtdev', 'odbc': 'ODBC::ODBC', + 'openssl': 'OpenSSL::SSL', 'pcre2': 'PCRE2', 'psql': 'PostgreSQL::PostgreSQL', 'sqlite': 'SQLite::SQLite3', @@ -263,4 +264,8 @@ libray_mapping = { def substitute_libs(lib: str) -> str: - return libray_mapping.get(lib, lib) + libpostfix = '' + if lib.endswith('/nolink'): + lib = lib[:-7] + libpostfix = '_nolink' + return libray_mapping.get(lib, lib) + libpostfix diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 9399be5f336..7f4af835ffc 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1012,7 +1012,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, write_library_section(cm_fh, scope, ['QMAKE_USE', 'LIBS'], - ['QT_FOR_PRIVATE', 'QMAKE_USE_PRIVATE', 'LIBS_PRIVATE'], + ['QT_FOR_PRIVATE', 'QMAKE_USE_PRIVATE', 'QMAKE_USE_FOR_PRIVATE', 'LIBS_PRIVATE'], ['QT',], indent=indent, known_libraries=known_libraries) From dac32e95d632cc1d52304160a29c1ad6595baa37 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 10 Apr 2019 10:36:57 +0200 Subject: [PATCH 0409/1322] CMake: Update src/corelib Change-Id: I0321883f762460b146666bfbad0d8b27c3fdeadd Reviewed-by: Alexandru Croitor --- cmake/FindAtomic.cmake | 2 +- src/corelib/CMakeLists.txt | 318 ++++++++++++++++++------------------- 2 files changed, 160 insertions(+), 160 deletions(-) diff --git a/cmake/FindAtomic.cmake b/cmake/FindAtomic.cmake index 66763786863..b4580067ca5 100644 --- a/cmake/FindAtomic.cmake +++ b/cmake/FindAtomic.cmake @@ -29,7 +29,7 @@ if(NOT HAVE_STDATOMIC) set(CMAKE_REQUIRE_LIBRARIES "${_req_libraries}") endif() -add_library(Atomic INTERFACE) +add_library(Atomic INTERFACE IMPORTED) if(HAVE_STDATOMIC_WITH_LIB) target_link_libraries(Atomic INTERFACE atomic) endif() diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 2059ec6f0c2..c345f648deb 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -16,6 +16,7 @@ endif() add_qt_module(Core SOURCES + # special case: remove ../3rdparty/harfbuzz animation/qabstractanimation.cpp animation/qabstractanimation.h animation/qabstractanimation_p.h animation/qanimationgroup.cpp animation/qanimationgroup.h animation/qanimationgroup_p.h animation/qparallelanimationgroup.cpp animation/qparallelanimationgroup.h animation/qparallelanimationgroup_p.h @@ -232,73 +233,22 @@ add_qt_module(Core QT_NO_USING_NAMESPACE QT_NO_FOREACH INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_BINARY_DIR}/global # special case for qconfig.cpp - LIBRARIES # special case: - Qt::GlobalConfigPrivate - QtHarfBuzz - Threads::Threads - tinycbor - WrapDoubleConversion + ${CMAKE_CURRENT_BINARY_DIR}/global # special case + # special case: remove ../3rdparty/... + LIBRARIES ZLIB::ZLIB + # double-conversion # special case + Qt::GlobalConfigPrivate # special case + QtHarfBuzz # special case + Threads::Threads # special case + tinycbor # special case + WrapDoubleConversion # special case PUBLIC_LIBRARIES # special case: Qt::Platform DISABLE_AUTOGEN_TOOLS # special case: uic - # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" - # ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" - # ANDROID_PERMISSIONS = "android.permission.INTERNET" "android.permission.WRITE_EXTERNAL_STORAGE" - # CMAKE_DISABLED_FEATURES = "$$joinQT_DISABLED_FEATURES,"$$escape_expand(\\n) "" - # CMAKE_HOST_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA/src],$$[QT_INSTALL_PREFIX]" - # CMAKE_INSTALL_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA],$$[QT_INSTALL_PREFIX]" - # CONFIG = "exceptions" "qt_tracepoints" "$$MODULE_CONFIG" "simd" "optimize_full" - # HOST_BINS = "$$[QT_HOST_BINS]" - # INSTALLS = "ctest_qt5_module_files" "cmake_qt5_umbrella_module_files" - # MIPS_DSP_ASM = "tools/qstring_mips_dsp_asm.S" - # MIPS_DSP_HEADERS = "../gui/painting/qt_mips_asm_dsp_p.h" - # MODULE = "core" - # MODULE_CONFIG = "moc" "resources" - # PRECOMPILED_HEADER = "global/qt_pch.h" - # QMAKE_DSYM_DEBUG_SCRIPT = "$$PWD/debug_script.py" - # QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtCore.dynlist" - # QMAKE_EXTRA_COMPILERS = "qfloat16_tables" - # QMAKE_PKGCONFIG_VARIABLES = "host_bins" "qt_conf" - # QMAKE_QFLOAT16_TABLES_GENERATE = "global/qfloat16.h" - # QMAKE_SUBSTITUTES = "ctest_macros_file" "cmake_umbrella_config_file" "cmake_umbrella_config_module_location" "cmake_umbrella_config_module_location_for_install" "cmake_umbrella_config_version_file" "cmake_extras_mkspec_dir" "cmake_extras_mkspec_dir_for_install" - # TRACEPOINT_PROVIDER = "$$PWD/qtcore.tracepoints" - # TR_EXCLUDE = "../3rdparty/*" - # VERSIONTAGGING_SOURCES = "global/qversiontagging.cpp" - # _LOADED = "qt_module" "cmake_functions" - # cmake_extras_mkspec_dir.input = "$$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in" - # cmake_extras_mkspec_dir.output = "$$DESTDIR/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" - # cmake_extras_mkspec_dir_for_install.input = "$$PWD/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in" - # cmake_extras_mkspec_dir_for_install.output = "$$DESTDIR/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" - # cmake_qt5_umbrella_module_files.files = "$$cmake_umbrella_config_file.output" "$$cmake_umbrella_config_version_file.output" "$$cmake_umbrella_config_module_location_for_install.output" - # cmake_qt5_umbrella_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5" - # cmake_umbrella_config_file.input = "$$PWD/Qt5Config.cmake.in" - # cmake_umbrella_config_file.output = "$$DESTDIR/cmake/Qt5/Qt5Config.cmake" - # cmake_umbrella_config_module_location.input = "$$PWD/Qt5ModuleLocation.cmake.in" - # cmake_umbrella_config_module_location.output = "$$DESTDIR/cmake/Qt5/Qt5ModuleLocation.cmake" - # cmake_umbrella_config_module_location_for_install.input = "$$PWD/Qt5ModuleLocationForInstall.cmake.in" - # cmake_umbrella_config_module_location_for_install.output = "$$DESTDIR/cmake/install/Qt5/Qt5ModuleLocation.cmake" - # cmake_umbrella_config_version_file.input = "$$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in" - # cmake_umbrella_config_version_file.output = "$$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake" - # ctest_macros_file.CONFIG = "verbatim" - # ctest_macros_file.input = "$$PWD/Qt5CTestMacros.cmake" - # ctest_macros_file.output = "$$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake" - # ctest_qt5_module_files.files = "$$ctest_macros_file.output" "$$cmake_extras_mkspec_dir_for_install.output" - # ctest_qt5_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5Core" - # host_bins.name = "host_bins" - # host_bins.variable = "HOST_BINS" - # qfloat16_tables.commands = "$$QMAKE_QFLOAT16_TABLES" "${QMAKE_FILE_OUT}" - # qfloat16_tables.depends = "$$QMAKE_QFLOAT16_TABLES" - # qfloat16_tables.input = "QMAKE_QFLOAT16_TABLES_GENERATE" - # qfloat16_tables.output = "global/qfloat16tables.cpp" - # qfloat16_tables.variable_out = "SOURCES" - # qt_conf.name = "qt_config" - # qt_conf.variable = "QT_CONFIG" ) - # special case: add_dependencies(Core Qt::moc) add_dependencies(Core Qt::rcc) @@ -355,25 +305,71 @@ if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) endif() + +add_qt_simd_part(Core SIMD mips_dsp + SOURCES + ../gui/painting/qt_mips_asm_dsp_p.h + tools/qstring_mips_dsp_asm.S +) + + +#### Keys ignored in scope 1:.:.:corelib.pro:: +# ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" +# ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" +# ANDROID_PERMISSIONS = "android.permission.INTERNET" "android.permission.WRITE_EXTERNAL_STORAGE" +# CMAKE_DISABLED_FEATURES = "$$joinQT_DISABLED_FEATURES,"$$escape_expand(\\n) "" +# CMAKE_HOST_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA/src],$$[QT_INSTALL_PREFIX]" +# CMAKE_INSTALL_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA],$$[QT_INSTALL_PREFIX]" +# CONFIG = "exceptions" "qt_tracepoints" "$$MODULE_CONFIG" "simd" "optimize_full" +# HOST_BINS = "$$[QT_HOST_BINS]" +# INSTALLS = "ctest_qt5_module_files" "cmake_qt5_umbrella_module_files" +# MODULE = "core" +# MODULE_CONFIG = "moc" "resources" +# QMAKE_DSYM_DEBUG_SCRIPT = "$$PWD/debug_script.py" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtCore.dynlist" +# QMAKE_PKGCONFIG_VARIABLES = "host_bins" "qt_conf" +# QMAKE_SUBSTITUTES = "ctest_macros_file" "cmake_umbrella_config_file" "cmake_umbrella_config_module_location" "cmake_umbrella_config_module_location_for_install" "cmake_umbrella_config_version_file" "cmake_extras_mkspec_dir" "cmake_extras_mkspec_dir_for_install" +# _LOADED = "qt_module" "cmake_functions" +# cmake_extras_mkspec_dir.input = "$$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in" +# cmake_extras_mkspec_dir.output = "$$DESTDIR/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" +# cmake_extras_mkspec_dir_for_install.input = "$$PWD/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in" +# cmake_extras_mkspec_dir_for_install.output = "$$DESTDIR/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" +# cmake_qt5_umbrella_module_files.files = "$$cmake_umbrella_config_file.output" "$$cmake_umbrella_config_version_file.output" "$$cmake_umbrella_config_module_location_for_install.output" +# cmake_qt5_umbrella_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5" +# cmake_umbrella_config_file.input = "$$PWD/Qt5Config.cmake.in" +# cmake_umbrella_config_file.output = "$$DESTDIR/cmake/Qt5/Qt5Config.cmake" +# cmake_umbrella_config_module_location.input = "$$PWD/Qt5ModuleLocation.cmake.in" +# cmake_umbrella_config_module_location.output = "$$DESTDIR/cmake/Qt5/Qt5ModuleLocation.cmake" +# cmake_umbrella_config_module_location_for_install.input = "$$PWD/Qt5ModuleLocationForInstall.cmake.in" +# cmake_umbrella_config_module_location_for_install.output = "$$DESTDIR/cmake/install/Qt5/Qt5ModuleLocation.cmake" +# cmake_umbrella_config_version_file.input = "$$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in" +# cmake_umbrella_config_version_file.output = "$$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake" +# ctest_macros_file.CONFIG = "verbatim" +# ctest_macros_file.input = "$$PWD/Qt5CTestMacros.cmake" +# ctest_macros_file.output = "$$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake" +# ctest_qt5_module_files.files = "$$ctest_macros_file.output" "$$cmake_extras_mkspec_dir_for_install.output" +# ctest_qt5_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5Core" +# host_bins.name = "host_bins" +# host_bins.variable = "HOST_BINS" +# qt_conf.name = "qt_config" +# qt_conf.variable = "QT_CONFIG" + ## Scopes: ##################################################################### -# -#extend_target(Core CONDITION QT_FEATURE_gc_binaries -# # MODULE_CONFIG = "gc_binaries" -#) -# -#extend_target(Core CONDITION NOT QT_NAMESPACE_ISEMPTY -# # MODULE_DEFINES = "QT_NAMESPACE=$$QT_NAMESPACE" -#) + +#### Keys ignored in scope 2:.:.:corelib.pro:QT_FEATURE_gc_binaries: +# MODULE_CONFIG = "gc_binaries" + +#### Keys ignored in scope 3:.:.:corelib.pro:NOT QT_NAMESPACE_ISEMPTY: +# MODULE_DEFINES = "QT_NAMESPACE=$$QT_NAMESPACE" extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x67000000" ) -# -#extend_target(Core CONDITION FREEBSD OR OPENBSD -# # QMAKE_LFLAGS_NOUNDEF = -#) + +#### Keys ignored in scope 5:.:.:corelib.pro:FREEBSD OR OPENBSD: +# QMAKE_LFLAGS_NOUNDEF = extend_target(Core CONDITION WIN32 SOURCES @@ -389,7 +385,7 @@ extend_target(Core CONDITION WIN32 plugin/qsystemlibrary.cpp plugin/qsystemlibrary_p.h thread/qatomic_msvc.h thread/qthread_win.cpp - # special case: DEFINES + # DEFINES # special case: remove LIBRARIES ws2_32 ) @@ -403,14 +399,15 @@ extend_target(Core CONDITION WIN32 AND NOT WINRT io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h LIBRARIES - kernel32 - user32 - shell32 - uuid - ole32 advapi32 - winmm + kernel32 + ole32 + shell32 + user32 + uuid version + winmm + PUBLIC_LIBRARIES mpr netapi32 userenv @@ -435,72 +432,62 @@ extend_target(Core CONDITION APPLE_OSX kernel/qcoreapplication_mac.cpp kernel/qeventdispatcher_cf.mm kernel/qeventdispatcher_cf_p.h LIBRARIES + ${FWAppKit} ${FWApplicationServices} ${FWCoreServices} ${FWFoundation} - ${FWCoreServices} - ${FWAppKit} ${FWSecurity} + PUBLIC_LIBRARIES ${FWDiskArbitration} ${FWIOKit} ) extend_target(Core CONDITION INTEGRITY LIBRARIES - posix ivfs - socket net + posix shm_client + socket COMPILE_OPTIONS "--pending_instantiations=128" ) -# -#extend_target(Core CONDITION pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR) -# # CMAKE_HOST_DATA_DIR = "$$[QT_HOST_DATA/src]/" -# # CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = "True" -#) -# -#extend_target(Core CONDITION pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR) -# # CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/" -# # CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True" -#) -# -#extend_target(Core CONDITION contains(QT_CPU_FEATURES__ss_QT_ARCH, f16c) -# # f16c_cxx = "true" -#) -# -#extend_target(Core CONDITION (NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (CLANG OR intel_icl OR ICC) -# # f16c_cxx = "false" -#) -# -#extend_target(Core CONDITION ((NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (NOT (CLANG OR intel_icl OR ICC))) AND (GCC AND f16c AND x86SimdAlways) -# # f16c_cxx = "true" -#) -# -#extend_target(Core CONDITION (((NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (NOT (CLANG OR intel_icl OR ICC))) AND (NOT (GCC AND f16c AND x86SimdAlways))) AND (MSVC AND contains(QT_CPU_FEATURES__ss_QT_ARCH,avx)) -# # f16c_cxx = "true" -#) -# -#extend_target(Core CONDITION (((NOT (contains(QT_CPU_FEATURES__ss_QT_ARCH,f16c))) AND (NOT (CLANG OR intel_icl OR ICC))) AND (NOT (GCC AND f16c AND x86SimdAlways))) AND (NOT (MSVC AND contains(QT_CPU_FEATURES__ss_QT_ARCH,avx))) -# # f16c_cxx = "false" -#) +extend_target(Core CONDITION DEFINES___contains___QT_EVAL + SOURCES + ${PROJECT_SOURCE_DIR}/src/corelib/kernel/qtcore_eval.cpp + INCLUDE_DIRECTORIES + ${PROJECT_BUILD_DIR}/src/corelib/global +) -# special case -# needs refinement for the other compiler specific cases. -if(TEST_arch_${TEST_architecture_arch}_subarch_f16c) - # Equivalent to contains(QT_CPU_FEATURES.$$QT_ARCH, f16c) - extend_target(Core - DEFINES - QFLOAT16_INCLUDE_FAST - ) -else() - add_qt_simd_part(Core SIMD f16c - SOURCES - global/qfloat16_f16c.c - ) -endif() +#### Keys ignored in scope 13:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR): +# CMAKE_HOST_DATA_DIR = "$$[QT_HOST_DATA/src]/" +# CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = "True" + +#### Keys ignored in scope 14:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR): +# CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/" +# CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True" + +#### Keys ignored in scope 18:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c: +# f16c_cxx = "true" + +#### Keys ignored in scope 20:.:global:global/global.pri:CLANG OR intel_icl OR ICC: +# f16c_cxx = "false" + +#### Keys ignored in scope 22:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways: +# f16c_cxx = "true" + +#### Keys ignored in scope 24:.:global:global/global.pri:MSVC AND QT_CPU_FEATURES__ss_QT_ARCH___contains___avx: +# f16c_cxx = "true" + +#### Keys ignored in scope 25:.:global:global/global.pri:else: +# f16c_cxx = "false" + +# special case: Handled manually: +# extend_target(Core CONDITION _ss_f16c_cxx ... + +#### Keys ignored in scope 27:.:global:global/global.pri:else: +# F16C_SOURCES = "global/qfloat16_f16c.c" extend_target(Core CONDITION linux_x_ OR hurd_x_ AND NOT cross_compile AND NOT static AND NOT _x_-armcc_x_ DEFINES @@ -513,20 +500,18 @@ extend_target(Core CONDITION LINUX AND NOT static SOURCES global/minimum-linux_p.h ) -# -#extend_target(Core CONDITION LINUX AND precompile_header AND NOT static -# # NO_PCH_ASM = "global/minimum-linux.S" -# # QMAKE_EXTRA_COMPILERS = "no_pch_assembler" -# # no_pch_assembler.commands = "$$QMAKE_CC" "-c" "$(CFLAGS)" "$(INCPATH)" "${QMAKE_FILE_IN}" "-o" "${QMAKE_FILE_OUT}" -# # no_pch_assembler.dependency_type = "TYPE_C" -# # no_pch_assembler.input = "NO_PCH_ASM" -# # no_pch_assembler.name = "compiling[no_pch]" "${QMAKE_FILE_IN}" -# # no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" -#) -# -#extend_target(Core CONDITION LINUX AND precompile_header AND silent AND NOT static -# # no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&" "$$no_pch_assembler.commands" -#) + +#### Keys ignored in scope 32:.:global:global/global.pri:precompile_header: +# NO_PCH_ASM = "global/minimum-linux.S" +# QMAKE_EXTRA_COMPILERS = "no_pch_assembler" +# no_pch_assembler.commands = "$$QMAKE_CC" "-c" "$(CFLAGS)" "$(INCPATH)" "${QMAKE_FILE_IN}" "-o" "${QMAKE_FILE_OUT}" +# no_pch_assembler.dependency_type = "TYPE_C" +# no_pch_assembler.input = "NO_PCH_ASM" +# no_pch_assembler.name = "compiling[no_pch]" "${QMAKE_FILE_IN}" +# no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" + +#### Keys ignored in scope 33:.:global:global/global.pri:silent: +# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&" "$$no_pch_assembler.commands" extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static SOURCES @@ -542,20 +527,18 @@ extend_target(Core CONDITION QT_FEATURE_journald LIBRARIES journald ) -# -#extend_target(Core CONDITION GCC AND ltcg -# # QMAKE_EXTRA_COMPILERS = "versiontagging_compiler" -# # versiontagging_compiler.commands = "$$QMAKE_CXX" "-c" "$(CXXFLAGS)" "$(INCPATH)" "-fno-lto" "-o" "${QMAKE_FILE_OUT}" "${QMAKE_FILE_IN}" -# # versiontagging_compiler.dependency_type = "TYPE_C" -# # versiontagging_compiler.input = "VERSIONTAGGING_SOURCES" -# # versiontagging_compiler.name = "compiling[versiontagging]" "${QMAKE_FILE_IN}" -# # versiontagging_compiler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" -# # versiontagging_compiler.variable_out = "OBJECTS" -#) -# -#extend_target(Core CONDITION GCC AND ltcg AND silent -# # versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&" "$$versiontagging_compiler.commands" -#) + +#### Keys ignored in scope 37:.:global:global/global.pri:GCC AND ltcg: +# QMAKE_EXTRA_COMPILERS = "versiontagging_compiler" +# versiontagging_compiler.commands = "$$QMAKE_CXX" "-c" "$(CXXFLAGS)" "$(INCPATH)" "-fno-lto" "-o" "${QMAKE_FILE_OUT}" "${QMAKE_FILE_IN}" +# versiontagging_compiler.dependency_type = "TYPE_C" +# versiontagging_compiler.input = "VERSIONTAGGING_SOURCES" +# versiontagging_compiler.name = "compiling[versiontagging]" "${QMAKE_FILE_IN}" +# versiontagging_compiler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" +# versiontagging_compiler.variable_out = "OBJECTS" + +#### Keys ignored in scope 38:.:global:global/global.pri:silent: +# versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&" "$$versiontagging_compiler.commands" extend_target(Core CONDITION UNIX SOURCES @@ -625,7 +608,7 @@ extend_target(Core CONDITION QT_FEATURE_future ) extend_target(Core CONDITION QT_FEATURE_std_atomic64 - LIBRARIES + PUBLIC_LIBRARIES Atomic ) @@ -835,7 +818,7 @@ extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) SOURCES io/qstandardpaths_haiku.cpp io/qstorageinfo_unix.cpp - LIBRARIES + PUBLIC_LIBRARIES be ) @@ -990,6 +973,21 @@ add_qt_resource(Core "mimetypes" PREFIX "/qt-project.org/qmime/packages" BASE "m mime/packages/freedesktop.org.xml) +# special case: +# needs refinement for the other compiler specific cases. +if(TEST_arch_${TEST_architecture_arch}_subarch_f16c) + # Equivalent to contains(QT_CPU_FEATURES.$$QT_ARCH, f16c) + extend_target(Core + DEFINES + QFLOAT16_INCLUDE_FAST + ) +else() + add_qt_simd_part(Core SIMD f16c + SOURCES + global/qfloat16_f16c.c + ) +endif() + # special case: add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" COMMAND qfloat16-tables @@ -999,6 +997,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp VERBATIM) target_sources(Core PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp") +# special case: set_source_files_properties( thread/qmutex_linux.cpp thread/qmutex_mac.cpp @@ -1017,5 +1016,6 @@ endif() qt_internal_add_link_flags_gc_sections(Core PRIVATE) # special case qt_create_tracepoints(Core ./qtcore.tracepoints) - -add_qt_docs(./doc/qtcore.qdocconf) +add_qt_docs( + ./doc/qtcore.qdocconf +) From f9676fdd91ae09a5e34baabcbef59d1580822740 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 10 Apr 2019 10:54:08 +0200 Subject: [PATCH 0410/1322] CMake: Re-generate gui Change-Id: Ia944a66d75e0bfda888a208f93d581bb5a43a87f Reviewed-by: Alexandru Croitor --- src/gui/CMakeLists.txt | 149 ++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 97 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b3d0f9fcb53..26309053231 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,3 +1,5 @@ +# Generated from gui.pro. + # special case: set(OpenGL_GL_PREFERENCE GLVND) @@ -228,27 +230,27 @@ add_qt_module(Gui DEFINES QT_NO_USING_NAMESPACE QT_NO_FOREACH - QT_QPA_DEFAULT_PLATFORM_NAME="${QT_QPA_DEFAULT_PLATFORM}" + QT_QPA_DEFAULT_PLATFORM_NAME="${QT_QPA_DEFAULT_PLATFORM}" # special case LIBRARIES Qt::CorePrivate - ZLIB::ZLIB + ZLIB::ZLIB # special case PUBLIC_LIBRARIES Qt::Core ) # Resources: -set_source_files_properties("painting/../../3rdparty/icc/sRGB2014.icc" - PROPERTIES alias "sRGB2014.icc") -add_qt_resource(Gui "qpdf" PREFIX "qpdf/" BASE "painting" FILES - ../../3rdparty/icc/sRGB2014.icc - qpdfa_metadata.xml) - # special case: # This name is fixed in the code:-/ add_qt_resource(Gui qmake_webgradients PREFIX "/qgradient" BASE "painting" FILES webgradients.binaryjson ) +set_source_files_properties("painting/../../3rdparty/icc/sRGB2014.icc" + PROPERTIES alias "sRGB2014.icc") +add_qt_resource(Gui "qpdf" PREFIX "qpdf/" BASE "painting" FILES + ../../3rdparty/icc/sRGB2014.icc + qpdfa_metadata.xml) + add_qt_simd_part(Gui SIMD sse2 SOURCES painting/qdrawhelper_sse2.cpp @@ -268,20 +270,18 @@ add_qt_simd_part(Gui SIMD sse4_1 add_qt_simd_part(Gui SIMD neon SOURCES - painting/qdrawhelper_neon_p.h - image/qimage_neon.cpp - painting/qdrawhelper_neon.cpp - painting/qimagescale_neon.cpp ../3rdparty/pixman/pixman-arm-neon-asm.S + image/qimage_neon.cpp + painting/qdrawhelper_neon.cpp painting/qdrawhelper_neon_p.h painting/qdrawhelper_neon_asm.S + painting/qimagescale_neon.cpp ) add_qt_simd_part(Gui SIMD mips_dsp SOURCES - painting/qdrawhelper_mips_dsp_p.h - painting/qt_mips_asm_dsp_p.h - painting/qdrawhelper_mips_dsp.cpp + painting/qdrawhelper_mips_dsp.cpp painting/qdrawhelper_mips_dsp_p.h painting/qdrawhelper_mips_dsp_asm.S + painting/qt_mips_asm_dsp_p.h ) add_qt_simd_part(Gui SIMD mips_dspr2 @@ -298,60 +298,29 @@ add_qt_simd_part(Gui SIMD avx2 painting/qdrawhelper_avx2.cpp ) - -#### Keys ignored in scope 1:.:gui.pro:: -# CONFIG = "simd" "optimize_full" "qt_tracepoints" -# KERNEL_P = "kernel" -# MODULE_PLUGIN_TYPES = "platforms" "platforms/darwin" "xcbglintegrations" "platformthemes" "platforminputcontexts" "generic" "iconengines" "imageformats" "egldeviceintegrations" -# PRECOMPILED_HEADER = "kernel/qt_gui_pch.h" -# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtGui.dynlist" -# QMAKE_EXTRA_COMPILERS = "qvkgen_h" "qvkgen_ph" "qvkgen_pimpl" -# QMAKE_LIBS = "$$QMAKE_LIBS_GUI" -# QMAKE_QVKGEN_INPUT = "vulkan/vk.xml" -# QMAKE_QVKGEN_LICENSE_HEADER = "$$QT_SOURCE_TREE/header.LGPL" -# _LOADED = "qt_module" "cmake_functions" -# qvkgen_h.commands = "$$QMAKE_QVKGEN" "${QMAKE_FILE_IN}" "$$shell_quote$$QMAKE_QVKGEN_LICENSE_HEADER" "${QMAKE_FILE_OUT_PATH}/${QMAKE_FILE_OUT_BASE}" -# qvkgen_h.input = "QMAKE_QVKGEN_INPUT" -# qvkgen_h.output = "$$OUT_PWD/vulkan/qvulkanfunctions.h" -# qvkgen_ph.commands = "$$escape_expand\\n" -# qvkgen_ph.depends = "$$OUT_PWD/vulkan/qvulkanfunctions.h" -# qvkgen_ph.input = "QMAKE_QVKGEN_INPUT" -# qvkgen_ph.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.h" -# qvkgen_pimpl.commands = "$$escape_expand\\n" -# qvkgen_pimpl.depends = "$$OUT_PWD/vulkan/qvulkanfunctions_p.h" -# qvkgen_pimpl.input = "QMAKE_QVKGEN_INPUT" -# qvkgen_pimpl.output = "$$OUT_PWD/vulkan/qvulkanfunctions_p.cpp" -# targ_headers.CONFIG = "no_check_exist" -# webgradients.base = "painting" # special case -# webgradients.files = "painting/webgradients.binaryjson" # special case -# webgradients.prefix = "qgradient" # special case - #special case: extend_target(Gui CONDITION QT_FEATURE_standarditemmodel SOURCES itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h ) +#### Keys ignored in scope 1:.:.:gui.pro:: +# CONFIG = "simd" "optimize_full" "qt_tracepoints" +# MODULE_PLUGIN_TYPES = "platforms" "platforms/darwin" "xcbglintegrations" "platformthemes" "platforminputcontexts" "generic" "iconengines" "imageformats" "egldeviceintegrations" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtGui.dynlist" +# QMAKE_LIBS = "$$QMAKE_LIBS_GUI" +# _LOADED = "qt_module" "cmake_functions" + ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:gui.pro:qtConfig(opengl._x_): +#### Keys ignored in scope 2:.:.:gui.pro:qtConfig(opengl._x_): # MODULE_CONFIG = "opengl" -#### Keys ignored in scope 3:.:gui.pro:QT_FEATURE_angle: -# CMAKE_ANGLE_EGL_DLL_DEBUG = "libEGLd.dll" -# CMAKE_ANGLE_EGL_DLL_RELEASE = "libEGL.dll" -# CMAKE_ANGLE_EGL_IMPLIB_DEBUG = "libEGLd.$${QMAKE_EXTENSION_STATICLIB}" -# CMAKE_ANGLE_EGL_IMPLIB_RELEASE = "libEGL.$${QMAKE_EXTENSION_STATICLIB}" -# CMAKE_ANGLE_GLES2_DLL_DEBUG = "libGLESv2d.dll" -# CMAKE_ANGLE_GLES2_DLL_RELEASE = "libGLESv2.dll" -# CMAKE_ANGLE_GLES2_IMPLIB_DEBUG = "libGLESv2d.$${QMAKE_EXTENSION_STATICLIB}" -# CMAKE_ANGLE_GLES2_IMPLIB_RELEASE = "libGLESv2.$${QMAKE_EXTENSION_STATICLIB}" -# CMAKE_GL_INCDIRS = "$$CMAKE_INCLUDE_DIR" -# CMAKE_QT_OPENGL_IMPLEMENTATION = "GLESv2" +#### Keys ignored in scope 3:.:.:gui.pro:QT_FEATURE_angle: # MODULE_AUX_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE/QtANGLE" -#### Keys ignored in scope 4:.:gui.pro:testcocoon: +#### Keys ignored in scope 4:.:.:gui.pro:testcocoon: # _LOADED = "testcocoon" extend_target(Gui CONDITION APPLE_OSX @@ -372,45 +341,45 @@ extend_target(Gui CONDITION WIN32 kernel/qwindowdefs_win.h ) -#### Keys ignored in scope 7:.:gui.pro:WIN32: +#### Keys ignored in scope 7:.:.:gui.pro:WIN32: # CMAKE_WINDOWS_BUILD = "True" -#### Keys ignored in scope 10:.:gui.pro:QT_FEATURE_egl: +#### Keys ignored in scope 10:.:.:gui.pro:QT_FEATURE_egl: # CMAKE_EGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_EGL" -#### Keys ignored in scope 11:.:gui.pro:NOT QMAKE_LIBDIR_EGL_ISEMPTY: +#### Keys ignored in scope 11:.:.:gui.pro:NOT QMAKE_LIBDIR_EGL_ISEMPTY: # CMAKE_EGL_LIBDIR = "$$cmakeTargetPath$$QMAKE_LIBDIR_EGL" -#### Keys ignored in scope 12:.:gui.pro:QT_FEATURE_opengles2: +#### Keys ignored in scope 12:.:.:gui.pro:QT_FEATURE_opengles2: # CMAKE_GL_HEADER_NAME = "GLES2/gl2.h" # CMAKE_OPENGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_OPENGL_ES2" # CMAKE_OPENGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_OPENGL_ES2" # CMAKE_QT_OPENGL_IMPLEMENTATION = "GLESv2" -#### Keys ignored in scope 13:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ES2_ISEMPTY: +#### Keys ignored in scope 13:.:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ES2_ISEMPTY: # CMAKE_GL_INCDIRS = "$$cmakeTargetPaths$$QMAKE_INCDIR_OPENGL_ES2" -#### Keys ignored in scope 14:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ES2_ISEMPTY: +#### Keys ignored in scope 14:.:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ES2_ISEMPTY: # CMAKE_OPENGL_LIBDIR = "$$cmakePortablePaths$$QMAKE_LIBDIR_OPENGL_ES2" -#### Keys ignored in scope 16:.:gui.pro:QT_FEATURE_opengl: +#### Keys ignored in scope 16:.:.:gui.pro:QT_FEATURE_opengl: # CMAKE_GL_HEADER_NAME = "GL/gl.h" # CMAKE_OPENGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_OPENGL" # CMAKE_QT_OPENGL_IMPLEMENTATION = "GL" -#### Keys ignored in scope 17:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ISEMPTY: +#### Keys ignored in scope 17:.:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ISEMPTY: # CMAKE_GL_INCDIRS = "$$cmakeTargetPaths$$QMAKE_INCDIR_OPENGL" -#### Keys ignored in scope 18:.:gui.pro:NOT QT_FEATURE_dynamicgl: +#### Keys ignored in scope 18:.:.:gui.pro:NOT QT_FEATURE_dynamicgl: # CMAKE_OPENGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_OPENGL" -#### Keys ignored in scope 19:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ISEMPTY: +#### Keys ignored in scope 19:.:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ISEMPTY: # CMAKE_OPENGL_LIBDIR = "$$cmakePortablePaths$$QMAKE_LIBDIR_OPENGL" -#### Keys ignored in scope 20:.:gui.pro:APPLE_OSX: +#### Keys ignored in scope 20:.:.:gui.pro:APPLE_OSX: # CMAKE_GL_HEADER_NAME = "gl.h" -#### Keys ignored in scope 21:.:gui.pro:QT_FEATURE_egl: +#### Keys ignored in scope 21:.:.:gui.pro:QT_FEATURE_egl: # CMAKE_EGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_EGL" extend_target(Gui CONDITION QT_FEATURE_accessibility @@ -439,6 +408,7 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h ) +# special case: # With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf # acted like WrapOpenGL: direct linkage against either libGLESv2 or # libGL, depending on the opengl _feature_. This is done by hand now @@ -483,9 +453,6 @@ extend_target(Gui CONDITION QT_FEATURE_opengl WrapOpenGL ) -#### Keys ignored in scope 27:.:kernel/kernel.pri:QT_FEATURE_opengl: -# CONFIG = "opengl" - extend_target(Gui CONDITION QT_FEATURE_movie SOURCES image/qmovie.cpp image/qmovie.h @@ -524,23 +491,18 @@ extend_target(Gui CONDITION QT_FEATURE_cssparser text/qcssparser.cpp text/qcssparser_p.h ) -#### Keys ignored in scope 53:.:opengl/opengl.pri:QT_FEATURE_opengles2: -# CONFIG = "opengles2" +# special case: +# extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 ... -extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 - SOURCES - painting/qdrawhelper.cpp -) - -#### Keys ignored in scope 43:.:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: +#### Keys ignored in scope 43:.:painting:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: # CONFIG = "no_clang_integrated_as" -extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT (TEST_architecture_arch STREQUAL "arm64") +extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT (TEST_architecture_arch STREQUAL "arm64") DEFINES ENABLE_PIXMAN_DRAWHELPERS ) -#### Keys ignored in scope 53:.:opengl/opengl.pri:QT_FEATURE_opengles2: +#### Keys ignored in scope 53:.:opengl:opengl/opengl.pri:QT_FEATURE_opengles2: # CONFIG = "opengles2" extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 @@ -586,25 +548,15 @@ extend_target(Gui CONDITION QT_FEATURE_vulkan vulkan/qvulkanfunctions.cpp vulkan/qvulkaninstance.cpp vulkan/qvulkaninstance.h vulkan/qvulkanwindow.cpp vulkan/qvulkanwindow.h vulkan/qvulkanwindow_p.h + PUBLIC_LIBRARIES + vulkan_nolink ) -# special case to include only headers aka QMAKE_USE += vulkan/nolink -if(QT_FEATURE_vulkan) - # Can't use generator expressions https://gitlab.kitware.com/cmake/cmake/issues/19072 - get_target_property(vulkan_includes Vulkan::Vulkan INTERFACE_INCLUDE_DIRECTORIES) - target_include_directories(Gui PUBLIC ${vulkan_includes}) -endif() - -#### Keys ignored in scope 61:.:vulkan/vulkan.pri:QT_FEATURE_vulkan: +#### Keys ignored in scope 61:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: # CONFIG = "generated_privates" -# qvkgen_h.variable_out = "HEADERS" -# qvkgen_ph.variable_out = "HEADERS" -# qvkgen_pimpl.variable_out = "SOURCES" -#### Keys ignored in scope 63:.:vulkan/vulkan.pri:else: +#### Keys ignored in scope 63:.:vulkan:vulkan/vulkan.pri:else: # qvkgen_h.CONFIG = "target_predeps" "no_link" -# qvkgen_ph.CONFIG = "target_predeps" "no_link" -# qvkgen_pimpl.CONFIG = "target_predeps" "no_link" # special case: if (QT_FEATURE_vulkan) @@ -645,6 +597,7 @@ if (QT_FEATURE_vulkan) ) endif() +# special case: # qpa headers are expected to be located right next to QtGui's private # headers. So a private QtGui header is #include and # a qpa header is #include , both of them implying @@ -652,6 +605,8 @@ endif() qt_read_headers_pri("Gui" "module_headers") # special case install(FILES ${module_headers_qpa} DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) # special case -qt_create_tracepoints(Gui ./qtgui.tracepoints) -add_qt_docs(./doc/qtgui.qdocconf) +qt_create_tracepoints(Gui ./qtgui.tracepoints) +add_qt_docs( + ./doc/qtgui.qdocconf +) From 859b36ca143bd2955f97f167ede7f14029326f6c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 10 Apr 2019 12:12:09 +0200 Subject: [PATCH 0411/1322] CMake: Use imported target to create _nolink targets Use an imported target to create _nolink targets. This gets rid of the need to have an helper target that gets aliases to get work around the problem of the original target might having a "::" in its name. Change-Id: I4618980cf2c673ebf5caca593bccf122b3c81480 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 5a323264e91..84769a4eb84 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -170,20 +170,18 @@ function(qt_create_nolink_target target) set(nolink_target "${target}_nolink") if(NOT TARGET "${nolink_target}") - string(REPLACE ":" "_" base_target "__${nolink_target}") - add_library("${base_target}" INTERFACE) - target_include_directories("${base_target}" INTERFACE - $) - target_include_directories("${base_target}" INTERFACE SYSTEM - $) - target_compile_definitions("${base_target}" INTERFACE - $) - target_compile_options("${base_target}" INTERFACE - $) - target_compile_features("${base_target}" INTERFACE - $) - - add_library("${nolink_target}" ALIAS "${base_target}") + add_library("${nolink_target}" INTERFACE IMPORTED) + set_target_properties("${nolink_target}" PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES + $ + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + $ + INTERFACE_COMPILE_DEFINITIONS + $ + INTERFACE_COMPILE_OPTIONS + $ + INTERFACE_COMPILE_FEATURES + $) endif() endfunction() From 8f0eb6557970a2407afa7190e617afdc5d3ef691 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 11 Apr 2019 17:04:11 +0200 Subject: [PATCH 0412/1322] CMake: Configurejson2cmake: Always enable system-pcre2 and handle dlopen Handle dlopen properly. Code is ifdef-ed on it, so we need it:-/ Change-Id: I7f35d24b97530796a4cdcdc1acbe139757170215 Reviewed-by: Albert Astals Cid --- util/cmake/configurejson2cmake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 1edb4b44a15..f870637e156 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -288,10 +288,10 @@ def map_condition(condition): assert isinstance(condition, str) mapped_features = { - "dlopen": "ON", 'gbm': 'gbm_FOUND', "system-xcb": "ON", "system-freetype": "ON", + 'system-pcre2': 'ON', } # Turn foo != "bar" into (NOT foo STREQUAL 'bar') @@ -694,7 +694,9 @@ def parseFeature(ctx, feature, data, cm_fh): 'cross_compile': None, 'debug_and_release': None, 'debug': None, - 'dlopen': None, # handled by CMAKE_DL_LIBS + 'dlopen': { + 'condition': 'UNIX', + }, 'doubleconversion': None, 'enable_gdb_index': None, 'enable_new_dtags': None, From 2ec3f492a7964648e838ef663fe41e4e7351c9df Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 11 Apr 2019 17:06:01 +0200 Subject: [PATCH 0413/1322] CMake: pro2cmake.py: Handle setting a key with $$key in the value Change-Id: I86552ed2a30f07f8c6060b2bad04fd5489b1d482 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 7f4af835ffc..44326e488e3 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -189,7 +189,7 @@ class Operation: else: self._value = [str(value), ] - def process(self, input, transformer): + def process(self, key, input, transformer): assert(False) def __repr__(self): @@ -212,7 +212,7 @@ class Operation: class AddOperation(Operation): - def process(self, input, transformer): + def process(self, key, input, transformer): return input + transformer(self._value) def __repr__(self): @@ -220,7 +220,7 @@ class AddOperation(Operation): class UniqueAddOperation(Operation): - def process(self, input, transformer): + def process(self, key, input, transformer): result = input for v in transformer(self._value): if v not in result: @@ -232,11 +232,18 @@ class UniqueAddOperation(Operation): class SetOperation(Operation): - def process(self, input, transformer): + def process(self, key, input, transformer): + values = [] # typing.List[str] + for v in self._value: + if v != '$$' + key: + values.append(v) + else: + values += input + if transformer: - return list(transformer(self._value)) + return list(transformer(values)) else: - return self._value + return values def __repr__(self): return '=({})'.format(self._dump()) @@ -246,7 +253,7 @@ class RemoveOperation(Operation): def __init__(self, value): super().__init__(value) - def process(self, input, transformer): + def process(self, key, input, transformer): input_set = set(input) value_set = set(self._value) result = [] @@ -513,7 +520,7 @@ class Scope(object): op_transformer = lambda files: files for op in self._operations.get(key, []): - result = op.process(result, op_transformer) + result = op.process(key, result, op_transformer) for ic in self._included_children: result = list(ic._evalOps(key, transformer, result)) @@ -540,7 +547,8 @@ class Scope(object): expanded_files = [] # typing.List[str] for f in files: - expanded_files += self._expand_value(f) + r = self._expand_value(f) + expanded_files += r mapped_files = list(map(lambda f: map_to_file(f, self, is_include=is_include), expanded_files)) @@ -568,7 +576,7 @@ class Scope(object): if match.group(0) == value: return self.get(match.group(1)) - replacement = self.expand(match.group(1)) + replacement = self.get(match.group(1)) replacement_str = replacement[0] if replacement else '' result = result[:match.start()] \ + replacement_str \ From 95cdb0d1ae62b4aa801eec32949ad18c61032e49 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 12 Apr 2019 11:45:43 +0200 Subject: [PATCH 0414/1322] CMake: pro2cmake.py: Inherrit VPATH from parent scopes Change-Id: I95b62fdf3a4cba674bef5a58f0d414464daa3b0c Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 44326e488e3..75d52957a90 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -510,10 +510,14 @@ class Scope(object): def _evalOps(self, key: str, transformer: typing.Optional[typing.Callable[[Scope, typing.List[str]], typing.List[str]]], - result: typing.List[str]) \ + result: typing.List[str], *, inherrit: bool = False) \ -> typing.List[str]: self._visited_keys.add(key) + # Inherrit values from above: + if self._parent and inherrit: + result = self._parent._evalOps(key, transformer, result) + if transformer: op_transformer = lambda files: transformer(self, files) else: @@ -527,13 +531,13 @@ class Scope(object): return result - def get(self, key: str, *, ignore_includes: bool = False) -> typing.List[str]: + def get(self, key: str, *, ignore_includes: bool = False, inherrit: bool = False) -> typing.List[str]: if key == 'PWD': return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] if key == 'OUT_PWD': return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] - return self._evalOps(key, None, []) + return self._evalOps(key, None, [], inherrit=inherrit) def get_string(self, key: str, default: str = '') -> str: v = self.get(key) @@ -553,7 +557,7 @@ class Scope(object): mapped_files = list(map(lambda f: map_to_file(f, self, is_include=is_include), expanded_files)) if use_vpath: - result = list(map(lambda f: handle_vpath(f, self.basedir, self.get('VPATH')), mapped_files)) + result = list(map(lambda f: handle_vpath(f, self.basedir, self.get('VPATH', inherrit=True)), mapped_files)) else: result = mapped_files From ce809cab29ff1d5c99fdbc6fdcab0960eaecdd4a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 12 Apr 2019 11:53:38 +0200 Subject: [PATCH 0415/1322] CMake: pro2cmake.py: Fix handling of libraries in QT Change-Id: I5737a285ca0575a454e60fad231435d96b2f1be7 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 75d52957a90..e7bb4f3fa2e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -961,17 +961,15 @@ def write_library_section(cm_fh: typing.IO[str], scope: Scope, if map_qt_library(q) not in known_libraries] for key in mixed: for lib in scope.expand(key): - if map_qt_library(lib) in known_libraries: + mapped_lib = map_qt_library(lib) + if mapped_lib in known_libraries: continue - if lib.endswith('-private'): - mapped_lib_name = map_qt_base_library(lib[0:-8]) - if mapped_lib_name: - private_dependencies.append(mapped_lib_name + 'Private') - public_dependencies.append(mapped_lib_name) - continue - - public_dependencies.append(lib) + if mapped_lib.endswith('Private'): + private_dependencies.append(mapped_lib) + public_dependencies.append(mapped_lib[:-7]) + else: + public_dependencies.append(mapped_lib) write_library_list(cm_fh, 'LIBRARIES', private_dependencies, indent=indent) write_library_list(cm_fh, 'PUBLIC_LIBRARIES', public_dependencies, indent=indent) From 37ed6dae00640f9cc980ffda05347c12a7eb5d7e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 11 Apr 2019 17:05:06 +0200 Subject: [PATCH 0416/1322] CMake: Map xkbcommon_support Qt 5.12 comes with xkbcommon_support now. Map that accordingly. Change-Id: Id10708349d377f6bdfed654428ebcef0b533bd69 Reviewed-by: Albert Astals Cid --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 9de01df32f0..13c1677b52f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -152,6 +152,7 @@ def map_qt_base_library(lib: str) -> str: 'winextras': 'Qt::WinExtras', 'x11extras': 'Qt::X11Extras', 'xcb_qpa_lib': 'Qt::XcbQpa', + 'xkbcommon_support': 'Qt::XkbCommonSupport', 'xmlpatterns': 'Qt::XmlPatterns', 'xml': 'Qt::Xml', } From 51b7fbb62647226d4527f9bc695d8df2a7b194d2 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 16 Apr 2019 12:49:16 +0200 Subject: [PATCH 0417/1322] Work around issue of missing Windows qtmain static library Applications that have the WIN32_EXECUTABLE property set, must have a WinMain function. In qmake's case, this function is provided by the qtmain static library. Until that is implemented in CMake land, disable the property on Windows for all qt executables. This fixes the linker issues while building examples. Task-number: QTBUG-75195 Change-Id: I323d4dd899f716cd6b9b7f4b5ecb76b22f462fc4 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 84769a4eb84..f881c3eabd1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -852,6 +852,12 @@ function(add_qt_executable name) MACOSX_BUNDLE "${arg_GUI}" ) + if(WIN32) + # Workaround for not having ported the winmain / qtmain static library + # which is always linked in by qmake. + set_target_properties("${name}" PROPERTIES WIN32_EXECUTABLE 0) + endif() + if(NOT arg_NO_INSTALL) install(TARGETS "${name}" RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}" From 5fd882803e6bf642e17e7f8c32b35bcd6c7a6e50 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 16 Apr 2019 12:53:24 +0200 Subject: [PATCH 0418/1322] Fix dbusxml2cpp custom command invocation Use absolute paths for source files, and relative paths plus a correct working directory for output files. This is required to work around a limitation of the dbusxml2cpp tool where it splits a command line option on a colon ":". Windows paths contain colons, and that breaks the internal logic of the tool when passing absolute paths. Change-Id: Ic653f1317ae4f68bb2f488c117fe48c34310c76e Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f881c3eabd1..70dee6851c4 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1161,14 +1161,20 @@ function(qt_create_qdbusxml2cpp_command target infile) set(file_name ${arg_BASENAME}) endif() + # Use absolute file path for the source file and set the current working directory to the + # current binary directory, because setting an absolute path for the header:source combo option + # does not work. Splitting on ":" breaks inside the dbus tool when running on Windows + # due to ":" being contained in the drive path (e.g C:\foo.h:C:\foo.cpp). + get_filename_component(absolute_in_file_path "${infile}" ABSOLUTE) - set(header_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.h") - set(source_file "${CMAKE_CURRENT_BINARY_DIR}/${file_name}.cpp") + set(header_file "${file_name}.h") + set(source_file "${file_name}.cpp") add_custom_command(OUTPUT "${header_file}" "${source_file}" - COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp ${arg_FLAGS} "${option}" "${header_file}:${source_file}" "${infile}" - DEPENDS "${infile}" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qdbusxml2cpp ${arg_FLAGS} "${option}" + "${header_file}:${source_file}" "${absolute_in_file_path}" + DEPENDS "${absolute_in_file_path}" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" VERBATIM) target_sources("${target}" PRIVATE "${header_file}" "${source_file}") From d35b94829cf786dd24e97f2494e33e4651017b57 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 17 Apr 2019 13:38:01 +0200 Subject: [PATCH 0419/1322] Remove the Gui extra cmake file which was restored during the merge When building qtsvg, the file gets picked up while doing find_package(Qt5Gui) and fails the configuration phase. Remove it as it was done before. Change-Id: I3499e33ecc129e31f8d3b144ee6370b2a9bb4f9a Reviewed-by: Tobias Hunger --- src/gui/Qt5GuiConfigExtras.cmake.in | 193 ---------------------------- 1 file changed, 193 deletions(-) delete mode 100644 src/gui/Qt5GuiConfigExtras.cmake.in diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in deleted file mode 100644 index 84dbbfebd47..00000000000 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ /dev/null @@ -1,193 +0,0 @@ - -!!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) - -!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) -set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR/QtANGLE\") -!!ELSE -set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR/QtANGLE\") -!!ENDIF - -_qt5_Gui_check_file_exists(${Qt5Gui_EGL_INCLUDE_DIRS}) - -list(APPEND Qt5Gui_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) -set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) -set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) - -macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) - set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) - -!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE) - set(imported_location \"${_qt5Gui_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -!!ELSE - set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\") -!!ENDIF - -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) - set(imported_implib \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") -!!ELSE - set(imported_implib \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\") -!!ENDIF - - set_target_properties(Qt5::${TargetName} PROPERTIES - \"IMPORTED_LOCATION_${Configuration}\" ${imported_location} - \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib} - ) -endmacro() - -add_library(Qt5::Gui_EGL SHARED IMPORTED) -_populate_qt5gui_gl_target_properties(Gui_EGL RELEASE $${CMAKE_ANGLE_EGL_DLL_RELEASE} $${CMAKE_ANGLE_EGL_IMPLIB_RELEASE}) -add_library(Qt5::Gui_GLESv2 SHARED IMPORTED) -_populate_qt5gui_gl_target_properties(Gui_GLESv2 RELEASE $${CMAKE_ANGLE_GLES2_DLL_RELEASE} $${CMAKE_ANGLE_GLES2_IMPLIB_RELEASE}) - -set_property(TARGET Qt5::Gui_EGL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) -set_property(TARGET Qt5::Gui_GLESv2 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_OPENGL_INCLUDE_DIRS}) - -!!IF !isEmpty(CMAKE_DEBUG_TYPE) -_populate_qt5gui_gl_target_properties(Gui_EGL DEBUG $${CMAKE_ANGLE_EGL_DLL_DEBUG} $${CMAKE_ANGLE_EGL_IMPLIB_DEBUG}) -_populate_qt5gui_gl_target_properties(Gui_GLESv2 DEBUG $${CMAKE_ANGLE_GLES2_DLL_DEBUG} $${CMAKE_ANGLE_GLES2_IMPLIB_DEBUG}) -!!ENDIF - -set(Qt5Gui_EGL_LIBRARIES Qt5::Gui_EGL) -set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2) - -!!ELSE - -!!IF !isEmpty(CMAKE_GL_INCDIRS) - -set(_GL_INCDIRS $$CMAKE_GL_INCDIRS) -find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME - PATHS ${_GL_INCDIRS} -) -if (NOT _qt5gui_OPENGL_INCLUDE_DIR) - message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"${_GL_INCDIRS}\\\".\") -endif() -unset(_GL_INCDIRS) - -# Don\'t check for existence of the "_qt5gui_OPENGL_INCLUDE_DIR" because it is -# optional. - -list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR}) -set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR}) - -unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE) - -!!ENDIF - -macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) - set(Qt5Gui_${Name}_LIBRARIES) -!!IF !mac - set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs}) -!!ELSE - foreach(_dir ${IncDirs}) - if (EXISTS ${_dir}) - list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_dir}) - else() - find_path(_actual_dir ${_dir}) # Look in sdk directories - if (_actual_dir) - list(APPEND Qt5Gui_${Name}_INCLUDE_DIRS ${_actual_dir}) - endif() - unset(_actual_dir CACHE) - endif() - endforeach() -!!ENDIF - foreach(_lib ${Libs}) - if (IS_ABSOLUTE ${_lib}) - get_filename_component(_libFile ${_lib} NAME_WE) - if (_libFile MATCHES \"^${CMAKE_SHARED_LIBRARY_PREFIX}(.*)\") - set(_libFile ${CMAKE_MATCH_1}) - endif() - else() - set(_libFile ${_lib}) - endif() - - string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_libFile}) - if (NOT TARGET Qt5::Gui_${_cmake_lib_name} AND NOT _Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE) - if (IS_ABSOLUTE ${_lib}) - set(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}) - else() - find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib} -!!IF !isEmpty(CROSS_COMPILE) - PATHS \"${LibDir}\" -!!IF !mac - NO_DEFAULT_PATH -!!ENDIF -!!ENDIF - ) - endif() -!!IF mac - set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") - if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}") - set(Qt5Gui_${_cmake_lib_name}_LIBRARY) - endif() -!!ENDIF - if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) - # The above find_library call doesn\'t work for finding - # libraries in Windows SDK paths outside of the proper - # environment, even if the libraries are present. In other - # cases it is OK for the libraries to not be found - # because they are optional dependencies of Qt5Gui, needed - # only if the qopengl.h header is used. - # We try to find the libraries in the first place because Qt may be - # compiled with another set of GL libraries (such as coming - # from ANGLE). The point of these find calls is to try to - # find the same binaries as Qt is compiled with (as they are - # in the interface of QtGui), so an effort is made to do so - # above with paths known to qmake. - set(_Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE TRUE) - unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) - else() - add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS}) - - set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) - _qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") - -!!IF !isEmpty(CMAKE_WINDOWS_BUILD) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") -!!ENDIF - unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) - - find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d - PATHS \"${LibDir}\" -!!IF !mac - NO_DEFAULT_PATH -!!ENDIF - ) - if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - _qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") -!!IF !isEmpty(CMAKE_WINDOWS_BUILD) - set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") -!!ENDIF - endif() - unset(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG CACHE) - list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name}) - endif() - endif() - endforeach() -endmacro() - - -!!IF !isEmpty(CMAKE_EGL_LIBS) -_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\") -!!ENDIF - -!!IF !isEmpty(CMAKE_OPENGL_LIBS) -_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$CMAKE_OPENGL_INCDIRS\") - -!!ENDIF - -!!ENDIF - -set(Qt5Gui_OPENGL_IMPLEMENTATION $$CMAKE_QT_OPENGL_IMPLEMENTATION) - -get_target_property(_configs Qt5::Gui IMPORTED_CONFIGURATIONS) -foreach(_config ${_configs}) - set_property(TARGET Qt5::Gui APPEND PROPERTY - IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} - ${Qt5Gui_EGL_LIBRARIES} ${Qt5Gui_OPENGL_LIBRARIES} - ) -endforeach() -unset(_configs) From d0d63aa26084036a9d5b29e2c450784cb703f87d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 25 Apr 2019 15:54:29 +0200 Subject: [PATCH 0420/1322] Append syncqt header include dir when building plugins Change-Id: I899d4562155fbc82cfd13979b424d751095a381b Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 70dee6851c4..ba70e82ce70 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -759,6 +759,8 @@ function(add_qt_plugin target) INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" + # For the syncqt headers + $ ${arg_INCLUDE_DIRECTORIES} PUBLIC_INCLUDE_DIRECTORIES ${arg_PUBLIC_INCLUDE_DIRECTORIES} LIBRARIES ${arg_LIBRARIES} From c43b57c9b8d02e070d26f6f6ebbd89caf8eb8255 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 18 Apr 2019 12:58:11 +0200 Subject: [PATCH 0421/1322] CMake: Add tests/auto/corelib/io/qabstractfileengine Change-Id: I2f48ba9b23f9e3bc7e6c91a7b4c79f5f15824270 Reviewed-by: Alexandru Croitor --- tests/auto/corelib/io/CMakeLists.txt | 1 + .../io/qabstractfileengine/CMakeLists.txt | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt diff --git a/tests/auto/corelib/io/CMakeLists.txt b/tests/auto/corelib/io/CMakeLists.txt index e1b4f931cdd..539a9d92420 100644 --- a/tests/auto/corelib/io/CMakeLists.txt +++ b/tests/auto/corelib/io/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(largefile) +add_subdirectory(qabstractfileengine) add_subdirectory(qbuffer) add_subdirectory(qdataurl) if(QT_FEATURE_private_tests) diff --git a/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt b/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt new file mode 100644 index 00000000000..97c9ba7969a --- /dev/null +++ b/tests/auto/corelib/io/qabstractfileengine/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from qabstractfileengine.pro. + +##################################################################### +## tst_qabstractfileengine Test: +##################################################################### + +add_qt_test(tst_qabstractfileengine + SOURCES + tst_qabstractfileengine.cpp + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + +# Resources: +add_qt_resource(tst_qabstractfileengine "qabstractfileengine" PREFIX "/tst_qabstractfileengine/" FILES + resources/) + + +#### Keys ignored in scope 1:.:.:qabstractfileengine.pro:: +# CONFIG = "testcase" From a1752276e0f71f29df12317eaa81798ccbe2fa91 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 29 Apr 2019 13:14:22 +0200 Subject: [PATCH 0422/1322] CMake: Do not link qmake against Qt (not even the bootstrap one) Qmake should not rebuild all the code in QtCore, but currently it does. When linking against QtCore, all the symbols get duplicated. A clever linker will "deduplicate" the symbols again, so this actually works with shared Qt builds, but it fails for static builds. Do not rely on the linker being clever and just do not link Qt at all for qmake. Change-Id: I0f79ed9176a19ee884dd425e5f23c26cf69dc422 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 18 +++++++++++++----- qmake/CMakeLists.txt | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ba70e82ce70..6f178e2e586 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -924,14 +924,22 @@ function(add_qt_tool name) return() endif() - qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP;NO_INSTALL" "" "${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP;NO_QT;NO_INSTALL" "" "${__default_private_args}" ${ARGN}) set(disable_autogen_tools "${arg_DISABLE_AUTOGEN_TOOLS}") - if (arg_BOOTSTRAP) - set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Bootstrap) - list(APPEND disable_autogen_tools "uic" "moc" "rcc") + if (arg_NO_QT) + # FIXME: Remove NO_QT again once qmake can use a "normal" Qt! + if (arg_BOOTSTRAP) + message(FATAL_ERROR "Tool can not be NO_QT and BOOTSTRAP at the same time!") + endif() + set(corelib "") else() - set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Core) + if (arg_BOOTSTRAP) + set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Bootstrap) + list(APPEND disable_autogen_tools "uic" "moc" "rcc") + else() + set(corelib ${QT_CMAKE_EXPORT_NAMESPACE}::Core) + endif() endif() set(bootstrap "") diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index d40ec9119b3..fc6e4ceea3b 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -12,6 +12,7 @@ find_library(FWFoundation Foundation) # special case ##################################################################### add_qt_tool(qmake # special case + NO_QT # special case # GUI # special case: remove this SOURCES ../src/corelib/codecs/qutfcodec.cpp ../src/corelib/codecs/qutfcodec_p.h From f38ebcbe32621953663efbd479ecadf6de4e4cc9 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 29 Apr 2019 16:32:21 +0200 Subject: [PATCH 0423/1322] Fix add_qt_tool to properly propagate NO_QT option Otherwise add_qt_executable will still link against Core, and thus building qmake in a static build will fail. Amends a1752276e0f71f29df12317eaa81798ccbe2fa91 Change-Id: Iebbdf9d0a2808a9eaeffdf8fbdb44ff5e2920f3b Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6f178e2e586..aaa68d8c0ad 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -808,7 +808,7 @@ endfunction() # Please consider to use a more specific version target like the one created # by add_qt_test or add_qt_tool below. function(add_qt_executable name) - qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP;NO_INSTALL" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP;NO_QT;NO_INSTALL" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x") set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") @@ -828,7 +828,7 @@ function(add_qt_executable name) ) set(extra_libraries "") - if(NOT arg_BOOTSTRAP) + if(NOT arg_BOOTSTRAP AND NOT arg_NO_QT) set(extra_libraries "Qt::Core") endif() @@ -947,6 +947,11 @@ function(add_qt_tool name) set(bootstrap BOOTSTRAP) endif() + set(no_qt "") + if(arg_NO_QT) + set(no_qt NO_QT) + endif() + set(no_install "") if(arg_NO_INSTALL) set(no_install NO_INSTALL) @@ -954,6 +959,7 @@ function(add_qt_tool name) add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" ${bootstrap} + ${no_qt} ${no_install} SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES From fda57947b4cbb36403c0245ed503a88b4d96cddf Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 29 Apr 2019 16:53:27 +0200 Subject: [PATCH 0424/1322] Fix qmake build after no longer linking against QtCore Change-Id: I264195ac6e896dd72656afbec2329ae0f1a8bc82 Reviewed-by: Tobias Hunger --- qmake/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index fc6e4ceea3b..3c93e40b9ef 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -16,13 +16,17 @@ add_qt_tool(qmake # special case # GUI # special case: remove this SOURCES ../src/corelib/codecs/qutfcodec.cpp ../src/corelib/codecs/qutfcodec_p.h + ../src/corelib/global/qendian.cpp # special case ../src/corelib/global/qglobal.cpp ../src/corelib/global/qglobal.h ../src/corelib/global/qlibraryinfo.cpp ../src/corelib/global/qlogging.cpp ../src/corelib/global/qmalloc.cpp ../src/corelib/global/qnumeric.cpp ../src/corelib/global/qnumeric.h + ../src/corelib/global/qoperatingsystemversion.cpp # special case + ../src/corelib/global/qrandom.cpp # special case ../src/corelib/io/qabstractfileengine.cpp ../src/corelib/io/qabstractfileengine_p.h ../src/corelib/io/qbuffer.cpp ../src/corelib/io/qbuffer.h + ../src/corelib/io/qdebug.cpp # special case ../src/corelib/io/qdir.cpp ../src/corelib/io/qdir.h ../src/corelib/io/qdir_p.h ../src/corelib/io/qdiriterator.cpp ../src/corelib/io/qdiriterator.h ../src/corelib/io/qfile.cpp ../src/corelib/io/qfile.h @@ -65,6 +69,7 @@ add_qt_tool(qmake # special case ../src/corelib/tools/qlocale_tools.cpp ../src/corelib/tools/qlocale_tools_p.h ../src/corelib/tools/qmap.cpp ../src/corelib/tools/qmap.h ../src/corelib/tools/qregexp.cpp ../src/corelib/tools/qregexp.h + ../src/corelib/tools/qringbuffer.cpp # special case ../src/corelib/tools/qstring.cpp ../src/corelib/tools/qstring.h ../src/corelib/tools/qstring_compat.cpp ../src/corelib/tools/qstringlist.cpp ../src/corelib/tools/qstringlist.h @@ -184,8 +189,7 @@ extend_target(qmake CONDITION WIN32 ../src/corelib/io/qfsfileengine_win.cpp ../src/corelib/tools/qlocale_win.cpp ../src/corelib/io/qsettings_win.cpp - ../src/corelib/global/qoperatingsystemversion.cpp - ../src/corelib/global/qoperatingsystemversion_win.cpp + # ../src/corelib/global/qoperatingsystemversion.cpp special case: remove this ../src/corelib/plugin/qsystemlibrary.cpp library/registry.cpp DEFINES @@ -211,3 +215,5 @@ set_target_properties(qmake PROPERTIES AUTORCC OFF AUTOUIC OFF ) + +qt_internal_add_link_flags_gc_sections(qmake PRIVATE) # special case From 5668522413c831d6f1c607e1c87a0b1e1ee3cbc5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 1 May 2019 14:40:32 +0200 Subject: [PATCH 0425/1322] Make freetype a required package With qmake if we don't find a system package, we use the bundled one. With CMake we don't provide a bundle freetype, hence it's required to find a system one (or custom provided one). Change-Id: I00a5e2ac55459957dae0729f89bafa792a102152 Reviewed-by: Simon Hausmann --- src/gui/configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 354be5bd44d..b11e06bdb4f 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -29,7 +29,7 @@ set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL) find_package(EGL) set_package_properties(EGL PROPERTIES TYPE OPTIONAL) find_package(Freetype) -set_package_properties(Freetype PROPERTIES TYPE OPTIONAL) +set_package_properties(Freetype PROPERTIES TYPE REQUIRED) find_package(Fontconfig) set_package_properties(Fontconfig PROPERTIES TYPE OPTIONAL) find_package(gbm) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 58ab106555a..fe853bb910d 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -54,7 +54,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'drm': 'Libdrm', 'egl': 'EGL', 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), - 'freetype': 'Freetype', + 'freetype': ['Freetype', 'REQUIRED'], 'gbm': 'gbm', 'glib': 'GLIB2', 'gnu_iconv': None, From 58316e03a2c3c95f63d9331e4959fb539ca1194b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 1 May 2019 14:07:16 +0200 Subject: [PATCH 0426/1322] Update readme with some useful info Update required dependencies. Add section on how to build vcpkg on macOS. Fix some typos. Lower required CMake version. Inform how to bypass annoying ninja reconfiguration issue. Change-Id: Ia35bd4329c2cbb9857157cdc33b098f5adb04a35 Reviewed-by: Simon Hausmann --- cmake/README.md | 53 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 24ac29d8e6a..d48c45c9b1c 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -1,15 +1,10 @@ # Status -Initial port is on-going. Some modules of QtBase are ported, incl. some of the platform modules. Most are missing still. +Initial port is on-going. Some modules of QtBase are ported, incl. some of the platform modules. Many libraries, tests and examples are still missing. -Basic functionality is there (moc, uic, etc.), but documentation, translations, qdbusxml2cpp, etc. are missing. +Basic functionality is there (moc, uic, etc.), but documentation, translations, etc. are missing. -NOTE: YOU WILL NEED CMAKE 3.15 or later (for example, master branch, -after 168c11f70e52f9b4f00ef289a95023be3f273d2d, for more details see -https://gitlab.kitware.com/cmake/cmake/merge_requests/2679 -and -https://gitlab.kitware.com/cmake/cmake/merge_requests/3049 -). +NOTE: YOU NEED CMAKE 3.14 or later. # Intro @@ -33,22 +28,34 @@ You may use vcpkg to install dependencies needed to build QtBase. * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to * Linux: ``x64-linux`` + * macOS: ``x64-osx`` * Windows: ``qt-x86-windows-static`` - * Build Qt dependencies: ``vcpkg install zlib pcre2 double-conversion harfbuzz`` + * Build Qt dependencies: ``vcpkg install zlib pcre2 double-conversion harfbuzz freetype`` * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake`` - Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_PATH. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). + Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_FILE. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). +# Building VCPKG on macOS + +vcpkg doesn't currently buid on macOS with Xcode provided clang, due to missing filesystem headers. It's expected to be fixed in Xcode 11. + +See https://github.com/Microsoft/vcpkg/issues/4475 and https://github.com/Microsoft/vcpkg/issues/6068. + +Vcpkg can be built with homebrew provided gcc though. + + * Install homebrew: ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` + * Install gcc via homebrew: ``brew install gcc`` + +After installing gcc, just follow the vcpkg instructions in the section above. # Building against homebrew on macOS -vcpkg doesn't support clang on macOS, see https://github.com/Microsoft/vcpkg/issues/4475 . +Instead of using vcpkg, you can also use homebrew to get the 3rd party dependencies. * Install homebrew: ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` - * Build Qt dependencies: ``brew install pcre2 harfbuzz`` - * Build cmake from HEAD (or you can build your own): ``brew install --HEAD cmake`` + * Build Qt dependencies: ``brew install pcre2 harfbuzz freetype`` + * Install cmake: ``brew install cmake`` * When running cmake in qtbase, pass ``-DCMAKE_PREFIX_PATH=/usr/local`` - # Building The basic way of building with cmake is as follows: @@ -80,8 +87,26 @@ When you're done with the build, you may want to install it, using ``ninja insta ninja install ``` +Make sure to remove CMakeCache.txt if you forgot to set the CMAKE_INSTALL_PREFIX on the first configuration, otherwise a second re-configuration will not pick up the new install prefix. + You can use ``cmake-gui {path to build directory}`` or ``ccmake {path to build directory}`` to configure the values of individual cmake variables or Qt features. After changing a value, you need to choose the *configure* step (usually several times:-/), followed by the *generate* step (to generate makefiles/ninja files). +## Ninja reconfiguration bug + +If you use the Ninja generator, there's a bug that after the first CMake configuration, if you run ninja, it will do the reconfiguration step again. This is quite annoying and time consuming. + +There is an open pull request that fixes the issue at https://github.com/ninja-build/ninja/pull/1527. You can build your own Ninja executable until the request is merged. + +``` + cd {some directory} + git clone https://github.com/ninja-build/ninja.git + cd ninja && mkdir build && cd build + git remote add fix git@github.com:mathstuf/ninja.git && git fetch --all + git cherry-pick 29a565f18e01ce83ca14801f4684cd2acaf00d4c + ../configure.py --bootstrap + cp ninja /usr/local/bin/ninja +``` + ## Building with CCache You can pass ``-DQT_USE_CCACHE=ON`` to make the build system look for ``ccache`` in your ``PATH`` and prepend it to all C/C++/Objective-C compiler calls. At the moment this is only supported for the Ninja and the Makefile generators. From 42d3b21c92525ea6a430c67e577a5991d679fa1d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 10 Apr 2019 19:21:22 +0200 Subject: [PATCH 0427/1322] Export tool config and target files for each relevant module CMake will now generate config and target files for each module that provides tools. As a result, namespaced global targets such as Qt5::moc or Qt5::rcc can be made available. Third party projects that require just these tools, and not the Qt modules themselves, should specify CMAKE_PREFIX_PATH pointing to the installed Qt location, and call find_package(Qt5CoreTools), find_package(Qt5GuiTools), etc. It is also possible to call find_package(Qt5Tools REQUIRED Core Widgets) where the last option is a list of modules whose tools should be imported. Note that all the tools are in the Qt5:: namespace and not in the Qt5CoreTools:: or Qt5WidgetsTools:: namespace. This commit also changes the behavior regarding when to build tools while building Qt itself. When cross compiling Qt (checked via CMAKE_CROSSCOMPILING) or when -DQT_FORCE_FIND_TOOLS=TRUE is passed, tools added by add_qt_tool will always be searched for and not built. In this case the user has to specify the CMake variable QT_HOST_PATH pointing to an installed host Qt location. When not cross compiling, tools added by add_qt_tool are built from source. When building leaf modules (like qtsvg) that require some tool that was built in qtbase (like moc), the module project should contain a find_package(Qt5ToolsCore) call and specify an appropriate CMAKE_PREFIX_PATH so that the tool package is found. Note that because HOST_QT_TOOLS_DIRECTORY was replaced by QT_HOST_PATH, the ensure syncqt code was changed to make it work properly with both qtbase and qtsvg. Here's a list of tools and their module associations: qmake, moc, rcc, tracegen, qfloat16-tables, qlalr -> CoreTools qvkgen -> GuiTools uic -> WidgetTools dbus related tools -> DBusTools Task-number: QTBUG-74134 Change-Id: Ie67d1e2f8de46102b48eca008f0b50caf4fbe3ed Reviewed-by: Tobias Hunger --- CMakeLists.txt | 5 +- cmake/QtBaseGlobalTargets.cmake | 18 +++ cmake/QtBuild.cmake | 197 +++++++++++++++++++---- cmake/QtConfig.cmake.in | 1 - cmake/QtModuleToolsConfig.cmake.in | 5 + cmake/QtPostProcess.cmake | 6 +- cmake/QtSetup.cmake | 14 +- cmake/QtToolsConfig.cmake.in | 35 ++++ cmake/README.md | 4 +- qmake/CMakeLists.txt | 1 + src/CMakeLists.txt | 15 +- src/corelib/CMakeLists.txt | 11 +- src/tools/moc/CMakeLists.txt | 1 + src/tools/qdbuscpp2xml/CMakeLists.txt | 1 + src/tools/qdbusxml2cpp/CMakeLists.txt | 1 + src/tools/qfloat16-tables/CMakeLists.txt | 1 + src/tools/qlalr/CMakeLists.txt | 1 + src/tools/qvkgen/CMakeLists.txt | 1 + src/tools/rcc/CMakeLists.txt | 1 + src/tools/tracegen/CMakeLists.txt | 1 + src/tools/uic/CMakeLists.txt | 1 + src/widgets/CMakeLists.txt | 2 +- 22 files changed, 260 insertions(+), 63 deletions(-) create mode 100644 cmake/QtModuleToolsConfig.cmake.in create mode 100644 cmake/QtToolsConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index b43a6622850..d46b574369a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,9 @@ include(QtBaseGlobalTargets) option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON) set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) +## Decide whether tools will be built. +qt_check_if_tools_will_be_built() + ## Visit all the directories: add_subdirectory(src) @@ -40,7 +43,7 @@ if (BUILD_TESTING) add_subdirectory(tests) endif() -if (NOT CMAKE_CROSSCOMPILING) +if (QT_WILL_BUILD_TOOLS) add_subdirectory(qmake) endif() diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 73deb51b494..613dc492423 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -11,6 +11,7 @@ target_include_directories(Platform target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS}) set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}") +# Generate and install Qt5 config file. configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" @@ -28,6 +29,23 @@ install(FILES COMPONENT Devel ) +# Generate and install Qt5Tools config file. +configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/QtToolsConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfig.cmake" + INSTALL_DESTINATION "${config_install_dir}" +) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfigVersion.cmake" + DESTINATION "${config_install_dir}Tools" + COMPONENT Devel +) ## Library to hold global features: ## These features are stored and accessed via Qt::GlobalConfig, but the diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index aaa68d8c0ad..00571903602 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -91,12 +91,32 @@ else() set(QT_HAS_NAMESPACE ON) endif() -macro(qt_internal_set_known_qt_modules) - set(KNOWN_QT_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) +macro(qt_internal_set_qt_known_modules) + set(QT_KNOWN_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) endmacro() # Reset: -qt_internal_set_known_qt_modules("") +qt_internal_set_qt_known_modules("") + +set(QT_KNOWN_MODULES_WITH_TOOLS "" CACHE INTERNAL "Known Qt modules with tools" FORCE) +macro(qt_internal_append_known_modules_with_tools module) + if(NOT ${module} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + set(QT_KNOWN_MODULES_WITH_TOOLS "${QT_KNOWN_MODULES_WITH_TOOLS};${module}" + CACHE INTERNAL "Known Qt modules with tools" FORCE) + endif() +endmacro() + +macro(qt_internal_append_known_module_tool module tool) + if(NOT ${tool} IN_LIST QT_KNOWN_MODULE_${module}_TOOLS) + list(APPEND QT_KNOWN_MODULE_${module}_TOOLS "${tool}") + set(QT_KNOWN_MODULE_${module}_TOOLS "${QT_KNOWN_MODULE_${module}_TOOLS}" + CACHE INTERNAL "Known Qt module ${module} tools" FORCE) + endif() +endmacro() + +# Reset syncqt cache variable, to make sure it gets recomputed on reconfiguration, otherwise +# it might not get installed. +unset(QT_SYNCQT CACHE) # For adjusting variables when running tests, we need to know what # the correct variable is for separating entries in PATH-alike @@ -202,12 +222,18 @@ function(qt_ensure_sync_qt) return() endif() - get_target_property(mocPath "${QT_CMAKE_EXPORT_NAMESPACE}::moc" LOCATION) - get_filename_component(binDirectory "${mocPath}" DIRECTORY) - # We could put this into the cache, but on the other hand there's no real need to - # pollute the app's cache with this. For the first qtbase build, the variable is - # set in global scope. - set(QT_SYNCQT "${binDirectory}/syncqt.pl" CACHE FILEPATH "syncqt script") + # When building qtbase, use the source syncqt, otherwise use the installed one. + if(EXISTS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl") + set(QT_SYNCQT "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" CACHE FILEPATH "syncqt script") + message(STATUS "Using source syncqt found at: ${QT_SYNCQT}") + install(PROGRAMS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" DESTINATION "${INSTALL_LIBEXECDIR}") + else() + get_filename_component(syncqt_absolute_path + "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBEXECDIR}/syncqt.pl" + ABSOLUTE) + set(QT_SYNCQT "${syncqt_absolute_path}" CACHE FILEPATH "syncqt script") + message(STATUS "Using installed syncqt found at: ${QT_SYNCQT}") + endif() endfunction() # A version of cmake_parse_arguments that makes sure all arguments are processed and errors out @@ -349,8 +375,11 @@ function(qt_autogen_tools target) set_target_properties("${target}" PROPERTIES AUTO${captitalAutogenTool} ON - AUTO${captitalAutogenTool}_EXECUTABLE "$") - set_property(TARGET ${target} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS Qt::${autogen_tool}) + AUTO${captitalAutogenTool}_EXECUTABLE + "$") + set_property(TARGET ${target} APPEND PROPERTY + AUTOGEN_TARGET_DEPENDS + ${QT_CMAKE_EXPORT_NAMESPACE}::${autogen_tool}) endforeach() set_directory_properties(PROPERTIES @@ -506,14 +535,16 @@ function(add_qt_module target) qt_internal_module_info(module "${target}") # Process arguments: - qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC" "CONFIG_MODULE_NAME" + qt_parse_all_arguments(arg "add_qt_module" + "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT" + "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args}" ${ARGN}) if(NOT DEFINED arg_CONFIG_MODULE_NAME) set(arg_CONFIG_MODULE_NAME "${module_lower}") endif() - qt_internal_set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") + qt_internal_set_qt_known_modules("${QT_KNOWN_MODULES}" "${target}") ### Define Targets: if(${arg_STATIC}) @@ -651,7 +682,7 @@ function(add_qt_module target) # When a public module depends on private, also make its private depend on the other's private set(qt_libs_private "") - foreach(it ${KNOWN_QT_MODULES}) + foreach(it ${QT_KNOWN_MODULES}) list(FIND arg_LIBRARIES "Qt::${it}Private" pos) if(pos GREATER -1) list(APPEND qt_libs_private "Qt::${it}Private") @@ -699,6 +730,64 @@ function(add_qt_module target) DESTINATION "${config_install_dir}" COMPONENT Devel ) + + if(NOT ${arg_DISABLE_TOOLS_EXPORT}) + qt_export_tools(${target}) + endif() +endfunction() + +function(qt_export_tools module_name) + # If no tools were defined belonging to this module, don't create a config and targets file. + # Guards against the case when doing a cross-build and the function is called manually and not + # by add_qt_module. + + if(NOT "${module_name}" IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + return() + endif() + + # The tools target name. For example: CoreTools + set(target "${module_name}Tools") + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") + + # Add the extra cmake statements to make the tool targets global, so it doesn't matter where + # find_package is called. + # Also assemble a list of tool targets to expose in the config file for informational purposes. + set(extra_cmake_statements "") + set(tool_targets "") + foreach(tool_name ${QT_KNOWN_MODULE_${module_name}_TOOLS}) + set(extra_cmake_statements "${extra_cmake_statements} +get_property(is_global TARGET ${INSTALL_CMAKE_NAMESPACE}::${tool_name} PROPERTY IMPORTED_GLOBAL) +if(NOT is_global) + set_property(TARGET ${INSTALL_CMAKE_NAMESPACE}::${tool_name} PROPERTY IMPORTED_GLOBAL TRUE) +endif() +") + list(APPEND tool_targets "${QT_CMAKE_EXPORT_NAMESPACE}::${tool_name}") + endforeach() + + string(APPEND extra_cmake_statements +"set(${QT_CMAKE_EXPORT_NAMESPACE}${module_name}Tools_TARGETS \"${tool_targets}\")") + + configure_package_config_file( + "${QT_CMAKE_DIR}/QtModuleToolsConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + INSTALL_DESTINATION "${config_install_dir}" + ) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + + install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" + NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" + DESTINATION "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") endfunction() function(qt_internal_check_directory_or_type name dir type default result_var) @@ -903,28 +992,68 @@ function(add_qt_test_helper name) add_qt_executable("${name}" NO_INSTALL OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.." ${ARGN}) endfunction() +# Sets QT_WILL_BUILD_TOOLS if tools will be built. +function(qt_check_if_tools_will_be_built) + set01(will_build_tools NOT CMAKE_CROSSCOMPILING AND NOT QT_FORCE_FIND_TOOLS) + set(QT_WILL_BUILD_TOOLS ${will_build_tools} CACHE INTERNAL "Are tools going to be built" FORCE) +endfunction() # This function is used to define a "Qt tool", such as moc, uic or rcc. # The BOOTSTRAP option allows building it as standalone program, otherwise # it will be linked against QtCore. function(add_qt_tool name) - set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") - if (NOT _build_tools) - message("Searching for ${name}.") - find_program("_PROG_${name}" "${name}" PATHS "${HOST_QT_TOOLS_DIRECTORY}" NO_DEFAULT_PATH) - if (_PROG_${name} STREQUAL "_PROG_${name}-NOTFOUND") - message(FATAL_ERROR "The name \"${name}\" was not found in the " - "HOST_QT_TOOLS_DIRECTORY (\"${HOST_QT_TOOLS_DIRECTORY}\").") - else() - message(STATUS "${name} was found at ${_PROG_${name}}.") - add_executable("${name}" IMPORTED GLOBAL) - set_target_properties("${name}" PROPERTIES IMPORTED_LOCATION "${_PROG_${name}}") - qt_internal_add_target_aliases("${name}") - endif() + qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP;NO_QT;NO_INSTALL" "TOOLS_TARGET" + "${__default_private_args}" ${ARGN}) + + # Handle case when a tool does not belong to a module and it can't be built either (like + # during a cross-compile). + if(NOT arg_TOOLS_TARGET AND NOT QT_WILL_BUILD_TOOLS) + message(FATAL_ERROR "The tool \"${name}\" has not been assigned to a module via" + " TOOLS_TARGET (so it can't be found) and it can't be built" + " (QT_WILL_BUILD_TOOLS is ${QT_WILL_BUILD_TOOLS}).") + endif() + + set(full_name "${QT_CMAKE_EXPORT_NAMESPACE}::${name}") + if(TARGET ${full_name}) + get_property(path TARGET ${full_name} PROPERTY LOCATION) + message(STATUS "Tool '${full_name}' was found at ${path}.") return() endif() - qt_parse_all_arguments(arg "add_qt_tool" "BOOTSTRAP;NO_QT;NO_INSTALL" "" "${__default_private_args}" ${ARGN}) + if(arg_TOOLS_TARGET AND NOT QT_WILL_BUILD_TOOLS) + set(tools_package_name "Qt5${arg_TOOLS_TARGET}Tools") + message(STATUS "Searching for tool '${full_name}' in package ${tools_package_name}.") + + # Only search in path provided by QT_HOST_PATH. We need to do it with CMAKE_PREFIX_PATH + # instead of PATHS option, because any find_dependency call inside a Tools package would + # not get the proper prefix when using PATHS. + set(BACKUP_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}) + set(CMAKE_PREFIX_PATH "${QT_HOST_PATH}") + find_package( + ${tools_package_name} + ${PROJECT_VERSION} + NO_PACKAGE_ROOT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_PACKAGE_REGISTRY + NO_CMAKE_SYSTEM_PATH + NO_CMAKE_SYSTEM_PACKAGE_REGISTRY) + set(CMAKE_PREFIX_PATH ${BACKUP_CMAKE_PREFIX_PATH}) + + if(${${tools_package_name}_FOUND} AND TARGET ${full_name}) + get_property(path TARGET ${full_name} PROPERTY LOCATION) + message(STATUS "${full_name} was found at ${path} using package ${tools_package_name}.") + return() + endif() + endif() + + if(NOT QT_WILL_BUILD_TOOLS) + message(FATAL_ERROR "The tool \"${full_name}\" was not found in the " + "${tools_package_name} package. " + "Package found: ${${tools_package_name}_FOUND}") + else() + message(STATUS "Tool '${full_name}' will be built from source.") + endif() set(disable_autogen_tools "${arg_DISABLE_AUTOGEN_TOOLS}") if (arg_NO_QT) @@ -973,8 +1102,16 @@ function(add_qt_tool name) ) qt_internal_add_target_aliases("${name}") - if(NOT arg_NO_INSTALL) - install(TARGETS "${name}" EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) + if(NOT arg_NO_INSTALL AND arg_TOOLS_TARGET) + # Assign a tool to an export set, and mark the module to which the tool belongs. + qt_internal_append_known_modules_with_tools("${arg_TOOLS_TARGET}") + + # Also append the tool to the module list. + qt_internal_append_known_module_tool("${arg_TOOLS_TARGET}" "${name}") + + install(TARGETS "${name}" + EXPORT "Qt${PROJECT_VERSION_MAJOR}${arg_TOOLS_TARGET}ToolsTargets" + DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) endif() endfunction() diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index 69586fe52e4..f30cd82cf16 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -8,7 +8,6 @@ endif() get_filename_component(_qt_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Targets.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@ToolsTargets.cmake") # if (NOT @INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS) # set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "The Qt package requires at least one component") diff --git a/cmake/QtModuleToolsConfig.cmake.in b/cmake/QtModuleToolsConfig.cmake.in new file mode 100644 index 00000000000..4dc658a10b2 --- /dev/null +++ b/cmake/QtModuleToolsConfig.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") + +@extra_cmake_statements@ diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 0d50d7fa476..e63bcc05389 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -13,8 +13,8 @@ function(qt_internal_write_depends_file target) endfunction() function(qt_internal_create_depends_files) - message("Generating depends files for ${KNOWN_QT_MODULES}...") - foreach (target ${KNOWN_QT_MODULES}) + message("Generating depends files for ${QT_KNOWN_MODULES}...") + foreach (target ${QT_KNOWN_MODULES}) get_target_property(depends "${target}" LINK_LIBRARIES) set(qtdeps "") foreach (dep ${depends}) @@ -26,7 +26,7 @@ function(qt_internal_create_depends_files) set(dep "${CMAKE_MATCH_1}") endif() - list(FIND KNOWN_QT_MODULES "${dep}" _pos) + list(FIND QT_KNOWN_MODULES "${dep}" _pos) if (_pos GREATER -1) list(APPEND qtdeps "${dep}") endif() diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index c7d6f50b738..7285c0c5163 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -54,18 +54,10 @@ include(QtCompilerOptimization) include(QtCompilerFlags) ## Find host tools (if non native): -set(HOST_QT_TOOLS_DIRECTORY "" CACHE PATH "Directory with Qt host tools.") +set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.") -if (CMAKE_CROSSCOMPILING AND "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") - message(FATAL_ERROR "You need to set HOST_QT_TOOLS_DIRECTORY for a cross-complile.") -endif() - -## Find syncqt in HOST TOOLS or locally: -if("x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") - set(QT_SYNCQT "${PROJECT_SOURCE_DIR}/bin/syncqt.pl") - install(PROGRAMS "${QT_SYNCQT}" DESTINATION "${INSTALL_BINDIR}") -else() - set(QT_SYNCQT "${HOST_QT_TOOLS_DIRECTORY}/syncqt.pl") +if (CMAKE_CROSSCOMPILING AND NOT IS_DIRECTORY ${QT_HOST_PATH}) + message(FATAL_ERROR "You need to set QT_HOST_PATH to cross compile Qt.") endif() ## Enable support for sanitizers: diff --git a/cmake/QtToolsConfig.cmake.in b/cmake/QtToolsConfig.cmake.in new file mode 100644 index 00000000000..7b2fa1de740 --- /dev/null +++ b/cmake/QtToolsConfig.cmake.in @@ -0,0 +1,35 @@ +@PACKAGE_INIT@ + +get_filename_component(_qt_tools_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) + + if (NOT @INSTALL_CMAKE_NAMESPACE@Tools_FIND_COMPONENTS) + set(@INSTALL_CMAKE_NAMESPACE@Tools_NOT_FOUND_MESSAGE + "The Qt tools package requires at least one component.") + set(@INSTALL_CMAKE_NAMESPACE@Tools_FOUND False) + return() + endif() + +foreach(module ${@INSTALL_CMAKE_NAMESPACE@Tools_FIND_COMPONENTS}) + find_package(@INSTALL_CMAKE_NAMESPACE@${module}Tools + ${_@INSTALL_CMAKE_NAMESPACE@Tools_FIND_PARTS_QUIET} + ${_@INSTALL_CMAKE_NAMESPACE@Tools_FIND_PARTS_REQUIRED} + PATHS ${_qt_tools_cmake_dir} NO_DEFAULT_PATH + ) + if (NOT @INSTALL_CMAKE_NAMESPACE@${module}Tools_FOUND) + string(CONFIGURE ${_qt5_module_location_template} _expected_module_location @ONLY) + + if (@INSTALL_CMAKE_NAMESPACE@_FIND_REQUIRED_${module}) + set(_Qt_NOTFOUND_MESSAGE + "${_Qt_NOTFOUND_MESSAGE}Failed to find Qt component \"${module}\" config file.") + elseif(NOT Qt_FIND_QUIETLY) + message(WARNING "Failed to find Qt component \"${module}\" config file.") + endif() + + unset(_expected_module_location) + endif() +endforeach() + +if (_Qt_NOTFOUND_MESSAGE) + set(@INSTALL_CMAKE_NAMESPACE@Tools_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}") + set(@INSTALL_CMAKE_NAMESPACE@Tools_FOUND False) +endif() diff --git a/cmake/README.md b/cmake/README.md index d48c45c9b1c..4a21e5f783c 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -126,10 +126,10 @@ Yocto based device SDKs come with an environment setup script that needs to be s In order to make sure that Qt picks up the code generator tools from the host build, you need to pass an extra parameter to cmake: ``` - -DHOST_QT_TOOLS_DIRECTORY=/path/to/your/host_build/bin + -DQT_HOST_PATH=/path/to/your/host_build ``` -The specified path needs to point to a directory that contains all the binaries of the host build of Qt. +The specified path needs to point to a directory that contains an installed host build of Qt. # Debugging CMake files diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 3c93e40b9ef..49d622a5fe6 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -13,6 +13,7 @@ find_library(FWFoundation Foundation) # special case add_qt_tool(qmake # special case NO_QT # special case + TOOLS_TARGET Core # special case # GUI # special case: remove this SOURCES ../src/corelib/codecs/qutfcodec.cpp ../src/corelib/codecs/qutfcodec_p.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 212df0d9c2d..dbd6f159231 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,20 +23,13 @@ endif() add_subdirectory(3rdparty) function(find_or_build_bootstrap_names) - # Move these into their own folder and move this code in the CMakeLists.txt file there! - set01(_build_tools "x${HOST_QT_TOOLS_DIRECTORY}" STREQUAL "x") - - if (_build_tools) + if (QT_WILL_BUILD_TOOLS) add_subdirectory(tools/bootstrap) # bootstrap library endif() add_subdirectory(tools/moc) add_subdirectory(tools/rcc) add_subdirectory(tools/qfloat16-tables) add_subdirectory(tools/tracegen) - - if (_build_tools) - install(EXPORT "Qt${PROJECT_VERSION_MAJOR}ToolsTargets" NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" DESTINATION "${INSTALL_LIBDIR}/cmake/Qt${PROJECT_VERSION_MAJOR}") - endif() endfunction() find_or_build_bootstrap_names() @@ -54,10 +47,14 @@ endif() if (QT_FEATURE_xml) add_subdirectory(xml) endif() +add_subdirectory(tools) + +# Need to build qmake and other Core tools before exporting them. +qt_export_tools(Core) + if (QT_FEATURE_dbus) add_subdirectory(dbus) endif() -add_subdirectory(tools) if(QT_FEATURE_gui) add_subdirectory(gui) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index eb11b1251e5..37e89a36482 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -235,13 +235,14 @@ add_qt_module(Core Qt::Platform DISABLE_AUTOGEN_TOOLS # special case: uic + DISABLE_TOOLS_EXPORT # special case: ) # special case: -add_dependencies(Core Qt::moc) -add_dependencies(Core Qt::rcc) -add_dependencies(CorePrivate Qt::moc) -add_dependencies(CorePrivate Qt::rcc) +add_dependencies(Core ${QT_CMAKE_EXPORT_NAMESPACE}::moc) +add_dependencies(Core ${QT_CMAKE_EXPORT_NAMESPACE}::rcc) +add_dependencies(CorePrivate ${QT_CMAKE_EXPORT_NAMESPACE}::moc) +add_dependencies(CorePrivate ${QT_CMAKE_EXPORT_NAMESPACE}::rcc) if (QT_NAMESPACE STREQUAL "") else() @@ -1030,7 +1031,7 @@ endif() # special case: add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" - COMMAND qfloat16-tables + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qfloat16-tables ARGS "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" DEPENDS global/qfloat16.h COMMENT qfloat16-tables diff --git a/src/tools/moc/CMakeLists.txt b/src/tools/moc/CMakeLists.txt index 470baa7127a..e36cb12ef56 100644 --- a/src/tools/moc/CMakeLists.txt +++ b/src/tools/moc/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_tool(moc BOOTSTRAP + TOOLS_TARGET Core # special case SOURCES cbordevice.h generator.cpp generator.h diff --git a/src/tools/qdbuscpp2xml/CMakeLists.txt b/src/tools/qdbuscpp2xml/CMakeLists.txt index 5e2937aa05c..d9432e827aa 100644 --- a/src/tools/qdbuscpp2xml/CMakeLists.txt +++ b/src/tools/qdbuscpp2xml/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_tool(qdbuscpp2xml + TOOLS_TARGET DBus # special case SOURCES ../moc/cbordevice.h ../moc/generator.cpp ../moc/generator.h diff --git a/src/tools/qdbusxml2cpp/CMakeLists.txt b/src/tools/qdbusxml2cpp/CMakeLists.txt index e9a72a3d45b..bd0679cd888 100644 --- a/src/tools/qdbusxml2cpp/CMakeLists.txt +++ b/src/tools/qdbusxml2cpp/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_tool(qdbusxml2cpp + TOOLS_TARGET DBus # special case SOURCES qdbusxml2cpp.cpp DEFINES diff --git a/src/tools/qfloat16-tables/CMakeLists.txt b/src/tools/qfloat16-tables/CMakeLists.txt index f437ccc8db9..2fe4ed0d5c5 100644 --- a/src/tools/qfloat16-tables/CMakeLists.txt +++ b/src/tools/qfloat16-tables/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_tool(qfloat16-tables BOOTSTRAP + TOOLS_TARGET Core # special case SOURCES gen_qfloat16_tables.cpp # CONFIG = "force_bootstrap" diff --git a/src/tools/qlalr/CMakeLists.txt b/src/tools/qlalr/CMakeLists.txt index 83d067751f7..787940082d3 100644 --- a/src/tools/qlalr/CMakeLists.txt +++ b/src/tools/qlalr/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_tool(qlalr + TOOLS_TARGET Core # special case SOURCES compress.cpp compress.h cppgenerator.cpp cppgenerator.h diff --git a/src/tools/qvkgen/CMakeLists.txt b/src/tools/qvkgen/CMakeLists.txt index ea9dbeeed74..12c0c4d72f8 100644 --- a/src/tools/qvkgen/CMakeLists.txt +++ b/src/tools/qvkgen/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_tool(qvkgen + TOOLS_TARGET Gui # special case SOURCES qvkgen.cpp # QMAKE_TARGET_DESCRIPTION = "Qt Vulkan Header Generator" diff --git a/src/tools/rcc/CMakeLists.txt b/src/tools/rcc/CMakeLists.txt index 12fd0690a71..e9d275c5a1c 100644 --- a/src/tools/rcc/CMakeLists.txt +++ b/src/tools/rcc/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_tool(rcc BOOTSTRAP + TOOLS_TARGET Core # special case SOURCES main.cpp rcc.cpp rcc.h diff --git a/src/tools/tracegen/CMakeLists.txt b/src/tools/tracegen/CMakeLists.txt index df989106263..6b2308a5bef 100644 --- a/src/tools/tracegen/CMakeLists.txt +++ b/src/tools/tracegen/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_tool(tracegen BOOTSTRAP + TOOLS_TARGET Core # special case SOURCES etw.cpp etw.h helpers.cpp helpers.h diff --git a/src/tools/uic/CMakeLists.txt b/src/tools/uic/CMakeLists.txt index 05de0a71ba5..e110049c1ca 100644 --- a/src/tools/uic/CMakeLists.txt +++ b/src/tools/uic/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_tool(uic + TOOLS_TARGET Widgets # special case SOURCES cpp/cppwritedeclaration.cpp cpp/cppwritedeclaration.h cpp/cppwriteincludes.cpp cpp/cppwriteincludes.h diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index a92da0f32ec..e643829c613 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -74,7 +74,7 @@ add_qt_module(Widgets # _LOADED = "qt_module" ) -add_dependencies(Widgets Qt::uic) # special case +add_dependencies(Widgets ${QT_CMAKE_EXPORT_NAMESPACE}::uic) # special case # Resources: add_qt_resource(Widgets "qstyle" PREFIX "/qt-project.org/styles/commonstyle" BASE "styles" FILES From 9b0b464e82071338134700edfa190bf998846e4e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 24 Apr 2019 17:14:25 +0200 Subject: [PATCH 0428/1322] Write find_dependency() calls in Qt Module config files This change introduces a new function called qt_find_package() which can take an extra option called PROVIDED_TARGETS, which associates targets with the package that defines those targets. This is done by setting the INTERFACE_QT_PACKAGE_NAME and INTERFACE_QT_PACKAGE_VERSION properties on the imported targets. This information allows us to generate appropriate find_dependency() calls in a module's Config file for third party libraries. For example when an application links against QtCore, it should also link against zlib and atomic libraries. In order to do that, the library locations first have to be found by CMake. This is achieved by embedding find_dependency(ZLIB) and find_dependency(Atomic) in Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake. The latter is picked up when an application project contains find_package(Qt5Core), and thus all linking dependencies are resolved. The information 'which package provides which targets' is contained in the python json2cmake conversion script. The generated output of the script contains qt_find_package() calls that represent that information. The Qt5CoreDependencies.cmake file and which which dependencies it contains is generated at the QtPostProcess stop. Note that for non-static Qt builds, we only need to propagate public 3rd party libraries. For static builds, we need all third party libraries. In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any scope, the targets on which the property is set, have to be GLOBAL. Also for applications and other modules to find all required third party libraries, we have to install all our custom Find modules, and make sure they define INTERFACE IMPORTED libraries, and not just IMPORTED libraries. Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa Reviewed-by: Tobias Hunger --- cmake/FindPCRE2.cmake | 2 +- cmake/FindPPS.cmake | 2 +- cmake/FindSlog2.cmake | 2 +- cmake/FindWrapDoubleConversion.cmake | 3 +- cmake/FindWrapOpenGL.cmake | 4 +- cmake/FindWrapRt.cmake | 2 +- cmake/FindZSTD.cmake | 1 + cmake/QtBaseGlobalTargets.cmake | 9 +++ cmake/QtBuild.cmake | 56 +++++++++++++++++++ cmake/QtModuleConfig.cmake.in | 5 ++ cmake/QtModuleDependencies.cmake.in | 34 +++++++++++ cmake/QtPostProcess.cmake | 53 ++++++++++++++++++ configure.cmake | 6 +- .../widgets/graphicsview/boxes/CMakeLists.txt | 3 +- src/corelib/CMakeLists.txt | 4 +- src/corelib/configure.cmake | 18 +++--- src/gui/CMakeLists.txt | 2 +- src/gui/configure.cmake | 40 ++++++------- src/network/CMakeLists.txt | 2 +- src/network/configure.cmake | 4 +- .../eglconvenience/CMakeLists.txt | 2 +- .../eventdispatchers/CMakeLists.txt | 2 +- .../fontdatabases/CMakeLists.txt | 4 +- .../glxconvenience/CMakeLists.txt | 4 +- src/platformsupport/input/CMakeLists.txt | 8 +-- .../kmsconvenience/CMakeLists.txt | 2 +- .../linuxaccessibility/CMakeLists.txt | 2 +- .../vkconvenience/CMakeLists.txt | 2 +- src/plugins/generic/tslib/CMakeLists.txt | 2 +- src/plugins/imageformats/jpeg/CMakeLists.txt | 2 +- .../compose/CMakeLists.txt | 2 +- src/plugins/platforms/cocoa/CMakeLists.txt | 4 +- src/plugins/platforms/eglfs/CMakeLists.txt | 4 +- .../eglfs_kms/CMakeLists.txt | 4 +- .../eglfs_kms_egldevice/CMakeLists.txt | 2 +- .../eglfs_kms_support/CMakeLists.txt | 2 +- .../eglfs_x11/CMakeLists.txt | 6 +- src/plugins/platforms/minimal/CMakeLists.txt | 2 +- .../platforms/minimalegl/CMakeLists.txt | 2 +- src/plugins/platforms/xcb/CMakeLists.txt | 14 ++--- .../platformthemes/gtk3/CMakeLists.txt | 4 +- src/plugins/printsupport/cups/CMakeLists.txt | 2 +- src/plugins/sqldrivers/configure.cmake | 6 +- src/plugins/sqldrivers/odbc/CMakeLists.txt | 2 +- src/plugins/sqldrivers/psql/CMakeLists.txt | 2 +- src/printsupport/configure.cmake | 2 +- src/widgets/configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 13 +++-- util/cmake/helper.py | 6 +- 49 files changed, 264 insertions(+), 99 deletions(-) create mode 100644 cmake/QtModuleDependencies.cmake.in diff --git a/cmake/FindPCRE2.cmake b/cmake/FindPCRE2.cmake index 7e45c963d7d..3977532124d 100644 --- a/cmake/FindPCRE2.cmake +++ b/cmake/FindPCRE2.cmake @@ -5,7 +5,7 @@ find_path(PCRE2_INCLUDE_DIRS pcre2.h) if (PCRE2_LIBRARIES STREQUAL "PCRE2_LIBRARIES-NOTFOUND" OR PCRE2_INCLUDE_DIRS STREQUAL "PCRE2_INCLUDE_DIRS-NOTFOUND") set(PCRE2_FOUND 0) else() - add_library(PCRE2 INTERFACE) + add_library(PCRE2 INTERFACE IMPORTED) target_link_libraries(PCRE2 INTERFACE ${PCRE2_LIBRARIES}) target_include_directories(PCRE2 INTERFACE ${PCRE2_INCLUDE_DIRS}) set(PCRE2_FOUND 1) diff --git a/cmake/FindPPS.cmake b/cmake/FindPPS.cmake index b1e418f227e..c3360fa82c3 100644 --- a/cmake/FindPPS.cmake +++ b/cmake/FindPPS.cmake @@ -11,7 +11,7 @@ find_package_handle_standard_args(PPS DEFAULT_MSG PPS_INCLUDE_DIR PPS_LIBRARY) mark_as_advanced(PPS_INCLUDE_DIR PPS_LIBRARY) if(PPS_FOUND) - add_library(__PPS IMPORTED) + add_library(__PPS INTERFACE IMPORTED) target_link_libraries(__PPS INTERFACE ${PPS_LIBRARY}) target_include_directories(__PPS INTERFACE ${PPS_INCLUDE_DIR}) diff --git a/cmake/FindSlog2.cmake b/cmake/FindSlog2.cmake index 8ff00e4157b..dfb6635a392 100644 --- a/cmake/FindSlog2.cmake +++ b/cmake/FindSlog2.cmake @@ -11,7 +11,7 @@ find_package_handle_standard_args(Slog2 DEFAULT_MSG Slog2_INCLUDE_DIR Slog2_LIBR mark_as_advanced(Slog2_INCLUDE_DIR Slog2_LIBRARY) if(Slog2_FOUND) - add_library(__Slog2 IMPORTED) + add_library(__Slog2 INTERFACE IMPORTED) target_link_libraries(__Slog2 INTERFACE ${Slog2_LIBRARY}) target_include_directories(__Slog2 INTERFACE ${Slog2_INCLUDE_DIR}) diff --git a/cmake/FindWrapDoubleConversion.cmake b/cmake/FindWrapDoubleConversion.cmake index 749965a7b80..cfb70a09819 100644 --- a/cmake/FindWrapDoubleConversion.cmake +++ b/cmake/FindWrapDoubleConversion.cmake @@ -1,9 +1,10 @@ include(CheckCXXSourceCompiles) -add_library(WrapDoubleConversion INTERFACE) +add_library(WrapDoubleConversion INTERFACE IMPORTED) find_package(double-conversion) if (double-conversion_FOUND) + include(FeatureSummary) set_package_properties(double-conversion PROPERTIES TYPE REQUIRED) target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion) set(WrapDoubleConversion_FOUND 1) diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake index c97ba0e4665..b3c60ba9534 100644 --- a/cmake/FindWrapOpenGL.cmake +++ b/cmake/FindWrapOpenGL.cmake @@ -6,7 +6,7 @@ if(TARGET WrapOpenGL) return() endif() -add_library(WrapOpenGL INTERFACE) +add_library(WrapOpenGL INTERFACE IMPORTED) if(QT_FEATURE_opengles2) find_package(GLESv2) @@ -16,3 +16,5 @@ else() target_link_libraries(WrapOpenGL INTERFACE OpenGL::GL) endif() set(WrapOpenGL_FOUND ON) + +set_property(TARGET WrapOpenGL PROPERTY IMPORTED_GLOBAL TRUE) diff --git a/cmake/FindWrapRt.cmake b/cmake/FindWrapRt.cmake index dee41e06179..ef5475c53dc 100644 --- a/cmake/FindWrapRt.cmake +++ b/cmake/FindWrapRt.cmake @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) { cmake_pop_check_state() -add_library(WrapRt INTERFACE) +add_library(WrapRt INTERFACE IMPORTED) if (LIBRT_FOUND) target_link_libraries(WrapRt INTERFACE "${LIBRT}") endif() diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake index 040e8c1642a..4f4590d357d 100644 --- a/cmake/FindZSTD.cmake +++ b/cmake/FindZSTD.cmake @@ -43,6 +43,7 @@ endif() mark_as_advanced(ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES) +include(FeatureSummary) set_package_properties(ZSTD PROPERTIES URL "https://github.com/facebook/zstd" DESCRIPTION "ZSTD compression library") diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 613dc492423..d50d1e2c2b5 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -95,3 +95,12 @@ install(FILES install(DIRECTORY cmake/3rdparty DESTINATION "${config_install_dir}" ) + +# Install our custom Find modules, which will be used by the find_dependency() calls +# inside the generated ModuleDependencies cmake files. +install(DIRECTORY cmake/ + DESTINATION "${config_install_dir}" + FILES_MATCHING PATTERN "Find*.cmake" + PATTERN "tests" EXCLUDE + PATTERN "3rdparty" EXCLUDE +) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 00571903602..f5775f2b1f6 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1365,3 +1365,59 @@ endfunction() function(add_qt_docs qdocFile) # TODO endfunction() + +macro(qt_find_package) + # Get the target names we expect to be provided by the package. + cmake_parse_arguments(arg "" "" "PROVIDED_TARGETS;COMPONENTS" ${ARGN}) + + # Get the version if specified. + set(package_version "") + if(${ARGC} GREATER_EQUAL 2) + if(${ARGV1} MATCHES "^[0-9\.]+$") + set(package_version "${ARGV1}") + endif() + endif() + + if(arg_COMPONENTS) + # Re-append components to forward them. + list(APPEND arg_UNPARSED_ARGUMENTS "COMPONENTS;${arg_COMPONENTS}") + endif() + + # Call original function without our custom arguments. + find_package(${arg_UNPARSED_ARGUMENTS}) + + if(${ARGV0}_FOUND AND arg_PROVIDED_TARGETS) + # If package was found, associate each target with its package name. This will be used + # later when creating Config files for Qt libraries, to generate correct find_dependency() + # calls. Also make the provided targets global, so that the properties can be read in + # all scopes. + foreach(qt_find_package_target_name ${arg_PROVIDED_TARGETS}) + if(TARGET ${qt_find_package_target_name}) + set_target_properties(${qt_find_package_target_name} + PROPERTIES INTERFACE_QT_PACKAGE_NAME ${ARGV0}) + if(package_version) + set_target_properties(${qt_find_package_target_name} + PROPERTIES INTERFACE_QT_PACKAGE_VERSION ${ARGV1}) + endif() + + if(arg_COMPONENTS) + set_target_properties(${qt_find_package_target_name} + PROPERTIES + INTERFACE_QT_PACKAGE_COMPONENTS ${arg_COMPONENTS}) + endif() + + get_property(is_global TARGET ${qt_find_package_target_name} PROPERTY + IMPORTED_GLOBAL) + if(NOT is_global) + set_property(TARGET ${qt_find_package_target_name} PROPERTY + IMPORTED_GLOBAL TRUE) + endif() + else() + message(FATAL_ERROR + "Error while trying to mark target '${qt_find_package_target_name}' as part" + " of the ${ARGV0} package. Provided target name does not exist.") + endif() + + endforeach() + endif() +endmacro() diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index e9eec7ae94d..9a0f0c368c6 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -5,6 +5,11 @@ include(CMakeFindDependencyMacro) get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_import_prefix "${_import_prefix}" REALPATH) +# Find required dependencies, if any. +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") +endif() + # note: target_deps example: "Qt5Core\;5.12.0;Qt5Gui\;5.12.0" set(_target_deps "@target_deps@") foreach(_target_dep ${_target_deps}) diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in new file mode 100644 index 00000000000..7ff02df8943 --- /dev/null +++ b/cmake/QtModuleDependencies.cmake.in @@ -0,0 +1,34 @@ +# Save old module path, and append a new path that points to the copied over Find modules +# so that find_dependency() can find the third party packages. +set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") +list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@") +list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/extra-cmake-modules/find-modules") + +# note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" +set(_third_party_deps "@third_party_deps@") + +foreach(_target_dep ${_third_party_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + list(GET _target_dep 2 components) + set(find_package_args "${pkg}") + if(version) + list(APPEND find_package_args "${version}") + endif() + + if(components) + list(APPEND find_package_args "COMPONENTS" ${components}) + endif() + + if (NOT ${pkg}_FOUND) + find_dependency(${find_package_args}) + endif() + + if (NOT ${pkg}_FOUND) + set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) + return() + endif() +endforeach() + +# Restore old module path. +set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index e63bcc05389..10dd5bfbb16 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -16,7 +16,10 @@ function(qt_internal_create_depends_files) message("Generating depends files for ${QT_KNOWN_MODULES}...") foreach (target ${QT_KNOWN_MODULES}) get_target_property(depends "${target}" LINK_LIBRARIES) + get_target_property(public_depends "${target}" INTERFACE_LINK_LIBRARIES) set(qtdeps "") + set(third_party_deps "") + set(third_party_deps_seen "") foreach (dep ${depends}) # Normalize module by stripping leading "Qt::" and trailing "Private" if (dep MATCHES "Qt::(.*)") @@ -32,6 +35,37 @@ function(qt_internal_create_depends_files) endif() endforeach() + # If we are doing a non-static Qt build, we only want to propagate public dependencies. + # If we are doing a static Qt build, we need to propagate all dependencies. + set(depends_var "public_depends") + if(NOT QT_BUILD_SHARED_LIBS) + set(depends_var "depends") + endif() + + foreach(dep ${${depends_var}}) + # Gather third party packages that should be found when using the Qt module. + if(TARGET ${dep}) + list(FIND third_party_deps_seen ${dep} dep_seen) + + get_target_property(package_name ${dep} INTERFACE_QT_PACKAGE_NAME) + if(dep_seen EQUAL -1 AND package_name) + list(APPEND third_party_deps_seen ${dep}) + get_target_property(package_version ${dep} INTERFACE_QT_PACKAGE_VERSION) + if(NOT package_version) + set(package_version "") + endif() + + get_target_property(package_components ${dep} INTERFACE_QT_PACKAGE_COMPONENTS) + if(NOT package_components) + set(package_components "") + endif() + + list(APPEND third_party_deps + "${package_name}\;${package_version}\;${package_components}") + endif() + endif() + endforeach() + if (DEFINED qtdeps) list(REMOVE_DUPLICATES qtdeps) endif() @@ -40,7 +74,26 @@ function(qt_internal_create_depends_files) if (${hasModuleHeaders}) qt_internal_write_depends_file("${target}" ${qtdeps}) endif() + + if(third_party_deps) + # Configure and install dependencies file. + configure_file( + "${QT_CMAKE_DIR}/QtModuleDependencies.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" + @ONLY + ) + + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") + + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + endif() endforeach() + + endfunction() qt_internal_create_depends_files() diff --git a/configure.cmake b/configure.cmake index cd03d9af01d..39a85a3f25e 100644 --- a/configure.cmake +++ b/configure.cmake @@ -6,11 +6,11 @@ #### Libraries -find_package(ZLIB) +qt_find_package(ZLIB PROVIDED_TARGETS ZLIB::ZLIB) set_package_properties(ZLIB PROPERTIES TYPE OPTIONAL) -find_package(ZSTD) +qt_find_package(ZSTD PROVIDED_TARGETS ZSTD::ZSTD) set_package_properties(ZSTD PROPERTIES TYPE OPTIONAL) -find_package(Libudev) +qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev) set_package_properties(Libudev PROPERTIES TYPE OPTIONAL) diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt index 10ff8b5b476..af2891ffb1a 100644 --- a/examples/widgets/graphicsview/boxes/CMakeLists.txt +++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt @@ -1,7 +1,6 @@ # Generated from boxes.pro. -find_package(WrapOpenGL) - +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## boxes Binary: ##################################################################### diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 37e89a36482..5aee60e7e10 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1,8 +1,8 @@ # Generated from corelib.pro. # special case: -find_package(Threads) -find_package(WrapDoubleConversion REQUIRED) +qt_find_package(Threads PROVIDED_TARGETS Threads::Threads) +qt_find_package(WrapDoubleConversion REQUIRED PROVIDED_TARGETS WrapDoubleConversion) if (NOT WrapDoubleConversion_FOUND) message(FATAL_ERROR "Your C library does not provide \ diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 10d2ea60de0..e9794dc2a41 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -10,23 +10,23 @@ set_property(CACHE INPUT_iconv PROPERTY STRINGS undefined no yes posix sun gnu) #### Libraries -find_package(GLIB2) +qt_find_package(GLIB2 PROVIDED_TARGETS GLIB2::GLIB2) set_package_properties(GLIB2 PROPERTIES TYPE OPTIONAL) -find_package(ICU COMPONENTS i18n uc data) +qt_find_package(ICU COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data) set_package_properties(ICU PROPERTIES TYPE OPTIONAL) -find_package(Libsystemd) +qt_find_package(Libsystemd) set_package_properties(Libsystemd PROPERTIES TYPE OPTIONAL) -find_package(Atomic) +qt_find_package(Atomic PROVIDED_TARGETS Atomic) set_package_properties(Atomic PROPERTIES TYPE OPTIONAL) -find_package(WrapRt) +qt_find_package(WrapRt PROVIDED_TARGETS WrapRt) set_package_properties(WrapRt PROPERTIES TYPE OPTIONAL) -find_package(LTTngUST) +qt_find_package(LTTngUST) set_package_properties(LTTngUST PROPERTIES TYPE OPTIONAL) -find_package(PCRE2) +qt_find_package(PCRE2 PROVIDED_TARGETS PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) -find_package(PPS) +qt_find_package(PPS) set_package_properties(PPS PROPERTIES TYPE OPTIONAL) -find_package(Slog2) +qt_find_package(Slog2) set_package_properties(Slog2 PROPERTIES TYPE OPTIONAL) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index fb60ac27814..1ddee1692d8 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -427,7 +427,7 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop # here (where the feature is available). # DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not # available until the add_qt_module call. -find_package(WrapOpenGL) # special case +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case extend_target(Gui CONDITION QT_FEATURE_opengl SOURCES diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index b11e06bdb4f..3d155e20651 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -22,45 +22,45 @@ set_property(CACHE INPUT_xcb PROPERTY STRINGS undefined no yes qt system) #### Libraries -find_package(ATSPI2) +qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2) set_package_properties(ATSPI2 PROPERTIES TYPE OPTIONAL) -find_package(Libdrm) +qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm) set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL) -find_package(EGL) +qt_find_package(EGL) set_package_properties(EGL PROPERTIES TYPE OPTIONAL) -find_package(Freetype) +qt_find_package(Freetype PROVIDED_TARGETS Freetype::Freetype) set_package_properties(Freetype PROPERTIES TYPE REQUIRED) -find_package(Fontconfig) +qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig) set_package_properties(Fontconfig PROPERTIES TYPE OPTIONAL) -find_package(gbm) +qt_find_package(gbm PROVIDED_TARGETS gbm::gbm) set_package_properties(gbm PROPERTIES TYPE OPTIONAL) -find_package(harfbuzz) +qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz) set_package_properties(harfbuzz PROPERTIES TYPE OPTIONAL) -find_package(Libinput) +qt_find_package(Libinput PROVIDED_TARGETS Libinput::Libinput) set_package_properties(Libinput PROPERTIES TYPE OPTIONAL) -find_package(JPEG) +qt_find_package(JPEG) set_package_properties(JPEG PROPERTIES TYPE OPTIONAL) -find_package(PNG) +qt_find_package(PNG PROVIDED_TARGETS PNG::PNG) set_package_properties(PNG PROPERTIES TYPE OPTIONAL) -find_package(Mtdev) +qt_find_package(Mtdev PROVIDED_TARGETS PkgConfig::Mtdev) set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) -find_package(OpenGL) +qt_find_package(OpenGL) set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL) -find_package(GLESv2) +qt_find_package(GLESv2) set_package_properties(GLESv2 PROPERTIES TYPE OPTIONAL) -find_package(Tslib) +qt_find_package(Tslib PROVIDED_TARGETS PkgConfig::Tslib) set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) -find_package(Vulkan) +qt_find_package(Vulkan) set_package_properties(Vulkan PROPERTIES TYPE OPTIONAL) -find_package(Wayland) +qt_find_package(Wayland) set_package_properties(Wayland PROPERTIES TYPE OPTIONAL) -find_package(X11) +qt_find_package(X11) set_package_properties(X11 PROPERTIES TYPE OPTIONAL) -find_package(XCB 1.9) +qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB) set_package_properties(XCB PROPERTIES TYPE OPTIONAL) -find_package(X11_XCB) +qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB) set_package_properties(X11_XCB PROPERTIES TYPE OPTIONAL) -find_package(XKB 0.4.1) +qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) set_package_properties(XKB PROPERTIES TYPE OPTIONAL) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 02d31fc468c..380ed8e9465 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -227,7 +227,7 @@ extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT APPLE_OSX AND (UNIX kernel/qnetworkproxy_libproxy.cpp LIBRARIES ${CMAKE_DL_LIBS} - LibProxy::LibProxy + PkgConfig::Libproxy ) extend_target(Network CONDITION NOT APPLE_OSX AND NOT QT_FEATURE_libproxy AND (UNIX OR WINRT) diff --git a/src/network/configure.cmake b/src/network/configure.cmake index 0bb54a6f7db..c765f59c5d2 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -6,9 +6,9 @@ #### Libraries -find_package(Libproxy) +qt_find_package(Libproxy PROVIDED_TARGETS PkgConfig::Libproxy) set_package_properties(Libproxy PROPERTIES TYPE OPTIONAL) -find_package(OpenSSL) +qt_find_package(OpenSSL) set_package_properties(OpenSSL PROPERTIES TYPE OPTIONAL) diff --git a/src/platformsupport/eglconvenience/CMakeLists.txt b/src/platformsupport/eglconvenience/CMakeLists.txt index 2cbc02073c4..f2db6c746eb 100644 --- a/src/platformsupport/eglconvenience/CMakeLists.txt +++ b/src/platformsupport/eglconvenience/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(EGL) # special case +qt_find_package(EGL) # special case ##################################################################### ## EglSupport Module: diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt index ba0d71f03b6..4037204f60d 100644 --- a/src/platformsupport/eventdispatchers/CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(GLIB2) # special case +qt_find_package(GLIB2) # special case set_package_properties(GLib PROPERTIES TYPE OPTIONAL) # special case ##################################################################### diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index be1047eb13c..7a0ef39b257 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -1,5 +1,5 @@ -find_package(Freetype) # special case -find_package(Fontconfig) # special case +qt_find_package(Freetype) # special case +qt_find_package(Fontconfig) # special case ##################################################################### ## FontDatabaseSupport Module: diff --git a/src/platformsupport/glxconvenience/CMakeLists.txt b/src/platformsupport/glxconvenience/CMakeLists.txt index 6bc3e1629ee..8480a351257 100644 --- a/src/platformsupport/glxconvenience/CMakeLists.txt +++ b/src/platformsupport/glxconvenience/CMakeLists.txt @@ -1,5 +1,5 @@ -find_package(X11) # special case -find_package(OpenGL) # special case +qt_find_package(X11) # special case +qt_find_package(OpenGL) # special case ##################################################################### ## GlxSupport Module: diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt index 1ab85ce2393..5ecbbbbe307 100644 --- a/src/platformsupport/input/CMakeLists.txt +++ b/src/platformsupport/input/CMakeLists.txt @@ -1,9 +1,9 @@ # Generated from input.pro. -find_package(Libinput) # special case -find_package(XKB) # special case -find_package(Tslib) # special case -find_package(Mtdev) # special case +qt_find_package(Libinput) # special case +qt_find_package(XKB) # special case +qt_find_package(Tslib) # special case +qt_find_package(Mtdev) # special case ##################################################################### ## InputSupport Module: diff --git a/src/platformsupport/kmsconvenience/CMakeLists.txt b/src/platformsupport/kmsconvenience/CMakeLists.txt index cf006fbeed8..1f9f4fbf364 100644 --- a/src/platformsupport/kmsconvenience/CMakeLists.txt +++ b/src/platformsupport/kmsconvenience/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Libdrm) # special case +qt_find_package(Libdrm) # special case ##################################################################### ## KmsSupport Module: diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt index 5478c9f773b..81914f7cd84 100644 --- a/src/platformsupport/linuxaccessibility/CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(ATSPI2 REQUIRED) # special case +qt_find_package(ATSPI2 REQUIRED) # special case ##################################################################### ## LinuxAccessibilitySupport Module: diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt index 106f78fb3db..659ee0cdbd6 100644 --- a/src/platformsupport/vkconvenience/CMakeLists.txt +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Vulkan) # special case +qt_find_package(Vulkan) # special case ##################################################################### ## VulkanSupport Module: diff --git a/src/plugins/generic/tslib/CMakeLists.txt b/src/plugins/generic/tslib/CMakeLists.txt index b46217d8453..b4f0c9ab040 100644 --- a/src/plugins/generic/tslib/CMakeLists.txt +++ b/src/plugins/generic/tslib/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from tslib.pro. -find_package(Tslib) # special case +qt_find_package(Tslib) # special case ##################################################################### ## qtslibplugin Plugin: diff --git a/src/plugins/imageformats/jpeg/CMakeLists.txt b/src/plugins/imageformats/jpeg/CMakeLists.txt index f70c72b9927..39c45bc2fe6 100644 --- a/src/plugins/imageformats/jpeg/CMakeLists.txt +++ b/src/plugins/imageformats/jpeg/CMakeLists.txt @@ -4,7 +4,7 @@ ## qjpeg Plugin: ##################################################################### -find_package(JPEG) +qt_find_package(JPEG) # special case add_qt_plugin(qjpeg TYPE imageformats diff --git a/src/plugins/platforminputcontexts/compose/CMakeLists.txt b/src/plugins/platforminputcontexts/compose/CMakeLists.txt index eaa3ac8f73b..e903d56d74a 100644 --- a/src/plugins/platforminputcontexts/compose/CMakeLists.txt +++ b/src/plugins/platforminputcontexts/compose/CMakeLists.txt @@ -4,7 +4,7 @@ ## composeplatforminputcontextplugin Plugin: ##################################################################### -find_package(XKB) # special case +qt_find_package(XKB) # special case pkg_get_variable(PKG_X11_PREFIX x11 prefix) # special case diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 0b08d493905..9a6902356ef 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -1,8 +1,8 @@ # Generated from cocoa.pro. # special case: -find_package(Cups) -find_package(WrapOpenGL) +qt_find_package(Cups PROVIDED_TARGETS Cups::Cups) +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) ##################################################################### ## qcocoa Plugin: diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index 5a4639ddd3b..b69f06a499e 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -1,5 +1,5 @@ -find_package(EGL) -find_package(WrapOpenGL) +qt_find_package(EGL) # special case +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## EglFSDeviceIntegration Module: diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt index 09a9560f80e..214b13be2e9 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from eglfs_kms.pro. -find_package(gbm) -find_package(Libdrm) +qt_find_package(gbm) +qt_find_package(Libdrm) ##################################################################### ## qeglfs-kms-integration Plugin: diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt index 9dc5d84523e..526c75a882f 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from eglfs_kms_egldevice.pro. -find_package(Libdrm) +qt_find_package(Libdrm) ##################################################################### ## qeglfs-kms-egldevice-integration Plugin: diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt index f077ceae4a3..96cabe9f1e0 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from eglfs_kms_support.pro. -find_package(Libdrm) +qt_find_package(Libdrm) ##################################################################### ## EglFsKmsSupport Module: diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt index aaa4da9cb38..f4487a77476 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt @@ -1,8 +1,8 @@ # Generated from eglfs_x11.pro. -find_package(XCB) -find_package(X11) -find_package(X11_XCB) +qt_find_package(XCB) +qt_find_package(X11) +qt_find_package(X11_XCB) ##################################################################### ## qeglfs-x11-integration Plugin: diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt index 0c3e44e2f1f..203a9e3920e 100644 --- a/src/plugins/platforms/minimal/CMakeLists.txt +++ b/src/plugins/platforms/minimal/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Freetype) # special case +qt_find_package(Freetype) # special case ##################################################################### ## qminimal Plugin: diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt index f42925f632a..6fc52355c8f 100644 --- a/src/plugins/platforms/minimalegl/CMakeLists.txt +++ b/src/plugins/platforms/minimalegl/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from minimalegl.pro. -find_package(WrapOpenGL) +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## qminimalegl Plugin: diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 646d9f19765..413599e6c5f 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -1,13 +1,13 @@ # Generated from xcb_qpa_lib.pro. # special case: -find_package(X11_XCB) -find_package(X11) -find_package(XCB) -find_package(XKB) -find_package(PkgConfig) -find_package(Freetype) -find_package(GLIB2) +qt_find_package(X11_XCB) +qt_find_package(X11) +qt_find_package(XCB) +qt_find_package(XKB) +qt_find_package(PkgConfig) +qt_find_package(Freetype) +qt_find_package(GLIB2) pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) # special case diff --git a/src/plugins/platformthemes/gtk3/CMakeLists.txt b/src/plugins/platformthemes/gtk3/CMakeLists.txt index 18bf5629701..af11ddb80a8 100644 --- a/src/plugins/platformthemes/gtk3/CMakeLists.txt +++ b/src/plugins/platformthemes/gtk3/CMakeLists.txt @@ -1,7 +1,7 @@ # Generated from gtk3.pro. -find_package(GTK3) -find_package(X11) +qt_find_package(GTK3) +qt_find_package(X11) ##################################################################### ## qgtk3 Plugin: diff --git a/src/plugins/printsupport/cups/CMakeLists.txt b/src/plugins/printsupport/cups/CMakeLists.txt index d36a5e7be56..7adf3e72ead 100644 --- a/src/plugins/printsupport/cups/CMakeLists.txt +++ b/src/plugins/printsupport/cups/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from cups.pro. -find_package(Cups) +qt_find_package(Cups PROVIDED_TARGETS Cups::Cups) # special case ##################################################################### ## cupsprintersupport Plugin: diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake index 41a66197d1b..9f0b0dfc7e6 100644 --- a/src/plugins/sqldrivers/configure.cmake +++ b/src/plugins/sqldrivers/configure.cmake @@ -6,11 +6,11 @@ #### Libraries -find_package(PostgreSQL) +qt_find_package(PostgreSQL PROVIDED_TARGETS PostgreSQL::PostgreSQL) set_package_properties(PostgreSQL PROPERTIES TYPE OPTIONAL) -find_package(ODBC) +qt_find_package(ODBC PROVIDED_TARGETS ODBC::ODBC) set_package_properties(ODBC PROPERTIES TYPE OPTIONAL) -find_package(SQLite3) +qt_find_package(SQLite3) set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL) diff --git a/src/plugins/sqldrivers/odbc/CMakeLists.txt b/src/plugins/sqldrivers/odbc/CMakeLists.txt index c3c52f526c3..4cfbe3b3073 100644 --- a/src/plugins/sqldrivers/odbc/CMakeLists.txt +++ b/src/plugins/sqldrivers/odbc/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(ODBC) # special case +qt_find_package(ODBC) # special case ##################################################################### ## qsqlodbc Plugin: diff --git a/src/plugins/sqldrivers/psql/CMakeLists.txt b/src/plugins/sqldrivers/psql/CMakeLists.txt index dfbeaba6de3..7b854c365fb 100644 --- a/src/plugins/sqldrivers/psql/CMakeLists.txt +++ b/src/plugins/sqldrivers/psql/CMakeLists.txt @@ -1,7 +1,7 @@ # FIXME cmake FindPostgreSQL is more exhaustive than the check we have for libpq-fe.h # it also checks for catalog/pg_type.h which is a more internal include, we should # add a way to tell cmake FindPostgreSQL to optionally only look for the libpq-fe.h one -find_package(PostgreSQL) # special case +qt_find_package(PostgreSQL) # special case ##################################################################### ## qsqlpsql Plugin: diff --git a/src/printsupport/configure.cmake b/src/printsupport/configure.cmake index 40aab5d9f76..bede6a503b5 100644 --- a/src/printsupport/configure.cmake +++ b/src/printsupport/configure.cmake @@ -6,7 +6,7 @@ #### Libraries -find_package(Cups) +qt_find_package(Cups PROVIDED_TARGETS Cups::Cups) set_package_properties(Cups PROPERTIES TYPE OPTIONAL) diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake index fead6b60b56..a67e12646c7 100644 --- a/src/widgets/configure.cmake +++ b/src/widgets/configure.cmake @@ -6,7 +6,7 @@ #### Libraries -find_package(GTK3) +qt_find_package(GTK3) set_package_properties(GTK3 PROPERTIES TYPE OPTIONAL) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index fe853bb910d..15cd9bab473 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -33,7 +33,7 @@ import re import sys from typing import Set, Union, List, Dict -from helper import map_qt_library, featureName, substitute_platform +from helper import map_qt_library, featureName, substitute_platform, qmake_library_to_cmake_target_mapping knownTests = set() # type: Set[str] @@ -68,7 +68,6 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: 'libinput': 'Libinput', 'libjpeg': 'JPEG', 'libpng': 'PNG', - 'libpng': 'PNG', 'libproxy': 'Libproxy', 'librt': 'WrapRt', 'libudev': 'Libudev', @@ -260,10 +259,16 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): isRequired = True extra.remove("REQUIRED") + # If we have a mapping from a qmake library to a CMake target name, + # encode that in the qt_find_package call(). + cmake_target_name = qmake_library_to_cmake_target_mapping.get(lib, None) + if cmake_target_name: + extra += ['PROVIDED_TARGETS', cmake_target_name] + if extra: - cm_fh.write('find_package({} {})\n'.format(newlib, ' '.join(extra))) + cm_fh.write('qt_find_package({} {})\n'.format(newlib, ' '.join(extra))) else: - cm_fh.write('find_package({})\n'.format(newlib)) + cm_fh.write('qt_find_package({})\n'.format(newlib)) cm_fh.write('set_package_properties({} PROPERTIES TYPE {})\n' .format(newlib, 'REQUIRED' if isRequired else 'OPTIONAL') diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 13c1677b52f..1e13a5a1f3e 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -211,7 +211,7 @@ def substitute_platform(platform: str) -> str: return platform_mapping.get(platform, platform) -libray_mapping = { +qmake_library_to_cmake_target_mapping = { 'atspi': 'PkgConfig::ATSPI2', 'cups': 'Cups::Cups', 'drm': 'Libdrm::Libdrm', @@ -228,7 +228,7 @@ libray_mapping = { 'libdl': '${CMAKE_DL_LIBS}', 'libinput': 'Libinput::Libinput', 'libpng' : 'PNG::PNG', - 'libproxy': 'LibProxy::LibProxy', + 'libproxy': 'PkgConfig::Libproxy', 'librt': 'WrapRt', 'libudev': 'PkgConfig::Libudev', 'mtdev': 'PkgConfig::Mtdev', @@ -269,4 +269,4 @@ def substitute_libs(lib: str) -> str: if lib.endswith('/nolink'): lib = lib[:-7] libpostfix = '_nolink' - return libray_mapping.get(lib, lib) + libpostfix + return qmake_library_to_cmake_target_mapping.get(lib, lib) + libpostfix From bcfc3dca5d9f3e329fbbcf114145cf8b348c2c81 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 29 Apr 2019 14:36:25 +0200 Subject: [PATCH 0429/1322] Make module package depend on its own tool package Also make the tool package depend on all tool packages that correspond to the qt module dependencies. So find_package(Qt5Widgets) implicitly calls find_package(Qt5WidgetTools). And find_package(Qt5WidgetsTools) will call find_package for Qt5GuiTools, and Qt5CoreTools. This enhances the user experience, so that in modules like qtsvg, you don't have to specify both find_package(Qt5Widgets) and find_package(Qt5WidgetsTools), but only the former. Or when cross building, you only need to specify Qt5WidgetTools, to get both Core and Gui tools. Change-Id: Ib1c5173a5b97584a52e144c22e38e90a712f727a Reviewed-by: Tobias Hunger --- cmake/QtModuleDependencies.cmake.in | 17 +++++++++++ cmake/QtModuleToolsConfig.cmake.in | 7 +++++ cmake/QtModuleToolsDependencies.cmake.in | 16 ++++++++++ cmake/QtPostProcess.cmake | 38 ++++++++++++++++++++++-- 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 cmake/QtModuleToolsDependencies.cmake.in diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index 7ff02df8943..2190460b71e 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -32,3 +32,20 @@ endforeach() # Restore old module path. set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") + +# Find Qt tool package. +set(_tool_deps "@main_module_tool_deps@") +foreach(_target_dep ${_tool_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + + if (NOT ${pkg}_FOUND) + find_dependency(${pkg} ${version}) + endif() + + if (NOT ${pkg}_FOUND) + set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) + return() + endif() +endforeach() + diff --git a/cmake/QtModuleToolsConfig.cmake.in b/cmake/QtModuleToolsConfig.cmake.in index 4dc658a10b2..afc6de5b197 100644 --- a/cmake/QtModuleToolsConfig.cmake.in +++ b/cmake/QtModuleToolsConfig.cmake.in @@ -1,5 +1,12 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) + +# Find required dependencies, if any. +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") +endif() + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") @extra_cmake_statements@ diff --git a/cmake/QtModuleToolsDependencies.cmake.in b/cmake/QtModuleToolsDependencies.cmake.in new file mode 100644 index 00000000000..bac8bb0e044 --- /dev/null +++ b/cmake/QtModuleToolsDependencies.cmake.in @@ -0,0 +1,16 @@ +# Find "ModuleTools" dependencies, which are other ModuleTools packages. +set(_tool_deps "@tool_deps@") +foreach(_target_dep ${_tool_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + + if (NOT ${pkg}_FOUND) + find_dependency(${pkg} ${version}) + endif() + + if (NOT ${pkg}_FOUND) + set(@INSTALL_CMAKE_NAMESPACE@@target@Tools_FOUND FALSE) + return() + endif() +endforeach() + diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 10dd5bfbb16..40ac08396d5 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -20,6 +20,8 @@ function(qt_internal_create_depends_files) set(qtdeps "") set(third_party_deps "") set(third_party_deps_seen "") + set(tool_deps "") + set(tool_deps_seen "") foreach (dep ${depends}) # Normalize module by stripping leading "Qt::" and trailing "Private" if (dep MATCHES "Qt::(.*)") @@ -32,6 +34,14 @@ function(qt_internal_create_depends_files) list(FIND QT_KNOWN_MODULES "${dep}" _pos) if (_pos GREATER -1) list(APPEND qtdeps "${dep}") + + # Make the ModuleTool package depend on dep's ModuleTool package. + list(FIND tool_deps_seen ${dep} dep_seen) + if(dep_seen EQUAL -1 AND ${dep} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + list(APPEND tool_deps_seen ${dep}) + list(APPEND tool_deps + "${INSTALL_CMAKE_NAMESPACE}${dep}Tools\;${PROJECT_VERSION}") + endif() endif() endforeach() @@ -66,6 +76,12 @@ function(qt_internal_create_depends_files) endif() endforeach() + # Add dependency to the main ModuleTool package to ModuleDependencies file. + if(${target} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + set(main_module_tool_deps + "${INSTALL_CMAKE_NAMESPACE}${target}Tools\;${PROJECT_VERSION}") + endif() + if (DEFINED qtdeps) list(REMOVE_DUPLICATES qtdeps) endif() @@ -75,8 +91,9 @@ function(qt_internal_create_depends_files) qt_internal_write_depends_file("${target}" ${qtdeps}) endif() - if(third_party_deps) - # Configure and install dependencies file. + + if(third_party_deps OR main_module_tool_deps) + # Configure and install ModuleDependencies file. configure_file( "${QT_CMAKE_DIR}/QtModuleDependencies.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" @@ -91,6 +108,23 @@ function(qt_internal_create_depends_files) COMPONENT Devel ) endif() + if(tool_deps) + # Configure and install ModuleToolDependencies file. + configure_file( + "${QT_CMAKE_DIR}/QtModuleToolsDependencies.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" + @ONLY + ) + + set(config_install_dir + "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}Tools") + + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + endif() endforeach() From 94c9d15355e07113da693f067c1ac15e5f7dc8d7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 May 2019 09:33:45 +0200 Subject: [PATCH 0430/1322] Re-generate CMakeListst for some tests that use .qrc files This way we don't need to run rcc during cmake time Change-Id: Id92111bce6c2b6798f3b18552cea82c8d07c4fc0 Reviewed-by: Simon Hausmann --- tests/auto/opengl/qgl/CMakeLists.txt | 31 +++++++++++-- .../dialogs/qfontdialog/CMakeLists.txt | 31 +++++++++++-- .../widgets/dialogs/qwizard/CMakeLists.txt | 22 +++++++-- .../widgets/kernel/qwidget/CMakeLists.txt | 46 ++++++++++++++++--- 4 files changed, 113 insertions(+), 17 deletions(-) diff --git a/tests/auto/opengl/qgl/CMakeLists.txt b/tests/auto/opengl/qgl/CMakeLists.txt index 77c0afca75b..c259f069a99 100644 --- a/tests/auto/opengl/qgl/CMakeLists.txt +++ b/tests/auto/opengl/qgl/CMakeLists.txt @@ -1,7 +1,30 @@ -add_qt_test("tst_qgl" SOURCES qgl.qrc tst_qgl.cpp +# Generated from qgl.pro. + +##################################################################### +## tst_qgl Test: +##################################################################### + +add_qt_test(tst_qgl + SOURCES + tst_qgl.cpp LIBRARIES - Qt::WidgetsPrivate - Qt::OpenGLPrivate - Qt::GuiPrivate Qt::CorePrivate + Qt::GuiPrivate + Qt::OpenGLPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::OpenGL + Qt::Widgets ) + +# Resources: +set_source_files_properties("../../gui/image/qpixmap/images/designer.png" + PROPERTIES alias "designer.png") +add_qt_resource(tst_qgl "qgl" FILES + ../../gui/image/qpixmap/images/designer.png) + + +#### Keys ignored in scope 1:.:.:qgl.pro:: +# CONFIG = "testcase" diff --git a/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt b/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt index 099fee7a51c..58cda26f0a1 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt +++ b/tests/auto/widgets/dialogs/qfontdialog/CMakeLists.txt @@ -1,9 +1,34 @@ -add_qt_test("tst_qfontdialog" +# Generated from qfontdialog.pro. + +##################################################################### +## tst_qfontdialog Test: +##################################################################### + +add_qt_test(tst_qfontdialog SOURCES - testfonts.qrc tst_qfontdialog.cpp LIBRARIES - Qt::WidgetsPrivate Qt::CorePrivate Qt::GuiPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Widgets ) + +# Resources: +set_source_files_properties("../../../shared/resources/test.ttf" + PROPERTIES alias "test.ttf") +set_source_files_properties("../../../shared/resources/testfont.ttf" + PROPERTIES alias "testfont.ttf") +add_qt_resource(tst_qfontdialog "testfonts" PREFIX "/" FILES + ../../../shared/resources/test.ttf + ../../../shared/resources/testfont.ttf) + + +#### Keys ignored in scope 1:.:.:qfontdialog.pro:: +# CONFIG = "testcase" + +## Scopes: +##################################################################### diff --git a/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt b/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt index 3d88e2cb694..daefe76139c 100644 --- a/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt +++ b/tests/auto/widgets/dialogs/qwizard/CMakeLists.txt @@ -1,8 +1,24 @@ -add_qt_test("tst_qwizard" +# Generated from qwizard.pro. + +##################################################################### +## tst_qwizard Test: +##################################################################### + +add_qt_test(tst_qwizard SOURCES - qwizard.qrc tst_qwizard.cpp tst_qwizard_2.cpp - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets ) + +# Resources: +add_qt_resource(tst_qwizard "qwizard" FILES + images/background.png + images/banner.png + images/logo.png + images/watermark.png) + + +#### Keys ignored in scope 1:.:.:qwizard.pro:: +# CONFIG = "testcase" diff --git a/tests/auto/widgets/kernel/qwidget/CMakeLists.txt b/tests/auto/widgets/kernel/qwidget/CMakeLists.txt index 3bafe782d6b..86d02ac733e 100644 --- a/tests/auto/widgets/kernel/qwidget/CMakeLists.txt +++ b/tests/auto/widgets/kernel/qwidget/CMakeLists.txt @@ -1,16 +1,48 @@ -add_qt_test("tst_qwidget" +# Generated from qwidget.pro. + +##################################################################### +## tst_qwidget Test: +##################################################################### + +add_qt_test(tst_qwidget SOURCES - qwidget.qrc tst_qwidget.cpp LIBRARIES - Qt::Widgets Qt::CorePrivate Qt::GuiPrivate - Qt::WidgetsPrivate Qt::TestPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Test + Qt::Widgets ) -extend_target("tst_qwidget" CONDITION APPLE_OSX - SOURCES tst_qwidget_mac_helpers.mm - LIBRARIES ${FWSecurity} ${FWAppKit} +# Resources: +add_qt_resource(tst_qwidget "qwidget" FILES + geometry-fullscreen.dat + geometry-maximized.dat + geometry.dat) + + +#### Keys ignored in scope 1:.:.:qwidget.pro:: +# CONFIG = "testcase" "x11inc" +# testcase.timeout = "600" + +## Scopes: +##################################################################### + +extend_target(tst_qwidget CONDITION APPLE_OSX + SOURCES + tst_qwidget_mac_helpers.mm + PUBLIC_LIBRARIES + ${FWAppKit} + ${FWSecurity} +) + +extend_target(tst_qwidget CONDITION WIN32 AND NOT WINRT + PUBLIC_LIBRARIES + gdi32 + user32 ) From 1b36fe53c621a4f37322c1bca755989d76b7d3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Mon, 11 Feb 2019 12:12:07 +0100 Subject: [PATCH 0431/1322] cmake: export locally-built dependencies in static build Change-Id: Ifbcedd32cef3b9c8b4b8c9ca0d229850f696f406 Reviewed-by: Alexandru Croitor --- cmake/3rdpartyConfig.cmake.in | 13 ++++ cmake/QtBaseGlobalTargets.cmake | 1 + cmake/QtBuild.cmake | 95 +++++++++++++++++++++++++++- src/3rdparty/harfbuzz/CMakeLists.txt | 5 +- src/3rdparty/tinycbor/CMakeLists.txt | 6 +- src/corelib/CMakeLists.txt | 7 ++ 6 files changed, 124 insertions(+), 3 deletions(-) create mode 100644 cmake/3rdpartyConfig.cmake.in diff --git a/cmake/3rdpartyConfig.cmake.in b/cmake/3rdpartyConfig.cmake.in new file mode 100644 index 00000000000..fe15a1efc6b --- /dev/null +++ b/cmake/3rdpartyConfig.cmake.in @@ -0,0 +1,13 @@ +@PACKAGE_INIT@ + +get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_import_prefix "${_import_prefix}" REALPATH) + +set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") +set(CMAKE_MODULE_PATH "${_import_prefix}" ${CMAKE_MODULE_PATH} ) + +@3RDPARTY_ADDITIONAL_SETUP_CODE@ + +set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") + +include("${CMAKE_CURRENT_LIST_DIR}/@target@Targets.cmake") diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index d50d1e2c2b5..67d20b775cc 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -78,6 +78,7 @@ add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) install(TARGETS Platform GlobalConfig GlobalConfigPrivate EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXPORT_NAMESPACE}:: DESTINATION "${config_install_dir}") +export(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") ## Install some QtBase specific CMake files: install(FILES diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f5775f2b1f6..ddf6389db1d 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -712,6 +712,15 @@ function(add_qt_module target) endif() endforeach() + foreach(lib ${arg_LIBRARIES}) + if (TARGET "${lib}") + get_target_property(_is_exported "${lib}" INTERFACE_QT_EXPORTED_LIBRARY) + if("${_is_exported}") + list(APPEND target_deps "${lib}\;${PROJECT_VERSION}") + endif() + endif() + endforeach() + configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" @@ -801,7 +810,6 @@ function(qt_internal_check_directory_or_type name dir type default result_var) endif() endfunction() - # This is the main entry point for defining Qt plugins. # A CMake target is created with the given target. The TYPE parameter is needed to place the # plugin into the correct plugins/ sub-directory. @@ -1222,6 +1230,13 @@ function(add_qt_simd_part target) $) target_link_libraries("${target}" PRIVATE "${name}") + + if(NOT BUILD_SHARED_LIBS) + install( + TARGETS ${name} + EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" + ) + endif() else() if(QT_CMAKE_DEBUG_EXTEND_TARGET) message("add_qt_simd_part(${target} SIMD ${arg_SIMD} ...): Skipped") @@ -1421,3 +1436,81 @@ macro(qt_find_package) endforeach() endif() endmacro() + +# Creates a simple export set for the various Find* dependencies +# which are needed when creating a static build of Qt. +# This introduces a custom target property: INTERFACE_QT_EXPORTED_LIBRARY +# This target property indicates that Qt modules / plugins using this 3rd party library +# must add it to their list of dependencies when creating their own ${qtmodule}Config.cmake +function(qt_install_static_target_export target) + if(BUILD_SHARED_LIBS) + return() + endif() + + qt_parse_all_arguments(arg "qt_install_3rdparty_config_files" "" "EXPORT" "" ${ARGN}) + # TODO mark EXPORT as required + + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${arg_EXPORT}") + + set_target_properties(${target} + PROPERTIES + INTERFACE_QT_EXPORTED_LIBRARY 1) + + install( + TARGETS ${target} + EXPORT ${arg_EXPORT}Targets + LIBRARY DESTINATION ${INSTALL_LIBDIR} + ARCHIVE DESTINATION ${INSTALL_LIBDIR}) + + install( + EXPORT ${arg_EXPORT}Targets + DESTINATION "${config_install_dir}" + ) + + export(EXPORT ${arg_EXPORT}Targets) +endfunction() + +# Create a set of ${target}Config.cmake and ${target}Version.cmake for a +# third-party library so that it can be found by client code linking statically. +function(qt_install_3rdparty_config_files target) + if(BUILD_SHARED_LIBS) + return() + endif() + + qt_parse_all_arguments(arg "qt_install_3rdparty_config_files" "" "EXPORT" "PACKAGES;ADDITIONAL_FILES" ${ARGN}) + # TODO mark EXPORT as required + + set(3RDPARTY_ADDITIONAL_SETUP_CODE) + foreach(package ${arg_PACKAGES}) + list(APPEND 3RDPARTY_ADDITIONAL_SETUP_CODE "find_package(${package})\n") + endforeach() + + set(config_install_dir "${INSTALL_LIBDIR}/cmake/${arg_EXPORT}") + configure_package_config_file( + "${PROJECT_SOURCE_DIR}/cmake/3rdpartyConfig.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake" + INSTALL_DESTINATION "${config_install_dir}" + ) + + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake" + ${arg_ADDITIONAL_FILES} + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) +endfunction() + +# Call this function in 3rdparty find modules that ought to be installed alongside +# Qt modules and must be found when linking statically. +function(qt_install_3rdparty_library target) + qt_install_static_target_export(${target} EXPORT ${target}) + qt_install_3rdparty_config_files(${target} EXPORT ${target} ${ARGN}) +endfunction() + diff --git a/src/3rdparty/harfbuzz/CMakeLists.txt b/src/3rdparty/harfbuzz/CMakeLists.txt index 25a3b75d2f0..3eaddbb2db8 100644 --- a/src/3rdparty/harfbuzz/CMakeLists.txt +++ b/src/3rdparty/harfbuzz/CMakeLists.txt @@ -8,4 +8,7 @@ add_library(QtHarfBuzz STATIC src/harfbuzz-open.c src/harfbuzz-stream.c ) -target_include_directories(QtHarfBuzz PUBLIC src) +target_include_directories(QtHarfBuzz PUBLIC + $) + +qt_install_3rdparty_library(QtHarfBuzz) diff --git a/src/3rdparty/tinycbor/CMakeLists.txt b/src/3rdparty/tinycbor/CMakeLists.txt index 3a1a760af9d..d0c90165bf6 100644 --- a/src/3rdparty/tinycbor/CMakeLists.txt +++ b/src/3rdparty/tinycbor/CMakeLists.txt @@ -1,2 +1,6 @@ add_library(tinycbor INTERFACE) -target_include_directories(tinycbor INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/src") +target_include_directories(tinycbor + INTERFACE + $) + +qt_install_3rdparty_library(tinycbor) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 5aee60e7e10..ba75c4cdb41 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -268,6 +268,13 @@ target_include_directories(Core_qobject PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/ker target_link_libraries(Core_qobject PRIVATE Qt::Platform Qt::GlobalConfig) target_link_libraries(Core PRIVATE Core_qobject) +if(NOT BUILD_SHARED_LIBS) + install( + TARGETS Core_qobject + EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" + ) +endif() + set_property(TARGET Core APPEND PROPERTY PUBLIC_HEADER "${CMAKE_CURRENT_BINARY_DIR}/global/qconfig.h") set_property(TARGET Core APPEND PROPERTY From 67c35ed8fc19130ba449099c02bede64b763c59f Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 2 May 2019 14:09:25 +0200 Subject: [PATCH 0432/1322] CMake: add xcb platform plugin Change-Id: I9b3e8b5e4a2f7799b32738319e6eed912d3261e2 Reviewed-by: Alexandru Croitor --- src/plugins/platforms/xcb/CMakeLists.txt | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 413599e6c5f..f67c48c1d20 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -165,3 +165,42 @@ extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_p LIBRARIES Freetype::Freetype ) + +# Generated from xcb-plugin.pro. + +##################################################################### +## qxcb Plugin: +##################################################################### + +add_qt_plugin(qxcb + TYPE platforms + SOURCES + qxcbmain.cpp + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::XcbQpaPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::XcbQpa +) + +#### Keys ignored in scope 1:.:.:./xcb-plugin.pro:: +# OTHER_FILES = "xcb.json" "README" +# PLUGIN_CLASS_NAME = "QXcbIntegrationPlugin" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:./xcb-plugin.pro:APPLE_OSX: +# CONFIG = "no_app_extension_api_only" + +#### Keys ignored in scope 3:.:.:./xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" + +#### TODO: xcb-static sub folder +#### TODO: gl_integrations sub folder From ef3e37b9a334ee91a84aabd3a1b2c5cdfe3c7abe Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 2 May 2019 12:00:40 +0200 Subject: [PATCH 0433/1322] Update version in cmake to 5.14.0 The dev->wip/cmake merge is done already. Change-Id: Ia6b17ac633cd2bcd1e9f6e96a0a0bf33042ed63b Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d46b574369a..ecc88a27e36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14.0) project(QtBase - VERSION 5.12.0 + VERSION 5.14.0 DESCRIPTION "Qt Base Libraries" HOMEPAGE_URL "https://qt.io/" LANGUAGES CXX C ASM From 1361cf5d50e0baa901c06cab7f87785a03c57cb7 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Thu, 2 May 2019 17:23:29 +0300 Subject: [PATCH 0434/1322] CMake: better GLX detection Change-Id: I71dfbb331cb02a3249b0c3c65f2a9bd9ce68c739 Reviewed-by: Tobias Hunger --- src/platformsupport/CMakeLists.txt | 2 +- src/plugins/platforms/offscreen/CMakeLists.txt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index ece4eed2aab..cac0b21782b 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -44,7 +44,7 @@ if(QT_FEATURE_opengl) add_subdirectory(platformcompositor) endif() -if (QT_FEATURE_xlib AND QT_FEATURE_opengl AND (NOT QT_FEATURE_opengles2)) +if (QT_FEATURE_xlib AND QT_FEATURE_opengl AND TARGET OpenGL::GLX) # special case add_subdirectory(glxconvenience) endif() diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index 3546f8710b9..513bc0a6bef 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -33,7 +33,7 @@ add_qt_plugin(qoffscreen ## Scopes: ##################################################################### -extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND NOT QT_FEATURE_opengles2 +extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND TARGET OpenGL::GLX # special case SOURCES qoffscreenintegration_x11.cpp qoffscreenintegration_x11.h LIBRARIES @@ -42,5 +42,9 @@ extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND NOT Qt::GlxSupport ) -#### Keys ignored in scope 3:.:.:./offscreen.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +extend_target(qoffscreen CONDITION NOT TARGET OpenGL::GLX OR NOT QT_FEATURE_opengl OR NOT QT_FEATURE_xlib # special case + SOURCES + qoffscreenintegration_dummy.cpp +) + # PLUGIN_EXTENDS = "-" From 7ff93f33648e210e29288764903850303363f9ba Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 May 2019 17:15:15 +0200 Subject: [PATCH 0435/1322] Fix build by re-generating CMakeLists.txt from offscreen.pro We don't need the _dummy.cpp files in the build anymore that don't exist anyway. Change-Id: I70e12dd39009c86779f3863c945e835b76cb24f6 Reviewed-by: Alexandru Croitor --- src/plugins/platforms/offscreen/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index 513bc0a6bef..e3f3ece17eb 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -42,9 +42,5 @@ extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND TAR Qt::GlxSupport ) -extend_target(qoffscreen CONDITION NOT TARGET OpenGL::GLX OR NOT QT_FEATURE_opengl OR NOT QT_FEATURE_xlib # special case - SOURCES - qoffscreenintegration_dummy.cpp -) - +#### Keys ignored in scope 3:.:.:offscreen.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" From 43c2580e5d607ca1a5642987d1b0bed17574e6db Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 2 May 2019 17:26:15 +0200 Subject: [PATCH 0436/1322] cmake: remove mirclient TODO mirclient qpa code was removed in 8c73ddd8e3fb43cc22fa111b855ab1f9f5b83405 Change-Id: I0c0f5228fb750b69a742c9d1d8377b4a4de165ce Reviewed-by: Simon Hausmann --- src/plugins/platforms/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index a6dfadc7e86..5d187ffc335 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -67,10 +67,6 @@ endif() # TODO add_subdirectory(wasm) #endif() -if(QT_FEATURE_mirclient) -# TODO add_subdirectory(mirclient) -endif() - if(QT_FEATURE_integrityfb) # TODO add_subdirectory(integrityfb) endif() From b26a52ec4874f707f6980b4c47592425c68d1360 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 2 May 2019 17:26:19 +0200 Subject: [PATCH 0437/1322] Update readme to mention how to set feature flags Change-Id: If63d37af4711c4332129d65b934269c33f041ea4 Reviewed-by: Simon Hausmann --- cmake/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/README.md b/cmake/README.md index 4a21e5f783c..57f87e0d849 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -91,6 +91,12 @@ Make sure to remove CMakeCache.txt if you forgot to set the CMAKE_INSTALL_PREFIX You can use ``cmake-gui {path to build directory}`` or ``ccmake {path to build directory}`` to configure the values of individual cmake variables or Qt features. After changing a value, you need to choose the *configure* step (usually several times:-/), followed by the *generate* step (to generate makefiles/ninja files). +## Specifying configure.json features on the command line + +QMake defines most features in configure.json files, like -developer-build or -no-opengl. + +In CMake land, we currently generate configure.cmake files from the configure.json files. If the feature in configure.json has the name "dlopen", you can specify whether to enable or disable that feature in CMake with a -D flag on the CMake command line. So for example -DFEATURE_dlopen=ON or -DFEATURE_sql_mysql=OFF. At the moment, if you change a FEATURE flag's value, you have to remove the CMakeCache.txt file and reconfigure with CMake. And even then you might stumble on some issues when reusing an existing build, because of an automoc bug in upstream CMake. + ## Ninja reconfiguration bug If you use the Ninja generator, there's a bug that after the first CMake configuration, if you run ninja, it will do the reconfiguration step again. This is quite annoying and time consuming. From 417e714d908e4293a46254b02f6c855bce2fed1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 2 May 2019 17:53:21 +0200 Subject: [PATCH 0438/1322] cmake: Fix Vulkan qt_find_package call Change-Id: I4494d6d7dc2cd0b5afed5bb9d591b62627cbc49d Reviewed-by: Alexandru Croitor --- src/gui/configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 3d155e20651..81e1b31620c 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -50,7 +50,7 @@ qt_find_package(GLESv2) set_package_properties(GLESv2 PROPERTIES TYPE OPTIONAL) qt_find_package(Tslib PROVIDED_TARGETS PkgConfig::Tslib) set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) -qt_find_package(Vulkan) +qt_find_package(Vulkan PROVIDED_TARGETS Vulkan::Vulkan) set_package_properties(Vulkan PROPERTIES TYPE OPTIONAL) qt_find_package(Wayland) set_package_properties(Wayland PROPERTIES TYPE OPTIONAL) From 10f477e5bb8dff131020eb5a43d5b78102e614eb Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 2 May 2019 16:28:51 +0200 Subject: [PATCH 0439/1322] cmake: add CMakeLists.txt files for xcb/gl_integrations Change-Id: I34bc3c0ab4b4b686fe57149a3bb69e2d2cafd551 Reviewed-by: Alexandru Croitor --- src/plugins/platforms/xcb/CMakeLists.txt | 3 +- .../xcb/gl_integrations/CMakeLists.txt | 10 ++++ .../gl_integrations/xcb_egl/CMakeLists.txt | 35 ++++++++++++++ .../gl_integrations/xcb_glx/CMakeLists.txt | 47 +++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt create mode 100644 src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt create mode 100644 src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index f67c48c1d20..57ec1b94435 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -202,5 +202,6 @@ add_qt_plugin(qxcb #### Keys ignored in scope 3:.:.:./xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" +add_subdirectory(gl_integrations) + #### TODO: xcb-static sub folder -#### TODO: gl_integrations sub folder diff --git a/src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt new file mode 100644 index 00000000000..a5a744d8981 --- /dev/null +++ b/src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from gl_integrations.pro. + + +if(QT_FEATURE_xcb_egl_plugin) + add_subdirectory(xcb_egl) +endif() + +if(QT_FEATURE_xcb_glx_plugin) + add_subdirectory(xcb_glx) +endif() diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt new file mode 100644 index 00000000000..6692ece7dc7 --- /dev/null +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from xcb_egl.pro. + +##################################################################### +## qxcb-egl-integration Plugin: +##################################################################### + +add_qt_plugin(qxcb-egl-integration + TYPE xcbglintegrations + SOURCES + qxcbeglcontext.h + qxcbeglintegration.cpp qxcbeglintegration.h + qxcbeglmain.cpp + qxcbeglnativeinterfacehandler.cpp qxcbeglnativeinterfacehandler.h + qxcbeglwindow.cpp qxcbeglwindow.h + DEFINES + QT_NO_FOREACH + INCLUDE_DIRECTORIES + .. + ../.. + LIBRARIES + Qt::CorePrivate + Qt::EglSupportPrivate + Qt::GuiPrivate + Qt::XcbQpaPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::EglSupport + Qt::Gui + Qt::XcbQpa +) + +#### Keys ignored in scope 1:.:.:./xcb_egl.pro:: +# CONFIG = "egl" +# PLUGIN_CLASS_NAME = "QXcbEglIntegrationPlugin" +# _LOADED = "qt_plugin" "qt_build_paths" diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt new file mode 100644 index 00000000000..51e5f976589 --- /dev/null +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from xcb_glx.pro. + +##################################################################### +## qxcb-glx-integration Plugin: +##################################################################### + +add_qt_plugin(qxcb-glx-integration + TYPE xcbglintegrations + SOURCES + qglxintegration.cpp qglxintegration.h + qxcbglxintegration.cpp qxcbglxintegration.h + qxcbglxmain.cpp + qxcbglxnativeinterfacehandler.cpp qxcbglxnativeinterfacehandler.h + qxcbglxwindow.cpp qxcbglxwindow.h + DEFINES + QT_NO_FOREACH + INCLUDE_DIRECTORIES + .. + ../.. + LIBRARIES + Qt::CorePrivate + Qt::GlxSupportPrivate + Qt::GuiPrivate + Qt::XcbQpaPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::GlxSupport + Qt::Gui + Qt::XcbQpa +) + +#### Keys ignored in scope 1:.:.:./xcb_glx.pro:: +# PLUGIN_CLASS_NAME = "QXcbGlxIntegrationPlugin" +# _LOADED = "qt_plugin" "qt_build_paths" + +## Scopes: +##################################################################### + +extend_target(qxcb-glx-integration CONDITION QT_FEATURE_xcb_glx + PUBLIC_LIBRARIES + xcb_glx +) + +extend_target(qxcb-glx-integration CONDITION NOT static + PUBLIC_LIBRARIES + ${CMAKE_DL_LIBS} +) From ca3a7efffd350b27c05e07f7ea73cc7a7bbeeb08 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 3 May 2019 09:27:44 +0200 Subject: [PATCH 0440/1322] cmake: Fix typo, variable was renamed earlier Change-Id: I8fe9da37572efe85b2dff0b223edb1d93e904f34 Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 67d20b775cc..b854d308459 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -77,7 +77,7 @@ target_include_directories(GlobalConfigPrivate INTERFACE add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) install(TARGETS Platform GlobalConfig GlobalConfigPrivate EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") -install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${INSTALL_CMAKE_EXPORT_NAMESPACE}:: DESTINATION "${config_install_dir}") +install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION "${config_install_dir}") export(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") ## Install some QtBase specific CMake files: From d3b10dabf20d369d4967cbdb4a8d6cb9993705bc Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 2 May 2019 17:39:44 +0200 Subject: [PATCH 0441/1322] Revert "CMake: better GLX detection" This fixes the build when GLX is available. In the .pro files as well as the .cpp files the condition of enabling GLX support is based on the Qt feature system (xlib && opengl && !opengles2). The change to replace the !opengles check with a cmake target check is incomplete for two reasons: (1) the target check would _never_ succeed because there was no find_package() call in scope that would create the target. (2) when the target is found, the .cpp code that checks for the features would fail, because that continues to use the !opengles2 condition -- the preprocessor can't know about cmake targets. So this reverts commit 1361cf5d50e0baa901c06cab7f87785a03c57cb7 and instead calls for an investigation why in Ville's machine desktop gl was disabled. Change-Id: I9a7957224f81b800282c260dee8abcd421fdbc9e Reviewed-by: Alexandru Croitor Reviewed-by: Albert Astals Cid --- src/platformsupport/CMakeLists.txt | 2 +- src/plugins/platforms/offscreen/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index cac0b21782b..ece4eed2aab 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -44,7 +44,7 @@ if(QT_FEATURE_opengl) add_subdirectory(platformcompositor) endif() -if (QT_FEATURE_xlib AND QT_FEATURE_opengl AND TARGET OpenGL::GLX) # special case +if (QT_FEATURE_xlib AND QT_FEATURE_opengl AND (NOT QT_FEATURE_opengles2)) add_subdirectory(glxconvenience) endif() diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index e3f3ece17eb..e81134bbfb3 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -33,7 +33,7 @@ add_qt_plugin(qoffscreen ## Scopes: ##################################################################### -extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND TARGET OpenGL::GLX # special case +extend_target(qoffscreen CONDITION QT_FEATURE_opengl AND QT_FEATURE_xlib AND NOT QT_FEATURE_opengles2 SOURCES qoffscreenintegration_x11.cpp qoffscreenintegration_x11.h LIBRARIES From db5f99f4513c759bdd971f881ef2046fca72e42f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 3 May 2019 09:31:19 +0200 Subject: [PATCH 0442/1322] cmake: make the qt_find_package PROVIDED_TARGETS optional This is because some FindPackage may produce some targets only on some platforms - e.g. qt_find_package(OpenGL) needs to define the provided target OpenGL::GLX which will only exist on linux but is required by various CMakeLists.txt files. Change-Id: I74515470f5d56c246f489df74901ad4223a92a70 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 +- src/gui/configure.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ddf6389db1d..f23c21901f9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1428,7 +1428,7 @@ macro(qt_find_package) IMPORTED_GLOBAL TRUE) endif() else() - message(FATAL_ERROR + message(AUTHOR_WARNING "Error while trying to mark target '${qt_find_package_target_name}' as part" " of the ${ARGV0} package. Provided target name does not exist.") endif() diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 81e1b31620c..542460a889f 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -44,7 +44,7 @@ qt_find_package(PNG PROVIDED_TARGETS PNG::PNG) set_package_properties(PNG PROPERTIES TYPE OPTIONAL) qt_find_package(Mtdev PROVIDED_TARGETS PkgConfig::Mtdev) set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) -qt_find_package(OpenGL) +qt_find_package(OpenGL PROVIDED_TARGETS OpenGL::GL OpenGL::OpenGL OpenGL::EGL OpenGL::GLX OpenGL::GLU) set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL) qt_find_package(GLESv2) set_package_properties(GLESv2 PROPERTIES TYPE OPTIONAL) From 64b31cafa102c788a25a3d83975da84938a7432b Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 3 May 2019 09:46:47 +0200 Subject: [PATCH 0443/1322] cmake: Fix xcb_glx build Use the actual cmake library target name Change-Id: Icda1d232e3b920bf33ebceb00f39682050f7dedd Reviewed-by: Alexandru Croitor --- .../platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt | 2 +- util/cmake/helper.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt index 51e5f976589..c8212daae6f 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt @@ -38,7 +38,7 @@ add_qt_plugin(qxcb-glx-integration extend_target(qxcb-glx-integration CONDITION QT_FEATURE_xcb_glx PUBLIC_LIBRARIES - xcb_glx + XCB::GLX ) extend_target(qxcb-glx-integration CONDITION NOT static diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 1e13a5a1f3e..eb30aa02ddd 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -240,6 +240,7 @@ qmake_library_to_cmake_target_mapping = { 'SQLite3': 'SQLite::SQLite3', 'tslib': 'PkgConfig::Tslib', 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', + 'xcb_glx': 'XCB::GLX', 'xcb_icccm': 'XCB::ICCCM', 'xcb_image': 'XCB::IMAGE', 'xcb_keysyms': 'XCB::KEYSYMS', From c2379c469cb464df7c4ab78eb65e32f795ed050e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 May 2019 10:15:34 +0200 Subject: [PATCH 0444/1322] Fix linking on systems where there's no libGLX.so but mesa provides bindings Behave like qmake and link against libGL simply. This happened in offscreen.pro implicitly through QT += gui-private and needs to happen explicitly here by using the CONFIG += opengl equivalent: WrapOpenGL. Change-Id: I396c2256c89f4560bb7f936f7540b33c754b9eda Reviewed-by: Alexandru Croitor --- src/platformsupport/glxconvenience/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/glxconvenience/CMakeLists.txt b/src/platformsupport/glxconvenience/CMakeLists.txt index 8480a351257..729f4945586 100644 --- a/src/platformsupport/glxconvenience/CMakeLists.txt +++ b/src/platformsupport/glxconvenience/CMakeLists.txt @@ -1,5 +1,5 @@ qt_find_package(X11) # special case -qt_find_package(OpenGL) # special case +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## GlxSupport Module: @@ -12,7 +12,7 @@ add_qt_module(GlxSupport DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES - OpenGL::GLX # special case + WrapOpenGL # special case Qt::CorePrivate Qt::GuiPrivate X11::X11 # special case From 914b367c7f6a117130b8a56338c46a8102a1f77f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 May 2019 12:07:37 +0200 Subject: [PATCH 0445/1322] Fix finding host tools when cross-compiling * When using a sysroot, just setting CMAKE_PREFIX_PATH to the QT_HOST_PATH is not sufficient in finding for example Qt5CoreTools because the QT_HOST_PATH would be prefixed by the sysroot. So this patch switches the mode to also enable looking outside of the sysroot. (done by Alexandru) * Once the Qt5CoreToolsConfigVersion.cmake was found, the built-in check for 32 vs. 64 bit compatibility by looking at the provided CMAKE_SIZEOF_VOID_P (4 when target is armv7 for example) and comparing it against the void* size used when building the tools would fail. Explicitly unsetting CMAKE_SIZEOF_VOID_P disables this check, and that's fine as we're not interested in any exported library targets -- where this could cause problems -- but merely programs to run. Change-Id: If2931dad023e39a3dbdaa17ac095131ad2c0ca60 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f23c21901f9..0ddc4110252 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1037,6 +1037,14 @@ function(add_qt_tool name) # not get the proper prefix when using PATHS. set(BACKUP_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}) set(CMAKE_PREFIX_PATH "${QT_HOST_PATH}") + + # Search both with sysroots prepended as well as in the host system. When cross compiling + # the mode_package might be set to ONLY only, and the Qt5 tools packages are actually + # in the host system. + set(BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE "BOTH") + set(BACKUP_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}") + set(CMAKE_SIZEOF_VOID_P "") find_package( ${tools_package_name} ${PROJECT_VERSION} @@ -1046,7 +1054,9 @@ function(add_qt_tool name) NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH NO_CMAKE_SYSTEM_PACKAGE_REGISTRY) - set(CMAKE_PREFIX_PATH ${BACKUP_CMAKE_PREFIX_PATH}) + set(CMAKE_SIZEOF_VOID_P "${BACKUP_CMAKE_SIZEOF_VOID_P}") + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE "${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}") + set(CMAKE_PREFIX_PATH "${BACKUP_CMAKE_PREFIX_PATH}") if(${${tools_package_name}_FOUND} AND TARGET ${full_name}) get_property(path TARGET ${full_name} PROPERTY LOCATION) From 753d35cd56184a699288578cd728d17f8798088d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 3 May 2019 11:38:41 +0200 Subject: [PATCH 0446/1322] cmake: move dependencies accumulation in QtPostProcess.cmake This is needed because dependencies added after add_qt_module with extend_target are currently not taken into account. Task-number: QTBUG-75538 Change-Id: I2c72207fb88b2480e41a2c8550978fb194275617 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 39 +++++++++++++++++++++-------- cmake/QtModuleConfig.cmake.in | 18 ------------- cmake/QtModuleDependencies.cmake.in | 19 ++++++++++++++ cmake/QtPostProcess.cmake | 24 +++++++++++++++++- 4 files changed, 71 insertions(+), 29 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0ddc4110252..78251c90542 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -422,6 +422,22 @@ function(extend_target target) endif() endforeach() + # Find dependencies to internal libraries + get_target_property(target_deps "${target}" _qt_target_deps) + if(NOT target_deps) + set(target_deps "") + endif() + + foreach(lib ${arg_LIBRARIES}) + if (TARGET "${lib}") + get_target_property(_is_exported "${lib}" INTERFACE_QT_EXPORTED_LIBRARY) + if("${_is_exported}") + list(APPEND target_deps "${lib}\;${PROJECT_VERSION}") + endif() + endif() + endforeach() + + # Set-up the target target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) if (arg_COMPILE_FLAGS) set_source_files_properties(${arg_SOURCES} PROPERTIES COMPILE_FLAGS "${arg_COMPILE_FLAGS}") @@ -431,7 +447,11 @@ function(extend_target target) target_link_libraries("${target}" PUBLIC ${arg_PUBLIC_LIBRARIES} PRIVATE ${arg_LIBRARIES}) target_compile_options("${target}" PUBLIC ${arg_PUBLIC_COMPILE_OPTIONS} PRIVATE ${arg_COMPILE_OPTIONS}) target_link_options("${target}" PUBLIC ${arg_PUBLIC_LINK_OPTIONS} PRIVATE ${arg_LINK_OPTIONS}) - set_target_properties("${target}" PROPERTIES AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}") + + set_target_properties("${target}" PROPERTIES + AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}" + _qt_target_deps "${target_deps}" + ) else() if(QT_CMAKE_DEBUG_EXTEND_TARGET) message("extend_target(${target} CONDITION ${arg_CONDITION} ...): Skipped") @@ -698,7 +718,13 @@ function(add_qt_module target) $ ) - set(target_deps) + get_target_property(target_deps "${target}" _qt_target_deps) + if(NOT target_deps) + set(target_deps "") + endif() + + # TODO: should this also be in extend_target ? From the looks of it I would say that + # it is not necessary but I'm not sure foreach(lib IN LISTS arg_PUBLIC_LIBRARIES qt_libs_private) if ("${lib}" MATCHES "^Qt::(.*)") set(lib "${CMAKE_MATCH_1}") @@ -712,14 +738,7 @@ function(add_qt_module target) endif() endforeach() - foreach(lib ${arg_LIBRARIES}) - if (TARGET "${lib}") - get_target_property(_is_exported "${lib}" INTERFACE_QT_EXPORTED_LIBRARY) - if("${_is_exported}") - list(APPEND target_deps "${lib}\;${PROJECT_VERSION}") - endif() - endif() - endforeach() + set_target_properties("${target}" PROPERTIES _qt_target_deps "${target_deps}") configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 9a0f0c368c6..9d2135d8426 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -10,24 +10,6 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependenci include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") endif() -# note: target_deps example: "Qt5Core\;5.12.0;Qt5Gui\;5.12.0" -set(_target_deps "@target_deps@") -foreach(_target_dep ${_target_deps}) - list(GET _target_dep 0 pkg) - list(GET _target_dep 1 version) - - if (NOT ${pkg}_FOUND) - find_dependency(${pkg} ${version} - PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH - ) - endif() - - if (NOT ${pkg}_FOUND) - set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) - return() - endif() -endforeach() - include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") foreach(extra_cmake_include @extra_cmake_includes@) diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index 2190460b71e..714d2b91ec0 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -49,3 +49,22 @@ foreach(_target_dep ${_tool_deps}) endif() endforeach() +# note: target_deps example: "Qt5Core\;5.12.0;Qt5Gui\;5.12.0" +set(_target_deps "@target_deps@") +foreach(_target_dep ${_target_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + + if (NOT ${pkg}_FOUND) + find_dependency(${pkg} ${version} + PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH + ) + endif() + + if (NOT ${pkg}_FOUND) + set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) + return() + endif() +endforeach() + + diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 40ac08396d5..57d194c0376 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -17,11 +17,15 @@ function(qt_internal_create_depends_files) foreach (target ${QT_KNOWN_MODULES}) get_target_property(depends "${target}" LINK_LIBRARIES) get_target_property(public_depends "${target}" INTERFACE_LINK_LIBRARIES) + get_target_property(target_deps "${target}" _qt_target_deps) + set(target_deps_seen "") + set(qtdeps "") set(third_party_deps "") set(third_party_deps_seen "") set(tool_deps "") set(tool_deps_seen "") + foreach (dep ${depends}) # Normalize module by stripping leading "Qt::" and trailing "Private" if (dep MATCHES "Qt::(.*)") @@ -82,6 +86,24 @@ function(qt_internal_create_depends_files) "${INSTALL_CMAKE_NAMESPACE}${target}Tools\;${PROJECT_VERSION}") endif() + # Dirty hack because https://gitlab.kitware.com/cmake/cmake/issues/19200 + foreach(dep ${target_deps}) + if(dep) + list(FIND target_deps_seen "${dep}" dep_seen) + if(dep_seen EQUAL -1) + list(LENGTH dep len) + if(NOT (len EQUAL 2)) + message(FATAL_ERROR "List '${dep}' should look like QtFoo;version") + endif() + list(GET dep 0 dep_name) + list(GET dep 1 dep_ver) + + list(APPEND target_deps_seen "${dep_name}\;${dep_ver}") + endif() + endif() + endforeach() + set(target_deps "${target_deps_seen}") + if (DEFINED qtdeps) list(REMOVE_DUPLICATES qtdeps) endif() @@ -92,7 +114,7 @@ function(qt_internal_create_depends_files) endif() - if(third_party_deps OR main_module_tool_deps) + if(third_party_deps OR main_module_tool_deps OR target_deps) # Configure and install ModuleDependencies file. configure_file( "${QT_CMAKE_DIR}/QtModuleDependencies.cmake.in" From d8cdbc4f97b030e8ae93fa63f6a4b5fa7a56c4e8 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 3 May 2019 14:46:29 +0200 Subject: [PATCH 0447/1322] cmake: Make add_qt_executable work Also needs the include/ from the top-level binary dir added to the include path. Change-Id: I7e0d82a2ee24d9bf9ffe9da5fd02b3b223fd48e7 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 78251c90542..059b0c82fc9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -996,6 +996,7 @@ function(add_qt_test name) INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" + $ "${arg_INCLUDE_DIRECTORIES}" DEFINES "${arg_DEFINES}" LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test ${arg_LIBRARIES} From 9618434de56644fb61a76d4a3eb2176d629023fc Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 3 May 2019 14:08:17 +0200 Subject: [PATCH 0448/1322] CMake: configurejson2cmake: Do not generate useless OPTIONALs Do not set properties of packages to type OPTIONAL. That is the default anyway. Update generator script and generated files. Change-Id: I7a4d043b69c93ce8c2929a2e27ac6a07e4e6d8cc Reviewed-by: Simon Hausmann --- configure.cmake | 3 --- src/corelib/configure.cmake | 8 -------- src/gui/configure.cmake | 23 ++--------------------- src/network/configure.cmake | 2 -- src/plugins/sqldrivers/configure.cmake | 3 --- src/printsupport/configure.cmake | 1 - src/widgets/configure.cmake | 1 - util/cmake/configurejson2cmake.py | 5 ++--- 8 files changed, 4 insertions(+), 42 deletions(-) diff --git a/configure.cmake b/configure.cmake index 39a85a3f25e..934327a1f09 100644 --- a/configure.cmake +++ b/configure.cmake @@ -7,11 +7,8 @@ #### Libraries qt_find_package(ZLIB PROVIDED_TARGETS ZLIB::ZLIB) -set_package_properties(ZLIB PROPERTIES TYPE OPTIONAL) qt_find_package(ZSTD PROVIDED_TARGETS ZSTD::ZSTD) -set_package_properties(ZSTD PROPERTIES TYPE OPTIONAL) qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev) -set_package_properties(Libudev PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index e9794dc2a41..019cdef67eb 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -11,23 +11,15 @@ set_property(CACHE INPUT_iconv PROPERTY STRINGS undefined no yes posix sun gnu) #### Libraries qt_find_package(GLIB2 PROVIDED_TARGETS GLIB2::GLIB2) -set_package_properties(GLIB2 PROPERTIES TYPE OPTIONAL) qt_find_package(ICU COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data) -set_package_properties(ICU PROPERTIES TYPE OPTIONAL) qt_find_package(Libsystemd) -set_package_properties(Libsystemd PROPERTIES TYPE OPTIONAL) qt_find_package(Atomic PROVIDED_TARGETS Atomic) -set_package_properties(Atomic PROPERTIES TYPE OPTIONAL) qt_find_package(WrapRt PROVIDED_TARGETS WrapRt) -set_package_properties(WrapRt PROPERTIES TYPE OPTIONAL) qt_find_package(LTTngUST) -set_package_properties(LTTngUST PROPERTIES TYPE OPTIONAL) qt_find_package(PCRE2 PROVIDED_TARGETS PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) qt_find_package(PPS) -set_package_properties(PPS PROPERTIES TYPE OPTIONAL) qt_find_package(Slog2) -set_package_properties(Slog2 PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 542460a889f..86cce0535a0 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -23,45 +23,26 @@ set_property(CACHE INPUT_xcb PROPERTY STRINGS undefined no yes qt system) #### Libraries qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2) -set_package_properties(ATSPI2 PROPERTIES TYPE OPTIONAL) qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm) -set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL) qt_find_package(EGL) -set_package_properties(EGL PROPERTIES TYPE OPTIONAL) qt_find_package(Freetype PROVIDED_TARGETS Freetype::Freetype) set_package_properties(Freetype PROPERTIES TYPE REQUIRED) qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig) -set_package_properties(Fontconfig PROPERTIES TYPE OPTIONAL) qt_find_package(gbm PROVIDED_TARGETS gbm::gbm) -set_package_properties(gbm PROPERTIES TYPE OPTIONAL) qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz) -set_package_properties(harfbuzz PROPERTIES TYPE OPTIONAL) qt_find_package(Libinput PROVIDED_TARGETS Libinput::Libinput) -set_package_properties(Libinput PROPERTIES TYPE OPTIONAL) qt_find_package(JPEG) -set_package_properties(JPEG PROPERTIES TYPE OPTIONAL) qt_find_package(PNG PROVIDED_TARGETS PNG::PNG) -set_package_properties(PNG PROPERTIES TYPE OPTIONAL) qt_find_package(Mtdev PROVIDED_TARGETS PkgConfig::Mtdev) -set_package_properties(Mtdev PROPERTIES TYPE OPTIONAL) -qt_find_package(OpenGL PROVIDED_TARGETS OpenGL::GL OpenGL::OpenGL OpenGL::EGL OpenGL::GLX OpenGL::GLU) -set_package_properties(OpenGL PROPERTIES TYPE OPTIONAL) +qt_find_package(OpenGL) qt_find_package(GLESv2) -set_package_properties(GLESv2 PROPERTIES TYPE OPTIONAL) qt_find_package(Tslib PROVIDED_TARGETS PkgConfig::Tslib) -set_package_properties(Tslib PROPERTIES TYPE OPTIONAL) -qt_find_package(Vulkan PROVIDED_TARGETS Vulkan::Vulkan) -set_package_properties(Vulkan PROPERTIES TYPE OPTIONAL) +qt_find_package(Vulkan) qt_find_package(Wayland) -set_package_properties(Wayland PROPERTIES TYPE OPTIONAL) qt_find_package(X11) -set_package_properties(X11 PROPERTIES TYPE OPTIONAL) qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB) -set_package_properties(XCB PROPERTIES TYPE OPTIONAL) qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB) -set_package_properties(X11_XCB PROPERTIES TYPE OPTIONAL) qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) -set_package_properties(XKB PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/src/network/configure.cmake b/src/network/configure.cmake index c765f59c5d2..c11bcf4744f 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -7,9 +7,7 @@ #### Libraries qt_find_package(Libproxy PROVIDED_TARGETS PkgConfig::Libproxy) -set_package_properties(Libproxy PROPERTIES TYPE OPTIONAL) qt_find_package(OpenSSL) -set_package_properties(OpenSSL PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake index 9f0b0dfc7e6..87728099d26 100644 --- a/src/plugins/sqldrivers/configure.cmake +++ b/src/plugins/sqldrivers/configure.cmake @@ -7,11 +7,8 @@ #### Libraries qt_find_package(PostgreSQL PROVIDED_TARGETS PostgreSQL::PostgreSQL) -set_package_properties(PostgreSQL PROPERTIES TYPE OPTIONAL) qt_find_package(ODBC PROVIDED_TARGETS ODBC::ODBC) -set_package_properties(ODBC PROPERTIES TYPE OPTIONAL) qt_find_package(SQLite3) -set_package_properties(SQLite3 PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/src/printsupport/configure.cmake b/src/printsupport/configure.cmake index bede6a503b5..c9b5f74750f 100644 --- a/src/printsupport/configure.cmake +++ b/src/printsupport/configure.cmake @@ -7,7 +7,6 @@ #### Libraries qt_find_package(Cups PROVIDED_TARGETS Cups::Cups) -set_package_properties(Cups PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake index a67e12646c7..50a50f6b054 100644 --- a/src/widgets/configure.cmake +++ b/src/widgets/configure.cmake @@ -7,7 +7,6 @@ #### Libraries qt_find_package(GTK3) -set_package_properties(GTK3 PROPERTIES TYPE OPTIONAL) #### Tests diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 15cd9bab473..fc6f9845a6c 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -270,9 +270,8 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): else: cm_fh.write('qt_find_package({})\n'.format(newlib)) - cm_fh.write('set_package_properties({} PROPERTIES TYPE {})\n' - .format(newlib, 'REQUIRED' if isRequired else 'OPTIONAL') - ) + if isRequired: + cm_fh.write('set_package_properties({} PROPERTIES TYPE REQUIRED)\n'.format(newlib)) def lineify(label, value, quote=True): if value: From 7874ce780130cdecd6188662f03703ff49387ab0 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 3 May 2019 15:02:32 +0200 Subject: [PATCH 0449/1322] CMake: Improve mapping of libraries Merge all data related to mapping libraries into one data structure in helper.py. Use that data for everything related to library mapping. This change enables way more features now like e.g. adding find_package calls into generated files. Change-Id: Ibbd2a1063cbeb65277582d434a6a672d62fc170b Reviewed-by: Simon Hausmann --- cmake/FindXRender.cmake | 5 + configure.cmake | 3 +- src/corelib/configure.cmake | 8 +- src/gui/CMakeLists.txt | 2 +- src/gui/configure.cmake | 35 +- src/network/configure.cmake | 3 +- src/plugins/sqldrivers/configure.cmake | 2 +- src/widgets/configure.cmake | 2 +- util/cmake/configurejson2cmake.py | 121 ++----- util/cmake/helper.py | 427 ++++++++++++++----------- util/cmake/pro2cmake.py | 2 +- 11 files changed, 311 insertions(+), 299 deletions(-) create mode 100644 cmake/FindXRender.cmake diff --git a/cmake/FindXRender.cmake b/cmake/FindXRender.cmake new file mode 100644 index 00000000000..f9b8b266c98 --- /dev/null +++ b/cmake/FindXRender.cmake @@ -0,0 +1,5 @@ +include(FindPkgConfig) + +if(NOT TARGET PkgConfig::xrender) + pkg_check_modules(XRender xrender IMPORTED_TARGET) +endif() diff --git a/configure.cmake b/configure.cmake index 934327a1f09..3c86c89f95f 100644 --- a/configure.cmake +++ b/configure.cmake @@ -8,6 +8,7 @@ qt_find_package(ZLIB PROVIDED_TARGETS ZLIB::ZLIB) qt_find_package(ZSTD PROVIDED_TARGETS ZSTD::ZSTD) +qt_find_package(DBus1 PROVIDED_TARGETS dbus-1) qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev) @@ -414,7 +415,7 @@ qt_feature("dbus" PUBLIC PRIVATE qt_feature_definition("dbus" "QT_NO_DBUS" NEGATE VALUE "1") qt_feature("dbus_linked" PRIVATE LABEL "Qt D-Bus directly linked to libdbus" - CONDITION QT_FEATURE_dbus AND libs.dbus OR FIXME + CONDITION QT_FEATURE_dbus AND DBus1_FOUND ENABLE INPUT_dbus STREQUAL 'linked' DISABLE INPUT_dbus STREQUAL 'runtime' ) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index 019cdef67eb..a5b40b56a03 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -12,14 +12,14 @@ set_property(CACHE INPUT_iconv PROPERTY STRINGS undefined no yes posix sun gnu) qt_find_package(GLIB2 PROVIDED_TARGETS GLIB2::GLIB2) qt_find_package(ICU COMPONENTS i18n uc data PROVIDED_TARGETS ICU::i18n ICU::uc ICU::data) -qt_find_package(Libsystemd) +qt_find_package(Libsystemd PROVIDED_TARGETS PkgConfig::Libsystemd) qt_find_package(Atomic PROVIDED_TARGETS Atomic) qt_find_package(WrapRt PROVIDED_TARGETS WrapRt) -qt_find_package(LTTngUST) +qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST) qt_find_package(PCRE2 PROVIDED_TARGETS PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) -qt_find_package(PPS) -qt_find_package(Slog2) +qt_find_package(PPS PROVIDED_TARGETS PPS::PPS) +qt_find_package(Slog2 PROVIDED_TARGETS Slog2::Slog2) #### Tests diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 1ddee1692d8..df60f64b49a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -579,7 +579,7 @@ extend_target(Gui CONDITION QT_FEATURE_vulkan vulkan/qvulkaninstance.cpp vulkan/qvulkaninstance.h vulkan/qvulkanwindow.cpp vulkan/qvulkanwindow.h vulkan/qvulkanwindow_p.h PUBLIC_LIBRARIES - Vulkan::Vulkan_nolink # special case + Vulkan::Vulkan_nolink ) # special case: diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 86cce0535a0..19f97628c5d 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -24,25 +24,40 @@ set_property(CACHE INPUT_xcb PROPERTY STRINGS undefined no yes qt system) qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2) qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm) -qt_find_package(EGL) +qt_find_package(EGL PROVIDED_TARGETS EGL::EGL) qt_find_package(Freetype PROVIDED_TARGETS Freetype::Freetype) set_package_properties(Freetype PROPERTIES TYPE REQUIRED) qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig) qt_find_package(gbm PROVIDED_TARGETS gbm::gbm) qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz) qt_find_package(Libinput PROVIDED_TARGETS Libinput::Libinput) -qt_find_package(JPEG) +qt_find_package(JPEG PROVIDED_TARGETS JPEG::JPEG) qt_find_package(PNG PROVIDED_TARGETS PNG::PNG) qt_find_package(Mtdev PROVIDED_TARGETS PkgConfig::Mtdev) -qt_find_package(OpenGL) -qt_find_package(GLESv2) +qt_find_package(OpenGL PROVIDED_TARGETS OpenGL::GL) +qt_find_package(GLESv2 PROVIDED_TARGETS GLESv2::GLESv2) qt_find_package(Tslib PROVIDED_TARGETS PkgConfig::Tslib) -qt_find_package(Vulkan) -qt_find_package(Wayland) -qt_find_package(X11) +qt_find_package(Vulkan PROVIDED_TARGETS Vulkan::Vulkan) +qt_find_package(Wayland PROVIDED_TARGETS Wayland::Server) +qt_find_package(X11 PROVIDED_TARGETS X11::XCB) +qt_find_package(X11 PROVIDED_TARGETS ${X11_SM_LIB} ${X11_ICE_LIB}) qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB) -qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB) +qt_find_package(XCB COMPONENTS ICCCM PROVIDED_TARGETS XCB::ICCCM) +qt_find_package(XCB COMPONENTS IMAGE PROVIDED_TARGETS XCB::IMAGE) +qt_find_package(XCB COMPONENTS KEYSYMS PROVIDED_TARGETS XCB::KEYSYMS) +qt_find_package(XCB COMPONENTS RENDERUTIL PROVIDED_TARGETS XCB::RENDERUTIL) +qt_find_package(XCB COMPONENTS RANDR PROVIDED_TARGETS XCB::RANDR) +qt_find_package(XCB COMPONENTS SHAPE PROVIDED_TARGETS XCB::SHAPE) +qt_find_package(XCB COMPONENTS SHM PROVIDED_TARGETS XCB::SHM) +qt_find_package(XCB COMPONENTS SYNC PROVIDED_TARGETS XCB::SYNC) +qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES) +qt_find_package(XCB COMPONENTS XINERAMA PROVIDED_TARGETS XCB::XINERAMA) +qt_find_package(XCB COMPONENTS XKB PROVIDED_TARGETS XCB::XKB) +qt_find_package(XCB PROVIDED_TARGETS XCB::RENDER) +qt_find_package(XCB PROVIDED_TARGETS XCB::GLX) +qt_find_package(XCB COMPONENTS XINPUT PROVIDED_TARGETS XCB::XINPUT) qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) +qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) #### Tests @@ -728,7 +743,7 @@ qt_feature("xcb_egl_plugin" PRIVATE ) qt_feature("xcb_native_painting" PRIVATE LABEL "Native painting (experimental)" - CONDITION QT_FEATURE_xcb_xlib AND QT_FEATURE_fontconfig AND XCB_RENDER_FOUND + CONDITION QT_FEATURE_xcb_xlib AND QT_FEATURE_fontconfig AND XRender_FOUND EMIT_IF QT_FEATURE_xcb ) qt_feature("xrender" PRIVATE @@ -738,7 +753,7 @@ qt_feature("xrender" PRIVATE ) qt_feature("xkb" PRIVATE LABEL "XCB XKB" - CONDITION ( NOT ON OR XCB_XKB_FOUND ) AND libs.xkbcommon_x11 OR FIXME + CONDITION ( NOT ON OR XCB_XKB_FOUND ) AND XKB_FOUND EMIT_IF QT_FEATURE_xcb ) qt_feature("xcb_xlib" PRIVATE diff --git a/src/network/configure.cmake b/src/network/configure.cmake index c11bcf4744f..c7d300acb0a 100644 --- a/src/network/configure.cmake +++ b/src/network/configure.cmake @@ -7,7 +7,8 @@ #### Libraries qt_find_package(Libproxy PROVIDED_TARGETS PkgConfig::Libproxy) -qt_find_package(OpenSSL) +qt_find_package(OpenSSL PROVIDED_TARGETS OpenSSL::SSL) +qt_find_package(OpenSSL PROVIDED_TARGETS OpenSSL::SSL) #### Tests diff --git a/src/plugins/sqldrivers/configure.cmake b/src/plugins/sqldrivers/configure.cmake index 87728099d26..037b3615592 100644 --- a/src/plugins/sqldrivers/configure.cmake +++ b/src/plugins/sqldrivers/configure.cmake @@ -8,7 +8,7 @@ qt_find_package(PostgreSQL PROVIDED_TARGETS PostgreSQL::PostgreSQL) qt_find_package(ODBC PROVIDED_TARGETS ODBC::ODBC) -qt_find_package(SQLite3) +qt_find_package(SQLite3 PROVIDED_TARGETS SQLite::SQLite3) #### Tests diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake index 50a50f6b054..099414ae399 100644 --- a/src/widgets/configure.cmake +++ b/src/widgets/configure.cmake @@ -6,7 +6,7 @@ #### Libraries -qt_find_package(GTK3) +qt_find_package(GTK3 PROVIDED_TARGETS PkgConfig::GTK3) #### Tests diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index fc6f9845a6c..b9ec0f94491 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -33,7 +33,7 @@ import re import sys from typing import Set, Union, List, Dict -from helper import map_qt_library, featureName, substitute_platform, qmake_library_to_cmake_target_mapping +from helper import map_qt_library, featureName, substitute_platform, find_library_mapping knownTests = set() # type: Set[str] @@ -44,70 +44,6 @@ class LibraryMapping: self.resultVariable = resultVariable self.appendFoundSuffix = appendFoundSuffix - -def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]: - libmap = { - 'atspi': 'ATSPI2', - 'corewlan': None, # Framework - 'cups': 'Cups', - 'double-conversion': None, - 'drm': 'Libdrm', - 'egl': 'EGL', - 'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"), - 'freetype': ['Freetype', 'REQUIRED'], - 'gbm': 'gbm', - 'glib': 'GLIB2', - 'gnu_iconv': None, - 'gtk3': 'GTK3', - 'harfbuzz': 'harfbuzz', - 'host_dbus': None, - 'icu': ['ICU', 'COMPONENTS', 'i18n', 'uc', 'data'], - 'journald': 'Libsystemd', - 'libatomic': 'Atomic', - 'libdl': None, # handled by CMAKE_DL_LIBS - 'libinput': 'Libinput', - 'libjpeg': 'JPEG', - 'libpng': 'PNG', - 'libproxy': 'Libproxy', - 'librt': 'WrapRt', - 'libudev': 'Libudev', - 'lttng-ust': LibraryMapping(package='LTTngUST', resultVariable="LTTNGUST"), - 'mtdev': 'Mtdev', - 'odbc': 'ODBC', - 'opengl': LibraryMapping(package="OpenGL", resultVariable="OpenGL_OpenGL"), - 'openssl': 'OpenSSL', - 'openssl_headers': LibraryMapping(package="OpenSSL", resultVariable="OPENSSL_INCLUDE_DIR", appendFoundSuffix=False), - 'pcre2': ['PCRE2', 'REQUIRED'], - 'posix_iconv': None, - 'pps': 'PPS', - 'psql': 'PostgreSQL', - 'slog2': 'Slog2', - 'sqlite3': 'SQLite3', - 'sun_iconv': None, - 'tslib': 'Tslib', - 'udev': 'Libudev', - 'vulkan': 'Vulkan', - 'wayland_server': 'Wayland', - 'x11sm': LibraryMapping(package="X11", resultVariable="X11_SM"), - 'xcb_glx': LibraryMapping(package="XCB", resultVariable="XCB_GLX"), - 'xcb_render': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), - 'xcb': ['XCB', '1.9'], - 'xcb_xinput': LibraryMapping(package="XCB", resultVariable="XCB_XINPUT"), - 'xcb_xkb': LibraryMapping(package="XCB", resultVariable="XCB_XKB"), - 'xcb_xlib': 'X11_XCB', - 'xkbcommon': ['XKB', '0.4.1'], - 'xlib': 'X11', - 'xrender': LibraryMapping(package="XCB", resultVariable="XCB_RENDER"), - 'zlib': 'ZLIB', - 'zstd': 'ZSTD', - 'opengl_es2': 'GLESv2', - } # type: Dict[str, Union[str, List[str], LibraryMapping]] - if lib not in libmap: - raise Exception(' XXXX Unknown library "{}".'.format(lib)) - - return libmap[lib] - - def map_tests(test: str) -> str: testmap = { 'c++11': '$', @@ -229,49 +165,48 @@ def processFiles(ctx, data): return ctx def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): - extra = [] - try: - newlib = map_library(lib) - if isinstance(newlib, list): - extra = newlib[1:] - newlib = newlib[0] - elif isinstance(newlib, LibraryMapping): - newlib = newlib.package - except Exception: - return ctx + newlib = find_library_mapping(lib) + if not newlib: + print(' XXXX Unknown library "{}".'.format(lib)) + return - if newlib is None: + if newlib.packageName is None: print(' **** Skipping library "{}" -- was masked.'.format(lib)) return print(' mapped library {} to {}.'.format(lib, newlib)) # Avoid duplicate find_package calls. - if newlib in cmake_find_packages_set: + if newlib.targetName in cmake_find_packages_set: return - cmake_find_packages_set.add(newlib) + cmake_find_packages_set.add(newlib.targetName) isRequired = False + extra = newlib.extra.copy() + if extra: if "REQUIRED" in extra: isRequired = True extra.remove("REQUIRED") - # If we have a mapping from a qmake library to a CMake target name, - # encode that in the qt_find_package call(). - cmake_target_name = qmake_library_to_cmake_target_mapping.get(lib, None) + cmake_target_name = newlib.targetName + + # _nolink or not does not matter at this point: + if cmake_target_name.endswith('_nolink') or cmake_target_name.endswith('/nolink'): + cmake_target_name = cmake_target_name[:-7] + if cmake_target_name: extra += ['PROVIDED_TARGETS', cmake_target_name] if extra: - cm_fh.write('qt_find_package({} {})\n'.format(newlib, ' '.join(extra))) + cm_fh.write('qt_find_package({} {})\n'.format(newlib.packageName, ' '.join(extra))) else: - cm_fh.write('qt_find_package({})\n'.format(newlib)) + cm_fh.write('qt_find_package({})\n'.format(newlib.packageName)) if isRequired: - cm_fh.write('set_package_properties({} PROPERTIES TYPE REQUIRED)\n'.format(newlib)) + cm_fh.write('set_package_properties({} PROPERTIES TYPE REQUIRED)\n'.format(newlib.packageName)) def lineify(label, value, quote=True): if value: @@ -316,18 +251,14 @@ def map_condition(condition): substitution = None appendFoundSuffix = True if match.group(1) == 'libs': - try: - substitution = map_library(match.group(2)) - if isinstance(substitution, list): - substitution = substitution[0] - elif isinstance(substitution, LibraryMapping): - appendFoundSuffix = substitution.appendFoundSuffix - substitution = substitution.resultVariable - except Exception: - substitution = None + libmapping = find_library_mapping(match.group(2)) - if substitution is not None and appendFoundSuffix: - substitution += '_FOUND' + if libmapping and libmapping.packageName: + substitution = libmapping.packageName + if libmapping.resultVariable: + substitution = libmapping.resultVariable + if libmapping.appendFoundSuffix: + substitution += '_FOUND' elif match.group(1) == 'features': feature = match.group(2) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index eb30aa02ddd..99a518bf0c0 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -27,147 +27,255 @@ ############################################################################# import re +import typing + +class LibraryMapping: + def __init__(self, soName: typing.Optional[str], + packageName: str, targetName: str, *, + resultVariable: typing.Optional[str] = None, + extra: typing.List[str] = [], + appendFoundSuffix: bool = True) -> None: + self.soName = soName + self.packageName = packageName + self.resultVariable = resultVariable + self.appendFoundSuffix = appendFoundSuffix + self.extra = extra + self.targetName = targetName + + def is_qt() -> bool: + return self.packageName == 'Qt' \ + or self.packageName == 'Qt5' \ + or self.packageName == 'Qt6' + +_qt_library_map = [ + # Qt: + LibraryMapping('accessibility_support', 'Qt5', 'Qt::AccessibilitySupport', extra = ['COMPONENTS', 'AccessibilitySupport']), + LibraryMapping('androidextras', 'Qt5', 'Qt::AndroidExtras', extra = ['COMPONENTS', 'AndroidExtras']), + LibraryMapping('animation', 'Qt5', 'Qt::3DAnimation', extra = ['COMPONENTS', '3DAnimation']), + LibraryMapping('application-lib', 'Qt5', 'Qt::AppManApplication', extra = ['COMPONENTS', 'AppManApplication']), + LibraryMapping('bluetooth', 'Qt5', 'Qt::Bluetooth', extra = ['COMPONENTS', 'Bluetooth']), + LibraryMapping('bootstrap', 'Qt5', 'Qt::Bootstrap', extra = ['COMPONENTS', 'Bootstrap']), + # bootstrap-dbus: Not needed in Qt6! + LibraryMapping('client', 'Qt5', 'Qt::WaylandClient', extra = ['COMPONENTS', 'WaylandClient']), + LibraryMapping('clipboard_support', 'Qt5', 'Qt::ClipboardSupport', extra = ['COMPONENTS', 'ClipboardSupport']), + LibraryMapping('common-lib', 'Qt5', 'Qt::AppManCommon', extra = ['COMPONENTS', 'AppManCommon']), + LibraryMapping('compositor', 'Qt5', 'Qt::WaylandCompositor', extra = ['COMPONENTS', 'WaylandCompositor']), + LibraryMapping('concurrent', 'Qt5', 'Qt::Concurrent', extra = ['COMPONENTS', 'Concurrent']), + LibraryMapping('container', 'Qt5', 'Qt::AxContainer', extra = ['COMPONENTS', 'AxContainer']), + LibraryMapping('control', 'Qt5', 'Qt::AxServer', extra = ['COMPONENTS', 'AxServer']), + LibraryMapping('core_headers', 'Qt5', 'Qt::WebEngineCore', extra = ['COMPONENTS', 'WebEngineCore']), + LibraryMapping('core', 'Qt5', 'Qt::Core', extra = ['COMPONENTS', 'Core']), + LibraryMapping('coretest', 'Qt5', 'Qt::3DCoreTest', extra = ['COMPONENTS', '3DCoreTest']), + LibraryMapping('crypto-lib', 'Qt5', 'Qt::AppManCrypto', extra = ['COMPONENTS', 'AppManCrypto']), + LibraryMapping('dbus', 'Qt5', 'Qt::Dbus', extra = ['COMPONENTS', 'DBus']), + LibraryMapping('devicediscovery', 'Qt5', 'Qt::DeviceDiscoverySupport', extra = ['COMPONENTS', 'DeviceDiscoverySupport']), + LibraryMapping('devicediscovery_support', 'Qt5', 'Qt::DeviceDiscoverySupport', extra = ['COMPONENTS', 'DeviceDiscoverySupport']), + LibraryMapping('edid', 'Qt5', 'Qt::EdidSupport', extra = ['COMPONENTS', 'EdidSupport']), + LibraryMapping('edid_support', 'Qt5', 'Qt::EdidSupport', extra = ['COMPONENTS', 'EdidSupport']), + LibraryMapping('eglconvenience', 'Qt5', 'Qt::EglSupport', extra = ['COMPONENTS', 'EglSupport']), + LibraryMapping('eglfsdeviceintegration', 'Qt5', 'Qt::EglFSDeviceIntegration', extra = ['COMPONENTS', 'EglFSDeviceIntegration']), + LibraryMapping('eglfs_kms_support', 'Qt5', 'Qt::EglFsKmsSupport', extra = ['COMPONENTS', 'EglFsKmsSupport']), + LibraryMapping('egl_support', 'Qt5', 'Qt::EglSupport', extra = ['COMPONENTS', 'EglSupport']), + # enginio: Not needed in Qt6! + LibraryMapping('eventdispatchers', 'Qt5', 'Qt::EventDispatcherSupport', extra = ['COMPONENTS', 'EventDispatcherSupport']), + LibraryMapping('eventdispatcher_support', 'Qt5', 'Qt::EventDispatcherSupport', extra = ['COMPONENTS', 'EventDispatcherSupport']), + LibraryMapping('extras', 'Qt5', 'Qt::3DExtras', extra = ['COMPONENTS', '3DExtras']), + LibraryMapping('fbconvenience', 'Qt5', 'Qt::FbSupport', extra = ['COMPONENTS', 'FbSupport']), + LibraryMapping('fb_support', 'Qt5', 'Qt::FbSupport', extra = ['COMPONENTS', 'FbSupport']), + LibraryMapping('fontdatabase_support', 'Qt5', 'Qt::FontDatabaseSupport', extra = ['COMPONENTS', 'FontDatabaseSupport']), + LibraryMapping('gamepad', 'Qt5', 'Qt::Gamepad', extra = ['COMPONENTS', 'Gamepad']), + LibraryMapping('global', 'Qt5', 'Qt::Core', extra = ['COMPONENTS', 'Core']), # manually added special case + LibraryMapping('glx_support', 'Qt5', 'Qt::GlxSupport', extra = ['COMPONENTS', 'GlxSupport']), + LibraryMapping('graphics_support', 'Qt5', 'Qt::GraphicsSupport', extra = ['COMPONENTS', 'GraphicsSupport']), + LibraryMapping('gsttools', 'Qt5', 'Qt::MultimediaGstTools', extra = ['COMPONENTS', 'MultimediaGstTools']), + LibraryMapping('gui', 'Qt5', 'Qt::Gui', extra = ['COMPONENTS', 'Gui']), + LibraryMapping('help', 'Qt5', 'Qt::Help', extra = ['COMPONENTS', 'Help']), + LibraryMapping('hunspellinputmethod', 'Qt5', 'Qt::HunspellInputMethod', extra = ['COMPONENTS', 'HunspellInputMethod']), + LibraryMapping('input', 'Qt5', 'Qt::InputSupport', extra = ['COMPONENTS', 'InputSupport']), + LibraryMapping('input_support', 'Qt5', 'Qt::InputSupport', extra = ['COMPONENTS', 'InputSupport']), + LibraryMapping('installer-lib', 'Qt5', 'Qt::AppManInstaller', extra = ['COMPONENTS', 'AppManInstaller']), + LibraryMapping('kmsconvenience', 'Qt5', 'Qt::KmsSupport', extra = ['COMPONENTS', 'KmsSupport']), + LibraryMapping('kms_support', 'Qt5', 'Qt::KmsSupport', extra = ['COMPONENTS', 'KmsSupport']), + LibraryMapping('launcher-lib', 'Qt5', 'Qt::AppManLauncher', extra = ['COMPONENTS', 'AppManLauncher']), + LibraryMapping('lib', 'Qt5', 'Qt::Designer', extra = ['COMPONENTS', 'Designer']), + LibraryMapping('linuxaccessibility_support', 'Qt5', 'Qt::LinuxAccessibilitySupport', extra = ['COMPONENTS', 'LinuxAccessibilitySupport']), + LibraryMapping('location', 'Qt5', 'Qt::Location', extra = ['COMPONENTS', 'Location']), + LibraryMapping('logic', 'Qt5', 'Qt::3DLogic', extra = ['COMPONENTS', '3DLogic']), + LibraryMapping('macextras', 'Qt5', 'Qt::MacExtras', extra = ['COMPONENTS', 'MacExtras']), + LibraryMapping('main-lib', 'Qt5', 'Qt::AppManMain', extra = ['COMPONENTS', 'AppManMain']), + LibraryMapping('manager-lib', 'Qt5', 'Qt::AppManManager', extra = ['COMPONENTS', 'AppManManager']), + LibraryMapping('monitor-lib', 'Qt5', 'Qt::AppManMonitor', extra = ['COMPONENTS', 'AppManMonitor']), + LibraryMapping('multimedia', 'Qt5', 'Qt::Multimedia', extra = ['COMPONENTS', 'Multimedia']), + LibraryMapping('multimediawidgets', 'Qt5', 'Qt::MultimediaWidgets', extra = ['COMPONENTS', 'MultimediaWidgets']), + LibraryMapping('network', 'Qt5', 'Qt::Network', extra = ['COMPONENTS', 'Network']), + LibraryMapping('nfc', 'Qt5', 'Qt::Nfc', extra = ['COMPONENTS', 'Nfc']), + LibraryMapping('oauth', 'Qt5', 'Qt::NetworkAuth', extra = ['COMPONENTS', 'NetworkAuth']), + LibraryMapping('openglextensions', 'Qt5', 'Qt::OpenGLExtensions', extra = ['COMPONENTS', 'OpenGLExtensions']), + LibraryMapping('opengl', 'Qt5', 'Qt::OpenGL', extra = ['COMPONENTS', 'OpenGL']), + LibraryMapping('package-lib', 'Qt5', 'Qt::AppManPackage', extra = ['COMPONENTS', 'AppManPackage']), + LibraryMapping('packetprotocol', 'Qt5', 'Qt::PacketProtocol', extra = ['COMPONENTS', 'PacketProtocol']), + LibraryMapping('particles', 'Qt5', 'Qt::QuickParticles', extra = ['COMPONENTS', 'QuickParticles']), + LibraryMapping('platformcompositor', 'Qt5', 'Qt::PlatformCompositorSupport', extra = ['COMPONENTS', 'PlatformCompositorSupport']), + LibraryMapping('platformcompositor_support', 'Qt5', 'Qt::PlatformCompositorSupport', extra = ['COMPONENTS', 'PlatformCompositorSupport']), + LibraryMapping('plugin-interfaces', 'Qt5', 'Qt::AppManPluginInterfaces', extra = ['COMPONENTS', 'AppManPluginInterfaces']), + LibraryMapping('positioning', 'Qt5', 'Qt::Positioning', extra = ['COMPONENTS', 'Positioning']), + LibraryMapping('positioningquick', 'Qt5', 'Qt::PositioningQuick', extra = ['COMPONENTS', 'PositioningQuick']), + LibraryMapping('printsupport', 'Qt5', 'Qt::PrintSupport', extra = ['COMPONENTS', 'PrintSupport']), + LibraryMapping('purchasing', 'Qt5', 'Qt::Purchasing', extra = ['COMPONENTS', 'Purchasing']), + LibraryMapping('qmldebug', 'Qt5', 'Qt::QmlDebug', extra = ['COMPONENTS', 'QmlDebug']), + LibraryMapping('qmldevtools', 'Qt5', 'Qt::QmlDevTools', extra = ['COMPONENTS', 'QmlDevTools']), + LibraryMapping('qml', 'Qt5', 'Qt::Qml', extra = ['COMPONENTS', 'Qml']), + LibraryMapping('qmltest', 'Qt5', 'Qt::QuickTest', extra = ['COMPONENTS', 'QuickTest']), + LibraryMapping('qtmultimediaquicktools', 'Qt5', 'Qt::MultimediaQuick', extra = ['COMPONENTS', 'MultimediaQuick']), + LibraryMapping('quick3danimation', 'Qt5', 'Qt::3DQuickAnimation', extra = ['COMPONENTS', '3DQuickAnimation']), + LibraryMapping('quick3dextras', 'Qt5', 'Qt::3DQuickExtras', extra = ['COMPONENTS', '3DQuickExtras']), + LibraryMapping('quick3dinput', 'Qt5', 'Qt::3DQuickInput', extra = ['COMPONENTS', '3DQuickInput']), + LibraryMapping('quick3d', 'Qt5', 'Qt::3DQuick', extra = ['COMPONENTS', '3DQuick']), + LibraryMapping('quick3drender', 'Qt5', 'Qt::3DQuickRender', extra = ['COMPONENTS', '3DQuickRender']), + LibraryMapping('quick3dscene2d', 'Qt5', 'Qt::3DQuickScene2D', extra = ['COMPONENTS', '3DQuickScene2D']), + LibraryMapping('quickcontrols2', 'Qt5', 'Qt::QuickControls2', extra = ['COMPONENTS', 'QuickControls2']), + LibraryMapping('quick', 'Qt5', 'Qt::Quick', extra = ['COMPONENTS', 'Quick']), + LibraryMapping('quickshapes', 'Qt5', 'Qt::QuickShapes', extra = ['COMPONENTS', 'QuickShapes']), + LibraryMapping('quicktemplates2', 'Qt5', 'Qt::QuickTemplates2', extra = ['COMPONENTS', 'QuickTemplates2']), + LibraryMapping('quickwidgets', 'Qt5', 'Qt::QuickWidgets', extra = ['COMPONENTS', 'QuickWidgets']), + LibraryMapping('render', 'Qt5', 'Qt::3DRender', extra = ['COMPONENTS', '3DRender']), + LibraryMapping('script', 'Qt5', 'Qt::Script', extra = ['COMPONENTS', 'Script']), + LibraryMapping('scripttools', 'Qt5', 'Qt::ScriptTools', extra = ['COMPONENTS', 'ScriptTools']), + LibraryMapping('sensors', 'Qt5', 'Qt::Sensors', extra = ['COMPONENTS', 'Sensors']), + LibraryMapping('serialport', 'Qt5', 'Qt::SerialPort', extra = ['COMPONENTS', 'SerialPort']), + LibraryMapping('services', 'Qt5', 'Qt::ServiceSupport', extra = ['COMPONENTS', 'ServiceSupport']), + LibraryMapping('service_support', 'Qt5', 'Qt::ServiceSupport', extra = ['COMPONENTS', 'ServiceSupport']), + LibraryMapping('sql', 'Qt5', 'Qt::Sql', extra = ['COMPONENTS', 'Sql']), + LibraryMapping('svg', 'Qt5', 'Qt::Svg', extra = ['COMPONENTS', 'Svg']), + LibraryMapping('testlib', 'Qt5', 'Qt::Test', extra = ['COMPONENTS', 'Test']), + LibraryMapping('theme_support', 'Qt5', 'Qt::ThemeSupport', extra = ['COMPONENTS', 'ThemeSupport']), + LibraryMapping('tts', 'Qt5', 'Qt::TextToSpeech', extra = ['COMPONENTS', 'TextToSpeech']), + LibraryMapping('uiplugin', 'Qt5', 'Qt::UiPlugin', extra = ['COMPONENTS', 'UiPlugin']), + LibraryMapping('uitools', 'Qt5', 'Qt::UiTools', extra = ['COMPONENTS', 'UiTools']), + LibraryMapping('virtualkeyboard', 'Qt5', 'Qt::VirtualKeyboard', extra = ['COMPONENTS', 'VirtualKeyboard']), + LibraryMapping('vulkan_support', 'Qt5', 'Qt::VulkanSupport', extra = ['COMPONENTS', 'VulkanSupport']), + LibraryMapping('webchannel', 'Qt5', 'Qt::WebChannel', extra = ['COMPONENTS', 'WebChannel']), + LibraryMapping('webengine', 'Qt5', 'Qt::WebEngine', extra = ['COMPONENTS', 'WebEngine']), + LibraryMapping('webenginewidgets', 'Qt5', 'Qt::WebEngineWidgets', extra = ['COMPONENTS', 'WebEngineWidgets']), + LibraryMapping('websockets', 'Qt5', 'Qt::WebSockets', extra = ['COMPONENTS', 'WebSockets']), + LibraryMapping('webview', 'Qt5', 'Qt::WebView', extra = ['COMPONENTS', 'WebView']), + LibraryMapping('widgets', 'Qt5', 'Qt::Widgets', extra = ['COMPONENTS', 'Widgets']), + LibraryMapping('window-lib', 'Qt5', 'Qt::AppManWindow', extra = ['COMPONENTS', 'AppManWindow']), + LibraryMapping('windowsuiautomation_support', 'Qt5', 'Qt::WindowsUIAutomationSupport', extra = ['COMPONENTS', 'WindowsUIAutomationSupport']), + LibraryMapping('winextras', 'Qt5', 'Qt::WinExtras', extra = ['COMPONENTS', 'WinExtras']), + LibraryMapping('x11extras', 'Qt5', 'Qt::X11Extras', extra = ['COMPONENTS', 'X11Extras']), + LibraryMapping('xkbcommon_support', 'Qt5', 'Qt::XkbCommonSupport', extra = ['COMPONENTS', 'XkbCommonSupport']), + LibraryMapping('xmlpatterns', 'Qt5', 'Qt::XmlPatterns', extra = ['COMPONENTS', 'XmlPatterns']), + LibraryMapping('xml', 'Qt5', 'Qt::Xml', extra = ['COMPONENTS', 'Xml']), + # qtzlib: No longer supported. +] + +_library_map = [ + # 3rd party: + LibraryMapping('atspi', 'ATSPI2', 'PkgConfig::ATSPI2'), + LibraryMapping('corewlan', None, None), + LibraryMapping('cups', 'Cups', 'Cups::Cups'), + LibraryMapping('dbus', 'DBus1', 'dbus-1'), + LibraryMapping('doubleconversion', None, None), + LibraryMapping('drm', 'Libdrm', 'Libdrm::Libdrm'), + LibraryMapping('egl', 'EGL', 'EGL::EGL'), + LibraryMapping('fontconfig', 'Fontconfig', 'Fontconfig::Fontconfig', resultVariable="FONTCONFIG"), + LibraryMapping('freetype', 'Freetype', 'Freetype::Freetype', extra=['REQUIRED']), + LibraryMapping('gbm', 'gbm', 'gbm::gbm'), + LibraryMapping('glib', 'GLIB2', 'GLIB2::GLIB2'), + LibraryMapping('gnu_iconv', None, None), + LibraryMapping('gtk3', 'GTK3', 'PkgConfig::GTK3'), + LibraryMapping('harfbuzz', 'harfbuzz', 'harfbuzz::harfbuzz'), + LibraryMapping('host_dbus', None, None), + LibraryMapping('icu', 'ICU', 'ICU::i18n ICU::uc ICU::data', extra=['COMPONENTS', 'i18n', 'uc', 'data']), + LibraryMapping('journald', 'Libsystemd', 'PkgConfig::Libsystemd'), + LibraryMapping('libatomic', 'Atomic', 'Atomic'), + LibraryMapping('libdl', None, None), + LibraryMapping('libinput', 'Libinput', 'Libinput::Libinput'), + LibraryMapping('libjpeg', 'JPEG', 'JPEG::JPEG'), + LibraryMapping('libpng', 'PNG', 'PNG::PNG'), + LibraryMapping('libproxy', 'Libproxy', 'PkgConfig::Libproxy'), + LibraryMapping('librt', 'WrapRt','WrapRt'), + LibraryMapping('libudev', 'Libudev', 'PkgConfig::Libudev'), + LibraryMapping('lttng-ust', 'LTTngUST', 'LTTng::UST', resultVariable='LTTNGUST'), + LibraryMapping('mtdev', 'Mtdev', 'PkgConfig::Mtdev'), + LibraryMapping('odbc', 'ODBC', 'ODBC::ODBC'), + LibraryMapping('opengl_es2', 'GLESv2', 'GLESv2::GLESv2'), + LibraryMapping('opengl', 'OpenGL', 'OpenGL::GL', resultVariable='OpenGL_OpenGL'), + LibraryMapping('openssl_headers', 'OpenSSL', 'OpenSSL::SSL_nolink', resultVariable='OPENSSL_INCLUDE_DIR', appendFoundSuffix=False), + LibraryMapping('openssl', 'OpenSSL', 'OpenSSL::SSL'), + LibraryMapping('pcre2', 'PCRE2', 'PCRE2', extra = ['REQUIRED']), + LibraryMapping('posix_iconv', None, None), + LibraryMapping('pps', 'PPS', 'PPS::PPS'), + LibraryMapping('psql', 'PostgreSQL', 'PostgreSQL::PostgreSQL'), + LibraryMapping('slog2', 'Slog2', 'Slog2::Slog2'), + LibraryMapping('sqlite2', None, None), # No more sqlite2 support in Qt6! + LibraryMapping('sqlite3', 'SQLite3', 'SQLite::SQLite3'), + LibraryMapping('sun_iconv', None, None), + LibraryMapping('tslib', 'Tslib', 'PkgConfig::Tslib'), + LibraryMapping('udev', 'Libudev', 'PkgConfig::Libudev'), + LibraryMapping('udev', 'Libudev', 'PkgConfig::Libudev'), # see also libudev! + LibraryMapping('vulkan', 'Vulkan', 'Vulkan::Vulkan'), + LibraryMapping('wayland_server', 'Wayland', 'Wayland::Server'), + LibraryMapping('x11sm', 'X11', '${X11_SM_LIB} ${X11_ICE_LIB}', resultVariable="X11_SM"), + LibraryMapping('xcb_glx', 'XCB', 'XCB::GLX', resultVariable='XCB_GLX'), + LibraryMapping('xcb_render', 'XCB', 'XCB::RENDER', resultVariable='XCB_RENDER'), + LibraryMapping('xcb', 'XCB', 'XCB::XCB', extra = ['1.9']), + LibraryMapping('xcb_glx', 'XCB', 'XCB::GLX', extra = ['COMPONENTS', 'GLX'], resultVariable='XCB_GLX'), + LibraryMapping('xcb_icccm', 'XCB', 'XCB::ICCCM', extra = ['COMPONENTS', 'ICCCM'], resultVariable='XCB_ICCCM'), + LibraryMapping('xcb_image', 'XCB', 'XCB::IMAGE', extra = ['COMPONENTS', 'IMAGE'], resultVariable='XCB_IMAGE'), + LibraryMapping('xcb_keysyms', 'XCB', 'XCB::KEYSYMS', extra = ['COMPONENTS', 'KEYSYMS'], resultVariable='XCB_KEYSYMS'), + LibraryMapping('xcb_randr', 'XCB', 'XCB::RANDR', extra = ['COMPONENTS', 'RANDR'], resultVariable='XCB_RANDR'), + LibraryMapping('xcb_render', 'XCB', 'XCB::RENDER', extra = ['COMPONENTS', 'RENDER'], resultVariable='XCB_RENDER'), + LibraryMapping('xcb_renderutil', 'XCB', 'XCB::RENDERUTIL', extra = ['COMPONENTS', 'RENDERUTIL'], resultVariable='XCB_RENDERUTIL'), + LibraryMapping('xcb_shape', 'XCB', 'XCB::SHAPE', extra = ['COMPONENTS', 'SHAPE'], resultVariable='XCB_SHAPE'), + LibraryMapping('xcb_shm', 'XCB', 'XCB::SHM', extra = ['COMPONENTS', 'SHM'], resultVariable='XCB_SHM'), + LibraryMapping('xcb_sync', 'XCB', 'XCB::SYNC', extra = ['COMPONENTS', 'SYNC'], resultVariable='XCB_SYNC'), + LibraryMapping('xcb_xfixes', 'XCB', 'XCB::XFIXES', extra = ['COMPONENTS', 'XFIXES'], resultVariable='XCB_XFIXES'), + LibraryMapping('xcb_xinerama', 'XCB', 'XCB::XINERAMA', extra = ['COMPONENTS', 'XINERAMA'], resultVariable='XCB_XINERAMA'), + LibraryMapping('xcb_xinput', 'XCB', 'XCB::XINPUT', extra = ['COMPONENTS', 'XINPUT'], resultVariable='XCB_XINPUT'), + LibraryMapping('xcb_xkb', 'XCB', 'XCB::XKB', extra = ['COMPONENTS', 'XKB'], resultVariable='XCB_XKB'), + LibraryMapping('xcb_xlib', 'X11_XCB', 'X11::XCB'), + LibraryMapping('xkbcommon_evdev', 'XKB', 'XKB::XKB', extra = ['0.4.1']), # see also xkbcommon + LibraryMapping('xkbcommon_x11', 'XKB', 'XKB::XKB', extra = ['0.4.1']), # see also xkbcommon + LibraryMapping('xkbcommon', 'XKB', 'XKB::XKB', extra = ['0.4.1']), + LibraryMapping('xlib', 'X11', 'X11::XCB'), # FIXME: Is this correct? + LibraryMapping('xrender', 'XRender', 'PkgConfig::xrender'), + LibraryMapping('zlib', 'ZLIB', 'ZLIB::ZLIB'), + LibraryMapping('zstd', 'ZSTD', 'ZSTD::ZSTD'), +] + + +def find_library_mapping(soName: str) -> typing.Optional[LibraryMapping]: + for i in _library_map: + if i.soName == soName: + return i + return None + + +def find_qt_library_mapping(soName: str) -> typing.Optional[LibraryMapping]: + for i in _qt_library_map: + if i.soName == soName: + return i + return None def featureName(input: str) -> str: return re.sub(r'[^a-zA-Z0-9_]', '_', input) -def map_qt_base_library(lib: str) -> str: - library_map = { - 'global': 'Qt::Core', # manually added special case - 'accessibility_support': 'Qt::AccessibilitySupport', - 'androidextras': 'Qt::AndroidExtras', - 'animation': 'Qt::3DAnimation', - 'application-lib': 'Qt::AppManApplication', - 'bluetooth': 'Qt::Bluetooth', - 'bootstrap-dbus': 'Qt::BootstrapDBus', - 'bootstrap': 'Qt::Bootstrap', - 'client': 'Qt::WaylandClient', - 'clipboard_support': 'Qt::ClipboardSupport', - 'common-lib': 'Qt::AppManCommon', - 'compositor': 'Qt::WaylandCompositor', - 'concurrent': 'Qt::Concurrent', - 'container': 'Qt::AxContainer', - 'control': 'Qt::AxServer', - 'core_headers': 'Qt::WebEngineCore', - 'core': 'Qt::Core', - 'coretest': 'Qt::3DCoreTest', - 'crypto-lib': 'Qt::AppManCrypto', - 'dbus': 'Qt::DBus', - 'devicediscovery': 'Qt::DeviceDiscoverySupport', - 'devicediscovery_support': 'Qt::DeviceDiscoverySupport', - 'edid': 'Qt::EdidSupport', - 'eglconvenience': 'Qt::EglSupport', - 'eglfsdeviceintegration': 'Qt::EglFSDeviceIntegration', - 'eglfs_kms_support': 'Qt::EglFsKmsSupport', - 'egl_support': 'Qt::EglSupport', - 'enginio_client': 'Enginio', - 'eventdispatchers': 'Qt::EventDispatcherSupport', - 'extras': 'Qt::3DExtras', - 'fb_support': 'Qt::FbSupport', - 'fbconvenience': 'Qt::FbSupport', - 'fontdatabase_support': 'Qt::FontDatabaseSupport', - 'gamepad': 'Qt::Gamepad', - 'glx_support': 'Qt::GlxSupport', - 'graphics_support': 'Qt::GraphicsSupport', - 'gsttools': 'Qt::MultimediaGstTools', - 'gui': 'Qt::Gui', - 'help': 'Qt::Help', - 'hunspellinputmethod': 'Qt::HunspellInputMethod', - 'input': 'Qt::InputSupport', - 'input_support': 'Qt::InputSupport', - 'installer-lib': 'Qt::AppManInstaller', - 'kmsconvenience': 'Qt::KmsSupport', - 'kms_support': 'Qt::KmsSupport', - 'launcher-lib': 'Qt::AppManLauncher', - 'lib': 'Qt::Designer', - 'linuxaccessibility_support': 'Qt::LinuxAccessibilitySupport', - 'location': 'Qt::Location', - 'logic': 'Qt::3DLogic', - 'macextras': 'Qt::MacExtras', - 'main-lib': 'Qt::AppManMain', - 'manager-lib': 'Qt::AppManManager', - 'monitor-lib': 'Qt::AppManMonitor', - 'multimedia': 'Qt::Multimedia', - 'multimediawidgets': 'Qt::MultimediaWidgets', - 'network': 'Qt::Network', - 'nfc': 'Qt::Nfc', - 'oauth': 'Qt::NetworkAuth', - 'openglextensions': 'Qt::OpenGLExtensions', - 'opengl': 'Qt::OpenGL', - 'package-lib': 'Qt::AppManPackage', - 'packetprotocol': 'Qt::PacketProtocol', - 'particles': 'Qt::QuickParticles', - 'platformcompositor': 'Qt::PlatformCompositorSupport', - 'platformcompositor_support': 'Qt::PlatformCompositorSupport', - 'plugin-interfaces': 'Qt::AppManPluginInterfaces', - 'positioning': 'Qt::Positioning', - 'positioningquick': 'Qt::PositioningQuick', - 'printsupport': 'Qt::PrintSupport', - 'purchasing': 'Qt::Purchasing', - 'qmldebug': 'Qt::QmlDebug', - 'qmldevtools': 'Qt::QmlDevTools', - 'qml': 'Qt::Qml', - 'qmltest': 'Qt::QuickTest', - 'qtmultimediaquicktools': 'Qt::MultimediaQuick', - 'qtzlib': 'Qt::Zlib', - 'quick3danimation': 'Qt::3DQuickAnimation', - 'quick3dextras': 'Qt::3DQuickExtras', - 'quick3dinput': 'Qt::3DQuickInput', - 'quick3d': 'Qt::3DQuick', - 'quick3drender': 'Qt::3DQuickRender', - 'quick3dscene2d': 'Qt::3DQuickScene2D', - 'quickcontrols2': 'Qt::QuickControls2', - 'quick': 'Qt::Quick', - 'quickshapes': 'Qt::QuickShapes', - 'quicktemplates2': 'Qt::QuickTemplates2', - 'quickwidgets': 'Qt::QuickWidgets', - 'render': 'Qt::3DRender', - 'script': 'Qt::Script', - 'scripttools': 'Qt::ScriptTools', - 'sensors': 'Qt::Sensors', - 'serialport': 'Qt::SerialPort', - 'services': 'Qt::ServiceSupport', - 'sql': 'Qt::Sql', - 'svg': 'Qt::Svg', - 'testlib': 'Qt::Test', - 'theme_support': 'Qt::ThemeSupport', - 'service_support': 'Qt::ServiceSupport', - 'eventdispatcher_support': 'Qt::EventDispatcherSupport', - 'edid_support': 'Qt::EdidSupport', - 'tts': 'Qt::TextToSpeech', - 'uiplugin': 'Qt::UiPlugin', - 'uitools': 'Qt::UiTools', - 'virtualkeyboard': 'Qt::VirtualKeyboard', - 'vulkan_support': 'Qt::VulkanSupport', - 'webchannel': 'Qt::WebChannel', - 'webengine': 'Qt::WebEngine', - 'webenginewidgets': 'Qt::WebEngineWidgets', - 'websockets': 'Qt::WebSockets', - 'webview': 'Qt::WebView', - 'widgets': 'Qt::Widgets', - 'window-lib': 'Qt::AppManWindow', - 'windowsuiautomation_support': 'Qt::WindowsUIAutomationSupport', - 'winextras': 'Qt::WinExtras', - 'x11extras': 'Qt::X11Extras', - 'xcb_qpa_lib': 'Qt::XcbQpa', - 'xkbcommon_support': 'Qt::XkbCommonSupport', - 'xmlpatterns': 'Qt::XmlPatterns', - 'xml': 'Qt::Xml', - } - return library_map.get(lib, lib) - - def map_qt_library(lib: str) -> str: private = False if lib.endswith('-private'): private = True lib = lib[:-8] - mapped = map_qt_base_library(lib) + mapped = find_qt_library_mapping(lib) + qt_name = lib + if mapped: + qt_name = mapped.targetName if private: - mapped += 'Private' - return mapped + qt_name += 'Private' + return qt_name platform_mapping = { @@ -211,63 +319,14 @@ def substitute_platform(platform: str) -> str: return platform_mapping.get(platform, platform) -qmake_library_to_cmake_target_mapping = { - 'atspi': 'PkgConfig::ATSPI2', - 'cups': 'Cups::Cups', - 'drm': 'Libdrm::Libdrm', - 'doubleconversion': 'double-conversion', - 'fontconfig': 'Fontconfig::Fontconfig', - 'freetype': 'Freetype::Freetype', - 'gbm': 'gbm::gbm', - 'glib': 'GLIB2::GLIB2', - 'glx_support': 'Qt::GlxSupport', - 'glx_supportPrivate': 'Qt::GlxSupportPrivate', - 'harfbuzz': 'harfbuzz::harfbuzz', - 'icu': 'ICU::i18n ICU::uc ICU::data', - 'libatomic': 'Atomic', - 'libdl': '${CMAKE_DL_LIBS}', - 'libinput': 'Libinput::Libinput', - 'libpng' : 'PNG::PNG', - 'libproxy': 'PkgConfig::Libproxy', - 'librt': 'WrapRt', - 'libudev': 'PkgConfig::Libudev', - 'mtdev': 'PkgConfig::Mtdev', - 'odbc': 'ODBC::ODBC', - 'openssl': 'OpenSSL::SSL', - 'pcre2': 'PCRE2', - 'psql': 'PostgreSQL::PostgreSQL', - 'sqlite': 'SQLite::SQLite3', - 'SQLite3': 'SQLite::SQLite3', - 'tslib': 'PkgConfig::Tslib', - 'x11sm': '${X11_SM_LIB} ${X11_ICE_LIB}', - 'xcb_glx': 'XCB::GLX', - 'xcb_icccm': 'XCB::ICCCM', - 'xcb_image': 'XCB::IMAGE', - 'xcb_keysyms': 'XCB::KEYSYMS', - 'xcb_randr': 'XCB::RANDR', - 'xcb_renderutil': 'XCB::RENDERUTIL', - 'xcb_render': 'XCB::RENDER', - 'xcb_shape': 'XCB::SHAPE', - 'xcb_shm': 'XCB::SHM', - 'xcb_sync': 'XCB::SYNC', - 'xcb': 'XCB::XCB', - 'xcb_xfixes': 'XCB::XFIXES', - 'xcb_xinerama': 'XCB::XINERAMA', - 'xcb_xinput': 'XCB::XINPUT', - 'xcb_xkb': 'XCB::XKB', - 'xcb_xlib': 'X11::XCB', - 'xkbcommon_evdev': 'XKB::XKB', - 'xkbcommon_x11': 'XKB::XKB', - 'xkbcommon': 'XKB::XKB', - 'xrender': 'XCB::RENDER', - 'zlib': 'ZLIB::ZLIB', - 'zstd': 'ZSTD::ZSTD', -} - - def substitute_libs(lib: str) -> str: libpostfix = '' if lib.endswith('/nolink'): lib = lib[:-7] libpostfix = '_nolink' - return qmake_library_to_cmake_target_mapping.get(lib, lib) + libpostfix + mapping = find_qt_library_mapping(lib) + if not mapping: + mapping = find_library_mapping(lib) + if not mapping: + return lib + libpostfix + return mapping.targetName + libpostfix diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 7801c4d103e..493517dbc76 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -42,7 +42,7 @@ import typing from sympy.logic import (simplify_logic, And, Or, Not,) import pyparsing as pp -from helper import map_qt_library, map_qt_base_library, featureName, \ +from helper import map_qt_library, featureName, \ substitute_platform, substitute_libs From f2bb48e635779b730750b83a28b82b645959e764 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 3 May 2019 15:15:02 +0200 Subject: [PATCH 0450/1322] cmake: Install required CMake templates Change-Id: I4a56440bee1aa7143971dd8f0b8af6dc042703f3 Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index b854d308459..b4c4bd02985 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -90,6 +90,9 @@ install(FILES cmake/QtPostProcess.cmake cmake/QtSetup.cmake cmake/QtModuleConfig.cmake.in + cmake/QtModuleDependencies.cmake.in + cmake/QtModuleToolsDependencies.cmake.in + cmake/QtModuleToolsConfig.cmake.in DESTINATION "${config_install_dir}" ) # TODO: Check whether this is the right place to install these From aef11e420db95a5dd42faa314f9afe69e890ee8d Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Fri, 3 May 2019 12:30:09 +0200 Subject: [PATCH 0451/1322] cmake: Generate config files with Qt:: prefix Generate CMake config files which export Qt targets with a Qt:: prefix (i.e. without a major version suffix in the namespace) Change-Id: Ia07f98be6d0e24c196e3880b7469f1f0c6232c06 Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 4 ++++ cmake/QtBuild.cmake | 26 +++++++++++++++++++++++++- cmake/QtConfig.cmake.in | 2 ++ cmake/QtModuleConfig.cmake.in | 2 ++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index b4c4bd02985..af320a05b34 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -80,6 +80,10 @@ install(TARGETS Platform GlobalConfig GlobalConfigPrivate EXPORT "${INSTALL_CMAK install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION "${config_install_dir}") export(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") +qt_internal_export_modern_cmake_config_targets_file(TARGETS Platform GlobalConfig GlobalConfigPrivate + EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE} + CONFIG_INSTALL_DIR ${config_install_dir}) + ## Install some QtBase specific CMake files: install(FILES cmake/QtBuild.cmake diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 059b0c82fc9..1a15c146c75 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -130,6 +130,23 @@ endif() # Functions and macros: +function(qt_internal_export_modern_cmake_config_targets_file) + cmake_parse_arguments(__arg "" "EXPORT_NAME_PREFIX;CONFIG_INSTALL_DIR" "TARGETS" ${ARGN}) + + foreach(target ${__arg_TARGETS}) + if (TARGET "${target}Versionless") + continue() + endif() + + add_library("${target}Versionless" INTERFACE) + target_link_libraries("${target}Versionless" INTERFACE "${target}") + set_target_properties("${target}Versionless" PROPERTIES EXPORT_NAME "${target}") + install(TARGETS "${target}Versionless" EXPORT "${__arg_EXPORT_NAME_PREFIX}VersionlessTargets") + endforeach() + + install(EXPORT "${__arg_EXPORT_NAME_PREFIX}VersionlessTargets" NAMESPACE Qt:: DESTINATION "${__arg_CONFIG_INSTALL_DIR}") +endfunction() + # Print all variables defined in the current scope. macro(qt_debug_print_variables) cmake_parse_arguments(__arg "DEDUP" "" "MATCH;IGNORE" ${ARGN}) @@ -678,10 +695,13 @@ function(add_qt_module target) PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/private ) - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${config_install_dir}) + qt_internal_export_modern_cmake_config_targets_file(TARGETS "${target}" "${target_private}" + EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} + CONFIG_INSTALL_DIR "${config_install_dir}") + set(extra_cmake_files) set(extra_cmake_includes) if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Macros.cmake") @@ -816,6 +836,10 @@ endif() install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" DESTINATION "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") + + qt_internal_export_modern_cmake_config_targets_file(TARGETS ${QT_KNOWN_MODULE_${module_name}_TOOLS} + EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} + CONFIG_INSTALL_DIR ${config_install_dir}) endfunction() function(qt_internal_check_directory_or_type name dir type default result_var) diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index f30cd82cf16..73871747e08 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -9,6 +9,8 @@ get_filename_component(_qt_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@VersionlessTargets.cmake") + # if (NOT @INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS) # set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "The Qt package requires at least one component") # set(@INSTALL_CMAKE_NAMESPACE@_FOUND False) diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 9d2135d8426..7baea8cf9cf 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -12,6 +12,8 @@ endif() include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake") + foreach(extra_cmake_include @extra_cmake_includes@) include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}") endforeach() From a907d7df3488764b74afd219e1ddd368062529d6 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 3 May 2019 15:21:30 +0200 Subject: [PATCH 0452/1322] Handle generating find_dependency() calls for nolink targets Previously we just recorded that Gui has to link against Vulkan::Vulkan_nolink, but if an application consumed Gui, it wouldn't find that target. We need to record that if a module links against Vulkan_nolink, and then generate a find_dependency(Vulkan) call in the module config file. We also have to assign the _nolink interface library to an export (the Qt5 one), so that it gets installed as a target. Change-Id: Icbc29ff4161ab18fdd162196ae128e29c1ee8c80 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 20 ++++++++++++++++---- cmake/QtPostProcess.cmake | 8 ++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 1a15c146c75..7c776fcda79 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -193,7 +193,7 @@ macro(assert) endmacro() -function(qt_create_nolink_target target) +function(qt_create_nolink_target target export_target) if(NOT TARGET "${target}") message(FATAL_ERROR "${target} does not exist when trying to build a nolink target.") endif() @@ -205,9 +205,18 @@ function(qt_create_nolink_target target) message(FATAL_ERROR "${target} must not be an object library.") endif() - set(nolink_target "${target}_nolink") + # Strip off the namespace prefix, so from Vulkan::Vulkan to Vulkan, and then append _nolink. + string(REGEX REPLACE "^.*::" "" non_prefixed_target ${target}) + set(nolink_target "${non_prefixed_target}_nolink") + + # Create the nolink interface target, assign the properties from the original target, + # associate the nolink target with the same export which contains + # the target that uses the _nolink target. + # Also create a namespaced alias of the form {$target}::${target}_nolink which is used by + # our modules. if(NOT TARGET "${nolink_target}") - add_library("${nolink_target}" INTERFACE IMPORTED) + add_library("${nolink_target}" INTERFACE) + set(prefixed_nolink_target "${target}_nolink") set_target_properties("${nolink_target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES $ @@ -219,6 +228,8 @@ function(qt_create_nolink_target target) $ INTERFACE_COMPILE_FEATURES $) + install(TARGETS ${nolink_target} EXPORT ${export_target}) + add_library(${prefixed_nolink_target} ALIAS ${nolink_target}) endif() endfunction() @@ -435,7 +446,8 @@ function(extend_target target) foreach(lib ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES}) string(REGEX REPLACE "_nolink$" "" base_lib "${lib}") if(NOT base_lib STREQUAL lib) - qt_create_nolink_target("${base_lib}") + set(export_target "${INSTALL_CMAKE_NAMESPACE}${target}Targets") + qt_create_nolink_target("${base_lib}" ${export_target}) endif() endforeach() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 57d194c0376..fe6d70985bd 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -58,6 +58,14 @@ function(qt_internal_create_depends_files) foreach(dep ${${depends_var}}) # Gather third party packages that should be found when using the Qt module. + # Also handle nolink target dependencies. + string(REGEX REPLACE "_nolink$" "" base_dep "${dep}") + if(NOT base_dep STREQUAL dep) + # Resets target name like Vulkan_nolink to Vulkan, because we need to call + # find_package(Vulkan). + set(dep ${base_dep}) + endif() + if(TARGET ${dep}) list(FIND third_party_deps_seen ${dep} dep_seen) From 6b2de61bf973dc8c0f245ba4dfdb791faa15b428 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 3 May 2019 16:03:45 +0200 Subject: [PATCH 0453/1322] Make zlib a required package for QtCore Change-Id: Ifbb969fafe05e355d6874d8bebe2e8f1e80510ff Reviewed-by: Simon Hausmann --- configure.cmake | 1 + util/cmake/helper.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.cmake b/configure.cmake index 3c86c89f95f..92e4198adde 100644 --- a/configure.cmake +++ b/configure.cmake @@ -7,6 +7,7 @@ #### Libraries qt_find_package(ZLIB PROVIDED_TARGETS ZLIB::ZLIB) +set_package_properties(ZLIB PROPERTIES TYPE REQUIRED) qt_find_package(ZSTD PROVIDED_TARGETS ZSTD::ZSTD) qt_find_package(DBus1 PROVIDED_TARGETS dbus-1) qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 99a518bf0c0..b58c73dae85 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -241,7 +241,7 @@ _library_map = [ LibraryMapping('xkbcommon', 'XKB', 'XKB::XKB', extra = ['0.4.1']), LibraryMapping('xlib', 'X11', 'X11::XCB'), # FIXME: Is this correct? LibraryMapping('xrender', 'XRender', 'PkgConfig::xrender'), - LibraryMapping('zlib', 'ZLIB', 'ZLIB::ZLIB'), + LibraryMapping('zlib', 'ZLIB', 'ZLIB::ZLIB', extra=['REQUIRED']), LibraryMapping('zstd', 'ZSTD', 'ZSTD::ZSTD'), ] From 1a92808a7890129dca6df3ca3ec8374841a9fe58 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 3 May 2019 15:46:02 +0200 Subject: [PATCH 0454/1322] Add support for MinGW Tested with MinGW 7.3.0 64 from Qt 5.12 installation. The CMake 3rd party libraries I used from hunter project (with some package, and target names changes) Change-Id: Ie89555a6cd8bdb7182f9b2dd2c3c39784c523ead Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 7c776fcda79..dc52c7d72b3 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -65,6 +65,9 @@ if(WIN32) set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-msvc) elseif(CLANG) set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-clang) + elseif(MINGW) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-g++) + list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS _WIN32_WINNT=0x0601) endif() elseif(LINUX) if(GCC) @@ -278,7 +281,7 @@ function(qt_internal_add_link_flags_no_undefined target) if (GCC OR CLANG) if(APPLE) set(no_undefined_flag "-Wl,-undefined,error") - elseif(LINUX) + elseif(LINUX OR MINGW) set(no_undefined_flag "-Wl,--no-undefined") else() message(FATAL_ERROR "Platform linker doesn't support erroring upon encountering undefined symbols. Target:\"${target}\".") @@ -1449,7 +1452,10 @@ endfunction() macro(qt_find_package) # Get the target names we expect to be provided by the package. - cmake_parse_arguments(arg "" "" "PROVIDED_TARGETS;COMPONENTS" ${ARGN}) + set(options CONFIG NO_MODULE MODULE REQUIRED) + set(oneValueArgs) + set(multiValueArgs PROVIDED_TARGETS COMPONENTS) + cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # Get the version if specified. set(package_version "") @@ -1464,8 +1470,24 @@ macro(qt_find_package) list(APPEND arg_UNPARSED_ARGUMENTS "COMPONENTS;${arg_COMPONENTS}") endif() - # Call original function without our custom arguments. - find_package(${arg_UNPARSED_ARGUMENTS}) + if(NOT (arg_CONFIG OR arg_NO_MODULE OR arg_MODULE)) + # Try to find a config package first in quiet mode + set(config_package_arg ${arg_UNPARSED_ARGUMENTS}) + list(APPEND config_package_arg "CONFIG;QUIET") + find_package(${config_package_arg}) + endif() + + # Ensure the options are back in the original unparsed arguments + foreach(opt IN LISTS options) + if(arg_${opt}) + list(APPEND arg_UNPARSED_ARGUMENTS ${opt}) + endif() + endforeach() + + if (NOT ${ARGV0}_FOUND) + # Call original function without our custom arguments. + find_package(${arg_UNPARSED_ARGUMENTS}) + endif() if(${ARGV0}_FOUND AND arg_PROVIDED_TARGETS) # If package was found, associate each target with its package name. This will be used From 380f1eb92fccc865cdd00d74f2e160a358829ee4 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 4 May 2019 15:15:44 +0200 Subject: [PATCH 0455/1322] Fix special cases in widgets Change-Id: I026a321a916885ccd93361da91bc3ce6fb6f6ad1 Reviewed-by: Tobias Hunger --- src/widgets/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index e643829c613..d73dc8789dc 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -60,7 +60,7 @@ add_qt_module(Widgets LIBRARIES Qt::CorePrivate Qt::GuiPrivate - PUBLIC_LIBRARIES # special case + PUBLIC_LIBRARIES Qt::Core Qt::Gui # CONFIG = "$$MODULE_CONFIG" "qt_tracepoints" From f26a156dd3e7784b0345789c5c85ad397ffb4ad2 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 4 May 2019 15:13:46 +0200 Subject: [PATCH 0456/1322] Fix special cases in network Change-Id: I66cc33afe3bfdf4e86dfeb0b341770355f59c0da Reviewed-by: Tobias Hunger --- src/network/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 380ed8e9465..3ce9a3aa0a2 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -152,11 +152,13 @@ extend_target(Network CONDITION UNIX ${CMAKE_DL_LIBS} ) -# special case: Do not add this to android! +# special case begin +# Do not add this to android! extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY AND NOT ANDROID SOURCES kernel/qdnslookup_unix.cpp ) +# special case end extend_target(Network CONDITION QT_FEATURE_linux_netlink AND UNIX SOURCES From 059f4ade7fd08b782ecb888f8ee9f0e553c07e9a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 12:26:31 +0200 Subject: [PATCH 0457/1322] CMake: pro2cmake.py: Fix library mapping Fix library substitution again which broke when I merged all the library related pieces of information. Keep Qt and 3rdparty libraries separate so that dbus does not get mapped into Qt::DBus (or the other way around). Make names in helper.py more consistent while at it. Change-Id: I5e5bf02bdabf8bafe991c5701deca76bde4df2c3 Reviewed-by: Alexandru Croitor --- util/cmake/configurejson2cmake.py | 10 ++++----- util/cmake/helper.py | 30 +++++++++++++++++---------- util/cmake/pro2cmake.py | 34 +++++++++++++++++++------------ 3 files changed, 45 insertions(+), 29 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index b9ec0f94491..8b9251f8a79 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -33,7 +33,7 @@ import re import sys from typing import Set, Union, List, Dict -from helper import map_qt_library, featureName, substitute_platform, find_library_mapping +from helper import map_qt_library, featureName, map_platform, find_3rd_party_library_mapping knownTests = set() # type: Set[str] @@ -165,7 +165,7 @@ def processFiles(ctx, data): return ctx def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): - newlib = find_library_mapping(lib) + newlib = find_3rd_party_library_mapping(lib) if not newlib: print(' XXXX Unknown library "{}".'.format(lib)) return @@ -174,7 +174,7 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): print(' **** Skipping library "{}" -- was masked.'.format(lib)) return - print(' mapped library {} to {}.'.format(lib, newlib)) + print(' mapped library {} to {}.'.format(lib, newlib.targetName)) # Avoid duplicate find_package calls. if newlib.targetName in cmake_find_packages_set: @@ -251,7 +251,7 @@ def map_condition(condition): substitution = None appendFoundSuffix = True if match.group(1) == 'libs': - libmapping = find_library_mapping(match.group(2)) + libmapping = find_3rd_party_library_mapping(match.group(2)) if libmapping and libmapping.packageName: substitution = libmapping.packageName @@ -282,7 +282,7 @@ def map_condition(condition): substitution = 'INPUT_{}'.format(featureName(match.group(2))) elif match.group(1) == 'config': - substitution = substitute_platform(match.group(2)) + substitution = map_platform(match.group(2)) elif match.group(1) == 'arch': if match.group(2) == 'i386': diff --git a/util/cmake/helper.py b/util/cmake/helper.py index b58c73dae85..0a782307034 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -67,7 +67,7 @@ _qt_library_map = [ LibraryMapping('core', 'Qt5', 'Qt::Core', extra = ['COMPONENTS', 'Core']), LibraryMapping('coretest', 'Qt5', 'Qt::3DCoreTest', extra = ['COMPONENTS', '3DCoreTest']), LibraryMapping('crypto-lib', 'Qt5', 'Qt::AppManCrypto', extra = ['COMPONENTS', 'AppManCrypto']), - LibraryMapping('dbus', 'Qt5', 'Qt::Dbus', extra = ['COMPONENTS', 'DBus']), + LibraryMapping('dbus', 'Qt5', 'Qt::DBus', extra = ['COMPONENTS', 'DBus']), LibraryMapping('devicediscovery', 'Qt5', 'Qt::DeviceDiscoverySupport', extra = ['COMPONENTS', 'DeviceDiscoverySupport']), LibraryMapping('devicediscovery_support', 'Qt5', 'Qt::DeviceDiscoverySupport', extra = ['COMPONENTS', 'DeviceDiscoverySupport']), LibraryMapping('edid', 'Qt5', 'Qt::EdidSupport', extra = ['COMPONENTS', 'EdidSupport']), @@ -189,10 +189,11 @@ _library_map = [ LibraryMapping('host_dbus', None, None), LibraryMapping('icu', 'ICU', 'ICU::i18n ICU::uc ICU::data', extra=['COMPONENTS', 'i18n', 'uc', 'data']), LibraryMapping('journald', 'Libsystemd', 'PkgConfig::Libsystemd'), + LibraryMapping('jpeg', 'JPEG', 'JPEG::JPEG'), # see also libjpeg LibraryMapping('libatomic', 'Atomic', 'Atomic'), - LibraryMapping('libdl', None, None), + LibraryMapping('libdl', None, '${CMAKE_DL_LIBS}'), LibraryMapping('libinput', 'Libinput', 'Libinput::Libinput'), - LibraryMapping('libjpeg', 'JPEG', 'JPEG::JPEG'), + LibraryMapping('libjpeg', 'JPEG', 'JPEG::JPEG'), # see also jpeg LibraryMapping('libpng', 'PNG', 'PNG::PNG'), LibraryMapping('libproxy', 'Libproxy', 'PkgConfig::Libproxy'), LibraryMapping('librt', 'WrapRt','WrapRt'), @@ -246,7 +247,7 @@ _library_map = [ ] -def find_library_mapping(soName: str) -> typing.Optional[LibraryMapping]: +def find_3rd_party_library_mapping(soName: str) -> typing.Optional[LibraryMapping]: for i in _library_map: if i.soName == soName: return i @@ -272,6 +273,7 @@ def map_qt_library(lib: str) -> str: mapped = find_qt_library_mapping(lib) qt_name = lib if mapped: + assert mapped.targetName # Qt libs must have a target name set qt_name = mapped.targetName if private: qt_name += 'Private' @@ -314,19 +316,25 @@ platform_mapping = { } -def substitute_platform(platform: str) -> str: +def map_platform(platform: str) -> str: """ Return the qmake platform as cmake platform or the unchanged string. """ return platform_mapping.get(platform, platform) -def substitute_libs(lib: str) -> str: +def is_known_3rd_party_library(lib: str) -> bool: + if lib.endswith('/nolink') or lib.endswith('_nolink'): + lib = lib[:-7] + mapping = find_3rd_party_library_mapping(lib) + + return mapping is not None and mapping.targetName is not None + + +def map_3rd_party_library(lib: str) -> str: libpostfix = '' if lib.endswith('/nolink'): lib = lib[:-7] libpostfix = '_nolink' - mapping = find_qt_library_mapping(lib) - if not mapping: - mapping = find_library_mapping(lib) - if not mapping: - return lib + libpostfix + mapping = find_3rd_party_library_mapping(lib) + if not mapping or not mapping.targetName: + return lib return mapping.targetName + libpostfix diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 493517dbc76..23ba9d7fc8b 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -42,8 +42,8 @@ import typing from sympy.logic import (simplify_logic, And, Or, Not,) import pyparsing as pp -from helper import map_qt_library, featureName, \ - substitute_platform, substitute_libs +from helper import map_qt_library, map_3rd_party_library, is_known_3rd_party_library, \ + featureName, map_platform def _parse_commandline(): @@ -810,15 +810,14 @@ def map_condition(condition: str) -> str: part = 'TARGET {}'.format(map_qt_library(feature.group(2))) else: feature = featureName(feature.group(2)) - if feature.startswith('system_') and substitute_libs(feature[7:]) != feature[7:]: - # Qt6 always uses system libraries! + if feature.startswith('system_') and is_known_3rd_party_library(feature[7:]): part = 'ON' elif feature == 'dlopen': part = 'ON' else: part = 'QT_FEATURE_' + feature else: - part = substitute_platform(part) + part = map_platform(part) part = part.replace('true', 'ON') part = part.replace('false', 'OFF') @@ -939,7 +938,9 @@ def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, if d.startswith('-'): d = '# Remove: {}'.format(d[1:]) else: - d = substitute_libs(d) + d = map_3rd_party_library(d) + if not d or d in dependencies_to_print: + continue dependencies_to_print.append(d) is_framework = False @@ -954,18 +955,24 @@ def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, def write_library_section(cm_fh: typing.IO[str], scope: Scope, public: typing.List[str], private: typing.List[str], - mixed: typing.List[str], *, + qt_private: typing.List[str], + qt_mixed: typing.List[str], *, indent: int = 0, known_libraries=set()): - public_dependencies = [] # typing.List[str] - private_dependencies = [] # typing.List[str] + public_dependencies = [] # type: typing.List[str] + private_dependencies = [] # type: typing.List[str] for key in public: - public_dependencies += [map_qt_library(q) for q in scope.expand(key) - if map_qt_library(q) not in known_libraries] + public_dependencies += [q for q in scope.expand(key) + if q not in known_libraries] for key in private: + private_dependencies += [q for q in scope.expand(key) + if q not in known_libraries] + + for key in qt_private: private_dependencies += [map_qt_library(q) for q in scope.expand(key) if map_qt_library(q) not in known_libraries] - for key in mixed: + + for key in qt_mixed: for lib in scope.expand(key): mapped_lib = map_qt_library(lib) if mapped_lib in known_libraries: @@ -1028,7 +1035,8 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, write_library_section(cm_fh, scope, ['QMAKE_USE', 'LIBS'], - ['QT_FOR_PRIVATE', 'QMAKE_USE_PRIVATE', 'QMAKE_USE_FOR_PRIVATE', 'LIBS_PRIVATE'], + ['QMAKE_USE_PRIVATE', 'QMAKE_USE_FOR_PRIVATE', 'LIBS_PRIVATE'], + ['QT_FOR_PRIVATE',], ['QT',], indent=indent, known_libraries=known_libraries) From 42648ff99310db6ce8e94c5dea9db16a6454232f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:39:36 +0200 Subject: [PATCH 0458/1322] CMake: Regenerate src/dbus Change-Id: Iff9890ead883bac5f75425a2d0367e639d648399 Reviewed-by: Alexandru Croitor --- src/dbus/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index d17667a26a1..4768460e05e 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -44,14 +44,15 @@ add_qt_module(DBus LIBRARIES Qt::CorePrivate PUBLIC_LIBRARIES - Qt::Core # special case - # MODULE_CONFIG = "dbusadaptors" "dbusinterfaces" - # _LOADED = "qt_module" + Qt::Core ) set_source_files_properties(qdbusmarshaller.cpp PROPERTIES HEADER_FILE_ONLY ON) # special case: This file is included by qdbusargument.cpp +#### Keys ignored in scope 1:.:.:dbus.pro:: +# MODULE_CONFIG = "dbusadaptors" "dbusinterfaces" +# _LOADED = "qt_module" ## Scopes: ##################################################################### @@ -60,15 +61,16 @@ extend_target(DBus CONDITION QT_FEATURE_dbus_linked DEFINES QT_LINKED_LIBDBUS LIBRARIES - dbus + dbus-1 ) extend_target(DBus CONDITION WIN32 LIBRARIES - ws2_32 advapi32 netapi32 user32 + ws2_32 +) +add_qt_docs( + doc/qtdbus.qdocconf ) - -add_qt_docs(./doc/qtdbus.qdocconf) From 1c310adb173668b09c4d45d1f84cce598764603a Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:40:37 +0200 Subject: [PATCH 0459/1322] CMake: Regenerate src/opengl Change-Id: I6a140b18f12cb048e2b113fb1cef38e224cc8417 Reviewed-by: Alexandru Croitor --- src/opengl/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index acc4cdda9a3..705bf8e3d05 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -31,12 +31,13 @@ add_qt_module(OpenGL Qt::GuiPrivate Qt::WidgetsPrivate WrapOpenGL # special case - PUBLIC_LIBRARIES # special case + PUBLIC_LIBRARIES Qt::Core Qt::Gui + Qt::Widgets ) -#### Keys ignored in scope 1:.:opengl.pro:: +#### Keys ignored in scope 1:.:.:opengl.pro:: # _LOADED = "qt_module" ## Scopes: @@ -47,18 +48,19 @@ extend_target(OpenGL CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") "/BASE:0x63000000" ) -#### Keys ignored in scope 3:.:opengl.pro:solaris-cc_x_: +#### Keys ignored in scope 3:.:.:opengl.pro:solaris-cc_x_: # QMAKE_CXXFLAGS_RELEASE = "--O2" -#### Keys ignored in scope 4:.:opengl.pro:QT_FEATURE_opengl: +#### Keys ignored in scope 4:.:.:opengl.pro:QT_FEATURE_opengl: # CONFIG = "opengl" -#### Keys ignored in scope 5:.:opengl.pro:QT_FEATURE_opengles2: +#### Keys ignored in scope 5:.:.:opengl.pro:QT_FEATURE_opengles2: # CONFIG = "opengles2" extend_target(OpenGL CONDITION QT_FEATURE_graphicseffect SOURCES qgraphicsshadereffect.cpp qgraphicsshadereffect_p.h ) - -add_qt_docs(./doc/qtopengl.qdocconf) +add_qt_docs( + doc/qtopengl.qdocconf +) From da02d17b5eb30c00dafe6bd0916a931814d16b58 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:43:46 +0200 Subject: [PATCH 0460/1322] CMake: Regenerate src/platfomheaders Change-Id: I82d94c0f53bf3291cd26188ab6afd78493f2b92c Reviewed-by: Alexandru Croitor --- src/platformheaders/CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/platformheaders/CMakeLists.txt b/src/platformheaders/CMakeLists.txt index 431aade79b8..79ba95a8061 100644 --- a/src/platformheaders/CMakeLists.txt +++ b/src/platformheaders/CMakeLists.txt @@ -1,12 +1,15 @@ +# Generated from platformheaders.pro. + +# special case begin + # FIXME Add the rest of the stuff -add_qt_module(PlatformHeaders SOURCES fake.cpp) -set_source_files_properties(fake.cpp PROPERTIES - SKIP_AUTOMOC ON - SKIP_AUTOUIC ON - SKIP_AUTORCC ON -) +add_qt_module(PlatformHeaders) extend_target(PlatformHeaders CONDITION APPLE SOURCES cocoafunctions/qcocoawindowfunctions.h) -add_qt_docs(./doc/qtplatformheaders.qdocconf) +add_qt_docs( + doc/qtplatformheaders.qdocconf +) + +# special case end From e438747eb17a3dfa1f5717c0f7291f54342998ce Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:44:33 +0200 Subject: [PATCH 0461/1322] CMake: Regenerate src/concurrent Change-Id: I888f0a3821c091180928949bd52ea70a1be69d3f Reviewed-by: Alexandru Croitor --- src/concurrent/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index 25ca44ddbfd..36fe0666d65 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -26,13 +26,15 @@ add_qt_module(Concurrent QT_NO_FOREACH LIBRARIES Qt::CorePrivate - PUBLIC_LIBRARIES # special case + PUBLIC_LIBRARIES Qt::Core - # CONFIG = "exceptions" - # PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" - # _LOADED = "qt_module" ) +#### Keys ignored in scope 1:.:.:concurrent.pro:: +# CONFIG = "exceptions" +# PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### @@ -40,5 +42,6 @@ extend_target(Concurrent CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i3 LINK_OPTIONS "/BASE:0x66000000" ) - -add_qt_docs(./doc/qtconcurrent.qdocconf) +add_qt_docs( + doc/qtconcurrent.qdocconf +) From 59e32c4e23225f4b37b78a1bb144b81306c9c630 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:45:37 +0200 Subject: [PATCH 0462/1322] CMake: Regenerate src/platformsupport Change-Id: I883573633dbd82ebcca9cc0dc435cd867cec24b8 Reviewed-by: Alexandru Croitor --- src/platformsupport/CMakeLists.txt | 54 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/platformsupport/CMakeLists.txt b/src/platformsupport/CMakeLists.txt index ece4eed2aab..ee85e55c8d8 100644 --- a/src/platformsupport/CMakeLists.txt +++ b/src/platformsupport/CMakeLists.txt @@ -1,54 +1,56 @@ # Generated from platformsupport.pro. -add_subdirectory(themes) add_subdirectory(edid) add_subdirectory(eventdispatchers) add_subdirectory(devicediscovery) add_subdirectory(fbconvenience) +add_subdirectory(themes) if(QT_FEATURE_freetype OR APPLE OR WIN32) add_subdirectory(fontdatabases) endif() -if((UNIX AND (NOT uikit)) OR QT_FEATURE_xcb) - add_subdirectory(services) -endif() - if(QT_FEATURE_evdev OR QT_FEATURE_tslib OR QT_FEATURE_libinput OR QT_FEATURE_integrityhid) add_subdirectory(input) endif() -if(QT_FEATURE_accessibility) - add_subdirectory(accessibility) - if(QT_FEATURE_accessibility_atspi_bridge) - add_subdirectory(linuxaccessibility) - endif() - if(WIN32 AND NOT WINRT) - add_subdirectory(windowsuiautomation) - endif() -endif() - -if(QT_FEATURE_vulkan) - add_subdirectory(vkconvenience) -endif() - -if(QT_FEATURE_kms) - add_subdirectory(kmsconvenience) -endif() - -if(QT_FEATURE_egl) - add_subdirectory(eglconvenience) +if(UNIX AND NOT APPLE_UIKIT OR QT_FEATURE_xcb) + add_subdirectory(services) endif() if(QT_FEATURE_opengl) add_subdirectory(platformcompositor) endif() -if (QT_FEATURE_xlib AND QT_FEATURE_opengl AND (NOT QT_FEATURE_opengles2)) +if(QT_FEATURE_egl) + add_subdirectory(eglconvenience) +endif() + +if(QT_FEATURE_xlib AND QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2) add_subdirectory(glxconvenience) endif() +if(QT_FEATURE_kms) + add_subdirectory(kmsconvenience) +endif() + +if(QT_FEATURE_accessibility) + add_subdirectory(accessibility) + + if(QT_FEATURE_accessibility_atspi_bridge) + add_subdirectory(linuxaccessibility) + endif() + + if(WIN32 AND NOT WINRT) + add_subdirectory(windowsuiautomation) + endif() +endif() + if(APPLE) add_subdirectory(clipboard) add_subdirectory(graphics) endif() + +if(QT_FEATURE_vulkan) + add_subdirectory(vkconvenience) +endif() From f02a9c81ad344bcad76a45dbe31695b42e12cf5f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:46:29 +0200 Subject: [PATCH 0463/1322] CMake: Regenerate src/platformsupport/accessibility Change-Id: Ie250afa3b4dc6c5750dd3cd15c1e83edcb7e0734 Reviewed-by: Alexandru Croitor --- src/platformsupport/accessibility/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/accessibility/CMakeLists.txt b/src/platformsupport/accessibility/CMakeLists.txt index 14b24aba560..2a6588764a4 100644 --- a/src/platformsupport/accessibility/CMakeLists.txt +++ b/src/platformsupport/accessibility/CMakeLists.txt @@ -13,9 +13,12 @@ add_qt_module(AccessibilitySupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:accessibility.pro:: +#### Keys ignored in scope 1:.:.:accessibility.pro:: # CONFIG = "static" "internal_module" # MODULE = "accessibility_support" # _LOADED = "qt_module" From 65c5ffdb1d000f88448f41fc17050b1933dd5d60 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:47:01 +0200 Subject: [PATCH 0464/1322] CMake: Regenerate src/platformsupport/clipboard Change-Id: I6e61274a2f5796a6b4ddcbbdf03c345a03e4b91a Reviewed-by: Alexandru Croitor --- src/platformsupport/clipboard/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/clipboard/CMakeLists.txt b/src/platformsupport/clipboard/CMakeLists.txt index 97ffe79043b..4a93b240cdf 100644 --- a/src/platformsupport/clipboard/CMakeLists.txt +++ b/src/platformsupport/clipboard/CMakeLists.txt @@ -11,12 +11,14 @@ add_qt_module(ClipboardSupport DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES - ${FWImageIO} Qt::CorePrivate + PUBLIC_LIBRARIES + ${FWImageIO} + Qt::Core Qt::Gui ) -#### Keys ignored in scope 1:.:clipboard.pro:: +#### Keys ignored in scope 1:.:.:clipboard.pro:: # CONFIG = "static" "internal_module" # MODULE = "clipboard_support" # _LOADED = "qt_module" From c29fe1fae271e125c9bab74e98bd090c47158372 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:47:38 +0200 Subject: [PATCH 0465/1322] CMake: Regenerate src/platformsupport/devicediscovery Change-Id: Ia306a7197c10fffb520e90eead449c551f0dfbe8 Reviewed-by: Alexandru Croitor --- src/platformsupport/devicediscovery/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/devicediscovery/CMakeLists.txt b/src/platformsupport/devicediscovery/CMakeLists.txt index cfb06cd3eb0..a704fc3ba2a 100644 --- a/src/platformsupport/devicediscovery/CMakeLists.txt +++ b/src/platformsupport/devicediscovery/CMakeLists.txt @@ -12,9 +12,11 @@ add_qt_module(DeviceDiscoverySupport QT_NO_CAST_FROM_ASCII LIBRARIES Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core ) -#### Keys ignored in scope 1:.:devicediscovery.pro:: +#### Keys ignored in scope 1:.:.:devicediscovery.pro:: # CONFIG = "static" "internal_module" # MODULE = "devicediscovery_support" # QT_FOR_CONFIG = "gui-private" From 46b1676804f935396878ca09a8e6e2c053988752 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:48:00 +0200 Subject: [PATCH 0466/1322] CMake: Regenerate src/platformsupport/edid Change-Id: Id567354daa47c0be07211ebf01f92cd01be9a5c7 Reviewed-by: Alexandru Croitor --- src/platformsupport/edid/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/edid/CMakeLists.txt b/src/platformsupport/edid/CMakeLists.txt index 3c9668527e1..fd4a53239f5 100644 --- a/src/platformsupport/edid/CMakeLists.txt +++ b/src/platformsupport/edid/CMakeLists.txt @@ -12,9 +12,11 @@ add_qt_module(EdidSupport QT_NO_CAST_FROM_ASCII LIBRARIES Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core ) -#### Keys ignored in scope 1:.:edid.pro:: +#### Keys ignored in scope 1:.:.:edid.pro:: # CONFIG = "static" "internal_module" # MODULE = "edid_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" From a7fc360b22febd4bce36a204161ec8a7330b39d1 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:50:03 +0200 Subject: [PATCH 0467/1322] CMake: Regenerate platformsupport/eventdispatchers Change-Id: Ie9cbee3fcb58673c08e8378382dd45e61fc4ff01 Reviewed-by: Alexandru Croitor --- src/platformsupport/eventdispatchers/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt index 4037204f60d..9f5b4a06698 100644 --- a/src/platformsupport/eventdispatchers/CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -1,5 +1,6 @@ +# Generated from eventdispatchers.pro. + qt_find_package(GLIB2) # special case -set_package_properties(GLib PROPERTIES TYPE OPTIONAL) # special case ##################################################################### ## EventDispatcherSupport Module: @@ -12,9 +13,12 @@ add_qt_module(EventDispatcherSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:eventdispatchers.pro:: +#### Keys ignored in scope 1:.:.:eventdispatchers.pro:: # CONFIG = "static" "internal_module" # MODULE = "eventdispatcher_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" From f8d3b60fb187c328aa27e850b8378ffbd822d723 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:50:35 +0200 Subject: [PATCH 0468/1322] CMake: Regenerate platformsupport/fbconvenience Change-Id: Ic838debdca48553252cb4c32ec8a42695ba24b46 Reviewed-by: Alexandru Croitor --- src/platformsupport/fbconvenience/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/fbconvenience/CMakeLists.txt b/src/platformsupport/fbconvenience/CMakeLists.txt index bb283979db7..d4b1d469b09 100644 --- a/src/platformsupport/fbconvenience/CMakeLists.txt +++ b/src/platformsupport/fbconvenience/CMakeLists.txt @@ -17,9 +17,12 @@ add_qt_module(FbSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:fbconvenience.pro:: +#### Keys ignored in scope 1:.:.:fbconvenience.pro:: # CONFIG = "static" "internal_module" # MODULE = "fb_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" From 775e59564262b3f8c8b1f3f61a7c54e1d09d3bcd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:52:06 +0200 Subject: [PATCH 0469/1322] CMake: Regenerate platformsupport/fontdatabases This one does actually contain functionality changes, but those look OK to me. Change-Id: I5fd2caee16da86c529e1c83ca66452f780e54e26 Reviewed-by: Alexandru Croitor --- .../fontdatabases/CMakeLists.txt | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 7a0ef39b257..140882691c3 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -1,3 +1,5 @@ +# Generated from fontdatabases.pro. + qt_find_package(Freetype) # special case qt_find_package(Fontconfig) # special case @@ -12,9 +14,12 @@ add_qt_module(FontDatabaseSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:fontdatabases.pro:: +#### Keys ignored in scope 1:.:.:fontdatabases.pro:: # CONFIG = "static" "internal_module" # MODULE = "fontdatabase_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" @@ -34,16 +39,6 @@ extend_target(FontDatabaseSupport CONDITION APPLE ${FWFoundation} ) -#### Keys ignored in scope 2:.:fontdatabases.pro:APPLE: -# CONFIG = "watchos_coretext" - -extend_target(FontDatabaseSupport CONDITION APPLE AND QT_FEATURE_freetype - SOURCES - freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h - LIBRARIES - Freetype::Freetype -) - extend_target(FontDatabaseSupport CONDITION APPLE_OSX LIBRARIES ${FWAppKit} @@ -82,6 +77,8 @@ extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT windows/qwindowsnativeimage.cpp windows/qwindowsnativeimage_p.h LIBRARIES Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Gui advapi32 gdi32 ole32 @@ -93,23 +90,32 @@ extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype AND WIN32 AND NO windows/qwindowsfontdatabase_ft.cpp windows/qwindowsfontdatabase_ft_p.h ) -extend_target(FontDatabaseSupport CONDITION QT_FEATURE_directwrite AND WIN32 AND NOT WINRT +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT WINRT SOURCES windows/qwindowsfontenginedirectwrite.cpp windows/qwindowsfontenginedirectwrite_p.h + LIBRARIES + d2d1 ) -extend_target(FontDatabaseSupport CONDITION QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT WINRT +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND QT_FEATURE_directwrite2 AND WIN32 AND NOT WINRT DEFINES QT_USE_DIRECTWRITE2 + LIBRARIES + dwrite_2 ) -extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT QT_FEATURE_directwrite AND NOT WINRT +extend_target(FontDatabaseSupport CONDITION QT_FEATURE_direct2d AND QT_FEATURE_directwrite AND WIN32 AND NOT QT_FEATURE_directwrite2 AND NOT WINRT + LIBRARIES + dwrite +) + +extend_target(FontDatabaseSupport CONDITION WIN32 AND NOT WINRT AND (NOT QT_FEATURE_direct2d OR NOT QT_FEATURE_directwrite) DEFINES QT_NO_DIRECTWRITE ) extend_target(FontDatabaseSupport CONDITION WIN32 AND mingw AND NOT WINRT - LIBRARIES + PUBLIC_LIBRARIES uuid ) @@ -120,6 +126,8 @@ extend_target(FontDatabaseSupport CONDITION WINRT __WRL_NO_DEFAULT_LIB__ LIBRARIES Qt::GuiPrivate - dwrite + dwrite_1 + PUBLIC_LIBRARIES + Qt::Gui ws2_32 ) From 5d374083b789aefb9282fef58e7f4339e80d9455 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:53:18 +0200 Subject: [PATCH 0470/1322] CMake: Regenerate platformsupport/graphics Change-Id: Ifff85f70de092ade438430d71d9a149f49363c14 Reviewed-by: Alexandru Croitor --- src/platformsupport/graphics/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/graphics/CMakeLists.txt b/src/platformsupport/graphics/CMakeLists.txt index 9deca9d7c76..f6a429fa3a5 100644 --- a/src/platformsupport/graphics/CMakeLists.txt +++ b/src/platformsupport/graphics/CMakeLists.txt @@ -13,9 +13,12 @@ add_qt_module(GraphicsSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:graphics.pro:: +#### Keys ignored in scope 1:.:.:graphics.pro:: # CONFIG = "static" "internal_module" # MODULE = "graphics_support" # _LOADED = "qt_module" From 3d452d7c3bb86f04863c822a1dd70cf486a6362f Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:56:19 +0200 Subject: [PATCH 0471/1322] CMake: Regenerate platformsupport/linuxaccessibility Use ATSPI with nolink! Change-Id: I334fa93364109ca04b4312d12ddcea34d9e9a103 Reviewed-by: Alexandru Croitor --- .../linuxaccessibility/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt index 81914f7cd84..d62ccc8ca53 100644 --- a/src/platformsupport/linuxaccessibility/CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -1,3 +1,5 @@ +# Generated from linuxaccessibility.pro. + qt_find_package(ATSPI2 REQUIRED) # special case ##################################################################### @@ -29,12 +31,16 @@ add_qt_module(LinuxAccessibilitySupport LIBRARIES Qt::AccessibilitySupportPrivate Qt::CorePrivate - Qt::DBus Qt::GuiPrivate - PkgConfig::ATSPI2 + PUBLIC_LIBRARIES + PkgConfig::ATSPI2_nolink + Qt::AccessibilitySupport + Qt::Core + Qt::DBus + Qt::Gui ) -#### Keys ignored in scope 1:.:linuxaccessibility.pro:: +#### Keys ignored in scope 1:.:.:linuxaccessibility.pro:: # CONFIG = "static" "internal_module" # MODULE = "linuxaccessibility_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" From 9b7f5776eec29ffc17daeb1ea4e193aaec5b433e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:57:10 +0200 Subject: [PATCH 0472/1322] CMake: Regenerate platformsupport/services Change-Id: I73444aeef2e37ebb2f90e8bae3e6932989bad5f0 Reviewed-by: Alexandru Croitor --- src/platformsupport/services/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/platformsupport/services/CMakeLists.txt b/src/platformsupport/services/CMakeLists.txt index 3169332381a..23e1d5e4cdc 100644 --- a/src/platformsupport/services/CMakeLists.txt +++ b/src/platformsupport/services/CMakeLists.txt @@ -13,9 +13,12 @@ add_qt_module(ServiceSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:services.pro:: +#### Keys ignored in scope 1:.:.:services.pro:: # CONFIG = "static" "internal_module" # MODULE = "service_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" @@ -25,6 +28,6 @@ add_qt_module(ServiceSupport ##################################################################### extend_target(ServiceSupport CONDITION QT_FEATURE_dbus - LIBRARIES + PUBLIC_LIBRARIES Qt::DBus ) From ef170a12d8534c084693299802f29c1f5d19def6 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:57:33 +0200 Subject: [PATCH 0473/1322] CMake: Regenerate platformsupport/themes Change-Id: Ica4b4c3f2a5f86476f179a01aea5eeb25e617a98 Reviewed-by: Alexandru Croitor --- src/platformsupport/themes/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/themes/CMakeLists.txt b/src/platformsupport/themes/CMakeLists.txt index 865624bd395..9dca636b920 100644 --- a/src/platformsupport/themes/CMakeLists.txt +++ b/src/platformsupport/themes/CMakeLists.txt @@ -13,9 +13,12 @@ add_qt_module(ThemeSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:themes.pro:: +#### Keys ignored in scope 1:.:.:themes.pro:: # CONFIG = "static" "internal_module" # MODULE = "theme_support" # _LOADED = "qt_module" From cbaa8ee27df60a9a0fb8611ee596a88dd1ebb7c5 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:58:48 +0200 Subject: [PATCH 0474/1322] CMake: Regenerate platformsupport/vkconvenience This does not link to vulkan, just as it did before. Feels wrong... Change-Id: I7e76e03e95ed33421de684f51c9943a84dde7779 Reviewed-by: Alexandru Croitor --- src/platformsupport/vkconvenience/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt index 659ee0cdbd6..a6f85d8c55f 100644 --- a/src/platformsupport/vkconvenience/CMakeLists.txt +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -1,3 +1,5 @@ +# Generated from vkconvenience.pro. + qt_find_package(Vulkan) # special case ##################################################################### @@ -13,9 +15,12 @@ add_qt_module(VulkanSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:vkconvenience.pro:: +#### Keys ignored in scope 1:.:.:vkconvenience.pro:: # CONFIG = "static" "internal_module" # MODULE = "vulkan_support" # PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" From b15776c76fdd962cde1e1e842a2ca7d251d95502 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 14:59:33 +0200 Subject: [PATCH 0475/1322] CMake: Regenerate platformsupport/windowsuiautomation Change-Id: I17c927cf7eb8c66ee941a2d91c918e105474da29 Reviewed-by: Alexandru Croitor --- src/platformsupport/windowsuiautomation/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/windowsuiautomation/CMakeLists.txt b/src/platformsupport/windowsuiautomation/CMakeLists.txt index 84c118258e6..e4e0eed64a3 100644 --- a/src/platformsupport/windowsuiautomation/CMakeLists.txt +++ b/src/platformsupport/windowsuiautomation/CMakeLists.txt @@ -21,9 +21,12 @@ add_qt_module(WindowsUIAutomationSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:windowsuiautomation.pro:: +#### Keys ignored in scope 1:.:.:windowsuiautomation.pro:: # CONFIG = "static" "internal_module" # MODULE = "windowsuiautomation_support" # _LOADED = "qt_module" From 1e5c90e6e2054120feff929c99cdd54cbc7a808e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 15:00:20 +0200 Subject: [PATCH 0476/1322] CMake: Regenerate src/plugins Change-Id: I64f920e909de7c612e3ab18b8aa31b98e0e1acfd Reviewed-by: Alexandru Croitor --- src/plugins/CMakeLists.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 9c4eee2db46..6b69c5463d4 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,28 +1,32 @@ +# Generated from plugins.pro. -if (QT_FEATURE_sql) + +if(TARGET Qt::Sql) add_subdirectory(sqldrivers) endif() -if(QT_FEATURE_network AND QT_FEATURE_bearermanagement) +if(TARGET Qt::Network AND QT_FEATURE_bearermanagement) add_subdirectory(bearer) endif() -if(QT_FEATURE_gui) +if(TARGET Qt::Gui) add_subdirectory(platforms) - add_subdirectory(platformthemes) add_subdirectory(platforminputcontexts) - if (QT_FEATURE_imageformatplugin) + add_subdirectory(platformthemes) + + if(QT_FEATURE_imageformatplugin) add_subdirectory(imageformats) endif() - if (NOT ANDROID AND QT_FEATURE_library) + + if(NOT ANDROID AND QT_FEATURE_library) add_subdirectory(generic) endif() endif() -if (QT_FEATURE_widgets) +if(TARGET Qt::Widgets) add_subdirectory(styles) endif() -if (NOT WINRT AND TARGET PrintSupport) +if(NOT WINRT AND TARGET Qt::PrintSupport) add_subdirectory(printsupport) endif() From d1a0af9b0c56e520ad478e908e3abba6601fea01 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 15:06:23 +0200 Subject: [PATCH 0477/1322] CMake: Regenerate src/platformsupport/platformcompositor Change-Id: I435fb110ad59eb197401c6d8090c697ceb4cf687 Reviewed-by: Alexandru Croitor --- src/platformsupport/platformcompositor/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/platformsupport/platformcompositor/CMakeLists.txt b/src/platformsupport/platformcompositor/CMakeLists.txt index a8696be5cd8..1cb4752ead9 100644 --- a/src/platformsupport/platformcompositor/CMakeLists.txt +++ b/src/platformsupport/platformcompositor/CMakeLists.txt @@ -14,9 +14,12 @@ add_qt_module(PlatformCompositorSupport LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:platformcompositor.pro:: +#### Keys ignored in scope 1:.:.:platformcompositor.pro:: # CONFIG = "static" "internal_module" # MODULE = "platformcompositor_support" # _LOADED = "qt_module" From aba911c4d08be77d7458291fd3f5b53354e82944 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 15:29:48 +0200 Subject: [PATCH 0478/1322] CMake: Regenerate src/platformsupport/kmsconvenience Change-Id: I2608275ca7cd5315e7ffdffbb25f78e98fbf9bc3 Reviewed-by: Alexandru Croitor --- src/platformsupport/kmsconvenience/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/kmsconvenience/CMakeLists.txt b/src/platformsupport/kmsconvenience/CMakeLists.txt index 1f9f4fbf364..3300c2d98de 100644 --- a/src/platformsupport/kmsconvenience/CMakeLists.txt +++ b/src/platformsupport/kmsconvenience/CMakeLists.txt @@ -1,3 +1,5 @@ +# Generated from kmsconvenience.pro. + qt_find_package(Libdrm) # special case ##################################################################### @@ -10,14 +12,16 @@ add_qt_module(KmsSupport qkmsdevice.cpp qkmsdevice_p.h DEFINES QT_NO_CAST_FROM_ASCII - PUBLIC_LIBRARIES # special case - Libdrm::Libdrm LIBRARIES Qt::CorePrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Libdrm::Libdrm + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:kmsconvenience.pro:: +#### Keys ignored in scope 1:.:.:kmsconvenience.pro:: # CONFIG = "static" "internal_module" # MODULE = "kms_support" # _LOADED = "qt_module" From 9ffcc761887f0088ae6226098723818843f0d287 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 15:49:37 +0200 Subject: [PATCH 0479/1322] CMake: Scripts: Fix double entries in 3rd party library mapping Change-Id: I35f29876874d6083d19382800d194e417d57bca1 Reviewed-by: Alexandru Croitor --- src/gui/configure.cmake | 4 ++-- util/cmake/helper.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 19f97628c5d..476b77d8d11 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -53,8 +53,8 @@ qt_find_package(XCB COMPONENTS SYNC PROVIDED_TARGETS XCB::SYNC) qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES) qt_find_package(XCB COMPONENTS XINERAMA PROVIDED_TARGETS XCB::XINERAMA) qt_find_package(XCB COMPONENTS XKB PROVIDED_TARGETS XCB::XKB) -qt_find_package(XCB PROVIDED_TARGETS XCB::RENDER) -qt_find_package(XCB PROVIDED_TARGETS XCB::GLX) +qt_find_package(XCB COMPONENTS RENDER PROVIDED_TARGETS XCB::RENDER) +qt_find_package(XCB COMPONENTS GLX PROVIDED_TARGETS XCB::GLX) qt_find_package(XCB COMPONENTS XINPUT PROVIDED_TARGETS XCB::XINPUT) qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 0a782307034..d47c65ffa6f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -219,8 +219,6 @@ _library_map = [ LibraryMapping('vulkan', 'Vulkan', 'Vulkan::Vulkan'), LibraryMapping('wayland_server', 'Wayland', 'Wayland::Server'), LibraryMapping('x11sm', 'X11', '${X11_SM_LIB} ${X11_ICE_LIB}', resultVariable="X11_SM"), - LibraryMapping('xcb_glx', 'XCB', 'XCB::GLX', resultVariable='XCB_GLX'), - LibraryMapping('xcb_render', 'XCB', 'XCB::RENDER', resultVariable='XCB_RENDER'), LibraryMapping('xcb', 'XCB', 'XCB::XCB', extra = ['1.9']), LibraryMapping('xcb_glx', 'XCB', 'XCB::GLX', extra = ['COMPONENTS', 'GLX'], resultVariable='XCB_GLX'), LibraryMapping('xcb_icccm', 'XCB', 'XCB::ICCCM', extra = ['COMPONENTS', 'ICCCM'], resultVariable='XCB_ICCCM'), From 0434b7fb38c33b26700daabe31a29ab0cd4294d7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 15:02:40 +0200 Subject: [PATCH 0480/1322] CMake: Regenerate src/plugins/bearer Change-Id: I6c900247eb03b8afc3f299b5dbca5bac64527a52 Reviewed-by: Alexandru Croitor --- src/plugins/bearer/CMakeLists.txt | 10 ++++++---- src/plugins/bearer/connman/CMakeLists.txt | 6 ++++-- src/plugins/bearer/generic/CMakeLists.txt | 7 +++++-- src/plugins/bearer/networkmanager/CMakeLists.txt | 6 ++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/plugins/bearer/CMakeLists.txt b/src/plugins/bearer/CMakeLists.txt index ec860de2cbc..88e4f4206e3 100644 --- a/src/plugins/bearer/CMakeLists.txt +++ b/src/plugins/bearer/CMakeLists.txt @@ -1,9 +1,11 @@ -if (NOT ANDROID AND LINUX AND QT_FEATURE_dbus) +# Generated from bearer.pro. + +if(NOT ANDROID AND LINUX AND TARGET Qt::DBus) # special case add_subdirectory(generic) add_subdirectory(connman) add_subdirectory(networkmanager) -elseif(ANDROID AND NOT ANDROID_EMBEDDED) -# TODO add_subdirectory(android) -else() +else if(ANDROID AND NOT ANDROID_EMBEDDED) # special case + add_subdirectory(android) +else() # special case add_subdirectory(generic) endif() diff --git a/src/plugins/bearer/connman/CMakeLists.txt b/src/plugins/bearer/connman/CMakeLists.txt index 08f286aee15..c7cfa6efda7 100644 --- a/src/plugins/bearer/connman/CMakeLists.txt +++ b/src/plugins/bearer/connman/CMakeLists.txt @@ -14,12 +14,14 @@ add_qt_plugin(qconnmanbearer qconnmanengine.cpp qconnmanengine.h qconnmanservice_linux.cpp qconnmanservice_linux_p.h LIBRARIES + Qt::NetworkPrivate + PUBLIC_LIBRARIES Qt::Core Qt::DBus - Qt::NetworkPrivate + Qt::Network ) -#### Keys ignored in scope 1:.:connman.pro:: +#### Keys ignored in scope 1:.:.:connman.pro:: # OTHER_FILES = "connman.json" # PLUGIN_CLASS_NAME = "QConnmanEnginePlugin" # _LOADED = "qt_plugin" diff --git a/src/plugins/bearer/generic/CMakeLists.txt b/src/plugins/bearer/generic/CMakeLists.txt index 822cd12b19c..f68b34a99ba 100644 --- a/src/plugins/bearer/generic/CMakeLists.txt +++ b/src/plugins/bearer/generic/CMakeLists.txt @@ -15,9 +15,12 @@ add_qt_plugin(qgenericbearer LIBRARIES Qt::CorePrivate Qt::NetworkPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Network ) -#### Keys ignored in scope 1:.:generic.pro:: +#### Keys ignored in scope 1:.:.:generic.pro:: # OTHER_FILES = "generic.json" # PLUGIN_CLASS_NAME = "QGenericEnginePlugin" # _LOADED = "qt_plugin" @@ -26,6 +29,6 @@ add_qt_plugin(qgenericbearer ##################################################################### extend_target(qgenericbearer CONDITION WIN32 AND NOT WINRT - LIBRARIES + PUBLIC_LIBRARIES iphlpapi ) diff --git a/src/plugins/bearer/networkmanager/CMakeLists.txt b/src/plugins/bearer/networkmanager/CMakeLists.txt index 62c0b2a98b2..998f06e47a0 100644 --- a/src/plugins/bearer/networkmanager/CMakeLists.txt +++ b/src/plugins/bearer/networkmanager/CMakeLists.txt @@ -14,12 +14,14 @@ add_qt_plugin(qnmbearer qnetworkmanagerengine.cpp qnetworkmanagerengine.h qnetworkmanagerservice.cpp qnetworkmanagerservice.h LIBRARIES + Qt::NetworkPrivate + PUBLIC_LIBRARIES Qt::Core Qt::DBus - Qt::NetworkPrivate + Qt::Network ) -#### Keys ignored in scope 1:.:networkmanager.pro:: +#### Keys ignored in scope 1:.:.:networkmanager.pro:: # OTHER_FILES = "networkmanager.json" # PLUGIN_CLASS_NAME = "QNetworkManagerEnginePlugin" # _LOADED = "qt_plugin" From b65e7b2ffee52b7a9f6df829c7925fa54b4d7ad8 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 15:28:53 +0200 Subject: [PATCH 0481/1322] CMake: Regenerate src/plugins/imageformats Change-Id: Iea0f1b5f51508b7e8c2cad405dd3e293186c583a Reviewed-by: Alexandru Croitor --- src/plugins/imageformats/CMakeLists.txt | 11 +++++++---- src/plugins/imageformats/gif/CMakeLists.txt | 11 +++++++++-- src/plugins/imageformats/ico/CMakeLists.txt | 10 ++++++++-- src/plugins/imageformats/jpeg/CMakeLists.txt | 15 +++++++++++---- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/plugins/imageformats/CMakeLists.txt b/src/plugins/imageformats/CMakeLists.txt index cd5c0347e53..9b39538e7c8 100644 --- a/src/plugins/imageformats/CMakeLists.txt +++ b/src/plugins/imageformats/CMakeLists.txt @@ -1,11 +1,14 @@ -if(QT_FEATURE_gif) - add_subdirectory(gif) -endif() +# Generated from imageformats.pro. + + if(QT_FEATURE_ico) add_subdirectory(ico) endif() + if(QT_FEATURE_jpeg) add_subdirectory(jpeg) endif() - +if(QT_FEATURE_gif) + add_subdirectory(gif) +endif() diff --git a/src/plugins/imageformats/gif/CMakeLists.txt b/src/plugins/imageformats/gif/CMakeLists.txt index efd910c3ffd..f6ca369b696 100644 --- a/src/plugins/imageformats/gif/CMakeLists.txt +++ b/src/plugins/imageformats/gif/CMakeLists.txt @@ -9,6 +9,13 @@ add_qt_plugin(qgif SOURCES main.cpp main.h qgifhandler.cpp qgifhandler_p.h - LIBRARIES - Qt::Gui + LIBRARIES # special case + Qt::GuiPrivate # special case + PUBLIC_LIBRARIES # special case + Qt::Gui # special case ) + +#### Keys ignored in scope 1:.:.:gif.pro:: +# OTHER_FILES = "gif.json" +# PLUGIN_CLASS_NAME = "QGifPlugin" +# _LOADED = "qt_plugin" diff --git a/src/plugins/imageformats/ico/CMakeLists.txt b/src/plugins/imageformats/ico/CMakeLists.txt index 52550eab60e..160b440dfff 100644 --- a/src/plugins/imageformats/ico/CMakeLists.txt +++ b/src/plugins/imageformats/ico/CMakeLists.txt @@ -10,6 +10,12 @@ add_qt_plugin(qico main.cpp main.h qicohandler.cpp qicohandler.h LIBRARIES - Qt::Gui - Qt::CorePrivate + Qt::GuiPrivate # special case + PUBLIC_LIBRARIES # special case + Qt::Gui # special case ) + +#### Keys ignored in scope 1:.:.:ico.pro:: +# OTHER_FILES = "ico.json" +# PLUGIN_CLASS_NAME = "QICOPlugin" +# _LOADED = "qt_plugin" diff --git a/src/plugins/imageformats/jpeg/CMakeLists.txt b/src/plugins/imageformats/jpeg/CMakeLists.txt index 39c45bc2fe6..1c4627cb4f5 100644 --- a/src/plugins/imageformats/jpeg/CMakeLists.txt +++ b/src/plugins/imageformats/jpeg/CMakeLists.txt @@ -1,19 +1,26 @@ # Generated from jpeg.pro. +qt_find_package(JPEG) # special case + ##################################################################### ## qjpeg Plugin: ##################################################################### -qt_find_package(JPEG) # special case - add_qt_plugin(qjpeg TYPE imageformats SOURCES main.cpp main.h qjpeghandler.cpp qjpeghandler_p.h LIBRARIES - Qt::Gui - Qt::CorePrivate + # Qt::CorePrivate # special case: remove Qt::GuiPrivate + PUBLIC_LIBRARIES # special case JPEG::JPEG + # Qt::Core # special case: remove + Qt::Gui # special case ) + +#### Keys ignored in scope 1:.:.:jpeg.pro:: +# OTHER_FILES = "jpeg.json" +# PLUGIN_CLASS_NAME = "QJpegPlugin" +# _LOADED = "qt_plugin" From e6b7a3e459c24fcf5b0896b26b96e0651fa26280 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 4 May 2019 12:01:23 +0200 Subject: [PATCH 0482/1322] Fix special cases in gui Change-Id: I9553f1443a772c45748fafca079eaad2bf8cf1de Reviewed-by: Tobias Hunger --- src/gui/CMakeLists.txt | 44 +++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index df60f64b49a..126ca109c98 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,12 +1,12 @@ # Generated from gui.pro. -# special case: -set(OpenGL_GL_PREFERENCE GLVND) +set(OpenGL_GL_PREFERENCE GLVND) # special case: ##################################################################### ## Gui Module: ##################################################################### +# special case begin if (QT_FEATURE_gui) if (WINRT) set(_default_platform "winrt") @@ -34,10 +34,11 @@ if (QT_FEATURE_gui) set(QT_QPA_DEFAULT_PLATFORM "${_default_platform}" CACHE STRING "QPA default platform") endif() +# special case end add_qt_module(Gui FEATURE_DEPENDENCIES # special case: - Qt::Network + Qt::Network # special case: SOURCES image/qbitmap.cpp image/qbitmap.h image/qbmphandler.cpp image/qbmphandler_p.h @@ -247,11 +248,12 @@ add_qt_module(Gui # Resources: -# special case: +# special case begin # This name is fixed in the code:-/ add_qt_resource(Gui qmake_webgradients PREFIX "/qgradient" BASE "painting" FILES webgradients.binaryjson ) +# special case end set_source_files_properties("painting/../../3rdparty/icc/sRGB2014.icc" PROPERTIES alias "sRGB2014.icc") @@ -297,18 +299,21 @@ add_qt_simd_part(Gui SIMD mips_dspr2 painting/qdrawhelper_mips_dspr2_asm.S ) -# special case: Replace arch_haswell with avx2 feature. That is what is used in the code requireing +# special case begin +# Replace arch_haswell with avx2 feature. That is what is used in the code requireing # this file, too! add_qt_simd_part(Gui SIMD avx2 SOURCES painting/qdrawhelper_avx2.cpp ) +# special case end -#special case: +# special case begin extend_target(Gui CONDITION QT_FEATURE_standarditemmodel SOURCES itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h ) +# special case end #### Keys ignored in scope 1:.:.:gui.pro:: @@ -420,14 +425,15 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h ) -# special case: +# special case begin # With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf # acted like WrapOpenGL: direct linkage against either libGLESv2 or # libGL, depending on the opengl _feature_. This is done by hand now # here (where the feature is available). # DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not # available until the add_qt_module call. -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) +# special case end extend_target(Gui CONDITION QT_FEATURE_opengl SOURCES @@ -462,7 +468,7 @@ extend_target(Gui CONDITION QT_FEATURE_opengl opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h LIBRARIES # special case - WrapOpenGL + WrapOpenGL # special case ) extend_target(Gui CONDITION QT_FEATURE_movie @@ -503,8 +509,7 @@ extend_target(Gui CONDITION QT_FEATURE_cssparser text/qcssparser.cpp text/qcssparser_p.h ) -# special case: -# extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 ... +# extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 ... # special case: #### Keys ignored in scope 45:.:painting:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: # CONFIG = "no_clang_integrated_as" @@ -514,13 +519,13 @@ extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT ( ENABLE_PIXMAN_DRAWHELPERS ) -# special case: +# special case begin extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64" AND QT_FEATURE_neon) SOURCES ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S ) - +# special case end #### Keys ignored in scope 46:.:painting:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND NOT INTEGRITY AND NOT QT_ARCH___contains___arm64: # NEON_ASM = "../3rdparty/pixman/pixman-arm-neon-asm.S" "painting/qdrawhelper_neon_asm.S" @@ -565,12 +570,13 @@ extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h ) -# special case +# special case begin # Make Vulkan a global imported target, so that generator expressions involving Vulkan # can be correctly evaluated in any sub project directory. if(TARGET Vulkan::Vulkan) set_property(TARGET Vulkan::Vulkan PROPERTY IMPORTED_GLOBAL TRUE) endif() +# special case end extend_target(Gui CONDITION QT_FEATURE_vulkan SOURCES @@ -582,7 +588,7 @@ extend_target(Gui CONDITION QT_FEATURE_vulkan Vulkan::Vulkan_nolink ) -# special case: +# special case begin if (QT_FEATURE_vulkan) set(qvkgen_command "${HOST_QVKGEN}") if (TARGET qvkgen) @@ -620,6 +626,7 @@ if (QT_FEATURE_vulkan) "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun_p_cpp}" ) endif() +# special case end #### Keys ignored in scope 62:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: # CONFIG = "generated_privates" @@ -632,14 +639,15 @@ extend_target(Gui CONDITION WASM platform/wasm/qwasmlocalfileaccess.cpp platform/wasm/qwasmlocalfileaccess_p.h ) -# special case: +# special case begin # qpa headers are expected to be located right next to QtGui's private # headers. So a private QtGui header is #include and # a qpa header is #include , both of them implying # linkage against Qt::GuiPrivate. -qt_read_headers_pri("Gui" "module_headers") # special case +qt_read_headers_pri("Gui" "module_headers") install(FILES ${module_headers_qpa} - DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) # special case + DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) +# special case end qt_create_tracepoints(Gui qtgui.tracepoints) add_qt_docs( From 97600f5562be205ff758e08838a56d1b14ecb50c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 4 May 2019 14:52:31 +0200 Subject: [PATCH 0483/1322] Fix special cases in corelib Change-Id: I506f379245619c8b5d248ea27dba35a165b455ee Reviewed-by: Tobias Hunger --- src/corelib/CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ba75c4cdb41..3846c38cded 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from corelib.pro. -# special case: +# special case begin qt_find_package(Threads PROVIDED_TARGETS Threads::Threads) qt_find_package(WrapDoubleConversion REQUIRED PROVIDED_TARGETS WrapDoubleConversion) @@ -9,6 +9,7 @@ if (NOT WrapDoubleConversion_FOUND) sscanf_l/snprintf_l _snprintf_l/_sscanf_l. \ You need to use libdouble-conversion for double/string conversion.") endif() +# special case end ##################################################################### ## Core Module: @@ -232,13 +233,13 @@ add_qt_module(Core tinycbor # special case WrapDoubleConversion # special case PUBLIC_LIBRARIES # special case: - Qt::Platform + Qt::Platform # special case: DISABLE_AUTOGEN_TOOLS # special case: - uic + uic # special case: DISABLE_TOOLS_EXPORT # special case: ) -# special case: +# special case begin add_dependencies(Core ${QT_CMAKE_EXPORT_NAMESPACE}::moc) add_dependencies(Core ${QT_CMAKE_EXPORT_NAMESPACE}::rcc) add_dependencies(CorePrivate ${QT_CMAKE_EXPORT_NAMESPACE}::moc) @@ -305,7 +306,7 @@ add_qt_simd_part(Core SIMD mips_dsp ../gui/painting/qt_mips_asm_dsp_p.h tools/qstring_mips_dsp_asm.S ) - +# special case end #### Keys ignored in scope 1:.:.:corelib.pro:: # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" @@ -480,8 +481,7 @@ extend_target(Core CONDITION INTEGRITY #### Keys ignored in scope 24:.:global:global/global.pri:else: # f16c_cxx = "false" -# special case: Handled manually: -# extend_target(Core CONDITION _ss_f16c_cxx ... +# extend_target(Core CONDITION _ss_f16c_cxx ... # special case: Handled manually: #### Keys ignored in scope 26:.:global:global/global.pri:else: # F16C_SOURCES = "global/qfloat16_f16c.c" @@ -1021,7 +1021,7 @@ extend_target(Core CONDITION WASM platform/wasm/qstdweb.cpp platform/wasm/qstdweb_p.h ) -# special case: +# special case begin # needs refinement for the other compiler specific cases. if(TEST_arch_${TEST_architecture_arch}_subarch_f16c) # Equivalent to contains(QT_CPU_FEATURES.$$QT_ARCH, f16c) @@ -1036,7 +1036,7 @@ else() ) endif() -# special case: + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qfloat16-tables ARGS "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp" @@ -1045,7 +1045,7 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp VERBATIM) target_sources(Core PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/global/qfloat16tables.cpp") -# special case: + set_source_files_properties( thread/qmutex_linux.cpp thread/qmutex_mac.cpp @@ -1053,7 +1053,7 @@ set_source_files_properties( thread/qmutex_win.cpp PROPERTIES HEADER_FILE_ONLY ON) # special case: These files are included by qmutex.cpp! -# special case + # Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library. if(WIN32) get_target_property(defines Core COMPILE_DEFINITIONS) @@ -1061,7 +1061,8 @@ if(WIN32) set_target_properties(Core PROPERTIES COMPILE_DEFINITIONS "${defines}") endif() -qt_internal_add_link_flags_gc_sections(Core PRIVATE) # special case +qt_internal_add_link_flags_gc_sections(Core PRIVATE) +# special case end qt_create_tracepoints(Core ./qtcore.tracepoints) add_qt_docs( From bbe5c58079b642908168ed8a32b14a539380dd4e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 7 May 2019 13:39:46 +0200 Subject: [PATCH 0484/1322] CMake: Fix src/plugins/bearer Sorry, last-minute-typo hit again:-/ Change-Id: I7130ba3306a96584e2bc33bc1aa27990a3508035 Reviewed-by: Albert Astals Cid --- src/plugins/bearer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/CMakeLists.txt b/src/plugins/bearer/CMakeLists.txt index 88e4f4206e3..c5218959d67 100644 --- a/src/plugins/bearer/CMakeLists.txt +++ b/src/plugins/bearer/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT ANDROID AND LINUX AND TARGET Qt::DBus) # special case add_subdirectory(generic) add_subdirectory(connman) add_subdirectory(networkmanager) -else if(ANDROID AND NOT ANDROID_EMBEDDED) # special case +elseif(ANDROID AND NOT ANDROID_EMBEDDED) # special case add_subdirectory(android) else() # special case add_subdirectory(generic) From d5018720db03224885244ab4af42da29bba45aa4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 6 May 2019 16:44:31 +0200 Subject: [PATCH 0485/1322] CMake: scripts: Treat libraries mapped to None as known This detects doubleconversion as a 3rd party library. This fixes defaulting QT_FEATURE_system_doubleconversion to 'ON'. Change-Id: I9d18dbbb6f7a99f6a5c674bed3013b96f19bf6e0 Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index d47c65ffa6f..f688d0e4777 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -324,7 +324,7 @@ def is_known_3rd_party_library(lib: str) -> bool: lib = lib[:-7] mapping = find_3rd_party_library_mapping(lib) - return mapping is not None and mapping.targetName is not None + return mapping is not None def map_3rd_party_library(lib: str) -> str: From 5ec3baa67a4d12b63ae11752f498d777e3ea229e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 7 May 2019 16:37:33 +0200 Subject: [PATCH 0486/1322] CMake: scripts: Make xcb_qpa_lib known as a Qt module Change-Id: I65f48d86c4ec946b38004b945078f29625e32d93 Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index f688d0e4777..1833df0bd34 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -164,6 +164,7 @@ _qt_library_map = [ LibraryMapping('windowsuiautomation_support', 'Qt5', 'Qt::WindowsUIAutomationSupport', extra = ['COMPONENTS', 'WindowsUIAutomationSupport']), LibraryMapping('winextras', 'Qt5', 'Qt::WinExtras', extra = ['COMPONENTS', 'WinExtras']), LibraryMapping('x11extras', 'Qt5', 'Qt::X11Extras', extra = ['COMPONENTS', 'X11Extras']), + LibraryMapping('xcb_qpa_lib', 'Qt5', 'Qt::XcbQpa', extra = ['COMPONENTS', 'XcbQpa']), LibraryMapping('xkbcommon_support', 'Qt5', 'Qt::XkbCommonSupport', extra = ['COMPONENTS', 'XkbCommonSupport']), LibraryMapping('xmlpatterns', 'Qt5', 'Qt::XmlPatterns', extra = ['COMPONENTS', 'XmlPatterns']), LibraryMapping('xml', 'Qt5', 'Qt::Xml', extra = ['COMPONENTS', 'Xml']), From cc141cc5c61d086d6938e2c7312ec02e5f79734c Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 7 May 2019 16:36:43 +0200 Subject: [PATCH 0487/1322] CMake: Fix dbus build after dbus library detection update Change-Id: If4d773136b1aa01204e012c6900458673a4c5670 Reviewed-by: Alexandru Croitor --- src/dbus/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index 4768460e05e..09fcdfd2559 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -60,10 +60,18 @@ set_source_files_properties(qdbusmarshaller.cpp extend_target(DBus CONDITION QT_FEATURE_dbus_linked DEFINES QT_LINKED_LIBDBUS - LIBRARIES + PUBLIC_LIBRARIES # special case dbus-1 ) +# begin special case: +extend_target(DBus CONDITION NOT QT_FEATURE_dbus_linked + PUBLIC_LIBRARIES + dbus-1_nolink +) +# end special case: + + extend_target(DBus CONDITION WIN32 LIBRARIES advapi32 From aed2c1f5ae002df7cc92bd4ceaa65c173757c40a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 7 May 2019 16:46:28 +0200 Subject: [PATCH 0488/1322] Force pro2cmake.py to always change the dir to the converted pro file Otherwise if you call the script from a different directory, path handling becomes broken and certain files are not found. Change-Id: Ia2f60abbd312a771330b3d5e928e1ccd0b4a845b Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 23ba9d7fc8b..a6ebc1094c0 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1566,8 +1566,14 @@ def main() -> None: debug_parsing = args.debug_parser or args.debug + backup_current_dir = os.getcwd() + for file in args.files: - parseresult = parseProFile(file, debug=debug_parsing) + new_current_dir = os.path.dirname(file) + file_relative_path = os.path.basename(file) + os.chdir(new_current_dir) + + parseresult = parseProFile(file_relative_path, debug=debug_parsing) if args.debug_parse_result or args.debug: print('\n\n#### Parser result:') @@ -1578,7 +1584,7 @@ def main() -> None: print(parseresult.asDict()) print('\n#### End of parser result dictionary.\n') - file_scope = Scope.FromDict(None, file, + file_scope = Scope.FromDict(None, file_relative_path, parseresult.asDict().get('statements')) if args.debug_pro_structure or args.debug: @@ -1594,6 +1600,7 @@ def main() -> None: print('\n#### End of full .pro/.pri file structure.\n') generate_cmakelists(file_scope) + os.chdir(backup_current_dir) if __name__ == '__main__': From aa8af1283f92033a615f0f2325b841100a303d92 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 7 May 2019 13:42:42 +0200 Subject: [PATCH 0489/1322] CMake: Do not require ATSPI2 in platformsupport/linuxaccessibility Change-Id: I3796ab3eb51306eec67460214c20a3c1c160edee Reviewed-by: Alexandru Croitor --- src/platformsupport/linuxaccessibility/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt index d62ccc8ca53..41c86236d26 100644 --- a/src/platformsupport/linuxaccessibility/CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from linuxaccessibility.pro. -qt_find_package(ATSPI2 REQUIRED) # special case +qt_find_package(ATSPI2) # special case ##################################################################### ## LinuxAccessibilitySupport Module: From e8bb67330164e3ed4baf87b4b0a46d584fe3b738 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 7 May 2019 16:38:55 +0200 Subject: [PATCH 0490/1322] CMake: Regenerate xcb platform plugin This contains fixes to the improved library detection recently introduced. Change-Id: I5df03b0c965dd0b8cf4b1769c752ecbb81558265 Reviewed-by: Alexandru Croitor --- src/plugins/platforms/xcb/CMakeLists.txt | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 57ec1b94435..c6c0c90b254 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -1,6 +1,6 @@ -# Generated from xcb_qpa_lib.pro. +# Generated from xcb.pro. -# special case: +# begin special case: qt_find_package(X11_XCB) qt_find_package(X11) qt_find_package(XCB) @@ -10,6 +10,7 @@ qt_find_package(Freetype) qt_find_package(GLIB2) pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) # special case +# end special case: ##################################################################### ## XcbQpa Module: @@ -55,6 +56,7 @@ add_qt_module(XcbQpa Qt::ServiceSupportPrivate Qt::ThemeSupportPrivate Qt::XkbCommonSupportPrivate + PkgConfig::XKB_COMMON_X11 # special case PUBLIC_LIBRARIES ${CMAKE_DL_LIBS} Qt::Core @@ -79,7 +81,7 @@ add_qt_module(XcbQpa XKB::XKB ) -#### Keys ignored in scope 1:.:.:xcb_qpa_lib.pro:: +#### Keys ignored in scope 3:.:.:xcb_qpa_lib.pro:: # CONFIG = "no_module_headers" "internal_module" # _LOADED = "qt_build_paths" "qt_module" @@ -158,16 +160,13 @@ extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender PUBLIC_LIBRARIES - X11::Xrender # special case + PkgConfig::xrender ) extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_painting LIBRARIES Freetype::Freetype ) - -# Generated from xcb-plugin.pro. - ##################################################################### ## qxcb Plugin: ##################################################################### @@ -188,7 +187,7 @@ add_qt_plugin(qxcb Qt::XcbQpa ) -#### Keys ignored in scope 1:.:.:./xcb-plugin.pro:: +#### Keys ignored in scope 24:.:.:xcb-plugin.pro:: # OTHER_FILES = "xcb.json" "README" # PLUGIN_CLASS_NAME = "QXcbIntegrationPlugin" # _LOADED = "qt_plugin" @@ -196,12 +195,11 @@ add_qt_plugin(qxcb ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:.:./xcb-plugin.pro:APPLE_OSX: +#### Keys ignored in scope 25:.:.:xcb-plugin.pro:APPLE_OSX: # CONFIG = "no_app_extension_api_only" -#### Keys ignored in scope 3:.:.:./xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 26:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" - add_subdirectory(gl_integrations) -#### TODO: xcb-static sub folder +#### TODO: xcb-static sub folder # special case From 9d96c8da78125531c64916291e03867e752a97af Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 7 May 2019 20:20:39 +0200 Subject: [PATCH 0491/1322] Fix freetype target not being found when using vcpkg vcpkg and upstream CMake find module define different target names for the same package. To circumvent this, create our own Wrap find module, and link against it. Inside the find module, try both target names. Change-Id: Iba488bce0fb410ddb83f6414244f86ad367de72b Reviewed-by: Liang Qi Reviewed-by: Tobias Hunger --- cmake/FindWrapFreetype.cmake | 26 +++++++++++++++++++ src/gui/configure.cmake | 4 +-- .../fontdatabases/CMakeLists.txt | 4 +-- src/plugins/platforms/minimal/CMakeLists.txt | 4 +-- src/plugins/platforms/xcb/CMakeLists.txt | 4 +-- util/cmake/helper.py | 2 +- 6 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 cmake/FindWrapFreetype.cmake diff --git a/cmake/FindWrapFreetype.cmake b/cmake/FindWrapFreetype.cmake new file mode 100644 index 00000000000..521346cc233 --- /dev/null +++ b/cmake/FindWrapFreetype.cmake @@ -0,0 +1,26 @@ +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET WrapFreetype::WrapFreetype) + set(WrapFreetype_FOUND ON) + return() +endif() + +set(WrapFreetype_FOUND OFF) +find_package(Freetype) + +if(Freetype_FOUND) + # vcpkg defines a lower case target name, while upstream Find module defines a prefixed + # upper case name. + set(potential_target_names Freetype::Freetype freetype) + foreach(target_name ${potential_target_names}) + if(TARGET ${target_name}) + set(WrapFreetype_FOUND ON) + set(final_target_name ${target_name}) + + add_library(WrapFreetype::WrapFreetype INTERFACE IMPORTED) + target_link_libraries(WrapFreetype::WrapFreetype INTERFACE ${final_target_name}) + + break() + endif() + endforeach() +endif() diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 476b77d8d11..f3799eabdb7 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -25,8 +25,8 @@ set_property(CACHE INPUT_xcb PROPERTY STRINGS undefined no yes qt system) qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2) qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm) qt_find_package(EGL PROVIDED_TARGETS EGL::EGL) -qt_find_package(Freetype PROVIDED_TARGETS Freetype::Freetype) -set_package_properties(Freetype PROPERTIES TYPE REQUIRED) +qt_find_package(WrapFreetype PROVIDED_TARGETS WrapFreetype::WrapFreetype) +set_package_properties(WrapFreetype::WrapFreetype PROPERTIES TYPE REQUIRED) qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig) qt_find_package(gbm PROVIDED_TARGETS gbm::gbm) qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz) diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index 140882691c3..6ffc2fb2f33 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -1,6 +1,6 @@ # Generated from fontdatabases.pro. -qt_find_package(Freetype) # special case +qt_find_package(WrapFreetype) # special case qt_find_package(Fontconfig) # special case ##################################################################### @@ -54,7 +54,7 @@ extend_target(FontDatabaseSupport CONDITION QT_FEATURE_freetype freetype/qfontengine_ft.cpp freetype/qfontengine_ft_p.h freetype/qfreetypefontdatabase.cpp freetype/qfreetypefontdatabase_p.h LIBRARIES - Freetype::Freetype + WrapFreetype::WrapFreetype ) extend_target(FontDatabaseSupport CONDITION UNIX diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt index 203a9e3920e..58cd506e963 100644 --- a/src/plugins/platforms/minimal/CMakeLists.txt +++ b/src/plugins/platforms/minimal/CMakeLists.txt @@ -1,4 +1,4 @@ -qt_find_package(Freetype) # special case +qt_find_package(WrapFreetype) # special case ##################################################################### ## qminimal Plugin: @@ -29,7 +29,7 @@ add_qt_plugin(qminimal extend_target(qminimal CONDITION QT_FEATURE_freetype LIBRARIES - Freetype::Freetype + WrapFreetype::WrapFreetype ) #### Keys ignored in scope 3:.:minimal.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index c6c0c90b254..77fda139cf5 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -6,7 +6,7 @@ qt_find_package(X11) qt_find_package(XCB) qt_find_package(XKB) qt_find_package(PkgConfig) -qt_find_package(Freetype) +qt_find_package(WrapFreetype) qt_find_package(GLIB2) pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) # special case @@ -165,7 +165,7 @@ extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xre extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_painting LIBRARIES - Freetype::Freetype + WrapFreetype::WrapFreetype ) ##################################################################### ## qxcb Plugin: diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 1833df0bd34..1873b5bfe0f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -181,7 +181,7 @@ _library_map = [ LibraryMapping('drm', 'Libdrm', 'Libdrm::Libdrm'), LibraryMapping('egl', 'EGL', 'EGL::EGL'), LibraryMapping('fontconfig', 'Fontconfig', 'Fontconfig::Fontconfig', resultVariable="FONTCONFIG"), - LibraryMapping('freetype', 'Freetype', 'Freetype::Freetype', extra=['REQUIRED']), + LibraryMapping('freetype', 'WrapFreetype', 'WrapFreetype::WrapFreetype', extra=['REQUIRED']), LibraryMapping('gbm', 'gbm', 'gbm::gbm'), LibraryMapping('glib', 'GLIB2', 'GLIB2::GLIB2'), LibraryMapping('gnu_iconv', None, None), From 0c498ef4ffde8c410ee2d34ef977779e22070122 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 8 May 2019 13:14:37 +0200 Subject: [PATCH 0492/1322] CMake: pro2cmake.py: Do not fail when run from .pro-file directory Change-Id: I285b05986e3a58efc060ca0b5732f6e3f5121476 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index a6ebc1094c0..820a95d7284 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1571,7 +1571,8 @@ def main() -> None: for file in args.files: new_current_dir = os.path.dirname(file) file_relative_path = os.path.basename(file) - os.chdir(new_current_dir) + if new_current_dir: + os.chdir(new_current_dir) parseresult = parseProFile(file_relative_path, debug=debug_parsing) From 0efe6fc90fe964b8be20ca2046e3bfe7a394f3f7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 7 May 2019 19:46:57 +0200 Subject: [PATCH 0493/1322] Don't link against dbus-1_nolink when dbus_linked feature is off dbus1_linked is only evaluated to true when the dbus package is found. If it was not found, then it makes no sense to link against the _nolink target, because no package was found in the first place. When the package is not found, QtDBus uses a minimal dbus header which is included with QtDBus sources, so there is no need for the _nolink target. This amends cc141cc5c61d086d6938e2c7312ec02e5f79734c and fixes a build failure on macOS. Change-Id: I71dcbb7465ad13b0bf03579f51412c373125caba Reviewed-by: Tobias Hunger --- src/dbus/CMakeLists.txt | 10 +------- tests/auto/dbus/qdbusinterface/CMakeLists.txt | 17 ++++++++++++- tests/auto/dbus/qdbustype/CMakeLists.txt | 24 ++++++++++++------- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index 09fcdfd2559..4768460e05e 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -60,18 +60,10 @@ set_source_files_properties(qdbusmarshaller.cpp extend_target(DBus CONDITION QT_FEATURE_dbus_linked DEFINES QT_LINKED_LIBDBUS - PUBLIC_LIBRARIES # special case + LIBRARIES dbus-1 ) -# begin special case: -extend_target(DBus CONDITION NOT QT_FEATURE_dbus_linked - PUBLIC_LIBRARIES - dbus-1_nolink -) -# end special case: - - extend_target(DBus CONDITION WIN32 LIBRARIES advapi32 diff --git a/tests/auto/dbus/qdbusinterface/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/CMakeLists.txt index bb1debd590b..c96944cd569 100644 --- a/tests/auto/dbus/qdbusinterface/CMakeLists.txt +++ b/tests/auto/dbus/qdbusinterface/CMakeLists.txt @@ -1,26 +1,41 @@ # Generated from qdbusinterface.pro. +# special case begin add_subdirectory(qmyserver) +##################################################################### +## ../tst_qdbusinterface Test: +##################################################################### + add_qt_test(tst_qdbusinterface SOURCES myobject.h tst_qdbusinterface.cpp LIBRARIES Qt::CorePrivate - Qt::DBus Qt::DBusPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::DBus ) +#### Keys ignored in scope 1:.:.:qdbusinterface.pro:: +# CONFIG = "testcase" +# DESTDIR = "./" + ## Scopes: ##################################################################### extend_target(tst_qdbusinterface CONDITION QT_FEATURE_dbus_linked DEFINES QT_LINKED_LIBDBUS + PUBLIC_LIBRARIES + dbus-1 ) extend_target(tst_qdbusinterface CONDITION NOT QT_FEATURE_dbus_linked SOURCES ../../../../src/dbus/qdbus_symbols.cpp ) + +# special case end diff --git a/tests/auto/dbus/qdbustype/CMakeLists.txt b/tests/auto/dbus/qdbustype/CMakeLists.txt index c76f44ba02d..fc0c014a075 100644 --- a/tests/auto/dbus/qdbustype/CMakeLists.txt +++ b/tests/auto/dbus/qdbustype/CMakeLists.txt @@ -10,17 +10,25 @@ add_qt_test(tst_qdbustype LIBRARIES Qt::CorePrivate Qt::DBusPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::DBus ) +#### Keys ignored in scope 1:.:.:qdbustype.pro:: +# CONFIG = "testcase" "parallel_test" + ## Scopes: ##################################################################### -extend_target(tst_qdbustype CONDITION QT_FEATURE_dbus_linked - DEFINES - QT_LINKED_LIBDBUS -) + extend_target(tst_qdbustype CONDITION QT_FEATURE_dbus_linked + DEFINES + QT_LINKED_LIBDBUS + LIBRARIES + dbus-1 + ) -extend_target(tst_qdbustype CONDITION NOT QT_FEATURE_dbus_linked - SOURCES - ../../../../src/dbus/qdbus_symbols.cpp -) + extend_target(tst_qdbustype CONDITION NOT QT_FEATURE_dbus_linked + SOURCES + ../../../../src/dbus/qdbus_symbols.cpp + ) From 5c98110fca071f4c0c8bcc68b8d8e12b96a0fce2 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 8 May 2019 14:33:36 +0200 Subject: [PATCH 0494/1322] CMake: Fix up after WrapFreetype introduction Change-Id: I05ca6f8b055f470101ff0dcd1720a349a87e4ba9 Reviewed-by: Alexandru Croitor --- src/gui/configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index f3799eabdb7..c7a9a5f8481 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -26,7 +26,7 @@ qt_find_package(ATSPI2 PROVIDED_TARGETS PkgConfig::ATSPI2) qt_find_package(Libdrm PROVIDED_TARGETS Libdrm::Libdrm) qt_find_package(EGL PROVIDED_TARGETS EGL::EGL) qt_find_package(WrapFreetype PROVIDED_TARGETS WrapFreetype::WrapFreetype) -set_package_properties(WrapFreetype::WrapFreetype PROPERTIES TYPE REQUIRED) +set_package_properties(WrapFreetype PROPERTIES TYPE REQUIRED) qt_find_package(Fontconfig PROVIDED_TARGETS Fontconfig::Fontconfig) qt_find_package(gbm PROVIDED_TARGETS gbm::gbm) qt_find_package(harfbuzz PROVIDED_TARGETS harfbuzz::harfbuzz) From 5608bf3cbadefb2c73b23e4b90b8211d034f2221 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 7 May 2019 11:27:33 +0200 Subject: [PATCH 0495/1322] CMake: pro2cmake.py: Add basic support for examples Examples need to be built stand-alone and as part of Qt, so they need a special CMakeLists.txt file that supports both use-cases. Add an --is-example switch to pro2cmake to make it generate these special CMakeLists.txt files. This is basic support only and is currently still missing the necessary find_package calls. Change-Id: Ie770287350fb8a41e872cb0ea607923caa33073d Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 157 ++++++++++++++++++++++++++++++---------- 1 file changed, 118 insertions(+), 39 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 820a95d7284..556bc59c2bd 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -67,6 +67,11 @@ def _parse_commandline(): dest='debug_full_pro_structure', action='store_true', help='Dump the full structure of the qmake .pro-file ' '(with includes).') + + parser.add_argument('--example', action='store_true', + dest="is_example", + help='Treat the input .pro file as an example.') + parser.add_argument('files', metavar='<.pro/.pri file>', type=str, nargs='+', help='The .pro/.pri file to process') @@ -826,7 +831,7 @@ def map_condition(condition: str) -> str: def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, - indent: int = 0) -> None: + indent: int = 0, is_example: bool=False) -> None: ind = ' ' * indent for sd in scope.get_files('SUBDIRS'): if os.path.isdir(sd): @@ -839,7 +844,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, '', scope.basedir) do_include(subdir_scope) - cmakeify_scope(subdir_scope, cm_fh, indent=indent) + cmakeify_scope(subdir_scope, cm_fh, indent=indent, is_example=is_example) elif sd.startswith('-'): cm_fh.write('{}### remove_subdirectory' '("{}")\n'.format(ind, sd[1:])) @@ -853,7 +858,7 @@ def handle_subdir(scope: Scope, cm_fh: typing.IO[str], *, elif cond: cm_fh.write('\n{}if({})\n'.format(ind, cond)) - handle_subdir(c, cm_fh, indent=indent + 1) + handle_subdir(c, cm_fh, indent=indent + 1, is_example=is_example) if cond: cm_fh.write('{}endif()\n'.format(ind)) @@ -914,10 +919,10 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, cm_fh.write(header) extra_indent = '' if cmake_parameter: - cm_fh.write('{} {}\n'.format(ind, cmake_parameter)) + cm_fh.write('{}{}\n'.format(ind, cmake_parameter)) extra_indent = ' ' for s in sort_sources(sources): - cm_fh.write('{} {}{}\n'.format(ind, extra_indent, s)) + cm_fh.write('{}{}{}\n'.format(ind, extra_indent, s)) cm_fh.write(footer) @@ -951,6 +956,54 @@ def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, cm_fh.write('{} {}\n'.format(ind, d)) +def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, + indent: int = 0, footer: str = ''): + write_source_file_list(cm_fh, scope, header, + ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'], + indent) + + +def write_defines(cm_fh: typing.IO[str], scope: Scope, header: str, *, + indent: int = 0, footer: str = ''): + ind = spaces(indent) + + defines = scope.expand('DEFINES') + defines += [d[2:] for d in scope.expand('QMAKE_CXXFLAGS') if d.startswith('-D')] + if defines: + cm_fh.write('{}{}\n'.format(ind, header)) + for d in defines: + d = d.replace('=\\\\\\"$$PWD/\\\\\\"', + '="${CMAKE_CURRENT_SOURCE_DIR}/"') + cm_fh.write('{} {}\n'.format(ind, d)) + if footer: + cm_fh.write('{}{}\n'.format(ind, footer)) + +def write_include_paths(cm_fh: typing.IO[str], scope: Scope, header: str, *, + indent: int = 0, footer: str = ''): + ind = spaces(indent) + + includes = scope.get_files('INCLUDEPATH') + if includes: + cm_fh.write('{}{}\n'.format(ind, header)) + for i in includes: + i = i.rstrip('/') or ('/') + cm_fh.write('{} {}\n'.format(ind, i)) + if footer: + cm_fh.write('{}{}\n'.format(ind, footer)) + + +def write_compile_options(cm_fh: typing.IO[str], scope: Scope, header: str, *, + indent: int = 0, footer: str = ''): + ind = spaces(indent) + + compile_options = [d for d in scope.expand('QMAKE_CXXFLAGS') if not d.startswith('-D')] + if compile_options: + cm_fh.write('{}{}\n'.format(ind, header)) + for co in compile_options: + cm_fh.write('{} "{}"\n'.format(ind, co)) + if footer: + cm_fh.write('{}{}\n'.format(ind, footer)) + def write_library_section(cm_fh: typing.IO[str], scope: Scope, public: typing.List[str], @@ -1001,37 +1054,23 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, if plugin_type: cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type)) - source_keys: typing.List[str] = [] - write_source_file_list(cm_fh, scope, 'SOURCES', - ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'], - indent) + write_all_source_file_lists(cm_fh, scope, 'SOURCES', indent=indent + 1) - write_source_file_list(cm_fh, scope, 'DBUS_ADAPTOR_SOURCES', ['DBUS_ADAPTORS',], indent) + write_source_file_list(cm_fh, scope, 'DBUS_ADAPTOR_SOURCES', ['DBUS_ADAPTORS',], indent + 1) dbus_adaptor_flags = scope.expand('QDBUSXML2CPP_ADAPTOR_HEADER_FLAGS') if dbus_adaptor_flags: cm_fh.write('{} DBUS_ADAPTOR_FLAGS\n'.format(ind)) cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_adaptor_flags))) - write_source_file_list(cm_fh, scope, 'DBUS_INTERFACE_SOURCES', ['DBUS_INTERFACES',], indent) + write_source_file_list(cm_fh, scope, 'DBUS_INTERFACE_SOURCES', ['DBUS_INTERFACES',], indent + 1) dbus_interface_flags = scope.expand('QDBUSXML2CPP_INTERFACE_HEADER_FLAGS') if dbus_interface_flags: cm_fh.write('{} DBUS_INTERFACE_FLAGS\n'.format(ind)) cm_fh.write('{} "{}"\n'.format(ind, '" "'.join(dbus_interface_flags))) - defines = scope.expand('DEFINES') - defines += [d[2:] for d in scope.expand('QMAKE_CXXFLAGS') if d.startswith('-D')] - if defines: - cm_fh.write('{} DEFINES\n'.format(ind)) - for d in defines: - d = d.replace('=\\\\\\"$$PWD/\\\\\\"', - '="${CMAKE_CURRENT_SOURCE_DIR}/"') - cm_fh.write('{} {}\n'.format(ind, d)) - includes = scope.get_files('INCLUDEPATH') - if includes: - cm_fh.write('{} INCLUDE_DIRECTORIES\n'.format(ind)) - for i in includes: - i = i.rstrip('/') or ('/') - cm_fh.write('{} {}\n'.format(ind, i)) + write_defines(cm_fh, scope, 'DEFINES', indent=indent + 1) + + write_include_paths(cm_fh, scope, 'INCLUDE_DIRECTORIES', indent=indent + 1) write_library_section(cm_fh, scope, ['QMAKE_USE', 'LIBS'], @@ -1040,11 +1079,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, ['QT',], indent=indent, known_libraries=known_libraries) - compile_options = [d for d in scope.expand('QMAKE_CXXFLAGS') if not d.startswith('-D')] - if compile_options: - cm_fh.write('{} COMPILE_OPTIONS\n'.format(ind)) - for co in compile_options: - cm_fh.write('{} "{}"\n'.format(ind, co)) + write_compile_options(cm_fh, scope, 'COMPILE_OPTIONS', indent=indent + 1) link_options = scope.get('QMAKE_LFLAGS') if link_options: @@ -1482,6 +1517,43 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, known_libraries={'Qt::Core', }, extra_keys=['target.path', 'INSTALLS']) +def write_example(cm_fh: typing.IO[str], scope: Scope, + gui: bool = False, *, indent: int = 0) -> None: + binary_name = scope.TARGET + assert binary_name + +#find_package(Qt5 COMPONENTS Widgets REQUIRED) +#target_link_libraries(mimetypebrowser Qt::Widgets) + + cm_fh.write('cmake_minimum_required(VERSION 3.14)\n' + + 'project(mimetypebrowser LANGUAGES CXX)\n\n' + + 'set(CMAKE_INCLUDE_CURRENT_DIR ON)\n\n' + + 'set(CMAKE_AUTOMOC ON)\n' + + 'set(CMAKE_AUTORCC ON)\n' + + 'set(CMAKE_AUTOUIC ON)\n\n' + + 'set(INSTALL_EXAMPLEDIR "examples")\n\n') + + add_executable = 'add_executable({}'.format(binary_name); + if gui: + add_executable += ' WIN32_EXECUTABLE MACOSX_BUNDLE' + + write_all_source_file_lists(cm_fh, scope, add_executable, indent=0) + + cm_fh.write(')\n') + + write_include_paths(cm_fh, scope, 'target_include_directories({}'.format(binary_name), + indent=0, footer=')') + write_defines(cm_fh, scope, 'target_compile_definitions({}'.format(binary_name), + indent=0, footer=')') + write_compile_options(cm_fh, scope, 'target_compile_options({}'.format(binary_name), + indent=0, footer=')') + + cm_fh.write('\ninstall(TARGETS mimetypebrowser\n' + + ' RUNTIME_DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + + ' BUNDLE_DESTINATION "${INSTALL_EXAMPLESDIR}"\n' + + ')\n') + + def write_plugin(cm_fh, scope, *, indent: int = 0): plugin_name = scope.TARGET assert plugin_name @@ -1491,52 +1563,59 @@ def write_plugin(cm_fh, scope, *, indent: int = 0): def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, - indent: int = 0) -> None: + indent: int = 0, is_example: bool=False) -> None: assert scope.TEMPLATE in ('app', 'lib') is_lib = scope.TEMPLATE == 'lib' is_plugin = any('qt_plugin' == s for s in scope.get('_LOADED')) if is_lib or 'qt_module' in scope.get('_LOADED'): + assert not is_example write_module(cm_fh, scope, indent=indent) elif is_plugin: + assert not is_example write_plugin(cm_fh, scope, indent=indent) elif 'qt_tool' in scope.get('_LOADED'): + assert not is_example write_tool(cm_fh, scope, indent=indent) else: if 'testcase' in scope.get('CONFIG') \ or 'testlib' in scope.get('CONFIG'): + assert not is_example write_test(cm_fh, scope, indent=indent) else: gui = 'console' not in scope.get('CONFIG') - write_binary(cm_fh, scope, gui, indent=indent) + if is_example: + write_example(cm_fh, scope, gui, indent=indent) + else: + write_binary(cm_fh, scope, gui, indent=indent) ind = spaces(indent) write_source_file_list(cm_fh, scope, '', ['QMAKE_DOCS',], - indent, + indent + 1, header = '{}add_qt_docs(\n'.format(ind), footer = '{})\n'.format(ind)) def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, - indent: int = 0) -> None: + indent: int = 0, is_example: bool=False) -> None: template = scope.TEMPLATE if template == 'subdirs': - handle_subdir(scope, cm_fh, indent=indent) + handle_subdir(scope, cm_fh, indent=indent, is_example=is_example) elif template in ('app', 'lib'): - handle_app_or_lib(scope, cm_fh, indent=indent) + handle_app_or_lib(scope, cm_fh, indent=indent, is_example=is_example) else: print(' XXXX: {}: Template type {} not yet supported.' .format(scope.file, template)) -def generate_cmakelists(scope: Scope) -> None: +def generate_cmakelists(scope: Scope, *, is_example: bool=False) -> None: with open(scope.cMakeListsFile, 'w') as cm_fh: assert scope.file cm_fh.write('# Generated from {}.\n\n' .format(os.path.basename(scope.file))) - cmakeify_scope(scope, cm_fh) + cmakeify_scope(scope, cm_fh, is_example=is_example) def do_include(scope: Scope, *, debug: bool = False) -> None: @@ -1600,7 +1679,7 @@ def main() -> None: print(file_scope.dump()) print('\n#### End of full .pro/.pri file structure.\n') - generate_cmakelists(file_scope) + generate_cmakelists(file_scope, is_example=args.is_example) os.chdir(backup_current_dir) From ee3d9a8b67183f7ccaa7267e49d30bf9165f6168 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 8 May 2019 16:45:25 +0200 Subject: [PATCH 0496/1322] CMake: scripts: Fix mypy issues Change-Id: I706740be79eccd6bf08213fdaf747dde08cd053a Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 7 ++++--- util/cmake/pro2cmake.py | 23 ++++++++++++----------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 1873b5bfe0f..0aac634984b 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -30,8 +30,9 @@ import re import typing class LibraryMapping: - def __init__(self, soName: typing.Optional[str], - packageName: str, targetName: str, *, + def __init__(self, soName: str, + packageName: typing.Optional[str], + targetName: typing.Optional[str], *, resultVariable: typing.Optional[str] = None, extra: typing.List[str] = [], appendFoundSuffix: bool = True) -> None: @@ -42,7 +43,7 @@ class LibraryMapping: self.extra = extra self.targetName = targetName - def is_qt() -> bool: + def is_qt(self) -> bool: return self.packageName == 'Qt' \ or self.packageName == 'Qt5' \ or self.packageName == 'Qt6' diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 556bc59c2bd..6388afd9f0a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -332,7 +332,7 @@ class Scope(object): @property def scope_debug(self) -> bool: merge = self.get_string('PRO2CMAKE_SCOPE_DEBUG').lower() - return merge and (merge == '1' or merge == 'on' or merge == 'yes' or merge == 'true') + return merge == '1' or merge == 'on' or merge == 'yes' or merge == 'true' @property def parent(self) -> typing.Optional[Scope]: @@ -557,7 +557,7 @@ class Scope(object): def _map_files(self, files: typing.List[str], *, use_vpath: bool = True, is_include: bool = False) -> typing.List[str]: - expanded_files = [] # typing.List[str] + expanded_files = [] # type: typing.List[str] for f in files: r = self._expand_value(f) expanded_files += r @@ -814,13 +814,13 @@ def map_condition(condition: str) -> str: if (feature.group(1) == "qtHaveModule"): part = 'TARGET {}'.format(map_qt_library(feature.group(2))) else: - feature = featureName(feature.group(2)) - if feature.startswith('system_') and is_known_3rd_party_library(feature[7:]): + feature_name = featureName(feature.group(2)) + if feature_name.startswith('system_') and is_known_3rd_party_library(feature_name[7:]): part = 'ON' elif feature == 'dlopen': part = 'ON' else: - part = 'QT_FEATURE_' + feature + part = 'QT_FEATURE_' + feature_name else: part = map_platform(part) @@ -928,7 +928,7 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, dependencies: typing.List[str], *, indent: int = 0): - dependencies_to_print = [] + dependencies_to_print = [] # type: typing.List[str] is_framework = False for d in dependencies: @@ -1301,11 +1301,11 @@ def recursive_evaluate_scope(scope: Scope, parent_condition: str = '', return current_condition -def map_to_cmake_condition(condition: str) -> str: +def map_to_cmake_condition(condition: typing.Optional[str]) -> str: condition = re.sub(r'\bQT_ARCH___equals___([a-zA-Z_0-9]*)', - r'(TEST_architecture_arch STREQUAL "\1")', condition) + r'(TEST_architecture_arch STREQUAL "\1")', condition or '') condition = re.sub(r'\bQT_ARCH___contains___([a-zA-Z_0-9]*)', - r'(TEST_architecture_arch STREQUAL "\1")', condition) + r'(TEST_architecture_arch STREQUAL "\1")', condition or '') return condition @@ -1366,6 +1366,7 @@ def merge_scopes(scopes: typing.List[Scope]) -> typing.List[Scope]: known_scopes = {} # type: typing.Mapping[str, Scope] for scope in scopes: total_condition = scope.total_condition + assert total_condition if total_condition == 'OFF': # ignore this scope entirely! pass @@ -1669,14 +1670,14 @@ def main() -> None: if args.debug_pro_structure or args.debug: print('\n\n#### .pro/.pri file structure:') - print(file_scope.dump()) + file_scope.dump() print('\n#### End of .pro/.pri file structure.\n') do_include(file_scope, debug=debug_parsing) if args.debug_full_pro_structure or args.debug: print('\n\n#### Full .pro/.pri file structure:') - print(file_scope.dump()) + file_scope.dump() print('\n#### End of full .pro/.pri file structure.\n') generate_cmakelists(file_scope, is_example=args.is_example) From c4dd1a8fe3f412a1045e43d2e507351fc2d18fc4 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 8 May 2019 17:00:48 +0200 Subject: [PATCH 0497/1322] CMake: pro2cmake.py: Extract writing lists into cmake files Extract the actual functionality to write a list of "things" below headers and/or cmake parameter and followed by a footer. Reuse this functionality everywhere we write a list of things. Change-Id: Ia7647be465b4788a2b1e6a5dbede1ca868f24ae2 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 106 +++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 60 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 6388afd9f0a..0a9f32267db 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -903,27 +903,37 @@ def write_scope_header(cm_fh: typing.IO[str], *, indent: int = 0): '##########################\n'.format(spaces(indent))) +def write_list(cm_fh: typing.IO[str], entries: typing.List[str], + cmake_parameter: str, + indent: int = 0, *, + header: str = '', footer: str = ''): + if not entries: + return + + ind = spaces(indent) + extra_indent = '' + + if header: + cm_fh.write('{}{}'.format(ind, header)) + extra_indent += ' ' + if cmake_parameter: + cm_fh.write('{}{}{}\n'.format(ind, extra_indent, cmake_parameter)) + extra_indent += ' ' + for s in sort_sources(entries): + cm_fh.write('{}{}{}\n'.format(ind, extra_indent, s)) + if footer: + cm_fh.write('{}{}'.format(ind, footer)) + + def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, keys: typing.List[str], indent: int = 0, *, header: str = '', footer: str = ''): - ind = spaces(indent) - # collect sources sources: typing.List[str] = [] for key in keys: sources += scope.get_files(key, use_vpath=True) - if not sources: - return - - cm_fh.write(header) - extra_indent = '' - if cmake_parameter: - cm_fh.write('{}{}\n'.format(ind, cmake_parameter)) - extra_indent = ' ' - for s in sort_sources(sources): - cm_fh.write('{}{}{}\n'.format(ind, extra_indent, s)) - cm_fh.write(footer) + write_list(cm_fh, sources, cmake_parameter, indent, header=header, footer=footer) def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, @@ -949,11 +959,7 @@ def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, dependencies_to_print.append(d) is_framework = False - if dependencies_to_print: - ind = spaces(indent) - cm_fh.write('{} {}\n'.format(ind, cmake_keyword)) - for d in sorted(list(set(dependencies_to_print))): - cm_fh.write('{} {}\n'.format(ind, d)) + write_list(cm_fh, dependencies_to_print, cmake_keyword, indent + 1) def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, @@ -963,46 +969,28 @@ def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str indent) -def write_defines(cm_fh: typing.IO[str], scope: Scope, header: str, *, +def write_defines(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, indent: int = 0, footer: str = ''): - ind = spaces(indent) - defines = scope.expand('DEFINES') defines += [d[2:] for d in scope.expand('QMAKE_CXXFLAGS') if d.startswith('-D')] - if defines: - cm_fh.write('{}{}\n'.format(ind, header)) - for d in defines: - d = d.replace('=\\\\\\"$$PWD/\\\\\\"', - '="${CMAKE_CURRENT_SOURCE_DIR}/"') - cm_fh.write('{} {}\n'.format(ind, d)) - if footer: - cm_fh.write('{}{}\n'.format(ind, footer)) + defines = [d.replace('=\\\\\\"$$PWD/\\\\\\"', + '="${CMAKE_CURRENT_SOURCE_DIR}/"') for d in defines] -def write_include_paths(cm_fh: typing.IO[str], scope: Scope, header: str, *, + write_list(cm_fh, defines, cmake_parameter, indent) + + +def write_include_paths(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, indent: int = 0, footer: str = ''): - ind = spaces(indent) + includes = [i.rstrip('/') or ('/') for i in scope.get_files('INCLUDEPATH')] - includes = scope.get_files('INCLUDEPATH') - if includes: - cm_fh.write('{}{}\n'.format(ind, header)) - for i in includes: - i = i.rstrip('/') or ('/') - cm_fh.write('{} {}\n'.format(ind, i)) - if footer: - cm_fh.write('{}{}\n'.format(ind, footer)) + write_list(cm_fh, includes, cmake_parameter, indent) -def write_compile_options(cm_fh: typing.IO[str], scope: Scope, header: str, *, +def write_compile_options(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, indent: int = 0, footer: str = ''): - ind = spaces(indent) - compile_options = [d for d in scope.expand('QMAKE_CXXFLAGS') if not d.startswith('-D')] - if compile_options: - cm_fh.write('{}{}\n'.format(ind, header)) - for co in compile_options: - cm_fh.write('{} "{}"\n'.format(ind, co)) - if footer: - cm_fh.write('{}{}\n'.format(ind, footer)) + + write_list(cm_fh, compile_options, cmake_parameter, indent) def write_library_section(cm_fh: typing.IO[str], scope: Scope, @@ -1386,18 +1374,16 @@ def write_simd_part(cm_fh: typing.IO[str], target: str, scope: Scope, indent: in 'avx512vl', 'avx512ifma', 'avx512vbmi', 'f16c', 'rdrnd', 'neon', 'mips_dsp', 'mips_dspr2', 'arch_haswell', 'avx512common', 'avx512core']; - ind = spaces(indent) - for simd in simd_options: SIMD = simd.upper(); write_source_file_list(cm_fh, scope, 'SOURCES', - ['{}_HEADERS'.format(SIMD), - '{}_SOURCES'.format(SIMD), - '{}_C_SOURCES'.format(SIMD), - '{}_ASM'.format(SIMD)], - indent, - header = '{}add_qt_simd_part({} SIMD {}\n'.format(ind, target, simd), - footer = '{})\n\n'.format(ind)) + ['{}_HEADERS'.format(SIMD), + '{}_SOURCES'.format(SIMD), + '{}_C_SOURCES'.format(SIMD), + '{}_ASM'.format(SIMD)], + indent, + header = 'add_qt_simd_part({} SIMD {}\n'.format(target, simd), + footer = ')\n\n') def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, @@ -1594,9 +1580,9 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, ind = spaces(indent) write_source_file_list(cm_fh, scope, '', ['QMAKE_DOCS',], - indent + 1, - header = '{}add_qt_docs(\n'.format(ind), - footer = '{})\n'.format(ind)) + indent, + header = 'add_qt_docs(\n', + footer = ')\n') def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, From 80e0c615a9b8c7498ecdfda1de5b98410ecfd0e7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 9 May 2019 10:02:37 +0200 Subject: [PATCH 0498/1322] CMake: pro2cmake.py: Separate library extraction logic from writing out data Separate the logic to find all used libraries from the code that writes out the link_library information into the CMakeLists(.gen)?.txt files. This patch will remove some "PUBLIC_LIBRARIES Qt::Core" from generated files. This is due to us handling some Qt libraries in special ways in some of our add_qt_* helpers. These special libraries were added to the LIBRARIES section, but actually they should be added to the PUBLIC_LIBRARIES section instead. Do so now, so that the newly generated files do not break things again. Change-Id: I588781087a8aecc4d879e949735671d8085f0698 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 9 ++- util/cmake/pro2cmake.py | 129 ++++++++++++++++++++-------------------- 2 files changed, 70 insertions(+), 68 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index dc52c7d72b3..d9d01cd6481 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -994,7 +994,8 @@ function(add_qt_executable name) "${CMAKE_CURRENT_BINARY_DIR}" ${arg_INCLUDE_DIRECTORIES} DEFINES ${arg_DEFINES} - LIBRARIES ${arg_LIBRARIES} ${extra_libraries} + LIBRARIES ${arg_LIBRARIES} + PUBLIC_LIBRARIES ${extra_libraries} DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" DBUS_ADAPTOR_FLAGS "${arg_DBUS_ADAPTOR_FLAGS}" DBUS_INTERFACE_SOURCES "${arg_DBUS_INTERFACE_SOURCES}" @@ -1038,7 +1039,8 @@ function(add_qt_test name) $ "${arg_INCLUDE_DIRECTORIES}" DEFINES "${arg_DEFINES}" - LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test ${arg_LIBRARIES} + PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test + LIBRARIES ${arg_LIBRARIES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} @@ -1171,7 +1173,8 @@ function(add_qt_tool name) INCLUDE_DIRECTORIES ${arg_INCLUDE_DIRECTORIES} DEFINES ${arg_DEFINES} - LIBRARIES ${corelib} ${arg_LIBRARIES} + PUBLIC_LIBRARIES ${corelib} + LIBRARIES ${arg_LIBRARIES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0a9f32267db..47d1bbc4395 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -888,6 +888,63 @@ def sort_sources(sources: typing.List[str]) -> typing.List[str]: return lines +def _map_libraries_to_cmake(libraries: typing.List[str], + known_libraries: typing.Set[str]) -> typing.List[str]: + result = [] # type: typing.List[str] + is_framework = False + + for l in libraries: + if l == '-framework': + is_framework = True + continue + if is_framework: + l = '${FW%s}' % l + if l.startswith('-l'): + l = l[2:] + + if l.startswith('-'): + l = '# Remove: {}'.format(l[1:]) + else: + l = map_3rd_party_library(l) + + if not l or l in result or l in known_libraries: + continue + + result.append(l) + is_framework = False + + return result + + +def extract_cmake_libraries(scope: Scope, *, known_libraries: typing.Set[str]=set()) \ + -> typing.Tuple[typing.List[str], typing.List[str]]: + public_dependencies = [] # type: typing.List[str] + private_dependencies = [] # type: typing.List[str] + + for key in ['QMAKE_USE', 'LIBS',]: + public_dependencies += scope.expand(key) + for key in ['QMAKE_USE_PRIVATE', 'QMAKE_USE_FOR_PRIVATE', 'LIBS_PRIVATE',]: + private_dependencies += scope.expand(key) + + for key in ['QT_FOR_PRIVATE',]: + private_dependencies += [map_qt_library(q) for q in scope.expand(key)] + + for key in ['QT',]: + # Qt public libs: These may include FooPrivate in which case we get + # a private dependency on FooPrivate as well as a public dependency on Foo + for lib in scope.expand(key): + mapped_lib = map_qt_library(lib) + + if mapped_lib.endswith('Private'): + private_dependencies.append(mapped_lib) + public_dependencies.append(mapped_lib[:-7]) + else: + public_dependencies.append(mapped_lib) + + return (_map_libraries_to_cmake(public_dependencies, known_libraries), + _map_libraries_to_cmake(private_dependencies, known_libraries)) + + def write_header(cm_fh: typing.IO[str], name: str, typename: str, *, indent: int = 0): cm_fh.write('{}###########################################' @@ -936,32 +993,6 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, write_list(cm_fh, sources, cmake_parameter, indent, header=header, footer=footer) -def write_library_list(cm_fh: typing.IO[str], cmake_keyword: str, - dependencies: typing.List[str], *, indent: int = 0): - dependencies_to_print = [] # type: typing.List[str] - is_framework = False - - for d in dependencies: - if d == '-framework': - is_framework = True - continue - if is_framework: - d = '${FW%s}' % d - if d.startswith('-l'): - d = d[2:] - - if d.startswith('-'): - d = '# Remove: {}'.format(d[1:]) - else: - d = map_3rd_party_library(d) - if not d or d in dependencies_to_print: - continue - dependencies_to_print.append(d) - is_framework = False - - write_list(cm_fh, dependencies_to_print, cmake_keyword, indent + 1) - - def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, indent: int = 0, footer: str = ''): write_source_file_list(cm_fh, scope, header, @@ -993,40 +1024,13 @@ def write_compile_options(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: write_list(cm_fh, compile_options, cmake_parameter, indent) -def write_library_section(cm_fh: typing.IO[str], scope: Scope, - public: typing.List[str], - private: typing.List[str], - qt_private: typing.List[str], - qt_mixed: typing.List[str], *, - indent: int = 0, known_libraries=set()): - public_dependencies = [] # type: typing.List[str] - private_dependencies = [] # type: typing.List[str] +def write_library_section(cm_fh: typing.IO[str], scope: Scope, *, + indent: int = 0, known_libraries: typing.Set[str]=set()): + (public_dependencies, private_dependencies) \ + = extract_cmake_libraries(scope, known_libraries=known_libraries) - for key in public: - public_dependencies += [q for q in scope.expand(key) - if q not in known_libraries] - for key in private: - private_dependencies += [q for q in scope.expand(key) - if q not in known_libraries] - - for key in qt_private: - private_dependencies += [map_qt_library(q) for q in scope.expand(key) - if map_qt_library(q) not in known_libraries] - - for key in qt_mixed: - for lib in scope.expand(key): - mapped_lib = map_qt_library(lib) - if mapped_lib in known_libraries: - continue - - if mapped_lib.endswith('Private'): - private_dependencies.append(mapped_lib) - public_dependencies.append(mapped_lib[:-7]) - else: - public_dependencies.append(mapped_lib) - - write_library_list(cm_fh, 'LIBRARIES', private_dependencies, indent=indent) - write_library_list(cm_fh, 'PUBLIC_LIBRARIES', public_dependencies, indent=indent) + write_list(cm_fh, private_dependencies, 'LIBRARIES', indent + 1) + write_list(cm_fh, public_dependencies, 'PUBLIC_LIBRARIES', indent + 1) @@ -1060,12 +1064,7 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, write_include_paths(cm_fh, scope, 'INCLUDE_DIRECTORIES', indent=indent + 1) - write_library_section(cm_fh, scope, - ['QMAKE_USE', 'LIBS'], - ['QMAKE_USE_PRIVATE', 'QMAKE_USE_FOR_PRIVATE', 'LIBS_PRIVATE'], - ['QT_FOR_PRIVATE',], - ['QT',], - indent=indent, known_libraries=known_libraries) + write_library_section(cm_fh, scope, indent=indent, known_libraries=known_libraries) write_compile_options(cm_fh, scope, 'COMPILE_OPTIONS', indent=indent + 1) From 862ebbf7ea28b36521d46a5e466cc1310de800c7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 9 May 2019 10:51:27 +0200 Subject: [PATCH 0499/1322] CMake: scripts: Extract code to write find_package lines Extract code to write find_package lines from configurejson2cmake.py and move this over into helper.py. Change-Id: Iefd313b2a56cb78a99a7f3151c3f6c6284482f79 Reviewed-by: Alexandru Croitor --- util/cmake/configurejson2cmake.py | 28 +++------------------- util/cmake/helper.py | 39 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 8b9251f8a79..040e8ee7b43 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -33,7 +33,8 @@ import re import sys from typing import Set, Union, List, Dict -from helper import map_qt_library, featureName, map_platform, find_3rd_party_library_mapping +from helper import map_qt_library, featureName, map_platform, \ + find_3rd_party_library_mapping, generate_find_package_info knownTests = set() # type: Set[str] @@ -182,31 +183,8 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): cmake_find_packages_set.add(newlib.targetName) - isRequired = False + cm_fh.write(generate_find_package_info(newlib)) - extra = newlib.extra.copy() - - if extra: - if "REQUIRED" in extra: - isRequired = True - extra.remove("REQUIRED") - - cmake_target_name = newlib.targetName - - # _nolink or not does not matter at this point: - if cmake_target_name.endswith('_nolink') or cmake_target_name.endswith('/nolink'): - cmake_target_name = cmake_target_name[:-7] - - if cmake_target_name: - extra += ['PROVIDED_TARGETS', cmake_target_name] - - if extra: - cm_fh.write('qt_find_package({} {})\n'.format(newlib.packageName, ' '.join(extra))) - else: - cm_fh.write('qt_find_package({})\n'.format(newlib.packageName)) - - if isRequired: - cm_fh.write('set_package_properties({} PROPERTIES TYPE REQUIRED)\n'.format(newlib.packageName)) def lineify(label, value, quote=True): if value: diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 0aac634984b..17e25ca0b06 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -338,3 +338,42 @@ def map_3rd_party_library(lib: str) -> str: if not mapping or not mapping.targetName: return lib return mapping.targetName + libpostfix + + +def generate_find_package_info(lib: LibraryMapping, use_qt_find_package: bool=True, *, + indent: int = 0) -> str: + isRequired = False + + extra = lib.extra.copy() + + if "REQUIRED" in extra and use_qt_find_package: + isRequired = True + extra.remove("REQUIRED") + + cmake_target_name = lib.targetName + + # _nolink or not does not matter at this point: + if cmake_target_name.endswith('_nolink') or cmake_target_name.endswith('/nolink'): + cmake_target_name = cmake_target_name[:-7] + + if cmake_target_name and use_qt_find_package: + extra += ['PROVIDED_TARGETS', cmake_target_name] + + result = '' + ind = ' ' * indent + + if use_qt_find_package: + if extra: + result = '{}qt_find_package({} {})\n'.format(ind, lib.packageName, ' '.join(extra)) + else: + result = '{}qt_find_package({})\n'.format(ind, lib.packageName) + + if isRequired: + result += '{}set_package_properties({} PROPERTIES TYPE REQUIRED)\n'.format(ind, lib.packageName) + else: + if extra: + result = '{}find_package({} {})\n'.format(ind, lib.packageName, ' '.join(extra)) + else: + result = '{}find_package({})\n'.format(ind, lib.packageName) + + return result From bc4687f5bbf5c2662a0de1e7c033105969a8451f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 4 May 2019 13:08:19 +0200 Subject: [PATCH 0500/1322] Keep "special case" modifications when regenerating project files The pro2cmake.py file is now smarter, and can reapply "special case" modifications after regenerating a CMakeLists.txt file. This substantially lowers the maintenance burden when regenerating many files at once. See the special_case_helper.py file for details on how it works. Make sure to commit the generated .prev_CMakeLists.txt file alongside your CMakeLists.txt changes. To disable the preservation behavior, you can pass -s or --skip-special-case-preservation to the script. To keep around temporary files that are created during this process, you can pass -k or --keep-temporary-files. To get more debug output, pass --debug-special-case-preservation. Fixes: QTBUG-75619 Change-Id: I6d8ba52ac5feb5020f31d47841203104c2a061d8 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 51 ++++- util/cmake/special_case_helper.py | 347 ++++++++++++++++++++++++++++++ 2 files changed, 394 insertions(+), 4 deletions(-) create mode 100644 util/cmake/special_case_helper.py diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 47d1bbc4395..4701b096c10 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -45,6 +45,9 @@ import pyparsing as pp from helper import map_qt_library, map_3rd_party_library, is_known_3rd_party_library, \ featureName, map_platform +from shutil import copyfile +from special_case_helper import SpecialCaseHandler + def _parse_commandline(): parser = ArgumentParser(description='Generate CMakeLists.txt files from .' @@ -67,10 +70,21 @@ def _parse_commandline(): dest='debug_full_pro_structure', action='store_true', help='Dump the full structure of the qmake .pro-file ' '(with includes).') + parser.add_argument('--debug-special-case-preservation', + dest='debug_special_case_preservation', action='store_true', + help='Show all git commands and file copies.') parser.add_argument('--example', action='store_true', dest="is_example", help='Treat the input .pro file as an example.') + parser.add_argument('-s', '--skip-special-case-preservation', + dest='skip_special_case_preservation', action='store_true', + help='Skips behavior to reapply ' + 'special case modifications (requires git in PATH)') + parser.add_argument('-k', '--keep-temporary-files', + dest='keep_temporary_files', action='store_true', + help='Don\'t automatically remove CMakeLists.gen.txt and other ' + 'intermediate files.') parser.add_argument('files', metavar='<.pro/.pri file>', type=str, nargs='+', help='The .pro/.pri file to process') @@ -448,7 +462,12 @@ class Scope(object): return self._file or '' @property - def cMakeListsFile(self) -> str: + def generated_cmake_lists_path(self) -> str: + assert self.basedir + return os.path.join(self.basedir, 'CMakeLists.gen.txt') + + @property + def original_cmake_lists_path(self) -> str: assert self.basedir return os.path.join(self.basedir, 'CMakeLists.txt') @@ -1596,8 +1615,9 @@ def cmakeify_scope(scope: Scope, cm_fh: typing.IO[str], *, .format(scope.file, template)) -def generate_cmakelists(scope: Scope, *, is_example: bool=False) -> None: - with open(scope.cMakeListsFile, 'w') as cm_fh: +def generate_new_cmakelists(scope: Scope, *, is_example: bool=False) -> None: + print('Generating CMakeLists.gen.txt') + with open(scope.generated_cmake_lists_path, 'w') as cm_fh: assert scope.file cm_fh.write('# Generated from {}.\n\n' .format(os.path.basename(scope.file))) @@ -1626,6 +1646,14 @@ def do_include(scope: Scope, *, debug: bool = False) -> None: scope.merge(include_scope) +def copy_generated_file_to_final_location(scope: Scope, keep_temporary_files=False) -> None: + print('Copying {} to {}'.format(scope.generated_cmake_lists_path, + scope.original_cmake_lists_path)) + copyfile(scope.generated_cmake_lists_path, scope.original_cmake_lists_path) + if not keep_temporary_files: + os.remove(scope.generated_cmake_lists_path) + + def main() -> None: args = _parse_commandline() @@ -1665,7 +1693,22 @@ def main() -> None: file_scope.dump() print('\n#### End of full .pro/.pri file structure.\n') - generate_cmakelists(file_scope, is_example=args.is_example) + generate_new_cmakelists(file_scope, is_example=args.is_example) + + copy_generated_file = True + if not args.skip_special_case_preservation: + debug_special_case = args.debug_special_case_preservation or args.debug + handler = SpecialCaseHandler(file_scope.original_cmake_lists_path, + file_scope.generated_cmake_lists_path, + file_scope.basedir, + keep_temporary_files=args.keep_temporary_files, + debug=debug_special_case) + + copy_generated_file = handler.handle_special_cases() + + if copy_generated_file: + copy_generated_file_to_final_location(file_scope, + keep_temporary_files=args.keep_temporary_files) os.chdir(backup_current_dir) diff --git a/util/cmake/special_case_helper.py b/util/cmake/special_case_helper.py new file mode 100644 index 00000000000..8777b9c4db4 --- /dev/null +++ b/util/cmake/special_case_helper.py @@ -0,0 +1,347 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2019 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +""" +This is a helper script that takes care of reapplying special case +modifications when regenerating a CMakeLists.txt file using +pro2cmake.py. + +It has two modes of operation: +1) Dumb "special case" block removal and re-application. +2) Smart "special case" diff application, using a previously generated + "clean" CMakeLists.txt as a source. "clean" in this case means a + generated file which has no "special case" modifications. + +Both modes use a temporary git repository to compute and reapply +"special case" diffs. + +For the first mode to work, the developer has to mark changes +with "# special case" markers on every line they want to keep. Or +enclose blocks of code they want to keep between "# special case begin" +and "# special case end" markers. + +For example: + +SOURCES + foo.cpp + bar.cpp # special case + +SOURCES + foo1.cpp + foo2.cpp + # special case begin + foo3.cpp + foo4.cpp + # special case end + +The second mode, as mentioned, requires a previous "clean" +CMakeLists.txt file. + +The script can then compute the exact diff between +a "clean" and "modified" (with special cases) file, and reapply that +diff to a newly generated "CMakeLists.txt" file. + +This implies that we always have to keep a "clean" file alongside the +"modified" project file for each project (corelib, gui, etc.) So we +have to commit both files to the repository. + +If there is no such "clean" file, we can use the first operation mode +to generate one. After that, we only have to use the second operation +mode for the project file in question. + +When the script is used, the developer only has to take care of fixing +the newly generated "modified" file. The "clean" file is automatically +handled and git add'ed by the script, and will be committed together +with the "modified" file. + + +""" + +import re +import os +import subprocess +import filecmp + +from shutil import copyfile +from shutil import rmtree + + +def remove_special_cases(original: str) -> str: + # Remove content between the following markers + # '# special case begin' and '# special case end'. + # This also remove the markers. + replaced = re.sub(r'\n[^#\n]*?#[^\n]*?special case begin.*?#[^\n]*special case end[^\n]*?\n', + '\n', + original, + 0, + re.DOTALL) + + # Remove individual lines that have the "# special case" marker. + replaced = re.sub(r'\n.*#.*special case[^\n]*\n', '\n', replaced) + return replaced + + +def read_content_from_file(file_path: str) -> str: + with open(file_path, 'r') as file_fd: + content = file_fd.read() + return content + + +def write_content_to_file(file_path: str, content: str) -> None: + with open(file_path, 'w') as file_fd: + file_fd.write(content) + + +def resolve_simple_git_conflicts(file_path: str, debug=False) -> None: + content = read_content_from_file(file_path) + # If the conflict represents the addition of a new content hunk, + # keep the content and remove the conflict markers. + if debug: + print('Resolving simple conflicts automatically.') + replaced = re.sub(r'\n<<<<<<< HEAD\n=======(.+?)>>>>>>> master\n', r'\1', content, 0, re.DOTALL) + write_content_to_file(file_path, replaced) + + +def copyfile_log(src: str, dst: str, debug=False): + if debug: + print('Copying {} to {}.'.format(src, dst)) + copyfile(src, dst) + + +def check_if_git_in_path() -> bool: + for path in os.environ['PATH'].split(os.pathsep): + git_path = os.path.join(path, 'git') + if os.path.isfile(git_path) and os.access(git_path, os.X_OK): + return True + return False + + +def run_process_quiet(args_string: str, debug=False) -> None: + if debug: + print('Running command: "{}\"'.format(args_string)) + args_list = args_string.split() + subprocess.run(args_list, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + + +def does_file_have_conflict_markers(file_path: str, debug=False) -> bool: + if debug: + print('Checking if {} has no leftover conflict markers.'.format(file_path)) + content_actual = read_content_from_file(file_path) + if '<<<<<<< HEAD' in content_actual: + print('Conflict markers found in {}. ' + 'Please remove or solve them first.'.format(file_path)) + return True + return False + + +def create_file_with_no_special_cases(original_file_path: str, no_special_cases_file_path: str, debug=False): + """ + Reads content of original CMakeLists.txt, removes all content + between "# special case" markers or lines, saves the result into a + new file. + """ + content_actual = read_content_from_file(original_file_path) + if debug: + print('Removing special case blocks from {}.'.format(original_file_path)) + content_no_special_cases = remove_special_cases(content_actual) + + if debug: + print('Saving original contents of {} ' + 'with removed special case blocks to {}'.format(original_file_path, + no_special_cases_file_path)) + write_content_to_file(no_special_cases_file_path, content_no_special_cases) + + +class SpecialCaseHandler(object): + + def __init__(self, + original_file_path: str, + generated_file_path: str, + base_dir: str, + keep_temporary_files=False, + debug=False) -> None: + self.base_dir = base_dir + self.original_file_path = original_file_path + self.generated_file_path = generated_file_path + self.keep_temporary_files = keep_temporary_files + self.use_heuristic = False + self.debug = debug + + @property + def prev_file_path(self) -> str: + return os.path.join(self.base_dir, '.prev_CMakeLists.txt') + + @property + def post_merge_file_path(self) -> str: + return os.path.join(self.base_dir, 'CMakeLists-post-merge.txt') + + @property + def no_special_file_path(self) -> str: + return os.path.join(self.base_dir, 'CMakeLists.no-special.txt') + + def apply_git_merge_magic(self, no_special_cases_file_path: str) -> None: + # Create new folder for temporary repo, and ch dir into it. + repo = os.path.join(self.base_dir, 'tmp_repo') + repo_absolute_path = os.path.abspath(repo) + txt = 'CMakeLists.txt' + + try: + os.mkdir(repo) + current_dir = os.getcwd() + os.chdir(repo) + except Exception as e: + print('Failed to create temporary directory for temporary git repo. Exception: {}' + .format(e)) + raise e + + generated_file_path = os.path.join("..", self.generated_file_path) + original_file_path = os.path.join("..", self.original_file_path) + no_special_cases_file_path = os.path.join("..", no_special_cases_file_path) + post_merge_file_path = os.path.join("..", self.post_merge_file_path) + + try: + # Create new repo with the "clean" CMakeLists.txt file. + run_process_quiet('git init .', debug=self.debug) + copyfile_log(no_special_cases_file_path, txt, debug=self.debug) + run_process_quiet('git add {}'.format(txt), debug=self.debug) + run_process_quiet('git commit -m no_special', debug=self.debug) + + # Copy the original "modified" file (with the special cases) + # and make a new commit. + copyfile_log(original_file_path, txt, debug=self.debug) + run_process_quiet('git add {}'.format(txt), debug=self.debug) + run_process_quiet('git commit -m original', debug=self.debug) + + # Checkout the commit with "clean" file again, and create a + # new branch. + run_process_quiet('git checkout HEAD~', debug=self.debug) + run_process_quiet('git checkout -b newly_generated', debug=self.debug) + + # Copy the new "modified" file and make a commit. + copyfile_log(generated_file_path, txt, debug=self.debug) + run_process_quiet('git add {}'.format(txt), debug=self.debug) + run_process_quiet('git commit -m newly_generated', debug=self.debug) + + # Merge the "old" branch with modifications into the "new" + # branch with the newly generated file. + run_process_quiet('git merge master', debug=self.debug) + + # Resolve some simple conflicts (just remove the markers) + # for cases that don't need intervention. + resolve_simple_git_conflicts(txt, debug=self.debug) + + # Copy the resulting file from the merge. + copyfile_log(txt, post_merge_file_path) + except Exception as e: + print('Git merge conflict resolution process failed. Exception: {}'.format(e)) + raise e + finally: + # Remove the temporary repo. + try: + if not self.keep_temporary_files: + rmtree(repo_absolute_path) + except Exception as e: + print(e) + + os.chdir(current_dir) + + def save_next_clean_file(self): + files_are_equivalent = filecmp.cmp(self.generated_file_path, self.post_merge_file_path) + + if not files_are_equivalent: + # Before overriding the generated file with the post + # merge result, save the new "clean" file for future + # regenerations. + copyfile_log(self.generated_file_path, self.prev_file_path, debug=self.debug) + run_process_quiet("git add {}".format(self.prev_file_path), debug=self.debug) + + def handle_special_cases_helper(self) -> bool: + """ + Uses git to reapply special case modifications to the "new" + generated CMakeLists.gen.txt file. + + If use_heuristic is True, a new file is created from the + original file, with special cases removed. + + If use_heuristic is False, an existing "clean" file with no + special cases is used from a previous conversion. The "clean" + file is expected to be in the same folder as the original one. + """ + try: + if does_file_have_conflict_markers(self.original_file_path): + return False + + if self.use_heuristic: + create_file_with_no_special_cases(self.original_file_path, + self.no_special_file_path) + no_special_cases_file_path = self.no_special_file_path + else: + no_special_cases_file_path = self.prev_file_path + + if self.debug: + print('Using git to reapply special case modifications to newly generated {} ' + 'file'.format(self.generated_file_path)) + + self.apply_git_merge_magic(no_special_cases_file_path) + self.save_next_clean_file() + + copyfile_log(self.post_merge_file_path, self.generated_file_path) + if not self.keep_temporary_files: + os.remove(self.post_merge_file_path) + + print('Special case reapplication using git is complete. ' + 'Make sure to fix remaining conflict markers.') + + except Exception as e: + print('Error occurred while trying to reapply special case modifications: {}'.format(e)) + return False + finally: + if not self.keep_temporary_files and self.use_heuristic: + os.remove(self.no_special_file_path) + + return True + + def handle_special_cases(self) -> bool: + original_file_exists = os.path.isfile(self.original_file_path) + prev_file_exists = os.path.isfile(self.prev_file_path) + self.use_heuristic = not prev_file_exists + + git_available = check_if_git_in_path() + keep_special_cases = original_file_exists and git_available + + if not git_available: + print('You need to have git in PATH in order to reapply the special ' + 'case modifications.') + + copy_generated_file = True + + if keep_special_cases: + copy_generated_file = self.handle_special_cases_helper() + + return copy_generated_file From 35ed41e547421f6594f76576c5074b1fe18e37d7 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 9 May 2019 10:59:13 +0200 Subject: [PATCH 0501/1322] CMake: pro2cmake.py: Generate find_package information into examples Change-Id: I6dab13ebea4386019f14be5f29a143d194268aac Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 16 ++++++++++++++++ util/cmake/pro2cmake.py | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 10 deletions(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 17e25ca0b06..0520e4fdb2b 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -261,6 +261,22 @@ def find_qt_library_mapping(soName: str) -> typing.Optional[LibraryMapping]: return None +def find_library_info_for_target(targetName: str) -> typing.Optional[LibraryMapping]: + qt_target = targetName + if targetName.endswith('Private'): + qt_target = qt_target[:-7] + + for i in _qt_library_map: + if i.targetName == qt_target: + return i + + for i in _library_map: + if i.targetName == targetName: + return i + + return None + + def featureName(input: str) -> str: return re.sub(r'[^a-zA-Z0-9_]', '_', input) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 4701b096c10..fec76f286cc 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -43,7 +43,7 @@ from sympy.logic import (simplify_logic, And, Or, Not,) import pyparsing as pp from helper import map_qt_library, map_3rd_party_library, is_known_3rd_party_library, \ - featureName, map_platform + featureName, map_platform, find_library_info_for_target, generate_find_package_info from shutil import copyfile from special_case_helper import SpecialCaseHandler @@ -74,7 +74,7 @@ def _parse_commandline(): dest='debug_special_case_preservation', action='store_true', help='Show all git commands and file copies.') - parser.add_argument('--example', action='store_true', + parser.add_argument('--is-example', action='store_true', dest="is_example", help='Treat the input .pro file as an example.') parser.add_argument('-s', '--skip-special-case-preservation', @@ -1522,25 +1522,45 @@ def write_binary(cm_fh: typing.IO[str], scope: Scope, known_libraries={'Qt::Core', }, extra_keys=['target.path', 'INSTALLS']) +def write_find_package_section(cm_fh: typing.IO[str], + public_libs: typing.List[str], + private_libs: typing.List[str], *, indent: int=0): + packages = [] # type: typing.List[LibraryMapping] + all_libs = public_libs + private_libs + + for l in all_libs: + info = find_library_info_for_target(l) + if info and info not in packages: + packages.append(info) + + ind = spaces(indent) + + for p in packages: + cm_fh.write(generate_find_package_info(p, use_qt_find_package=False, indent=indent)) + + if packages: + cm_fh.write('\n') + + def write_example(cm_fh: typing.IO[str], scope: Scope, gui: bool = False, *, indent: int = 0) -> None: binary_name = scope.TARGET assert binary_name -#find_package(Qt5 COMPONENTS Widgets REQUIRED) -#target_link_libraries(mimetypebrowser Qt::Widgets) - cm_fh.write('cmake_minimum_required(VERSION 3.14)\n' + - 'project(mimetypebrowser LANGUAGES CXX)\n\n' + + 'project({} LANGUAGES CXX)\n\n'.format(binary_name) + 'set(CMAKE_INCLUDE_CURRENT_DIR ON)\n\n' + 'set(CMAKE_AUTOMOC ON)\n' + 'set(CMAKE_AUTORCC ON)\n' + 'set(CMAKE_AUTOUIC ON)\n\n' + 'set(INSTALL_EXAMPLEDIR "examples")\n\n') + (public_libs, private_libs) = extract_cmake_libraries(scope) + write_find_package_section(cm_fh, public_libs, private_libs, indent=indent) + add_executable = 'add_executable({}'.format(binary_name); if gui: - add_executable += ' WIN32_EXECUTABLE MACOSX_BUNDLE' + add_executable += ' WIN32 MACOSX_BUNDLE' write_all_source_file_lists(cm_fh, scope, add_executable, indent=0) @@ -1553,9 +1573,9 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, write_compile_options(cm_fh, scope, 'target_compile_options({}'.format(binary_name), indent=0, footer=')') - cm_fh.write('\ninstall(TARGETS mimetypebrowser\n' + - ' RUNTIME_DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + - ' BUNDLE_DESTINATION "${INSTALL_EXAMPLESDIR}"\n' + + cm_fh.write('\ninstall(TARGETS {}\n'.format(binary_name) + + ' RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + + ' BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + ')\n') From e9085f4162ec172b9a5a5e3f9148e058fe1787cb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 9 May 2019 11:07:02 +0200 Subject: [PATCH 0502/1322] CMake: pro2cmake.py: Add target_link_libraries to examples Change-Id: Ic7054f0c88e228496b7f4855bffa5620ed717f9b Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fec76f286cc..0851181a25f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1570,6 +1570,10 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, indent=0, footer=')') write_defines(cm_fh, scope, 'target_compile_definitions({}'.format(binary_name), indent=0, footer=')') + write_list(cm_fh, private_libs, '', indent=indent, + header='target_link_libraries({} PRIVATE\n'.format(binary_name), footer=')') + write_list(cm_fh, public_libs, '', indent=indent, + header='target_link_libraries({} PUBLIC\n'.format(binary_name), footer=')') write_compile_options(cm_fh, scope, 'target_compile_options({}'.format(binary_name), indent=0, footer=')') From 263af45b4cf5c0f44e2920a6bd144983e421af92 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 25 Apr 2019 11:44:20 +0200 Subject: [PATCH 0503/1322] Move build and test instructions from coin to qtbase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That way we can update instructions without waiting for Coin update. The patch contains invalid test instructions, but as cmake port is not yet able to run tests it should not matter. Change-Id: I86088aefec49ded60af00243b0b8c60c8f16147a Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 coin/module_config.yaml diff --git a/coin/module_config.yaml b/coin/module_config.yaml new file mode 100644 index 00000000000..041209b2fd2 --- /dev/null +++ b/coin/module_config.yaml @@ -0,0 +1,56 @@ +version: 1 +accept_configuration: + condition: property + property: host.os + equals_property: target.os +build_instructions: + - type: MakeDirectory + directory: .git + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: cmake {{.Env.CONFIGURE_ARGS}} + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + - type: ExecuteCommand + command: make DESTDIR={{.InstallRoot}} -j {{.NumCPU}} install + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call make install. Contact Liang then. + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: ExecuteCommand + command: jom DESTDIR={{.InstallRoot}} -j {{.NumCPU}} install + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call nmake install. Contact Liang then. + disable_if: + condition: property + property: host.os + not_equals_value: Windows + - type: SignPackage + disable_if: + condition: property + property: host.os + not_equals_value: Windows + directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + - type: UploadArtifact + archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + transferType: UploadModuleBuildArtifact + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 +test_instructions: + - type: ExecuteCommand + command: echo "hello world - test" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call echo. Contact Liang then. From 400f94109dfb0b8fc28ee1e852b59891d3084624 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 8 May 2019 14:33:58 +0200 Subject: [PATCH 0504/1322] CMake: Wrap DBus1 find_package call to fix xproto not being picked up DBus1 (1.12) configuration file breaks PKG_CONFIG environment variables and will thus prevent other libraries to be picked up by pkgconfig. Main sympthom is that xproto is not getting picked up anymore, which results in hundreds of lines of warnings about this being printed. Work around that by wrapping the call to find_package(DBus1) and restoring the environment. Change-Id: Ia69f10b014dddc32045b40972500a843e5d29b38 Reviewed-by: Alexandru Croitor --- cmake/FindWrapDBus1.cmake | 10 ++++++++++ configure.cmake | 2 +- util/cmake/helper.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 cmake/FindWrapDBus1.cmake diff --git a/cmake/FindWrapDBus1.cmake b/cmake/FindWrapDBus1.cmake new file mode 100644 index 00000000000..3e0a31592c4 --- /dev/null +++ b/cmake/FindWrapDBus1.cmake @@ -0,0 +1,10 @@ +# DBus1 is buggy and breaks PKG_CONFIG environment. +# Work around that:-/ + +set(__qt_dbus_pcd $ENV{PKG_CONFIG_DIR}) +set(__qt_dbus_pcp $ENV{PKG_CONFIG_PATH}) +set(__qt_dbus_pcl $ENV{PKG_CONFIG_LIBDIR}) +find_package(DBus1) +set(ENV{PKG_CONFIG_DIR} ${__qt_dbus_pcd}) +set(ENV{PKG_CONFIG_PATH} ${__qt_dbus_pcp}) +set(ENV{PKG_CONFIG_LIBDIR} ${__qt_dbus_pcl}) diff --git a/configure.cmake b/configure.cmake index 92e4198adde..957d7fb13b0 100644 --- a/configure.cmake +++ b/configure.cmake @@ -9,7 +9,7 @@ qt_find_package(ZLIB PROVIDED_TARGETS ZLIB::ZLIB) set_package_properties(ZLIB PROPERTIES TYPE REQUIRED) qt_find_package(ZSTD PROVIDED_TARGETS ZSTD::ZSTD) -qt_find_package(DBus1 PROVIDED_TARGETS dbus-1) +qt_find_package(WrapDBus1 PROVIDED_TARGETS dbus-1) qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 0520e4fdb2b..99d9242eba9 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -177,7 +177,7 @@ _library_map = [ LibraryMapping('atspi', 'ATSPI2', 'PkgConfig::ATSPI2'), LibraryMapping('corewlan', None, None), LibraryMapping('cups', 'Cups', 'Cups::Cups'), - LibraryMapping('dbus', 'DBus1', 'dbus-1'), + LibraryMapping('dbus', 'WrapDBus1', 'dbus-1', resultVariable="DBus1"), LibraryMapping('doubleconversion', None, None), LibraryMapping('drm', 'Libdrm', 'Libdrm::Libdrm'), LibraryMapping('egl', 'EGL', 'EGL::EGL'), From 6396d46f554e6eab2ba7f212bd7447961cd4c286 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 10 May 2019 17:50:51 +0200 Subject: [PATCH 0505/1322] cmake: Correct way to save/restore env vars for pkgconfig it is different if they are not defined vs an empty string Change-Id: Ifb05db5dab32a699aafa32d91f9719eab78dee44 Reviewed-by: Alexandru Croitor --- cmake/FindWrapDBus1.cmake | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/cmake/FindWrapDBus1.cmake b/cmake/FindWrapDBus1.cmake index 3e0a31592c4..42349a8b1ae 100644 --- a/cmake/FindWrapDBus1.cmake +++ b/cmake/FindWrapDBus1.cmake @@ -1,10 +1,31 @@ # DBus1 is buggy and breaks PKG_CONFIG environment. # Work around that:-/ +# See https://gitlab.freedesktop.org/dbus/dbus/issues/267 for more information + +if(DEFINED ENV{PKG_CONFIG_DIR}) + set(__qt_dbus_pcd "$ENV{PKG_CONFIG_DIR}") +endif() +if(DEFINED ENV{PKG_CONFIG_PATH}) + set(__qt_dbus_pcp "$ENV{PKG_CONFIG_PATH}") +endif() +if(DEFINED ENV{PKG_CONFIG_LIBDIR}) + set(__qt_dbus_pcl "$ENV{PKG_CONFIG_LIBDIR}") +endif() -set(__qt_dbus_pcd $ENV{PKG_CONFIG_DIR}) -set(__qt_dbus_pcp $ENV{PKG_CONFIG_PATH}) -set(__qt_dbus_pcl $ENV{PKG_CONFIG_LIBDIR}) find_package(DBus1) -set(ENV{PKG_CONFIG_DIR} ${__qt_dbus_pcd}) -set(ENV{PKG_CONFIG_PATH} ${__qt_dbus_pcp}) -set(ENV{PKG_CONFIG_LIBDIR} ${__qt_dbus_pcl}) + +if(DEFINED __qt_dbus_pcd) + set(ENV{PKG_CONFIG_DIR} "${__qt_dbus_pcd}") +else() + unset(ENV{PKG_CONFIG_DIR}) +endif() +if(DEFINED __qt_dbus_pcp) + set(ENV{PKG_CONFIG_PATH} "${__qt_dbus_pcp}") +else() + unset(ENV{PKG_CONFIG_PATH}) +endif() +if(DEFINED __qt_dbus_pcl) + set(ENV{PKG_CONFIG_LIBDIR} "${__qt_dbus_pcl}") +else() + unset(ENV{PKG_CONFIG_LIBDIR}) +endif() From 02a015375a639a4d27d19bbf435f20b725696768 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 8 May 2019 14:45:41 +0200 Subject: [PATCH 0506/1322] Implement developer / non-prefix builds A non-prefix build is a build where you don't have to run make install. To do a non-prefix build, pass -DFEATURE_developer_build=ON when invoking CMake on qtbase. Note that this of course also enables developer build features (private tests, etc). When doing a non-prefix build, the CMAKE_INSTALL_PREFIX cache variable will point to the qtbase build directory. Tests can be run without installing Qt (QPA plugins are picked up from the build dir). This patch stops installation of any files by forcing the make "install" target be a no-op. When invoking cmake on the qtsvg module (or any other module), the CMAKE_INSTALL_PREFIX variable should be set to the qtbase build directory. The developer-build feature is propagated via the QtCore Config file, so that when building other modules, you don't have to specify it on the command line again. As a result of the change, all libraries, plugins, tools, include dirs, CMake Config files, CMake Targets files, Macro files, etc, will be placed in the qtbase build directory, mimicking the file layout of an installed Qt file layout. Only examples and tests are kept in the separate module build directories, which is equivalent to how qmake does it. The following global variables contain paths for the appropriate prefix or non prefix builds: QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR, QT_CONFIG_INSTALL_DIR. These should be used by developers when deciding where files should be placed. All usages of install() are replaced by qt_install(), which has some additional logic on how to handle associationg of CMake targets to export names. When installing files, some consideration should be taken if qt_copy_or_install() needs to be used instead of qt_install(), which takes care of copying files from the source dir to the build dir when doing non-prefix builds. Tested with qtbase and qtsvg, developer builds, non-developer builds and static developer builds on Windows, Linux and macOS. Task-number: QTBUG-75581 Change-Id: I0ed27fb6467662dd24fb23aee6b95dd2c9c4061f Reviewed-by: Kevin Funk Reviewed-by: Tobias Hunger --- cmake/QtBaseGlobalTargets.cmake | 92 ++++--- cmake/QtBuild.cmake | 430 ++++++++++++++++++++++++-------- cmake/QtFeature.cmake | 28 ++- cmake/QtModuleConfig.cmake.in | 4 + cmake/QtPostProcess.cmake | 30 ++- cmake/QtSetup.cmake | 17 ++ qmake/CMakeLists.txt | 9 +- src/gui/CMakeLists.txt | 13 +- 8 files changed, 453 insertions(+), 170 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index af320a05b34..e7c8e2f0e82 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -9,41 +9,47 @@ target_include_directories(Platform $ ) target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS}) -set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}") + +set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}") +qt_path_join(__GlobalConfig_build_dir ${QT_CONFIG_BUILD_DIR} ${__GlobalConfig_path_suffix}) +qt_path_join(__GlobalConfig_install_dir ${QT_CONFIG_INSTALL_DIR} ${__GlobalConfig_path_suffix}) # Generate and install Qt5 config file. configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" - INSTALL_DESTINATION "${config_install_dir}" + "${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" + INSTALL_DESTINATION "${__GlobalConfig_install_dir}" ) + write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake + ${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake" - DESTINATION "${config_install_dir}" - COMPONENT Devel -) # Generate and install Qt5Tools config file. configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtToolsConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfig.cmake" - INSTALL_DESTINATION "${config_install_dir}" + "${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ToolsConfig.cmake" + INSTALL_DESTINATION "${__GlobalConfig_install_dir}" ) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfigVersion.cmake + ${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ToolsConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfig.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}ToolsConfigVersion.cmake" - DESTINATION "${config_install_dir}Tools" + +qt_install(FILES + "${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}Config.cmake" + "${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ConfigVersion.cmake" + DESTINATION "${__GlobalConfig_install_dir}" + COMPONENT Devel +) + +qt_install(FILES + "${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ToolsConfig.cmake" + "${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}ToolsConfigVersion.cmake" + DESTINATION "${__GlobalConfig_install_dir}Tools" COMPONENT Devel ) @@ -62,7 +68,7 @@ qt_feature_module_begin(LIBRARY Core PRIVATE_FILE src/corelib/global/qconfig_p.h ) include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") -qt_feature_module_end(GlobalConfig) +qt_feature_module_end(GlobalConfig OUT_VAR_PREFIX "__GlobalConfig_") add_library(Qt::GlobalConfig ALIAS GlobalConfig) @@ -76,38 +82,42 @@ target_include_directories(GlobalConfigPrivate INTERFACE ) add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) -install(TARGETS Platform GlobalConfig GlobalConfigPrivate EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") -install(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION "${config_install_dir}") -export(EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets") +set(__export_targets Platform GlobalConfig GlobalConfigPrivate) +set(__export_name "${INSTALL_CMAKE_NAMESPACE}Targets") +qt_install(TARGETS ${__export_targets} EXPORT "${__export_name}") +qt_install(EXPORT ${__export_name} + NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: + DESTINATION "${__GlobalConfig_install_dir}") -qt_internal_export_modern_cmake_config_targets_file(TARGETS Platform GlobalConfig GlobalConfigPrivate +qt_internal_export_modern_cmake_config_targets_file(TARGETS ${__export_targets} EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE} - CONFIG_INSTALL_DIR ${config_install_dir}) + CONFIG_INSTALL_DIR + ${__GlobalConfig_install_dir}) ## Install some QtBase specific CMake files: -install(FILES - cmake/QtBuild.cmake - cmake/QtCompilerFlags.cmake - cmake/QtCompilerOptimization.cmake - cmake/QtFeature.cmake - cmake/QtPlatformSupport.cmake - cmake/QtPostProcess.cmake - cmake/QtSetup.cmake - cmake/QtModuleConfig.cmake.in - cmake/QtModuleDependencies.cmake.in - cmake/QtModuleToolsDependencies.cmake.in - cmake/QtModuleToolsConfig.cmake.in - DESTINATION "${config_install_dir}" +qt_copy_or_install(FILES + cmake/QtBuild.cmake + cmake/QtCompilerFlags.cmake + cmake/QtCompilerOptimization.cmake + cmake/QtFeature.cmake + cmake/QtPlatformSupport.cmake + cmake/QtPostProcess.cmake + cmake/QtSetup.cmake + cmake/QtModuleConfig.cmake.in + cmake/QtModuleDependencies.cmake.in + cmake/QtModuleToolsDependencies.cmake.in + cmake/QtModuleToolsConfig.cmake.in + DESTINATION "${__GlobalConfig_install_dir}" ) + + # TODO: Check whether this is the right place to install these -install(DIRECTORY cmake/3rdparty - DESTINATION "${config_install_dir}" -) +qt_copy_or_install(DIRECTORY cmake/3rdparty DESTINATION "${__GlobalConfig_install_dir}") # Install our custom Find modules, which will be used by the find_dependency() calls # inside the generated ModuleDependencies cmake files. -install(DIRECTORY cmake/ - DESTINATION "${config_install_dir}" +qt_copy_or_install(DIRECTORY cmake/ + DESTINATION "${__GlobalConfig_install_dir}" FILES_MATCHING PATTERN "Find*.cmake" PATTERN "tests" EXCLUDE PATTERN "3rdparty" EXCLUDE diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index d9d01cd6481..87a48b0aca7 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -130,12 +130,155 @@ else() set(QT_PATH_SEPARATOR ":") endif() +# Compute the values of QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR, QT_CONFIG_INSTALL_DIR +# taking into account whether the current build is a prefix build or a non-prefix build. +# +# These values should be prepended to file paths in commands or properties, +# in order to correctly place generated Config files, generated Targets files, +# excutables / libraries, when copying / installing files, etc. +# +# The build dir variables will always be absolute paths. +# The QT_INSTALL_DIR variable will have a relative path in a prefix build, +# which means that it can be empty, so use qt_join_path to prevent accidental absolute paths. +if(QT_WILL_INSTALL) + # In the usual prefix build case, the build dir is the current module build dir, + # and the install dir is the prefix, so we don't set it. + set(QT_BUILD_DIR "${CMAKE_BINARY_DIR}") + set(QT_INSTALL_DIR "") +else() + # When doing a non-prefix build, both the build dir and install dir are the same, + # pointing to the qtbase build dir. + set(QT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}") + set(QT_INSTALL_DIR "${QT_BUILD_DIR}") +endif() +set(__config_path_part "${INSTALL_LIBDIR}/cmake") +set(QT_CONFIG_BUILD_DIR "${QT_BUILD_DIR}/${__config_path_part}") +set(QT_CONFIG_INSTALL_DIR "${QT_INSTALL_DIR}") +if(QT_CONFIG_INSTALL_DIR) + string(APPEND QT_CONFIG_INSTALL_DIR "/") +endif() +string(APPEND QT_CONFIG_INSTALL_DIR ${__config_path_part}) +unset(__config_path_part) # Functions and macros: +# Wraps install() command. In a prefix build, simply passes along arguments to install(). +# In a non-prefix build, handles association of targets to export names, and also calls export(). +function(qt_install) + set(flags) + set(options EXPORT DESTINATION NAMESPACE) + set(multiopts TARGETS) + cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) + + if(arg_TARGETS) + set(is_install_targets TRUE) + endif() + + # In a prefix build, always invoke install() without modification. + # In a non-prefix build, pass install(TARGETS) commands to allow + # association of targets to export names, so we can later use the export names + # in export() commands. + if(QT_WILL_INSTALL OR is_install_targets) + install(${ARGV}) + endif() + + # Exit early if this is a prefix build. + if(QT_WILL_INSTALL) + return() + endif() + + # In a non-prefix build, when install(EXPORT) is called, + # also call export(EXPORT) to generate build tree target files. + if(NOT is_install_targets AND arg_EXPORT) + set(namespace_option "") + if(arg_NAMESPACE) + set(namespace_option NAMESPACE ${arg_NAMESPACE}) + endif() + export(EXPORT ${arg_EXPORT} + ${namespace_option} + FILE "${arg_DESTINATION}/${arg_EXPORT}.cmake") + endif() +endfunction() + +# Copies files using file(COPY) signature in non-prefix builds. +function(qt_non_prefix_copy) + if(NOT QT_WILL_INSTALL) + file(${ARGV}) + endif() +endfunction() + +# Use case is installing files in a prefix build, or copying them to the correct build dir +# in a non-prefix build. +# Pass along arguments as you would pass them to install(). +# Only supports FILES, PROGRAMS and DIRECTORY signature, and without fancy things +# like OPTIONAL or RENAME or COMPONENT. +function(qt_copy_or_install) + set(flags FILES PROGRAMS DIRECTORY) + set(options) + set(multiopts) + cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) + + # Remember which option has to be passed to the install command. + set(argv_copy ${ARGV}) + if(arg_FILES) + set(install_option "FILES") + elseif(arg_PROGRAMS) + set(install_option "PROGRAMS") + elseif(arg_DIRECTORY) + set(install_option "DIRECTORY") + endif() + + list(REMOVE_AT argv_copy 0) + qt_install(${install_option} ${argv_copy}) + qt_non_prefix_copy(COPY ${argv_copy}) +endfunction() + +# Hacky way to remove the install target in non-prefix builds. +# We need to associate targets with export names, and that is only possible to do with the +# install(TARGETS) command. But in a non-prefix build, we don't want to install anything. +# To make sure that developers don't accidentally run make install, replace the generated +# cmake_install.cmake file with an empty file. To do this, always create a new temporary file +# at CMake configuration step, and use it as an input to a custom command that replaces the +# cmake_install.cmake file with an empty one. This means we will always replace the file on +# every reconfiguration, but not when doing null builds. +function(remove_install_target) + set(file_in "${CMAKE_BINARY_DIR}/.remove_cmake_install_in.txt") + set(file_generated "${CMAKE_BINARY_DIR}/.remove_cmake_install_generated.txt") + set(cmake_install_file "${CMAKE_BINARY_DIR}/cmake_install.cmake") + file(WRITE ${file_in} "") + + add_custom_command(OUTPUT ${file_generated} + COMMAND ${CMAKE_COMMAND} -E copy ${file_in} ${file_generated} + COMMAND ${CMAKE_COMMAND} -E remove ${cmake_install_file} + COMMAND ${CMAKE_COMMAND} -E touch ${cmake_install_file} + COMMENT "Removing cmake_install.cmake" + MAIN_DEPENDENCY ${file_in}) + + add_custom_target(remove_cmake_install ALL DEPENDS ${file_generated}) +endfunction() + +function(qt_set_up_developer_build) + if(NOT QT_WILL_INSTALL) + remove_install_target() + endif() +endfunction() + +# Takes a list of path components and joins them into one path separated by forward slashes "/", +# and saves the path in out_var. +function(qt_path_join out_var) + # Remove output variable. + set(argv ${ARGV}) + list(REMOVE_AT argv 0) + + # Join the path components. + string(JOIN "/" path ${argv}) + set(${out_var} ${path} PARENT_SCOPE) +endfunction() + function(qt_internal_export_modern_cmake_config_targets_file) cmake_parse_arguments(__arg "" "EXPORT_NAME_PREFIX;CONFIG_INSTALL_DIR" "TARGETS" ${ARGN}) + set(export_name "${__arg_EXPORT_NAME_PREFIX}VersionlessTargets") foreach(target ${__arg_TARGETS}) if (TARGET "${target}Versionless") continue() @@ -144,10 +287,9 @@ function(qt_internal_export_modern_cmake_config_targets_file) add_library("${target}Versionless" INTERFACE) target_link_libraries("${target}Versionless" INTERFACE "${target}") set_target_properties("${target}Versionless" PROPERTIES EXPORT_NAME "${target}") - install(TARGETS "${target}Versionless" EXPORT "${__arg_EXPORT_NAME_PREFIX}VersionlessTargets") + qt_install(TARGETS "${target}Versionless" EXPORT ${export_name}) endforeach() - - install(EXPORT "${__arg_EXPORT_NAME_PREFIX}VersionlessTargets" NAMESPACE Qt:: DESTINATION "${__arg_CONFIG_INSTALL_DIR}") + qt_install(EXPORT ${export_name} NAMESPACE Qt:: DESTINATION "${__arg_CONFIG_INSTALL_DIR}") endfunction() # Print all variables defined in the current scope. @@ -196,7 +338,7 @@ macro(assert) endmacro() -function(qt_create_nolink_target target export_target) +function(qt_create_nolink_target target dependee_target) if(NOT TARGET "${target}") message(FATAL_ERROR "${target} does not exist when trying to build a nolink target.") endif() @@ -231,8 +373,11 @@ function(qt_create_nolink_target target export_target) $ INTERFACE_COMPILE_FEATURES $) - install(TARGETS ${nolink_target} EXPORT ${export_target}) + add_library(${prefixed_nolink_target} ALIAS ${nolink_target}) + + set(export_name "${INSTALL_CMAKE_NAMESPACE}${dependee_target}Targets") + qt_install(TARGETS ${nolink_target} EXPORT ${export_name}) endif() endfunction() @@ -257,7 +402,10 @@ function(qt_ensure_sync_qt) if(EXISTS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl") set(QT_SYNCQT "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" CACHE FILEPATH "syncqt script") message(STATUS "Using source syncqt found at: ${QT_SYNCQT}") - install(PROGRAMS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" DESTINATION "${INSTALL_LIBEXECDIR}") + + qt_path_join(syncqt_install_dir ${QT_INSTALL_DIR} ${INSTALL_LIBEXECDIR}) + qt_copy_or_install(PROGRAMS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" + DESTINATION "${syncqt_install_dir}") else() get_filename_component(syncqt_absolute_path "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBEXECDIR}/syncqt.pl" @@ -374,7 +522,7 @@ function(qt_internal_module_info result target) string(TOLOWER "${target}" lower) set("${result}_upper" "${upper}" PARENT_SCOPE) set("${result}_lower" "${lower}" PARENT_SCOPE) - set("${result}_include_dir" "${PROJECT_BINARY_DIR}/include/${module}" PARENT_SCOPE) + set("${result}_include_dir" "${QT_BUILD_DIR}/include/${module}" PARENT_SCOPE) endfunction() @@ -449,8 +597,7 @@ function(extend_target target) foreach(lib ${arg_PUBLIC_LIBRARIES} ${arg_LIBRARIES}) string(REGEX REPLACE "_nolink$" "" base_lib "${lib}") if(NOT base_lib STREQUAL lib) - set(export_target "${INSTALL_CMAKE_NAMESPACE}${target}Targets") - qt_create_nolink_target("${base_lib}" ${export_target}) + qt_create_nolink_target("${base_lib}" ${target}) endif() endforeach() @@ -504,7 +651,7 @@ function(qt_internal_library_deprecation_level result) endfunction() -function(qt_install_injections module) +function(qt_install_injections module build_dir install_dir) set(injections ${ARGN}) # examples: # SYNCQT.INJECTIONS = src/corelib/global/qconfig.h:qconfig.h:QtConfig src/corelib/global/qconfig_p.h:5.12.0/QtCore/private/qconfig_p.h @@ -519,10 +666,46 @@ function(qt_install_injections module) set(fwd_hdrs ${injection}) get_filename_component(destinationdir ${destination} DIRECTORY) get_filename_component(destinationname ${destination} NAME) - install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir} RENAME ${destinationname} OPTIONAL) + get_filename_component(original_file_name ${file} NAME) + + # Generate lower case forwarding header located in include/${module}, + # which points to the injected (generated) file, for example qconfig.h. + set(lower_case_forwarding_header_path "${build_dir}/${INSTALL_INCLUDEDIR}/${module}") + if(destinationdir) + string(APPEND lower_case_forwarding_header_path "/${destinationdir}") + endif() + + file(RELATIVE_PATH relpath + "${lower_case_forwarding_header_path}" + "${build_dir}/${file}") + set(main_contents "#include \"${relpath}\"") + file(GENERATE OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" + CONTENT "${main_contents}") + + # Copy the actual injected (generated) header file (not the just created forwarding one) + # to its install location. + qt_path_join(install_destination + ${install_dir} ${INSTALL_INCLUDEDIR} ${module} ${destinationdir}) + qt_install(FILES ${build_dir}/${file} + DESTINATION ${install_destination} + RENAME ${destinationname} OPTIONAL) + + # Generate upper case forwarding headers. foreach(fwd_hdr ${fwd_hdrs}) - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" CONTENT "#include \"${destinationname}\"\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${fwd_hdr}" DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${destinationdir} OPTIONAL) + set(upper_case_forwarding_header_path "${INSTALL_INCLUDEDIR}/${module}") + if(destinationdir) + string(APPEND upper_case_forwarding_header_path "/${destinationdir}") + endif() + + # Generate upper case forwarding header like QVulkanFunctions or QtConfig. + file(GENERATE OUTPUT "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}" + CONTENT "#include \"${destinationname}\"\n") + + # Install the forwarding header. + qt_path_join(install_destination + ${install_dir} ${upper_case_forwarding_header_path}) + qt_install(FILES "${build_dir}/${upper_case_forwarding_header_path}/${fwd_hdr}" + DESTINATION ${install_destination} OPTIONAL) endforeach() endforeach() endfunction() @@ -617,8 +800,11 @@ function(add_qt_module target) if(${arg_NO_MODULE_HEADERS}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) else() + # Use QT_BUILD_DIR for the syncqt call. + # So we either write the generated files into the qtbase non-prefix build root, or the + # module specific build root. qt_ensure_sync_qt() - execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}") + execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${QT_BUILD_DIR}" "${PROJECT_SOURCE_DIR}") set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) @@ -627,12 +813,12 @@ function(add_qt_module target) set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_include_dir}/${module}Depends") set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") - qt_install_injections("${module}" ${module_headers_injections}) endif() set_target_properties("${target}" PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_LIBDIR}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" + LIBRARY_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}" + RUNTIME_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}" + ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}" VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}") @@ -704,18 +890,27 @@ function(add_qt_module target) qt_internal_add_linker_version_script("${target}") endif() - install(TARGETS "${target}" "${target_private}" EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" - LIBRARY DESTINATION ${INSTALL_LIBDIR} - ARCHIVE DESTINATION ${INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} - PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/private - ) - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") - install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${config_install_dir}) + # Handle injections. Aka create forwarding headers for certain headers that have been + # automatically generated in the build dir (for example qconfig.h, qtcore-config.h, + # qvulkanfunctions.h, etc) + # module_headers_injections come from the qt_read_headers_pri() call. + # extra_library_injections come from the qt_feature_module_end() call. + set(final_injections "") + if(module_headers_injections) + string(APPEND final_injections "${module_headers_injections} ") + endif() + if(extra_library_injections) + string(APPEND final_injections "${extra_library_injections} ") + endif() - qt_internal_export_modern_cmake_config_targets_file(TARGETS "${target}" "${target_private}" - EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} - CONFIG_INSTALL_DIR "${config_install_dir}") + if(final_injections) + qt_install_injections("${module}" "${QT_BUILD_DIR}" "${QT_INSTALL_DIR}" ${final_injections}) + endif() + + # Handle creation of cmake files for consumers of find_package(). + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) set(extra_cmake_files) set(extra_cmake_includes) @@ -725,12 +920,58 @@ function(add_qt_module target) endif() if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake.in") configure_file("${CMAKE_CURRENT_LIST_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake" @ONLY) - list(APPEND extra_cmake_files "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") + list(APPEND extra_cmake_files "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") endif() + set(extra_cmake_code "") + + # Propagate developer builds to other modules via QtCore module. + if(FEATURE_developer_build AND target STREQUAL Core) + string(APPEND extra_cmake_code " +set(FEATURE_developer_build ON CACHE BOOL \"Developer build.\" FORCE)") + endif() + + configure_package_config_file( + "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + INSTALL_DESTINATION "${config_install_dir}" + ) + write_basic_package_version_file( + ${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" + ${extra_cmake_files} + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + qt_non_prefix_copy(COPY ${extra_cmake_files} DESTINATION "${config_install_dir}") + + set(exported_targets ${target} ${target_private}) + set(export_name "${INSTALL_CMAKE_NAMESPACE}${target}Targets") + qt_install(TARGETS ${exported_targets} + EXPORT ${export_name} + LIBRARY DESTINATION ${INSTALL_LIBDIR} + ARCHIVE DESTINATION ${INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} + PRIVATE_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/private + ) + qt_install(EXPORT ${export_name} + NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: + DESTINATION ${config_install_dir}) + + qt_internal_export_modern_cmake_config_targets_file( + TARGETS ${exported_targets} + EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} + CONFIG_INSTALL_DIR "${config_install_dir}") + ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. qt_internal_add_link_flags_no_undefined("${target}") @@ -775,25 +1016,6 @@ function(add_qt_module target) set_target_properties("${target}" PROPERTIES _qt_target_deps "${target_deps}") - configure_package_config_file( - "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" - INSTALL_DESTINATION "${config_install_dir}" - ) - write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake - VERSION ${PROJECT_VERSION} - COMPATIBILITY AnyNewerVersion - ) - - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" - ${extra_cmake_files} - DESTINATION "${config_install_dir}" - COMPONENT Devel - ) - if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) endif() @@ -810,7 +1032,10 @@ function(qt_export_tools module_name) # The tools target name. For example: CoreTools set(target "${module_name}Tools") - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") + + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) # Add the extra cmake statements to make the tool targets global, so it doesn't matter where # find_package is called. @@ -832,25 +1057,27 @@ endif() configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleToolsConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" INSTALL_DESTINATION "${config_install_dir}" ) write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" DESTINATION "${config_install_dir}" COMPONENT Devel ) - install(EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets" - NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" - DESTINATION "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") + set(export_name "${INSTALL_CMAKE_NAMESPACE}${target}Targets") + qt_install(EXPORT "${export_name}" + NAMESPACE "${QT_CMAKE_EXPORT_NAMESPACE}::" + DESTINATION "${config_install_dir}") + qt_internal_export_modern_cmake_config_targets_file(TARGETS ${QT_KNOWN_MODULE_${module_name}_TOOLS} EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} @@ -878,8 +1105,10 @@ function(add_qt_plugin target) "TYPE;OUTPUT_DIRECTORY;INSTALL_DIRECTORY;ARCHIVE_INSTALL_DIRECTORY" "${__default_private_args};${__default_public_args}" ${ARGN}) + set(output_directory_default "${QT_BUILD_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") + qt_internal_check_directory_or_type(OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" "${arg_TYPE}" - "${CMAKE_BINARY_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}" output_directory) + "${output_directory_default}" output_directory) qt_internal_check_directory_or_type(INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}" "${arg_TYPE}" "${INSTALL_PLUGINSDIR}/${arg_TYPE}" install_directory) qt_internal_check_directory_or_type(ARCHIVE_INSTALL_DIRECTORY @@ -946,10 +1175,14 @@ function(add_qt_plugin target) MOC_OPTIONS ${arg_MOC_OPTIONS} ) - install(TARGETS "${target}" EXPORT "${target}Targets" - LIBRARY DESTINATION "${install_directory}" - ARCHIVE DESTINATION "${archive_install_directory}") - install(EXPORT "${target}Targets" NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: DESTINATION ${INSTALL_LIBDIR}/cmake) + set(export_name "${target}Targets") + qt_install(TARGETS "${target}" + EXPORT ${export_name} + LIBRARY DESTINATION "${install_directory}" + ARCHIVE DESTINATION "${archive_install_directory}") + qt_install(EXPORT ${export_name} + NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: + DESTINATION ${QT_CONFIG_INSTALL_DIR}) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. @@ -1017,7 +1250,7 @@ function(add_qt_executable name) endif() if(NOT arg_NO_INSTALL) - install(TARGETS "${name}" + qt_install(TARGETS "${name}" RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}" BUNDLE DESTINATION "${arg_INSTALL_DIRECTORY}") endif() @@ -1165,7 +1398,7 @@ function(add_qt_tool name) set(no_install NO_INSTALL) endif() - add_qt_executable("${name}" OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}" + add_qt_executable("${name}" OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}" ${bootstrap} ${no_qt} ${no_install} @@ -1189,9 +1422,9 @@ function(add_qt_tool name) # Also append the tool to the module list. qt_internal_append_known_module_tool("${arg_TOOLS_TARGET}" "${name}") - install(TARGETS "${name}" - EXPORT "Qt${PROJECT_VERSION_MAJOR}${arg_TOOLS_TARGET}ToolsTargets" - DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) + qt_install(TARGETS "${name}" + EXPORT "${INSTALL_CMAKE_NAMESPACE}${arg_TOOLS_TARGET}ToolsTargets" + DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS}) endif() endfunction() @@ -1304,7 +1537,7 @@ function(add_qt_simd_part target) target_link_libraries("${target}" PRIVATE "${name}") if(NOT BUILD_SHARED_LIBS) - install( + qt_install( TARGETS ${name} EXPORT "${INSTALL_CMAKE_NAMESPACE}Targets" ) @@ -1420,32 +1653,23 @@ function(qt_create_qdbusxml2cpp_command target infile) target_sources("${target}" PRIVATE "${header_file}" "${source_file}") endfunction() - -function(qt_generate_forwarding_headers target) - qt_parse_all_arguments(arg "qt_generate_forwarding_headers" - "PRIVATE" "SOURCE;DESTINATION" "CLASSES" ${ARGN}) +function(qt_compute_injection_forwarding_header target) + qt_parse_all_arguments(arg "qt_compute_injection_forwarding_header" + "PRIVATE" "SOURCE;OUT_VAR" "" ${ARGN}) qt_internal_module_info(module "${target}") + get_filename_component(file_name "${arg_SOURCE}" NAME) - if (NOT arg_DESTINATION) - get_filename_component(arg_DESTINATION "${arg_SOURCE}" NAME) - endif() + set(source_absolute_path "${CMAKE_CURRENT_BINARY_DIR}/${arg_SOURCE}") + file(RELATIVE_PATH relpath "${CMAKE_BINARY_DIR}" "${source_absolute_path}") if (arg_PRIVATE) - set(main_fwd "${module_include_dir}/${PROJECT_VERSION}/${module}/private/${arg_DESTINATION}") + set(fwd "${PROJECT_VERSION}/${module}/private/${file_name}") else() - set(main_fwd "${module_include_dir}/${arg_DESTINATION}") + set(fwd "${file_name}") endif() - get_filename_component(main_fwd_dir "${main_fwd}" DIRECTORY) - file(RELATIVE_PATH relpath "${main_fwd_dir}" "${CMAKE_CURRENT_BINARY_DIR}/${arg_SOURCE}") - set(main_contents "#include \"${relpath}\"") - file(GENERATE OUTPUT "${main_fwd}" CONTENT "${main_contents}") - - foreach(class_fwd ${arg_CLASSES}) - set(class_fwd_contents "#include \"${fwd_hdr}\"") - message("Generating forwarding header: ${class_fwd} -> ${relpath}.") - file(GENERATE OUTPUT "${module_include_dir}/${class_fwd}" CONTENT "${class_fwd_contents}") - endforeach() + string(APPEND ${arg_OUT_VAR} " ${relpath}:${fwd}") + set(${arg_OUT_VAR} ${${arg_OUT_VAR}} PARENT_SCOPE) endfunction() @@ -1541,24 +1765,23 @@ function(qt_install_static_target_export target) qt_parse_all_arguments(arg "qt_install_3rdparty_config_files" "" "EXPORT" "" ${ARGN}) # TODO mark EXPORT as required - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${arg_EXPORT}") - set_target_properties(${target} PROPERTIES INTERFACE_QT_EXPORTED_LIBRARY 1) - install( + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${arg_EXPORT}) + + set(export_name "${arg_EXPORT}Targets") + qt_install( TARGETS ${target} - EXPORT ${arg_EXPORT}Targets + EXPORT ${export_name} LIBRARY DESTINATION ${INSTALL_LIBDIR} ARCHIVE DESTINATION ${INSTALL_LIBDIR}) - install( - EXPORT ${arg_EXPORT}Targets + qt_install( + EXPORT ${export_name} DESTINATION "${config_install_dir}" ) - - export(EXPORT ${arg_EXPORT}Targets) endfunction() # Create a set of ${target}Config.cmake and ${target}Version.cmake for a @@ -1576,22 +1799,25 @@ function(qt_install_3rdparty_config_files target) list(APPEND 3RDPARTY_ADDITIONAL_SETUP_CODE "find_package(${package})\n") endforeach() - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${arg_EXPORT}") + set(path_suffix "${arg_EXPORT}") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/3rdpartyConfig.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake" + "${config_build_dir}/${target}Config.cmake" INSTALL_DESTINATION "${config_install_dir}" ) write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake" + "${config_build_dir}/${target}ConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${target}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${target}ConfigVersion.cmake" + qt_install(FILES + "${config_build_dir}/${target}Config.cmake" + "${config_build_dir}/${target}ConfigVersion.cmake" ${arg_ADDITIONAL_FILES} DESTINATION "${config_install_dir}" COMPONENT Devel diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 2166ac69ff6..50c672d08cb 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -337,7 +337,19 @@ function(qt_internal_feature_write_file file features extra) file(GENERATE OUTPUT "${file}" CONTENT "${contents}") endfunction() -function(qt_feature_module_end target) +function(qt_feature_module_end) + set(flags) + set(options OUT_VAR_PREFIX) + set(multiopts) + cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) + set(target ${arg_UNPARSED_ARGUMENTS}) + + # The value of OUT_VAR_PREFIX is used as a prefix for output variables that should be + # set in the parent scope. + if(NOT arg_OUT_VAR_PREFIX) + set(arg_OUT_VAR_PREFIX "") + endif() + set(all_features ${__QtFeature_public_features} ${__QtFeature_private_features} ${__QtFeature_internal_features}) list(REMOVE_DUPLICATES all_features) @@ -378,12 +390,22 @@ function(qt_feature_module_end target) qt_internal_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_private_file}" "${__QtFeature_private_features}" "${__QtFeature_private_extra}" ) - qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_private_file}" PRIVATE) qt_internal_feature_write_file("${CMAKE_CURRENT_BINARY_DIR}/${__QtFeature_public_file}" "${__QtFeature_public_features}" "${__QtFeature_public_extra}" ) - qt_generate_forwarding_headers("${__QtFeature_library}" SOURCE "${__QtFeature_public_file}") + + # Extra header injections which have to have forwarding headers created by + # qt_install_injections. + set(injections "") + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_public_file}" + OUT_VAR injections) + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_private_file}" PRIVATE + OUT_VAR injections) + + set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) if (NOT ("${target}" STREQUAL "NO_MODULE")) get_target_property(targetType "${target}" TYPE) diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 7baea8cf9cf..6a68fdf3b0f 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -5,6 +5,10 @@ include(CMakeFindDependencyMacro) get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_import_prefix "${_import_prefix}" REALPATH) +# Extra cmake code begin +@extra_cmake_code@ +# Extra cmake code end + # Find required dependencies, if any. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index fe6d70985bd..43a66170334 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -1,6 +1,6 @@ function(qt_internal_write_depends_file target) set(module Qt${target}) - set(outfile "${PROJECT_BINARY_DIR}/include/${module}/${module}Depends") + set(outfile "${QT_BUILD_DIR}/include/${module}/${module}Depends") message("Generate ${outfile}...") set(contents "/* This file was generated by cmake with the info from ${module} target. */\n") string(APPEND contents "#ifdef __cplusplus /* create empty PCH in C mode */\n") @@ -121,39 +121,43 @@ function(qt_internal_create_depends_files) qt_internal_write_depends_file("${target}" ${qtdeps}) endif() - if(third_party_deps OR main_module_tool_deps OR target_deps) + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + # Configure and install ModuleDependencies file. configure_file( "${QT_CMAKE_DIR}/QtModuleDependencies.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" @ONLY ) - set(config_install_dir "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}") - - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" DESTINATION "${config_install_dir}" COMPONENT Devel ) + endif() if(tool_deps) + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}Tools") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + # Configure and install ModuleToolDependencies file. configure_file( "${QT_CMAKE_DIR}/QtModuleToolsDependencies.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" @ONLY ) - set(config_install_dir - "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}${target}Tools") - - install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" DESTINATION "${config_install_dir}" COMPONENT Devel ) + endif() endforeach() diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 7285c0c5163..187f1bf740e 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -34,6 +34,20 @@ set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) +if(FEATURE_developer_build) + set(QT_WILL_INSTALL OFF) + # Handle non-prefix builds by setting the cmake install prefix to the project binary dir. + if(PROJECT_NAME STREQUAL "QtBase") + set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH + "Install path prefix, prepended onto install directories." FORCE) + else() + # No-op. While building another module, the CMAKE_INSTALL_PREFIX should be set on the + # command line to point to the qtbase build dir. + endif() +else() + set(QT_WILL_INSTALL ON) +endif() + ## Enable testing: include(CTest) enable_testing() @@ -53,6 +67,9 @@ include(QtCompilerOptimization) ## Compiler flags: include(QtCompilerFlags) +## Set up developer build: +qt_set_up_developer_build() + ## Find host tools (if non native): set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.") diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 49d622a5fe6..a1e7625650b 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,7 +1,12 @@ # Generated from qmake.pro. -# special case: -install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${INSTALL_DATADIR}) +# special case begin +set(path_component "${INSTALL_DATADIR}") +qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${path_component}) + +qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" + DESTINATION ${mkspecs_install_dir}) +# special case end find_library(FWApplicationServices ApplicationServices) # special case find_library(FWCoreServices CoreServices) # special case diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 126ca109c98..15878a863b4 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -611,14 +611,6 @@ if (QT_FEATURE_vulkan) COMMENT "Generating vulkan data" ) - qt_generate_forwarding_headers("Gui" SOURCE "vulkan/${vulkan_fun}" - DESTINATION "qvulkanfunctions.h" - CLASSES QVulkanFunctions QVulkanDeviceFunctions - ) - qt_generate_forwarding_headers("Gui" SOURCE "vulkan/${vulkan_fun_p}" - DESTINATION "qvulkanfunctions_p.h" PRIVATE - ) - extend_target(Gui CONDITION QT_FEATURE_vulkan SOURCES "${CMAKE_CURRENT_BINARY_DIR}/vulkan/${vulkan_fun}" @@ -645,7 +637,10 @@ extend_target(Gui CONDITION WASM # a qpa header is #include , both of them implying # linkage against Qt::GuiPrivate. qt_read_headers_pri("Gui" "module_headers") -install(FILES ${module_headers_qpa} + +# No need to copy these in a non-prefix build, syncqt.pl takes care of generating the files +# in the build dir. +qt_install(FILES ${module_headers_qpa} DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) # special case end From c097256ee4b207284148a8026bb29fc4453efeae Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 15 May 2019 11:30:57 +0200 Subject: [PATCH 0507/1322] Encapsulate commands for building other repos into two macros Currently to build qtsvg we have some copy-pasted code to set up the paths for QtSetup and QtPostProcess to be found. To make it cleaner, introduce two new macros called qt_build_repo_begin and qt_build_repo_end(). The first one should be called in a child repo like qtsvg, right after a find_package(Qt5) call, and the second one at the end of the repo top-level CMakeLists.txt file. In order for the macros to work, extract some of the variables which were set in Qt5Config into Qt5CoreConfig instead. This makes sure that it works also for find_package(Qt5Core) calls. Task-number: QTBUG-75580 Change-Id: I85267c6bd86f9291ec2e170fddab1006ab684b5c Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 15 +++++++++++++-- cmake/QtConfig.cmake.in | 3 --- src/corelib/Qt5CoreMacros.cmake | 23 +++++++++++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 87a48b0aca7..bfbd0f69e4d 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -928,10 +928,21 @@ function(add_qt_module target) set(extra_cmake_code "") - # Propagate developer builds to other modules via QtCore module. - if(FEATURE_developer_build AND target STREQUAL Core) + if(target STREQUAL Core) + # Propagate common variables via QtCore package. + string(APPEND extra_cmake_code "set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})") string(APPEND extra_cmake_code " +option(BUILD_SHARED_LIBS \"Build Qt statically or dynamically\" ${BUILD_SHARED_LIBS})") + string(APPEND extra_cmake_code " +set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") + string(APPEND extra_cmake_code " +set(_qt_core_cmake_dir \${CMAKE_CURRENT_LIST_DIR})") + + # Propagate developer builds to other modules via QtCore package. + if(FEATURE_developer_build) + string(APPEND extra_cmake_code " set(FEATURE_developer_build ON CACHE BOOL \"Developer build.\" FORCE)") + endif() endif() configure_package_config_file( diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index 73871747e08..df6068f9a37 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -36,9 +36,6 @@ foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) endif() endforeach() -set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) -set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@) - if (_Qt_NOTFOUND_MESSAGE) set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}") set(@INSTALL_CMAKE_NAMESPACE@_FOUND False) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index bae1518375b..feab963a801 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -38,6 +38,29 @@ include(CMakeParseArguments) +macro(qt_build_repo_begin) + # Set up the paths for the modules. + set(QT_CMAKE_MODULE_PATH "${_qt_core_cmake_dir}/../${QT_CMAKE_EXPORT_NAMESPACE}") + list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH}) + + # Qt specific setup common for all modules: + include(QtSetup) + include(FeatureSummary) +endmacro() + +macro(qt_build_repo_end) + # Delayed actions on some of the Qt targets: + include(QtPostProcess) + + # Print a feature summary: + feature_summary(WHAT PACKAGES_FOUND + REQUIRED_PACKAGES_NOT_FOUND + RECOMMENDED_PACKAGES_NOT_FOUND + OPTIONAL_PACKAGES_NOT_FOUND + RUNTIME_PACKAGES_NOT_FOUND + FATAL_ON_MISSING_REQUIRED_PACKAGES) +endmacro() + # macro used to create the names of output files preserving relative dirs macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile ) string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) From 9542e78525b422159406d8fa63e30dcd0f926411 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 15 May 2019 13:57:15 +0200 Subject: [PATCH 0508/1322] Use the qt_build_repo() macros for building qtbase as well To implement this, create a new Qt5BuildInternals package. All child Qt modules like qtsvg should use find_package(Qt5BuildInternals) or find_package(Qt5 COMPONENTS BuildInternals) in the their top level CMakeLists.txt. This will make the qt_build_repo() macros available. For qtbase we slightly cheat, and specify a CMAKE_PREFIX_PATH pointing to the source folder that contains the BuildInternals package. For the other modules we actually use a configured and installed package Config file. This change moves variables that used to be written into the QtCore Config file into the BuildInternals package. This way things that are relevant only for building additional Qt modules does not pollute the QtCore package. Task-number: QTBUG-75580 Change-Id: I5479adff2f7903c9c2862d28c05c7f485ce3e4eb Reviewed-by: Simon Hausmann --- CMakeLists.txt | 21 ++++------ cmake/QtBaseGlobalTargets.cmake | 18 +++++++++ cmake/QtBuild.cmake | 23 ++--------- .../QtBuildInternalsConfig.cmake | 40 +++++++++++++++++++ cmake/QtModuleConfig.cmake.in | 4 -- cmake/QtPostProcess.cmake | 27 +++++++++++++ src/corelib/Qt5CoreMacros.cmake | 23 ----------- 7 files changed, 96 insertions(+), 60 deletions(-) create mode 100644 cmake/QtBuildInternals/QtBuildInternalsConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index ecc88a27e36..f0a8ef2a969 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,11 +14,13 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin" ) -## Qt specific setup common for all modules: -include(QtSetup) +## Find the build internals package. +list(APPEND CMAKE_PREFIX_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" +) +find_package(QtBuildInternals) -## Enable feature summary at the end of the configure run: -include(FeatureSummary) +qt_build_repo_begin(SKIP_CMAKE_MODULE_PATH_ADDITION) ## QtBase specific configure tests: include(QtBaseConfigureTests) @@ -52,13 +54,4 @@ if (BUILD_EXAMPLES) add_subdirectory(examples) endif() -## Delayed actions on some of the Qt targets: -include(QtPostProcess) - -## Print a feature summary: -feature_summary(WHAT PACKAGES_FOUND - REQUIRED_PACKAGES_NOT_FOUND - RECOMMENDED_PACKAGES_NOT_FOUND - OPTIONAL_PACKAGES_NOT_FOUND - RUNTIME_PACKAGES_NOT_FOUND - FATAL_ON_MISSING_REQUIRED_PACKAGES) +qt_build_repo_end() diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index e7c8e2f0e82..7bb4795d353 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -122,3 +122,21 @@ qt_copy_or_install(DIRECTORY cmake/ PATTERN "tests" EXCLUDE PATTERN "3rdparty" EXCLUDE ) + +# Configure and install the QtBuildInternals package. +set(__build_internals_path_suffix "${INSTALL_CMAKE_NAMESPACE}BuildInternals") +qt_path_join(__build_internals_build_dir ${QT_CONFIG_BUILD_DIR} ${__build_internals_path_suffix}) +qt_path_join(__build_internals_install_dir ${QT_CONFIG_INSTALL_DIR} + ${__build_internals_path_suffix}) +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake" + "${__build_internals_build_dir}/${INSTALL_CMAKE_NAMESPACE}BuildInternalsConfig.cmake" + @ONLY + ) + +qt_install(FILES + "${__build_internals_build_dir}/${INSTALL_CMAKE_NAMESPACE}BuildInternalsConfig.cmake" + "${__build_internals_build_dir}/QtBuildInternalsExtra.cmake" + DESTINATION "${__build_internals_install_dir}" + COMPONENT Devel +) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index bfbd0f69e4d..cc5b9e63e15 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -160,6 +160,10 @@ endif() string(APPEND QT_CONFIG_INSTALL_DIR ${__config_path_part}) unset(__config_path_part) +# This is used to hold extra cmake code that should be put into QtBuildInternalsExtra.cmake file +# at the QtPostProcess stage. +set(QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE "") + # Functions and macros: # Wraps install() command. In a prefix build, simply passes along arguments to install(). @@ -926,25 +930,6 @@ function(add_qt_module target) list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") endif() - set(extra_cmake_code "") - - if(target STREQUAL Core) - # Propagate common variables via QtCore package. - string(APPEND extra_cmake_code "set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})") - string(APPEND extra_cmake_code " -option(BUILD_SHARED_LIBS \"Build Qt statically or dynamically\" ${BUILD_SHARED_LIBS})") - string(APPEND extra_cmake_code " -set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") - string(APPEND extra_cmake_code " -set(_qt_core_cmake_dir \${CMAKE_CURRENT_LIST_DIR})") - - # Propagate developer builds to other modules via QtCore package. - if(FEATURE_developer_build) - string(APPEND extra_cmake_code " -set(FEATURE_developer_build ON CACHE BOOL \"Developer build.\" FORCE)") - endif() - endif() - configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake new file mode 100644 index 00000000000..a3b7bddb1af --- /dev/null +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -0,0 +1,40 @@ +if (CMAKE_VERSION VERSION_LESS 3.1.0) + message(FATAL_ERROR "Qt requires at least CMake version 3.1.0") +endif() + +###################################### +# +# Macros for building Qt modules +# +###################################### + +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake") + include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake) +endif() + +macro(qt_build_repo_begin) + if(${ARGC} EQUAL 1 AND "${ARGV0}" STREQUAL "SKIP_CMAKE_MODULE_PATH_ADDITION") + # No-op. + else() + # Set up the paths for the modules. + set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}") + list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH}) + endif() + + # Qt specific setup common for all modules: + include(QtSetup) + include(FeatureSummary) +endmacro() + +macro(qt_build_repo_end) + # Delayed actions on some of the Qt targets: + include(QtPostProcess) + + # Print a feature summary: + feature_summary(WHAT PACKAGES_FOUND + REQUIRED_PACKAGES_NOT_FOUND + RECOMMENDED_PACKAGES_NOT_FOUND + OPTIONAL_PACKAGES_NOT_FOUND + RUNTIME_PACKAGES_NOT_FOUND + FATAL_ON_MISSING_REQUIRED_PACKAGES) +endmacro() diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 6a68fdf3b0f..7baea8cf9cf 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -5,10 +5,6 @@ include(CMakeFindDependencyMacro) get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_import_prefix "${_import_prefix}" REALPATH) -# Extra cmake code begin -@extra_cmake_code@ -# Extra cmake code end - # Find required dependencies, if any. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 43a66170334..d900f8e88f5 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -164,4 +164,31 @@ function(qt_internal_create_depends_files) endfunction() +function(qt_generate_build_internals_extra_cmake_code) + if(PROJECT_NAME STREQUAL "QtBase") + # Propagate common variables via BuildInternals package. + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE + "set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})") + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +option(BUILD_SHARED_LIBS \"Build Qt statically or dynamically\" ${BUILD_SHARED_LIBS})") + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +set(QT_BUILD_INTERNALS_PATH \"\${CMAKE_CURRENT_LIST_DIR}\")") + + # Propagate developer builds to other modules via BuildInternals package. + if(FEATURE_developer_build) + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +set(FEATURE_developer_build ON CACHE BOOL \"Developer build.\" FORCE)") + endif() + + qt_path_join(extra_file_path + ${QT_CONFIG_BUILD_DIR} + ${INSTALL_CMAKE_NAMESPACE}BuildInternals/QtBuildInternalsExtra.cmake) + file(GENERATE OUTPUT "${extra_file_path}" + CONTENT "${QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE}") + endif() +endfunction() + qt_internal_create_depends_files() +qt_generate_build_internals_extra_cmake_code() diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index feab963a801..bae1518375b 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -38,29 +38,6 @@ include(CMakeParseArguments) -macro(qt_build_repo_begin) - # Set up the paths for the modules. - set(QT_CMAKE_MODULE_PATH "${_qt_core_cmake_dir}/../${QT_CMAKE_EXPORT_NAMESPACE}") - list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH}) - - # Qt specific setup common for all modules: - include(QtSetup) - include(FeatureSummary) -endmacro() - -macro(qt_build_repo_end) - # Delayed actions on some of the Qt targets: - include(QtPostProcess) - - # Print a feature summary: - feature_summary(WHAT PACKAGES_FOUND - REQUIRED_PACKAGES_NOT_FOUND - RECOMMENDED_PACKAGES_NOT_FOUND - OPTIONAL_PACKAGES_NOT_FOUND - RUNTIME_PACKAGES_NOT_FOUND - FATAL_ON_MISSING_REQUIRED_PACKAGES) -endmacro() - # macro used to create the names of output files preserving relative dirs macro(QT5_MAKE_OUTPUT_FILE infile prefix ext outfile ) string(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength) From 4dacc099213acf804b50c6e9a9afba5fda8b8e3b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 15 May 2019 14:22:20 +0200 Subject: [PATCH 0509/1322] Save and set the CMAKE_INSTALL_PREFIX in BuildInternal's Config file Once qtbase is built and installed, save the CMAKE_INSTALL_PREFIX that was used during the build, and set it when a consumer calls find_package(Qt5BuildInternals). This fixes a bug where syncqt can not be found when building qtsvg, while the developer specifies CMAKE_PREFIX_PATH to find the Qt packages, but does not set the CMAKE_INSTALL_PREFIX. Task-number: QTBUG-75544 Change-Id: I03fd23ba418af5115105610f3f9ed92664562945 Reviewed-by: Simon Hausmann --- cmake/QtPostProcess.cmake | 6 ++++++ cmake/QtSetup.cmake | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index d900f8e88f5..b1fb07c3943 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -176,6 +176,12 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " set(QT_BUILD_INTERNALS_PATH \"\${CMAKE_CURRENT_LIST_DIR}\")") + # Propagate the original install prefix, so that a developer building a child module can + # specify CMAKE_PREFIX_PATH for finding the Qt modules instead of CMAKE_INSTALL_PREFIX. + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH +\"Install path prefix, prepended onto install directories.\" FORCE)") + # Propagate developer builds to other modules via BuildInternals package. if(FEATURE_developer_build) string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 187f1bf740e..3b02633ed7f 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -41,8 +41,8 @@ if(FEATURE_developer_build) set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH "Install path prefix, prepended onto install directories." FORCE) else() - # No-op. While building another module, the CMAKE_INSTALL_PREFIX should be set on the - # command line to point to the qtbase build dir. + # No-op. While building another module, the CMAKE_INSTALL_PREFIX or CMAKE_PREFIX_PATH + # (either work) should be set on the command line to point to the qtbase build dir. endif() else() set(QT_WILL_INSTALL ON) From 9fade925e36651c3d746a71ec312535f6922035a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 16 May 2019 09:46:29 +0200 Subject: [PATCH 0510/1322] Stop trying to create config forwarding headers for NO_MODULE targets The GlobalConfig target is not an actual module, so there's no point in trying to create forwarding headers for GlobalConfig's qconfig.h within qt_feature_module_end. qconfig.h's forwarding header will be created implicitly while processing QtCore target's SYNCQT.INJECTIONS value, which is read from the headers.pri file generated by syncqt. This also fixes trying to create forwarding headers when processing the sqldrivers project. Amends 02a015375a639a4d27d19bbf435f20b725696768. Change-Id: Ifd70d8c3ebf881ffdcf90db8d5d3b23309bc8fed Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- cmake/QtBaseGlobalTargets.cmake | 2 +- cmake/QtFeature.cmake | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 7bb4795d353..7bb55ba3d9c 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -63,7 +63,7 @@ target_include_directories(GlobalConfig INTERFACE $ $ ) -qt_feature_module_begin(LIBRARY Core +qt_feature_module_begin(NO_MODULE PUBLIC_FILE src/corelib/global/qconfig.h PRIVATE_FILE src/corelib/global/qconfig_p.h ) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 50c672d08cb..6c6c2eedbba 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -397,15 +397,19 @@ function(qt_feature_module_end) # Extra header injections which have to have forwarding headers created by # qt_install_injections. - set(injections "") - qt_compute_injection_forwarding_header("${__QtFeature_library}" - SOURCE "${__QtFeature_public_file}" - OUT_VAR injections) - qt_compute_injection_forwarding_header("${__QtFeature_library}" - SOURCE "${__QtFeature_private_file}" PRIVATE - OUT_VAR injections) + # Skip creating forwarding headers if qt_feature_module_begin was called with NO_MODULE, aka + # there is no include/ so there's no place to put the forwarding headers. + if(__QtFeature_library) + set(injections "") + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_public_file}" + OUT_VAR injections) + qt_compute_injection_forwarding_header("${__QtFeature_library}" + SOURCE "${__QtFeature_private_file}" PRIVATE + OUT_VAR injections) - set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) + set(${arg_OUT_VAR_PREFIX}extra_library_injections ${injections} PARENT_SCOPE) + endif() if (NOT ("${target}" STREQUAL "NO_MODULE")) get_target_property(targetType "${target}" TYPE) From 3a9ffadf69cba54bc0383d99fc973cacbb74d74b Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Tue, 30 Apr 2019 13:36:00 +0300 Subject: [PATCH 0511/1322] Teach configure to run either qmake or cmake Task-number: QTBUG-74139 Change-Id: I609ec4b3ef9f30455bd72aaebad0b6c766c39cd7 Reviewed-by: Simon Hausmann --- configure | 177 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 146 insertions(+), 31 deletions(-) diff --git a/configure b/configure index ef7bad1bfce..945e6e82ccf 100755 --- a/configure +++ b/configure @@ -42,18 +42,27 @@ outpath=`/bin/pwd` WHICH="which" +PERL= +findPerl() +{ PERL=`$WHICH perl 2>/dev/null` +} # find out which awk we want to use, prefer gawk, then nawk, then regular awk AWK= +findAwk() +{ for e in gawk nawk awk; do if "$WHICH" $e >/dev/null 2>&1 && ( $e -f /dev/null /dev/null ) >/dev/null 2>&1; then AWK=$e break fi done +} # find a make command +findMake() +{ if [ -z "$MAKE" ]; then MAKE= for mk in gmake make; do @@ -70,20 +79,26 @@ if [ -z "$MAKE" ]; then # export MAKE, we need it later in the config.tests export MAKE fi +} # make sure qmake is not confused by these. recursion via Makefiles would # be still affected, so just unsetting them here is not an option. +checkQMakeEnv() +{ if [ -n "$QMAKESPEC" ] || [ -n "$XQMAKESPEC" ] || \ [ -n "$QMAKEPATH" ] || [ -n "$QMAKEFEATURES" ]; then echo >&2 "Please make sure to unset the QMAKESPEC, XQMAKESPEC, QMAKEPATH," echo >&2 "and QMAKEFEATURES environment variables prior to building Qt." exit 1 fi +} # do this early so we don't store it in config.status CFG_TOPLEVEL= -relpathMangled=$relpath outpathPrefix= +checkTopLevelBuild() +{ +relpathMangled=$relpath if [ x"$1" = x"-top-level" ]; then CFG_TOPLEVEL=yes relpathMangled=`dirname "$relpath"` @@ -95,9 +110,48 @@ else exit 1 fi fi +} + +CMAKE_CMDLINE= +getCMakeCmdLine() +{ +PASSTHRU= +set -f # suppress globbing in for loop +SAVED_IFS=$IFS +IFS=' +' +for i in "$@"; do + if [ "$PASSTHRU" = "yes" ]; then + CMAKE_CMDLINE="$CMAKE_CMDLINE +$i" + else + case $i in + --no-*) + VAR=`echo $i | sed 's,^--no-\(.*\),\1,'` + CMAKE_CMDLINE="$CMAKE_CMDLINE +-DFEATURE_${VAR}=OFF" + ;; + -no-*) + VAR=`echo $i | sed 's,^-no-\(.*\),\1,'` + CMAKE_CMDLINE="$CMAKE_CMDLINE +-DFEATURE_${VAR}=OFF" + ;; + --) + PASSTHRU=yes + ;; + *) + ;; + esac + fi +done +set +f +IFS=$SAVED_IFS +} OPT_CMDLINE= # expanded version for the script QMAKE_CMDLINE= # verbatim version for qmake call +getOptAndQMakeCmdLines() +{ set -f # suppress globbing in for loop SAVED_IFS=$IFS IFS=' @@ -132,6 +186,7 @@ for i in $OPT_CMDLINE; do done set +f IFS=$SAVED_IFS +} #------------------------------------------------------------------------------- # utility functions @@ -298,7 +353,8 @@ getQMakeConf() #------------------------------------------------------------------------------- # operating system detection #------------------------------------------------------------------------------- - +detectOperatingSystem() +{ # need that throughout the script UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown @@ -312,11 +368,12 @@ if [ "$OSTYPE" = "msys" ]; then relpath=`(cd "$relpath"; pwd -W)` outpath=`pwd -W` fi - +} #------------------------------------------------------------------------------- # Verify Xcode installation on Mac OS #------------------------------------------------------------------------------- - +maybeVerifyXcode() +{ if [ "$BUILD_ON_MAC" = "yes" ]; then if ! /usr/bin/xcode-select --print-path >/dev/null 2>&1; then echo >&2 @@ -339,7 +396,7 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then fi fi fi - +} #----------------------------------------------------------------------------- # Qt version detection #----------------------------------------------------------------------------- @@ -347,6 +404,8 @@ QT_VERSION= QT_MAJOR_VERSION= QT_MINOR_VERSION=0 QT_PATCH_VERSION=0 +detectQtVersion() +{ eval `sed -n -e 's/^MODULE_VERSION = \(\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*\)$/QT_VERSION=\1\ QT_MAJOR_VERSION=\2\ QT_MINOR_VERSION=\3\ @@ -356,7 +415,7 @@ if [ -z "$QT_MAJOR_VERSION" ]; then echo "Cannot proceed." exit 1 fi - +} #------------------------------------------------------------------------------- # initalize variables #------------------------------------------------------------------------------- @@ -372,11 +431,13 @@ OPT_VERBOSE=no OPT_HELP= CFG_SILENT=no CFG_DEV=no +BUILD_WITH_CMAKE=no #------------------------------------------------------------------------------- # parse command line arguments #------------------------------------------------------------------------------- - +parseCommandline() +{ # parse the arguments, setting things to "yes" or "no" while [ "$#" -gt 0 ]; do CURRENT_OPT="$1" @@ -523,6 +584,9 @@ while [ "$#" -gt 0 ]; do # need to keep this here, to ensure qmake is built silently CFG_SILENT="$VAL" ;; + cmake) + BUILD_WITH_CMAKE=yes + ;; *) ;; esac @@ -532,11 +596,12 @@ while [ "$#" -gt 0 ]; do fi done [ "x$ERROR" = "xyes" ] && exit 1 - +} #------------------------------------------------------------------------------- # help - interactive parts of the script _after_ this section please #------------------------------------------------------------------------------- - +handleHelp() +{ if [ "$OPT_HELP" = "yes" ]; then cat $relpath/config_help.txt if [ -n "$CFG_TOPLEVEL" ]; then @@ -551,12 +616,13 @@ if [ "$OPT_HELP" = "yes" ]; then fi exit 0 fi - +} #------------------------------------------------------------------------------- # platform detection #------------------------------------------------------------------------------- - PLATFORM_NOTES= +detectPlatform() +{ if [ -z "$PLATFORM" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE" in Darwin:*) @@ -622,11 +688,13 @@ if [ -z "$PLATFORM" ]; then esac fi echo "$PLATFORM_NOTES" > "${outpathPrefix}.config.notes" +} #------------------------------------------------------------------------------- # command line and environment validation #------------------------------------------------------------------------------- - +validateEnv() +{ if [ -d "$PLATFORM" ]; then QMAKESPEC="$PLATFORM" else @@ -656,11 +724,12 @@ if [ '!' -d "$QMAKESPEC" ]; then echo exit 2 fi - +} #------------------------------------------------------------------------------- # build tree initialization #------------------------------------------------------------------------------- - +initBuildTree() +{ # is this a shadow build? if [ "$OPT_SHADOW" = "maybe" ]; then OPT_SHADOW=no @@ -688,22 +757,7 @@ if [ "$OPT_SHADOW" = "yes" ]; then mkdir -p "$outpath/mkspecs" fi - -# ----------------------------------------------------------------------------- -# build qmake -# ----------------------------------------------------------------------------- - -# symlink includes -if [ -e "$relpath/.git" ]; then - if [ -z "$PERL" ]; then - echo - echo "You need perl in your PATH to make a build from GIT." - echo "Cannot proceed." - exit 1 - fi - - "$relpath/bin/syncqt.pl" -version $QT_VERSION -minimal -module QtCore "$relpath" || exit 1 -fi +} # $1: input variable name (awk regexp) # $2: optional output variable name @@ -715,6 +769,23 @@ setBootstrapVariable() getQMakeConf "$1" | echo ${2-$1} = `if [ -n "$3" ]; then sed "$3"; else cat; fi` >> "$mkfile" } +# ----------------------------------------------------------------------------- +# build qmake +# ----------------------------------------------------------------------------- + +buildQMake() +{ +# symlink includes +if [ -e "$relpath/.git" ]; then + if [ -z "$PERL" ]; then + echo + echo "You need perl in your PATH to make a build from GIT." + echo "Cannot proceed." + exit 1 + fi + + "$relpath/bin/syncqt.pl" -version $QT_VERSION -minimal -module QtCore "$relpath" || exit 1 +fi # build qmake echo "Creating qmake..." mkdir -p "$outpath/qmake" || exit @@ -813,11 +884,14 @@ setBootstrapVariable() fi echo "Done." fi +} #------------------------------------------------------------------------------- # create a qt.conf for the Qt build tree itself #------------------------------------------------------------------------------- +createQtConf() +{ # Note that this file is just sufficient to boot configure, by which it is # replaced in-place with a version which is suitable for building all of Qt. QTCONFFILE="$outpath/bin/qt.conf" @@ -834,11 +908,13 @@ if [ x"$relpath" != x"$outpath" ]; then Prefix=$relpath EOF fi +} #------------------------------------------------------------------------------- # configure and build top-level makefile #------------------------------------------------------------------------------- - +createToplevelMakefile() +{ # recreate command line for qmake set -f SAVED_IFS=$IFS @@ -859,3 +935,42 @@ if [ -n "$CFG_HOST_QT_TOOLS_PATH" ]; then else "$outpath/bin/qmake" "$relpathMangled" -- "$@" fi +} + +runCMake() +{ +# recreate command line for cmake +set -f +SAVED_IFS=$IFS +IFS=' +' +for i in $CMAKE_CMDLINE; do + set -- $* "$i" +done +set +f +IFS=$SAVED_IFS +cmake $* "$relpath" +} + +parseCommandline $@ +handleHelp +if [ "$BUILD_WITH_CMAKE" = "yes" ]; then + getCMakeCmdLine $@ + runCMake +else + findPerl + findAwk + findMake + checkQMakeEnv + checkTopLevelBuild + getOptAndQMakeCmdLines $@ + detectOperatingSystem + maybeVerifyXcode + detectQtVersion + detectPlatform + validateEnv + initBuildTree + buildQMake + createQtConf + createToplevelMakefile +fi From 85b038a0a23625bd45ff7b39f9db83d274bb33d5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 16 May 2019 13:22:44 +0200 Subject: [PATCH 0512/1322] Copy feature properties from GlobalConfig to Core target Current lates CMake has a limitation that it does not allow exporting custom properties from INTERFACE libraries. GlobalConfig is such a library, which means that so far all the global features were not actually exported. Copy the feature property values from GlobalConfig to Core. Because Core is an actual shared library, it keeps the custom properties when exported, and thus Core feature properties will contain the sum of Core and GlobalConfig feature values. Change-Id: Idde305cbaf9ab85ecfbe29522dcbac1c44022b17 Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 6c6c2eedbba..d11a7117880 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -427,6 +427,7 @@ function(qt_feature_module_end) set_property(TARGET "${target}" PROPERTY ${propertyPrefix}QT_${capitalState}_${capitalVisibility}_FEATURES "${${state}_${visibility}_features}") endforeach() endforeach() + qt_feature_copy_global_config_features_to_core(${target}) endif() unset(__QtFeature_library PARENT_SCOPE) @@ -443,6 +444,30 @@ function(qt_feature_module_end) unset(__QtFeature_define_definitions PARENT_SCOPE) endfunction() +function(qt_feature_copy_global_config_features_to_core target) + # CMake doesn't support setting custom properties on exported INTERFACE libraries + # See https://gitlab.kitware.com/cmake/cmake/issues/19261. + # To circumvent that, copy the properties from GlobalConfig to Core target. + # This way the global features actually get set in the generated CoreTargets.cmake file. + if(target STREQUAL Core) + foreach(visibility public private) + string(TOUPPER "${visibility}" capitalVisibility) + foreach(state enabled disabled) + string(TOUPPER "${state}" capitalState) + + set(core_property_name "QT_${capitalState}_${capitalVisibility}_FEATURES") + set(global_property_name "INTERFACE_${core_property_name}") + + get_property(core_values TARGET Core PROPERTY ${core_property_name}) + get_property(global_values TARGET GlobalConfig PROPERTY ${global_property_name}) + + set(total_values ${core_values} ${global_values}) + set_property(TARGET Core PROPERTY ${core_property_name} ${total_values}) + endforeach() + endforeach() + endif() +endfunction() + function(qt_config_compile_test name) cmake_parse_arguments(arg "" "LABEL" "LIBRARIES;CODE" ${ARGN}) From 140b65e36f71189fee181330018ed9fe8479fc6b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 16 May 2019 11:34:06 +0200 Subject: [PATCH 0513/1322] Propagate QT_CMAKE_EXPORT_NAMESPACE via QtCore package QT_CMAKE_EXPORT_NAMESPACE is used by the Qt packages to make features available to the consuming CMake project. The value was moved to the BuildInternals Config file, but that's wrong because consuming applications not including the BuildInternals component would fail to use any other Qt package. Move QT_CMAKE_EXPORT_NAMESPACE to be propagated with QtCore package again. Amends 9542e78525b422159406d8fa63e30dcd0f926411. Change-Id: I9841ac8c2828b00c0111d59e8976c889554e0ce1 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 10 ++++++++++ cmake/QtModuleConfig.cmake.in | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index cc5b9e63e15..50722a54758 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -930,6 +930,16 @@ function(add_qt_module target) list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") endif() + set(extra_cmake_code "") + + if(target STREQUAL Core) + # Propagate non-build related variables that are needed for consuming Qt packages. + # Do this in CoreConfig instead of Qt5Config, so that consumers can also use + # find_package(Qt5Core) instead of find_package(Qt5 COMPONENTS Core) + string(APPEND extra_cmake_code " +set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") + endif() + configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake" diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 7baea8cf9cf..6a68fdf3b0f 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -5,6 +5,10 @@ include(CMakeFindDependencyMacro) get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_import_prefix "${_import_prefix}" REALPATH) +# Extra cmake code begin +@extra_cmake_code@ +# Extra cmake code end + # Find required dependencies, if any. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") From 5fe8a38af34d1530f14c3b695dee5a33e4a85554 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 17 May 2019 15:05:49 +0200 Subject: [PATCH 0514/1322] CMake: Fix test_operations Fix test_operations and do some small mypy cleanups along the way Change-Id: I6586b5d3491e5dcf44252c098516f0922fa60420 Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 1 + util/cmake/pro2cmake.py | 31 ++++++++++++++++------------- util/cmake/tests/test_operations.py | 8 ++++---- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 99d9242eba9..ee4274abd7b 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -367,6 +367,7 @@ def generate_find_package_info(lib: LibraryMapping, use_qt_find_package: bool=Tr extra.remove("REQUIRED") cmake_target_name = lib.targetName + assert(cmake_target_name); # _nolink or not does not matter at this point: if cmake_target_name.endswith('_nolink') or cmake_target_name.endswith('/nolink'): diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0851181a25f..5b6b3847d8b 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -43,7 +43,8 @@ from sympy.logic import (simplify_logic, And, Or, Not,) import pyparsing as pp from helper import map_qt_library, map_3rd_party_library, is_known_3rd_party_library, \ - featureName, map_platform, find_library_info_for_target, generate_find_package_info + featureName, map_platform, find_library_info_for_target, generate_find_package_info, \ + LibraryMapping from shutil import copyfile from special_case_helper import SpecialCaseHandler @@ -205,13 +206,11 @@ def handle_vpath(source: str, base_dir: str, vpath: typing.List[str]) -> str: class Operation: - def __init__(self, value): - if isinstance(value, list): - self._value = value - else: - self._value = [str(value), ] + def __init__(self, value: typing.List[str]): + self._value = value - def process(self, key, input, transformer): + def process(self, key: str, input: typing.List[str], + transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: assert(False) def __repr__(self): @@ -234,7 +233,8 @@ class Operation: class AddOperation(Operation): - def process(self, key, input, transformer): + def process(self, key: str, input: typing.List[str], + transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: return input + transformer(self._value) def __repr__(self): @@ -242,7 +242,8 @@ class AddOperation(Operation): class UniqueAddOperation(Operation): - def process(self, key, input, transformer): + def process(self, key: str, input: typing.List[str], + transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: result = input for v in transformer(self._value): if v not in result: @@ -254,10 +255,11 @@ class UniqueAddOperation(Operation): class SetOperation(Operation): - def process(self, key, input, transformer): + def process(self, key: str, input: typing.List[str], + transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: values = [] # typing.List[str] for v in self._value: - if v != '$$' + key: + if v != '$${}'.format(key): values.append(v) else: values += input @@ -275,7 +277,8 @@ class RemoveOperation(Operation): def __init__(self, value): super().__init__(value) - def process(self, key, input, transformer): + def process(self, key: str, input: typing.List[str], + transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: input_set = set(input) value_set = set(self._value) result = [] @@ -305,8 +308,8 @@ class Scope(object): file: typing.Optional[str] = None, condition: str = '', base_dir: str = '', operations: typing.Mapping[str, typing.List[Operation]] = { - 'QT_SOURCE_TREE': [SetOperation('${PROJECT_SOURCE_DIR}')], - 'QT_BUILD_TREE': [SetOperation('${PROJECT_BUILD_DIR}')], + 'QT_SOURCE_TREE': [SetOperation(['${PROJECT_SOURCE_DIR}'])], + 'QT_BUILD_TREE': [SetOperation(['${PROJECT_BUILD_DIR}'])], }) -> None: if parent_scope: parent_scope._add_child(self) diff --git a/util/cmake/tests/test_operations.py b/util/cmake/tests/test_operations.py index 3ea2f76a431..c1e5f1b2507 100755 --- a/util/cmake/tests/test_operations.py +++ b/util/cmake/tests/test_operations.py @@ -32,26 +32,26 @@ from pro2cmake import AddOperation, SetOperation, UniqueAddOperation, RemoveOper def test_add_operation(): op = AddOperation(['bar', 'buz']) - result = op.process(['foo', 'bar']) + result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x) assert ['foo', 'bar', 'bar', 'buz'] == result def test_uniqueadd_operation(): op = UniqueAddOperation(['bar', 'buz']) - result = op.process(['foo', 'bar']) + result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x) assert ['foo', 'bar', 'buz'] == result def test_set_operation(): op = SetOperation(['bar', 'buz']) - result = op.process(['foo', 'bar']) + result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x) assert ['bar', 'buz'] == result def test_remove_operation(): op = RemoveOperation(['bar', 'buz']) - result = op.process(['foo', 'bar']) + result = op.process(['foo', 'bar'], ['foo', 'bar'], lambda x: x) assert ['foo', '-buz'] == result From 14bf7e952e529f5656514295960fa050aa3a8e69 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 17 May 2019 15:14:31 +0200 Subject: [PATCH 0515/1322] CMake: Fix test_scope_handling Adapt to updated APIs in pro2cmake.py Change-Id: I39898b675e27d6295ef6cfa049c82b245d71188a Reviewed-by: Alexandru Croitor --- util/cmake/tests/test_scope_handling.py | 62 ++++++++++++------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/util/cmake/tests/test_scope_handling.py b/util/cmake/tests/test_scope_handling.py index 8bca8c8ec57..c0b553fabd4 100755 --- a/util/cmake/tests/test_scope_handling.py +++ b/util/cmake/tests/test_scope_handling.py @@ -37,7 +37,7 @@ ScopeList = typing.List[Scope] def _map_to_operation(**kwargs): result = {} # type: typing.Mapping[str, typing.List[SetOperation]] for (key, value) in kwargs.items(): - result[key] = [SetOperation(value)] + result[key] = [SetOperation([value])] return result @@ -75,13 +75,13 @@ def test_evaluate_child_scope(): assert scope.total_condition == 'QT_FEATURE_foo' assert len(scope.children) == 1 - assert scope.getString('test1') == 'bar' - assert scope.getString('test2', 'not found') == 'not found' + assert scope.get_string('test1') == 'bar' + assert scope.get_string('test2', 'not found') == 'not found' child = scope.children[0] assert child.total_condition == 'QT_FEATURE_bar AND QT_FEATURE_foo' - assert child.getString('test1', 'not found') == 'not found' - assert child.getString('test2') == 'bar' + assert child.get_string('test1', 'not found') == 'not found' + assert child.get_string('test2') == 'bar' def test_evaluate_two_child_scopes(): @@ -94,21 +94,21 @@ def test_evaluate_two_child_scopes(): assert scope.total_condition == 'QT_FEATURE_foo' assert len(scope.children) == 2 - assert scope.getString('test1') == 'bar' - assert scope.getString('test2', 'not found') == 'not found' - assert scope.getString('test3', 'not found') == 'not found' + assert scope.get_string('test1') == 'bar' + assert scope.get_string('test2', 'not found') == 'not found' + assert scope.get_string('test3', 'not found') == 'not found' child1 = scope.children[0] assert child1.total_condition == 'QT_FEATURE_bar AND QT_FEATURE_foo' - assert child1.getString('test1', 'not found') == 'not found' - assert child1.getString('test2') == 'bar' - assert child1.getString('test3', 'not found') == 'not found' + assert child1.get_string('test1', 'not found') == 'not found' + assert child1.get_string('test2') == 'bar' + assert child1.get_string('test3', 'not found') == 'not found' child2 = scope.children[1] assert child2.total_condition == 'QT_FEATURE_buz AND QT_FEATURE_foo' - assert child2.getString('test1', 'not found') == 'not found' - assert child2.getString('test2') == '' - assert child2.getString('test3', 'not found') == 'buz' + assert child2.get_string('test1', 'not found') == 'not found' + assert child2.get_string('test2') == '' + assert child2.get_string('test3', 'not found') == 'buz' def test_evaluate_else_child_scopes(): @@ -121,21 +121,21 @@ def test_evaluate_else_child_scopes(): assert scope.total_condition == 'QT_FEATURE_foo' assert len(scope.children) == 2 - assert scope.getString('test1') == 'bar' - assert scope.getString('test2', 'not found') == 'not found' - assert scope.getString('test3', 'not found') == 'not found' + assert scope.get_string('test1') == 'bar' + assert scope.get_string('test2', 'not found') == 'not found' + assert scope.get_string('test3', 'not found') == 'not found' child1 = scope.children[0] assert child1.total_condition == 'QT_FEATURE_bar AND QT_FEATURE_foo' - assert child1.getString('test1', 'not found') == 'not found' - assert child1.getString('test2') == 'bar' - assert child1.getString('test3', 'not found') == 'not found' + assert child1.get_string('test1', 'not found') == 'not found' + assert child1.get_string('test2') == 'bar' + assert child1.get_string('test3', 'not found') == 'not found' child2 = scope.children[1] assert child2.total_condition == 'QT_FEATURE_foo AND NOT QT_FEATURE_bar' - assert child2.getString('test1', 'not found') == 'not found' - assert child2.getString('test2') == '' - assert child2.getString('test3', 'not found') == 'buz' + assert child2.get_string('test1', 'not found') == 'not found' + assert child2.get_string('test2') == '' + assert child2.get_string('test3', 'not found') == 'buz' def test_evaluate_invalid_else_child_scopes(): @@ -196,8 +196,8 @@ def test_merge_two_scopes_with_same_condition(): assert len(result) == 1 r0 = result[0] assert r0.total_condition == 'QT_FEATURE_bar' - assert r0.getString('test') == 'foo' - assert r0.getString('test2') == 'bar' + assert r0.get_string('test') == 'foo' + assert r0.get_string('test2') == 'bar' def test_merge_three_scopes_two_with_same_condition(): @@ -214,8 +214,8 @@ def test_merge_three_scopes_two_with_same_condition(): assert len(result) == 2 r0 = result[0] assert r0.total_condition == 'QT_FEATURE_bar' - assert r0.getString('test') == 'foo' - assert r0.getString('test2') == 'bar' + assert r0.get_string('test') == 'foo' + assert r0.get_string('test2') == 'bar' assert result[1] == scopes[1] @@ -261,8 +261,8 @@ def test_merge_parent_child_scopes_with_same_conditions(): r0 = result[0] assert r0.parent == None assert r0.total_condition == 'FOO AND bar' - assert r0.getString('test1') == 'parent' - assert r0.getString('test2') == 'child' + assert r0.get_string('test1') == 'parent' + assert r0.get_string('test2') == 'child' def test_merge_parent_child_scopes_with_on_child_condition(): @@ -277,8 +277,8 @@ def test_merge_parent_child_scopes_with_on_child_condition(): r0 = result[0] assert r0.parent == None assert r0.total_condition == 'FOO AND bar' - assert r0.getString('test1') == 'parent' - assert r0.getString('test2') == 'child' + assert r0.get_string('test1') == 'parent' + assert r0.get_string('test2') == 'child' # Real world examples: From e0a6e9f3aa66da3018b8362d949e288a2c801daa Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 14:56:11 +0200 Subject: [PATCH 0516/1322] Fix parsing qmake assignments that have comments in between For some reason the python comment regex that we used does not ignore the line break at the end of a comment line. This caused issues when parsing multi line assignments with comments in between. Use our own regex for comments to circumvent the issue. It was found while trying to port the qtimageformats repo. Added a pytest as well. Change-Id: Ie4bbdac2d1e1c133bc787a995224d0bbd8238204 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 7 ++++++- util/cmake/tests/data/lc_with_comment.pro | 4 ++++ util/cmake/tests/test_parsing.py | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 util/cmake/tests/data/lc_with_comment.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5b6b3847d8b..71053d288b7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -779,7 +779,12 @@ class QmakeParser: expr.setDebug() Grammar = StatementGroup('statements') - Grammar.ignore(pp.pythonStyleComment()) + + # Ignore comment lines, including the final line break, + # otherwise parsing fails when looking at multi line assignments + # with comments in between. + Comment = pp.Regex(r"#.*\n").setName("qmake style comment") + Grammar.ignore(Comment()) return Grammar diff --git a/util/cmake/tests/data/lc_with_comment.pro b/util/cmake/tests/data/lc_with_comment.pro new file mode 100644 index 00000000000..c087dadacc1 --- /dev/null +++ b/util/cmake/tests/data/lc_with_comment.pro @@ -0,0 +1,4 @@ +SUBDIRS = \ +# dds \ + tga \ + wbmp diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 79ad0a49454..4b6f48b931e 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -305,3 +305,7 @@ def test_realworld_lc(): result = parse_file(_tests_path + '/data/lc.pro') assert len(result) == 3 + +def test_realworld_lc_with_comment_in_between(): + result = parse_file(_tests_path + '/data/lc_with_comment.pro') + assert len(result) == 1 From c454e622a1d50f4e6a879390241034b910e5ee90 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 17:41:59 +0200 Subject: [PATCH 0517/1322] Don't exclude QtCore from dependencies when generating modules and plugins. src/network/network.pro for instance depends on core-private, but because we ignore adding QtCore as a public dependency, the exported Config file for Network doesn't depend on QtCore anymore, so if a user only links against Network, they won't automatically link against Core. Change-Id: I4a60ffae7e071927360b8ccf6b1b7479ab391060 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 71053d288b7..ddfa7d05c37 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1482,7 +1482,7 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, extra_lines=extra, indent=indent, - known_libraries={'Qt::Core', }, extra_keys=[]) + known_libraries={}, extra_keys=[]) if 'qt_tracepoints' in scope.get('CONFIG'): tracepoints = scope.get_files('TRACEPOINT_PROVIDER') @@ -1596,7 +1596,7 @@ def write_plugin(cm_fh, scope, *, indent: int = 0): assert plugin_name write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope, - indent=indent, known_libraries={'QtCore', }, extra_keys=[]) + indent=indent, known_libraries={}, extra_keys=[]) def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, From 826821658df16b18a51ec0c0a6e54f7e3e31795c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 18:09:21 +0200 Subject: [PATCH 0518/1322] Workaround fix in pro2cmake Operation __init__ method There are still call sites that call Operation.__init__ with a string instead of a list. Restore the handling of such a case. Amends 5fe8a38af34d1530f14c3b695dee5a33e4a85554 Change-Id: I2a4d5c5cb5b460bf02b6da02d42d8cc8d5eb4192 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ddfa7d05c37..5c5569ae30f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -206,8 +206,11 @@ def handle_vpath(source: str, base_dir: str, vpath: typing.List[str]) -> str: class Operation: - def __init__(self, value: typing.List[str]): - self._value = value + def __init__(self, value: typing.Union[typing.List[str], str]): + if isinstance(value, list): + self._value = value + else: + self._value = [str(value), ] def process(self, key: str, input: typing.List[str], transformer: typing.Callable[[typing.List[str]], typing.List[str]]) -> typing.List[str]: From 846adfe079fd57410fbb8e9c96eae010cf81dd26 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 17:24:15 +0200 Subject: [PATCH 0519/1322] Handle the new cmdline config feature in pro2cmake cmdline implies console, so use that also to determine if a binary should get a GUI flag. Change-Id: I084e0a45785df96a7dc2c101af5305fbb39efbc3 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5c5569ae30f..ba77e0e51f4 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1624,7 +1624,8 @@ def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, assert not is_example write_test(cm_fh, scope, indent=indent) else: - gui = 'console' not in scope.get('CONFIG') + config = scope.get('CONFIG') + gui = all(val not in config for val in ['console', 'cmdline']) if is_example: write_example(cm_fh, scope, gui, indent=indent) else: From a701be565272ecd7c6b07197ac3cecb22a63538e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 15:29:48 +0200 Subject: [PATCH 0520/1322] Regenerate gui And add the first version of the .prev file. Change-Id: Ie5fba879b8fdb670d4331d4df524ffb5bad3303e Reviewed-by: Tobias Hunger --- src/gui/.prev_CMakeLists.txt | 527 +++++++++++++++++++++++++++++++++++ src/gui/CMakeLists.txt | 2 +- 2 files changed, 528 insertions(+), 1 deletion(-) create mode 100644 src/gui/.prev_CMakeLists.txt diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt new file mode 100644 index 00000000000..fd80bb7000e --- /dev/null +++ b/src/gui/.prev_CMakeLists.txt @@ -0,0 +1,527 @@ +# Generated from gui.pro. + +##################################################################### +## Gui Module: +##################################################################### + +add_qt_module(Gui + SOURCES + image/qbitmap.cpp image/qbitmap.h + image/qbmphandler.cpp image/qbmphandler_p.h + image/qicon.cpp image/qicon.h image/qicon_p.h + image/qiconengine.cpp image/qiconengine.h + image/qiconengineplugin.cpp image/qiconengineplugin.h + image/qiconloader.cpp image/qiconloader_p.h + image/qimage.cpp image/qimage.h image/qimage_p.h + image/qimage_compat.cpp + image/qimage_conversions.cpp + image/qimageiohandler.cpp image/qimageiohandler.h + image/qimagepixmapcleanuphooks.cpp image/qimagepixmapcleanuphooks_p.h + image/qimagereader.cpp image/qimagereader.h + image/qimagereaderwriterhelpers.cpp image/qimagereaderwriterhelpers_p.h + image/qimagewriter.cpp image/qimagewriter.h + image/qpaintengine_pic.cpp image/qpaintengine_pic_p.h + image/qpicture.cpp image/qpicture.h image/qpicture_p.h + image/qpictureformatplugin.cpp image/qpictureformatplugin.h + image/qpixmap.cpp image/qpixmap.h + image/qpixmap_blitter.cpp image/qpixmap_blitter_p.h + image/qpixmap_raster.cpp image/qpixmap_raster_p.h + image/qpixmapcache.cpp image/qpixmapcache.h image/qpixmapcache_p.h + image/qplatformpixmap.cpp image/qplatformpixmap.h + image/qppmhandler.cpp image/qppmhandler_p.h + image/qxbmhandler.cpp image/qxbmhandler_p.h + image/qxpmhandler.cpp image/qxpmhandler_p.h + itemmodels/qstandarditemmodel.cpp itemmodels/qstandarditemmodel.h itemmodels/qstandarditemmodel_p.h + kernel/qclipboard.cpp kernel/qclipboard.h + kernel/qcursor.cpp kernel/qcursor.h kernel/qcursor_p.h + kernel/qevent.cpp kernel/qevent.h kernel/qevent_p.h + kernel/qgenericplugin.cpp kernel/qgenericplugin.h + kernel/qgenericpluginfactory.cpp kernel/qgenericpluginfactory.h + kernel/qguiapplication.cpp kernel/qguiapplication.h kernel/qguiapplication_p.h + kernel/qguivariant.cpp + kernel/qhighdpiscaling.cpp kernel/qhighdpiscaling_p.h + kernel/qinputdevicemanager.cpp kernel/qinputdevicemanager_p.h + kernel/qinputdevicemanager_p_p.h + kernel/qinputmethod.cpp kernel/qinputmethod.h kernel/qinputmethod_p.h + kernel/qinternalmimedata.cpp kernel/qinternalmimedata_p.h + kernel/qkeymapper.cpp kernel/qkeymapper_p.h + kernel/qkeysequence.cpp kernel/qkeysequence.h kernel/qkeysequence_p.h + kernel/qoffscreensurface.cpp kernel/qoffscreensurface.h + kernel/qpaintdevicewindow.cpp kernel/qpaintdevicewindow.h kernel/qpaintdevicewindow_p.h + kernel/qpalette.cpp kernel/qpalette.h + kernel/qpixelformat.cpp kernel/qpixelformat.h + kernel/qplatformclipboard.cpp kernel/qplatformclipboard.h + kernel/qplatformcursor.cpp kernel/qplatformcursor.h + kernel/qplatformdialoghelper.cpp kernel/qplatformdialoghelper.h + kernel/qplatformgraphicsbuffer.cpp kernel/qplatformgraphicsbuffer.h + kernel/qplatformgraphicsbufferhelper.cpp kernel/qplatformgraphicsbufferhelper.h + kernel/qplatforminputcontext.cpp kernel/qplatforminputcontext.h kernel/qplatforminputcontext_p.h + kernel/qplatforminputcontextfactory.cpp kernel/qplatforminputcontextfactory_p.h + kernel/qplatforminputcontextplugin.cpp kernel/qplatforminputcontextplugin_p.h + kernel/qplatformintegration.cpp kernel/qplatformintegration.h + kernel/qplatformintegrationfactory.cpp kernel/qplatformintegrationfactory_p.h + kernel/qplatformintegrationplugin.cpp kernel/qplatformintegrationplugin.h + kernel/qplatformmenu.cpp kernel/qplatformmenu.h + kernel/qplatformnativeinterface.cpp kernel/qplatformnativeinterface.h + kernel/qplatformoffscreensurface.cpp kernel/qplatformoffscreensurface.h + kernel/qplatformscreen.cpp kernel/qplatformscreen.h kernel/qplatformscreen_p.h + kernel/qplatformservices.cpp kernel/qplatformservices.h + kernel/qplatformsessionmanager.cpp kernel/qplatformsessionmanager.h + kernel/qplatformsharedgraphicscache.cpp kernel/qplatformsharedgraphicscache.h + kernel/qplatformsurface.cpp kernel/qplatformsurface.h + kernel/qplatformsystemtrayicon.cpp kernel/qplatformsystemtrayicon.h + kernel/qplatformtheme.cpp kernel/qplatformtheme.h kernel/qplatformtheme_p.h + kernel/qplatformthemefactory.cpp kernel/qplatformthemefactory_p.h + kernel/qplatformthemeplugin.cpp kernel/qplatformthemeplugin.h + kernel/qplatformwindow.cpp kernel/qplatformwindow.h kernel/qplatformwindow_p.h + kernel/qrasterwindow.cpp kernel/qrasterwindow.h + kernel/qscreen.cpp kernel/qscreen.h kernel/qscreen_p.h + kernel/qsessionmanager.cpp kernel/qsessionmanager.h kernel/qsessionmanager_p.h + kernel/qshortcutmap.cpp kernel/qshortcutmap_p.h + kernel/qstylehints.cpp kernel/qstylehints.h + kernel/qsurface.cpp kernel/qsurface.h + kernel/qsurfaceformat.cpp kernel/qsurfaceformat.h + kernel/qtestsupport_gui.cpp kernel/qtestsupport_gui.h + kernel/qtguiglobal.h kernel/qtguiglobal_p.h + kernel/qtouchdevice.cpp kernel/qtouchdevice.h kernel/qtouchdevice_p.h + kernel/qwindow.cpp kernel/qwindow.h kernel/qwindow_p.h + kernel/qwindowdefs.h + kernel/qwindowsysteminterface.cpp kernel/qwindowsysteminterface.h kernel/qwindowsysteminterface_p.h + math3d/qgenericmatrix.cpp math3d/qgenericmatrix.h + math3d/qmatrix4x4.cpp math3d/qmatrix4x4.h + math3d/qquaternion.cpp math3d/qquaternion.h + math3d/qvector2d.cpp math3d/qvector2d.h + math3d/qvector3d.cpp math3d/qvector3d.h + math3d/qvector4d.cpp math3d/qvector4d.h + painting/qbackingstore.cpp painting/qbackingstore.h + painting/qbezier.cpp painting/qbezier_p.h + painting/qblendfunctions.cpp painting/qblendfunctions_p.h + painting/qblittable.cpp painting/qblittable_p.h + painting/qbrush.cpp painting/qbrush.h + painting/qcolor.cpp painting/qcolor.h painting/qcolor_p.h + painting/qcolormatrix_p.h + painting/qcolorspace.cpp painting/qcolorspace.h painting/qcolorspace_p.h + painting/qcolortransferfunction_p.h + painting/qcolortransfertable_p.h + painting/qcolortransform.cpp painting/qcolortransform.h painting/qcolortransform_p.h + painting/qcolortrc_p.h + painting/qcolortrclut.cpp painting/qcolortrclut_p.h + painting/qcompositionfunctions.cpp + painting/qcosmeticstroker.cpp painting/qcosmeticstroker_p.h + painting/qdatabuffer_p.h + painting/qdrawhelper.cpp painting/qdrawhelper_p.h + painting/qdrawhelper_x86_p.h + painting/qdrawingprimitive_sse2_p.h + painting/qemulationpaintengine.cpp painting/qemulationpaintengine_p.h + painting/qfixed_p.h + painting/qgrayraster.c painting/qgrayraster_p.h + painting/qicc.cpp painting/qicc_p.h + painting/qimagescale.cpp + painting/qmatrix.cpp painting/qmatrix.h + painting/qmemrotate.cpp painting/qmemrotate_p.h + painting/qoutlinemapper.cpp painting/qoutlinemapper_p.h + painting/qpagedpaintdevice.cpp painting/qpagedpaintdevice.h painting/qpagedpaintdevice_p.h + painting/qpagelayout.cpp painting/qpagelayout.h + painting/qpagesize.cpp painting/qpagesize.h + painting/qpaintdevice.cpp painting/qpaintdevice.h + painting/qpaintengine.cpp painting/qpaintengine.h painting/qpaintengine_p.h + painting/qpaintengine_blitter.cpp painting/qpaintengine_blitter_p.h + painting/qpaintengine_raster.cpp painting/qpaintengine_raster_p.h + painting/qpaintengineex.cpp painting/qpaintengineex_p.h + painting/qpainter.cpp painting/qpainter.h painting/qpainter_p.h + painting/qpainterpath.cpp painting/qpainterpath.h painting/qpainterpath_p.h + painting/qpathclipper.cpp painting/qpathclipper_p.h + painting/qpathsimplifier.cpp painting/qpathsimplifier_p.h + painting/qpdf.cpp painting/qpdf_p.h + painting/qpdfwriter.cpp painting/qpdfwriter.h + painting/qpen.cpp painting/qpen.h + painting/qplatformbackingstore.cpp painting/qplatformbackingstore.h + painting/qpolygon.cpp painting/qpolygon.h + painting/qpolygonclipper_p.h + painting/qrasterdefs_p.h + painting/qrasterizer.cpp painting/qrasterizer_p.h + painting/qrbtree_p.h + painting/qregion.cpp painting/qregion.h + painting/qrgb.h + painting/qrgba64.h painting/qrgba64_p.h + painting/qstroker.cpp painting/qstroker_p.h + painting/qtextureglyphcache.cpp painting/qtextureglyphcache_p.h + painting/qtransform.cpp painting/qtransform.h + painting/qtriangulatingstroker.cpp painting/qtriangulatingstroker_p.h + painting/qtriangulator.cpp painting/qtriangulator_p.h + painting/qvectorpath_p.h + text/qabstracttextdocumentlayout.cpp text/qabstracttextdocumentlayout.h text/qabstracttextdocumentlayout_p.h + text/qdistancefield.cpp text/qdistancefield_p.h + text/qfont.cpp text/qfont.h text/qfont_p.h + text/qfontdatabase.cpp text/qfontdatabase.h + text/qfontengine.cpp text/qfontengine_p.h + text/qfontengine_qpf2.cpp + text/qfontengineglyphcache.cpp text/qfontengineglyphcache_p.h + text/qfontinfo.h + text/qfontmetrics.cpp text/qfontmetrics.h + text/qfontsubset.cpp text/qfontsubset_p.h + text/qfragmentmap.cpp text/qfragmentmap_p.h + text/qglyphrun.cpp text/qglyphrun.h text/qglyphrun_p.h + text/qinputcontrol.cpp text/qinputcontrol_p.h + text/qplatformfontdatabase.cpp text/qplatformfontdatabase.h + text/qrawfont.cpp text/qrawfont.h text/qrawfont_p.h + text/qstatictext.cpp text/qstatictext.h text/qstatictext_p.h + text/qsyntaxhighlighter.cpp text/qsyntaxhighlighter.h + text/qtextcursor.cpp text/qtextcursor.h text/qtextcursor_p.h + text/qtextdocument.cpp text/qtextdocument.h text/qtextdocument_p.cpp text/qtextdocument_p.h + text/qtextdocumentfragment.cpp text/qtextdocumentfragment.h text/qtextdocumentfragment_p.h + text/qtextdocumentlayout.cpp text/qtextdocumentlayout_p.h + text/qtextdocumentwriter.cpp text/qtextdocumentwriter.h + text/qtextengine.cpp text/qtextengine_p.h + text/qtextformat.cpp text/qtextformat.h text/qtextformat_p.h + text/qtexthtmlparser.cpp text/qtexthtmlparser_p.h + text/qtextimagehandler.cpp text/qtextimagehandler_p.h + text/qtextlayout.cpp text/qtextlayout.h + text/qtextlist.cpp text/qtextlist.h + text/qtextobject.cpp text/qtextobject.h text/qtextobject_p.h + text/qtextoption.cpp text/qtextoption.h + text/qtexttable.cpp text/qtexttable.h text/qtexttable_p.h + util/qabstractlayoutstyleinfo.cpp util/qabstractlayoutstyleinfo_p.h + util/qastchandler.cpp util/qastchandler_p.h + util/qdesktopservices.cpp util/qdesktopservices.h + util/qgridlayoutengine.cpp util/qgridlayoutengine_p.h + util/qhexstring_p.h + util/qktxhandler.cpp util/qktxhandler_p.h + util/qlayoutpolicy.cpp util/qlayoutpolicy_p.h + util/qpkmhandler.cpp util/qpkmhandler_p.h + util/qshaderformat.cpp util/qshaderformat_p.h + util/qshadergenerator.cpp util/qshadergenerator_p.h + util/qshadergraph.cpp util/qshadergraph_p.h + util/qshadergraphloader.cpp util/qshadergraphloader_p.h + util/qshaderlanguage.cpp util/qshaderlanguage_p.h + util/qshadernode.cpp util/qshadernode_p.h + util/qshadernodeport.cpp util/qshadernodeport_p.h + util/qshadernodesloader.cpp util/qshadernodesloader_p.h + util/qtexturefiledata.cpp util/qtexturefiledata_p.h + util/qtexturefilehandler_p.h + util/qtexturefilereader.cpp util/qtexturefilereader_p.h + util/qvalidator.cpp util/qvalidator.h + DEFINES + QT_NO_FOREACH + QT_NO_USING_NAMESPACE + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + +# Resources: +set_source_files_properties("painting/../../3rdparty/icc/sRGB2014.icc" + PROPERTIES alias "sRGB2014.icc") +add_qt_resource(Gui "qpdf" PREFIX "qpdf/" BASE "painting" FILES + ../../3rdparty/icc/sRGB2014.icc + qpdfa_metadata.xml) + +add_qt_simd_part(Gui SIMD sse2 + SOURCES + painting/qdrawhelper_sse2.cpp +) + +add_qt_simd_part(Gui SIMD ssse3 + SOURCES + image/qimage_ssse3.cpp + painting/qdrawhelper_ssse3.cpp +) + +add_qt_simd_part(Gui SIMD sse4_1 + SOURCES + painting/qdrawhelper_sse4.cpp + painting/qimagescale_sse4.cpp +) + +add_qt_simd_part(Gui SIMD neon + SOURCES + image/qimage_neon.cpp + painting/qdrawhelper_neon.cpp painting/qdrawhelper_neon_p.h + painting/qimagescale_neon.cpp +) + +add_qt_simd_part(Gui SIMD mips_dsp + SOURCES + painting/qdrawhelper_mips_dsp.cpp painting/qdrawhelper_mips_dsp_p.h + painting/qdrawhelper_mips_dsp_asm.S + painting/qt_mips_asm_dsp_p.h +) + +add_qt_simd_part(Gui SIMD mips_dspr2 + SOURCES + image/qimage_mips_dspr2.cpp + image/qimage_mips_dspr2_asm.S + painting/qdrawhelper_mips_dspr2_asm.S +) + +add_qt_simd_part(Gui SIMD arch_haswell + SOURCES + painting/qdrawhelper_avx2.cpp +) + + +#### Keys ignored in scope 1:.:.:gui.pro:: +# CONFIG = "simd" "optimize_full" "qt_tracepoints" +# MODULE_PLUGIN_TYPES = "platforms" "platforms/darwin" "xcbglintegrations" "platformthemes" "platforminputcontexts" "generic" "iconengines" "imageformats" "egldeviceintegrations" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtGui.dynlist" +# QMAKE_LIBS = "$$QMAKE_LIBS_GUI" +# _LOADED = "qt_module" "cmake_functions" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:gui.pro:qtConfig(opengl._x_): +# MODULE_CONFIG = "opengl" + +#### Keys ignored in scope 3:.:.:gui.pro:QT_FEATURE_angle: +# MODULE_AUX_INCLUDES = "\$\$QT_MODULE_INCLUDE_BASE/QtANGLE" + +#### Keys ignored in scope 4:.:.:gui.pro:testcocoon: +# _LOADED = "testcocoon" + +extend_target(Gui CONDITION APPLE_OSX + LIBRARIES + ${FWAppKit} +) + +extend_target(Gui CONDITION APPLE + SOURCES + image/qimage_darwin.mm + painting/qcoregraphics.mm painting/qcoregraphics_p.h + LIBRARIES + ${FWCoreGraphics} +) + +extend_target(Gui CONDITION QT_FEATURE_animation + SOURCES + animation/qguivariantanimation.cpp +) + +extend_target(Gui CONDITION WIN32 + SOURCES + kernel/qwindowdefs_win.h +) + +#### Keys ignored in scope 8:.:.:gui.pro:WIN32: +# CMAKE_WINDOWS_BUILD = "True" + +#### Keys ignored in scope 11:.:.:gui.pro:QT_FEATURE_egl: +# CMAKE_EGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_EGL" + +#### Keys ignored in scope 12:.:.:gui.pro:NOT QMAKE_LIBDIR_EGL_ISEMPTY: +# CMAKE_EGL_LIBDIR = "$$cmakeTargetPath$$QMAKE_LIBDIR_EGL" + +#### Keys ignored in scope 13:.:.:gui.pro:QT_FEATURE_opengles2: +# CMAKE_GL_HEADER_NAME = "GLES2/gl2.h" +# CMAKE_OPENGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_OPENGL_ES2" +# CMAKE_OPENGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_OPENGL_ES2" +# CMAKE_QT_OPENGL_IMPLEMENTATION = "GLESv2" + +#### Keys ignored in scope 14:.:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ES2_ISEMPTY: +# CMAKE_GL_INCDIRS = "$$cmakeTargetPaths$$QMAKE_INCDIR_OPENGL_ES2" + +#### Keys ignored in scope 15:.:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ES2_ISEMPTY: +# CMAKE_OPENGL_LIBDIR = "$$cmakePortablePaths$$QMAKE_LIBDIR_OPENGL_ES2" + +#### Keys ignored in scope 17:.:.:gui.pro:QT_FEATURE_opengl: +# CMAKE_GL_HEADER_NAME = "GL/gl.h" +# CMAKE_OPENGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_OPENGL" +# CMAKE_QT_OPENGL_IMPLEMENTATION = "GL" + +#### Keys ignored in scope 18:.:.:gui.pro:NOT QMAKE_INCDIR_OPENGL_ISEMPTY: +# CMAKE_GL_INCDIRS = "$$cmakeTargetPaths$$QMAKE_INCDIR_OPENGL" + +#### Keys ignored in scope 19:.:.:gui.pro:NOT QT_FEATURE_dynamicgl: +# CMAKE_OPENGL_LIBS = "$$cmakeProcessLibs$$QMAKE_LIBS_OPENGL" + +#### Keys ignored in scope 20:.:.:gui.pro:NOT QMAKE_LIBDIR_OPENGL_ISEMPTY: +# CMAKE_OPENGL_LIBDIR = "$$cmakePortablePaths$$QMAKE_LIBDIR_OPENGL" + +#### Keys ignored in scope 21:.:.:gui.pro:APPLE_OSX: +# CMAKE_GL_HEADER_NAME = "gl.h" + +#### Keys ignored in scope 22:.:.:gui.pro:QT_FEATURE_egl: +# CMAKE_EGL_INCDIRS = "$$cmakePortablePaths$$QMAKE_INCDIR_EGL" + +extend_target(Gui CONDITION QT_FEATURE_accessibility + SOURCES + accessible/qaccessible.cpp accessible/qaccessible.h + accessible/qaccessiblebridge.cpp accessible/qaccessiblebridge.h + accessible/qaccessiblecache.cpp accessible/qaccessiblecache_p.h + accessible/qaccessibleobject.cpp accessible/qaccessibleobject.h + accessible/qaccessibleplugin.cpp accessible/qaccessibleplugin.h + accessible/qplatformaccessibility.cpp accessible/qplatformaccessibility.h +) + +extend_target(Gui CONDITION APPLE_OSX AND QT_FEATURE_accessibility + SOURCES + accessible/qaccessiblecache_mac.mm + LIBRARIES + ${FWFoundation} +) + +extend_target(Gui CONDITION QT_FEATURE_draganddrop + SOURCES + kernel/qdnd.cpp kernel/qdnd_p.h + kernel/qdrag.cpp kernel/qdrag.h + kernel/qplatformdrag.cpp kernel/qplatformdrag.h + kernel/qshapedpixmapdndwindow.cpp kernel/qshapedpixmapdndwindow_p.h + kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h +) + +extend_target(Gui CONDITION QT_FEATURE_opengl + SOURCES + kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h + kernel/qopenglwindow.cpp kernel/qopenglwindow.h + kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h + opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h + opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h + opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h + opengl/qopenglcustomshaderstage.cpp opengl/qopenglcustomshaderstage_p.h + opengl/qopengldebug.cpp opengl/qopengldebug.h + opengl/qopenglengineshadermanager.cpp opengl/qopenglengineshadermanager_p.h + opengl/qopenglengineshadersource_p.h + opengl/qopenglextensions_p.h + opengl/qopenglextrafunctions.h + opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h + opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h + opengl/qopenglgradientcache.cpp opengl/qopenglgradientcache_p.h + opengl/qopenglpaintdevice.cpp opengl/qopenglpaintdevice.h opengl/qopenglpaintdevice_p.h + opengl/qopenglpaintengine.cpp opengl/qopenglpaintengine_p.h + opengl/qopenglpixeltransferoptions.cpp opengl/qopenglpixeltransferoptions.h + opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h + opengl/qopenglshadercache_p.h + opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h + opengl/qopengltexture.cpp opengl/qopengltexture.h opengl/qopengltexture_p.h + opengl/qopengltextureblitter.cpp opengl/qopengltextureblitter.h + opengl/qopengltexturecache.cpp opengl/qopengltexturecache_p.h + opengl/qopengltextureglyphcache.cpp opengl/qopengltextureglyphcache_p.h + opengl/qopengltexturehelper.cpp opengl/qopengltexturehelper_p.h + opengl/qopengltextureuploader.cpp opengl/qopengltextureuploader_p.h + opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h + opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h + opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h +) + +extend_target(Gui CONDITION QT_FEATURE_movie + SOURCES + image/qmovie.cpp image/qmovie.h +) + +extend_target(Gui CONDITION WIN32 AND NOT WINRT + SOURCES + image/qpixmap_win.cpp +) + +extend_target(Gui CONDITION QT_FEATURE_png + SOURCES + image/qpnghandler.cpp image/qpnghandler_p.h + LIBRARIES + PNG::PNG +) + +extend_target(Gui CONDITION QT_FEATURE_harfbuzz + SOURCES + text/qharfbuzzng.cpp text/qharfbuzzng_p.h + LIBRARIES + harfbuzz::harfbuzz +) + +extend_target(Gui CONDITION QT_FEATURE_textodfwriter + SOURCES + text/qtextodfwriter.cpp text/qtextodfwriter_p.h + text/qzip.cpp + text/qzipreader_p.h + text/qzipwriter_p.h +) + +extend_target(Gui CONDITION QT_FEATURE_cssparser + SOURCES + painting/qcssutil.cpp + text/qcssparser.cpp text/qcssparser_p.h +) + +extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 + SOURCES + -painting/qdrawhelper.cpp + painting/qdrawhelper.cpp +) + +#### Keys ignored in scope 45:.:painting:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: +# CONFIG = "no_clang_integrated_as" + +extend_target(Gui CONDITION UNIX AND NOT APPLE_UIKIT AND NOT INTEGRITY AND NOT (TEST_architecture_arch STREQUAL "arm64") + DEFINES + ENABLE_PIXMAN_DRAWHELPERS +) + +#### Keys ignored in scope 46:.:painting:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND NOT INTEGRITY AND NOT QT_ARCH___contains___arm64: +# NEON_ASM = "../3rdparty/pixman/pixman-arm-neon-asm.S" "painting/qdrawhelper_neon_asm.S" + +#### Keys ignored in scope 55:.:opengl:opengl/opengl.pri:QT_FEATURE_opengles2: +# CONFIG = "opengles2" + +extend_target(Gui CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 + SOURCES + opengl/qopenglfunctions_1_0.cpp opengl/qopenglfunctions_1_0.h + opengl/qopenglfunctions_1_1.cpp opengl/qopenglfunctions_1_1.h + opengl/qopenglfunctions_1_2.cpp opengl/qopenglfunctions_1_2.h + opengl/qopenglfunctions_1_3.cpp opengl/qopenglfunctions_1_3.h + opengl/qopenglfunctions_1_4.cpp opengl/qopenglfunctions_1_4.h + opengl/qopenglfunctions_1_5.cpp opengl/qopenglfunctions_1_5.h + opengl/qopenglfunctions_2_0.cpp opengl/qopenglfunctions_2_0.h + opengl/qopenglfunctions_2_1.cpp opengl/qopenglfunctions_2_1.h + opengl/qopenglfunctions_3_0.cpp opengl/qopenglfunctions_3_0.h + opengl/qopenglfunctions_3_1.cpp opengl/qopenglfunctions_3_1.h + opengl/qopenglfunctions_3_2_compatibility.cpp opengl/qopenglfunctions_3_2_compatibility.h + opengl/qopenglfunctions_3_2_core.cpp opengl/qopenglfunctions_3_2_core.h + opengl/qopenglfunctions_3_3_compatibility.cpp opengl/qopenglfunctions_3_3_compatibility.h + opengl/qopenglfunctions_3_3_core.cpp opengl/qopenglfunctions_3_3_core.h + opengl/qopenglfunctions_4_0_compatibility.cpp opengl/qopenglfunctions_4_0_compatibility.h + opengl/qopenglfunctions_4_0_core.cpp opengl/qopenglfunctions_4_0_core.h + opengl/qopenglfunctions_4_1_compatibility.cpp opengl/qopenglfunctions_4_1_compatibility.h + opengl/qopenglfunctions_4_1_core.cpp opengl/qopenglfunctions_4_1_core.h + opengl/qopenglfunctions_4_2_compatibility.cpp opengl/qopenglfunctions_4_2_compatibility.h + opengl/qopenglfunctions_4_2_core.cpp opengl/qopenglfunctions_4_2_core.h + opengl/qopenglfunctions_4_3_compatibility.cpp opengl/qopenglfunctions_4_3_compatibility.h + opengl/qopenglfunctions_4_3_core.cpp opengl/qopenglfunctions_4_3_core.h + opengl/qopenglfunctions_4_4_compatibility.cpp opengl/qopenglfunctions_4_4_compatibility.h + opengl/qopenglfunctions_4_4_core.cpp opengl/qopenglfunctions_4_4_core.h + opengl/qopenglfunctions_4_5_compatibility.cpp opengl/qopenglfunctions_4_5_compatibility.h + opengl/qopenglfunctions_4_5_core.cpp opengl/qopenglfunctions_4_5_core.h + opengl/qopenglqueryhelper_p.h + opengl/qopengltimerquery.cpp opengl/qopengltimerquery.h +) + +extend_target(Gui CONDITION QT_FEATURE_opengl AND QT_FEATURE_opengles2 + SOURCES + opengl/qopenglfunctions_es2.cpp opengl/qopenglfunctions_es2.h +) + +extend_target(Gui CONDITION QT_FEATURE_vulkan + SOURCES + vulkan/qplatformvulkaninstance.cpp vulkan/qplatformvulkaninstance.h + vulkan/qvulkanfunctions.cpp + vulkan/qvulkaninstance.cpp vulkan/qvulkaninstance.h + vulkan/qvulkanwindow.cpp vulkan/qvulkanwindow.h vulkan/qvulkanwindow_p.h + PUBLIC_LIBRARIES + Vulkan::Vulkan_nolink +) + +#### Keys ignored in scope 62:.:vulkan:vulkan/vulkan.pri:QT_FEATURE_vulkan: +# CONFIG = "generated_privates" + +#### Keys ignored in scope 64:.:vulkan:vulkan/vulkan.pri:else: +# qvkgen_h.CONFIG = "target_predeps" "no_link" + +extend_target(Gui CONDITION WASM + SOURCES + platform/wasm/qwasmlocalfileaccess.cpp platform/wasm/qwasmlocalfileaccess_p.h +) + + +qt_create_tracepoints(Gui qtgui.tracepoints) +add_qt_docs( + doc/qtgui.qdocconf +) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 15878a863b4..96842afd7ff 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -236,8 +236,8 @@ add_qt_module(Gui util/qtexturefilereader.cpp util/qtexturefilereader_p.h util/qvalidator.cpp util/qvalidator.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE QT_QPA_DEFAULT_PLATFORM_NAME="${QT_QPA_DEFAULT_PLATFORM}" # special case LIBRARIES Qt::CorePrivate From 7f68437296e1dc1e2008a15b0a41b1685b764f18 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 15:42:34 +0200 Subject: [PATCH 0521/1322] Regenerate widgets And add the first version of the .prev file. Change-Id: I901c413997dcc497da5e45b1675726180c84e709 Reviewed-by: Tobias Hunger --- src/widgets/.prev_CMakeLists.txt | 791 +++++++++++++++++++++++++++++++ src/widgets/CMakeLists.txt | 41 +- 2 files changed, 813 insertions(+), 19 deletions(-) create mode 100644 src/widgets/.prev_CMakeLists.txt diff --git a/src/widgets/.prev_CMakeLists.txt b/src/widgets/.prev_CMakeLists.txt new file mode 100644 index 00000000000..76b90226506 --- /dev/null +++ b/src/widgets/.prev_CMakeLists.txt @@ -0,0 +1,791 @@ +# Generated from widgets.pro. + +##################################################################### +## Widgets Module: +##################################################################### + +add_qt_module(Widgets + SOURCES + itemviews/qfileiconprovider.cpp itemviews/qfileiconprovider.h itemviews/qfileiconprovider_p.h + kernel/qaction.cpp kernel/qaction.h kernel/qaction_p.h + kernel/qactiongroup.cpp kernel/qactiongroup.h + kernel/qapplication.cpp kernel/qapplication.h kernel/qapplication_p.h + kernel/qboxlayout.cpp kernel/qboxlayout.h + kernel/qdesktopwidget.cpp kernel/qdesktopwidget.h kernel/qdesktopwidget_p.h + kernel/qgesture.cpp kernel/qgesture.h kernel/qgesture_p.h + kernel/qgesturemanager.cpp kernel/qgesturemanager_p.h + kernel/qgesturerecognizer.cpp kernel/qgesturerecognizer.h + kernel/qgridlayout.cpp kernel/qgridlayout.h + kernel/qlayout.cpp kernel/qlayout.h kernel/qlayout_p.h + kernel/qlayoutengine.cpp kernel/qlayoutengine_p.h + kernel/qlayoutitem.cpp kernel/qlayoutitem.h + kernel/qshortcut.cpp kernel/qshortcut.h + kernel/qsizepolicy.cpp kernel/qsizepolicy.h + kernel/qstackedlayout.cpp kernel/qstackedlayout.h + kernel/qstandardgestures.cpp kernel/qstandardgestures_p.h + kernel/qtestsupport_widgets.cpp kernel/qtestsupport_widgets.h + kernel/qtooltip.cpp kernel/qtooltip.h + kernel/qtwidgetsglobal.h kernel/qtwidgetsglobal_p.h + kernel/qwidget.cpp kernel/qwidget.h kernel/qwidget_p.h + kernel/qwidgetaction.cpp kernel/qwidgetaction.h kernel/qwidgetaction_p.h + kernel/qwidgetbackingstore.cpp kernel/qwidgetbackingstore_p.h + kernel/qwidgetsvariant.cpp + kernel/qwidgetwindow.cpp kernel/qwidgetwindow_p.h + kernel/qwindowcontainer.cpp kernel/qwindowcontainer_p.h + styles/qcommonstyle.cpp styles/qcommonstyle.h styles/qcommonstyle_p.h + styles/qcommonstylepixmaps_p.h + styles/qdrawutil.cpp styles/qdrawutil.h + styles/qpixmapstyle.cpp styles/qpixmapstyle_p.h + styles/qpixmapstyle_p_p.h + styles/qproxystyle.cpp styles/qproxystyle.h styles/qproxystyle_p.h + styles/qstyle.cpp styles/qstyle.h + styles/qstylefactory.cpp styles/qstylefactory.h + styles/qstylehelper.cpp styles/qstylehelper_p.h + styles/qstyleoption.cpp styles/qstyleoption.h + styles/qstylepainter.cpp styles/qstylepainter.h + styles/qstyleplugin.cpp styles/qstyleplugin.h + styles/qstylesheetstyle.cpp styles/qstylesheetstyle_p.h + styles/qstylesheetstyle_default.cpp + util/qcolormap.cpp util/qcolormap.h + util/qsystemtrayicon.cpp util/qsystemtrayicon.h util/qsystemtrayicon_p.h + widgets/qabstractscrollarea.cpp widgets/qabstractscrollarea.h widgets/qabstractscrollarea_p.h + widgets/qfocusframe.cpp widgets/qfocusframe.h + widgets/qframe.cpp widgets/qframe.h widgets/qframe_p.h + widgets/qwidgetanimator.cpp widgets/qwidgetanimator_p.h + DEFINES + QT_NO_USING_NAMESPACE + INCLUDE_DIRECTORIES + dialogs + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui +) + +# Resources: +add_qt_resource(Widgets "qstyle" PREFIX "/qt-project.org/styles/commonstyle" BASE "styles" FILES + images/cdr-128.png + images/cdr-16.png + images/cdr-32.png + images/cleartext-16.png + images/cleartext-32.png + images/closedock-10.png + images/closedock-16.png + images/closedock-20.png + images/closedock-32.png + images/closedock-48.png + images/closedock-64.png + images/computer-16.png + images/computer-32.png + images/desktop-16.png + images/desktop-32.png + images/dirclosed-128.png + images/dirclosed-16.png + images/dirclosed-32.png + images/dirlink-128.png + images/dirlink-16.png + images/dirlink-32.png + images/diropen-128.png + images/diropen-16.png + images/diropen-32.png + images/down-128.png + images/down-16.png + images/down-32.png + images/dvd-128.png + images/dvd-16.png + images/dvd-32.png + images/file-128.png + images/file-16.png + images/file-32.png + images/filecontents-128.png + images/filecontents-16.png + images/filecontents-32.png + images/fileinfo-128.png + images/fileinfo-16.png + images/fileinfo-32.png + images/filelink-128.png + images/filelink-16.png + images/filelink-32.png + images/floppy-128.png + images/floppy-16.png + images/floppy-32.png + images/fontbitmap-16.png + images/fonttruetype-16.png + images/fusion_groupbox.png + images/harddrive-128.png + images/harddrive-16.png + images/harddrive-32.png + images/left-128.png + images/left-16.png + images/left-32.png + images/media-pause-16.png + images/media-pause-32.png + images/media-play-16.png + images/media-play-32.png + images/media-seek-backward-16.png + images/media-seek-backward-32.png + images/media-seek-forward-16.png + images/media-seek-forward-32.png + images/media-skip-backward-16.png + images/media-skip-backward-32.png + images/media-skip-forward-16.png + images/media-skip-forward-32.png + images/media-stop-16.png + images/media-stop-32.png + images/media-volume-16.png + images/media-volume-muted-16.png + images/networkdrive-128.png + images/networkdrive-16.png + images/networkdrive-32.png + images/newdirectory-128.png + images/newdirectory-16.png + images/newdirectory-32.png + images/normalizedockup-10.png + images/normalizedockup-16.png + images/normalizedockup-20.png + images/normalizedockup-32.png + images/normalizedockup-48.png + images/normalizedockup-64.png + images/parentdir-128.png + images/parentdir-16.png + images/parentdir-32.png + images/refresh-24.png + images/refresh-32.png + images/right-128.png + images/right-16.png + images/right-32.png + images/standardbutton-apply-128.png + images/standardbutton-apply-16.png + images/standardbutton-apply-32.png + images/standardbutton-cancel-128.png + images/standardbutton-cancel-16.png + images/standardbutton-cancel-32.png + images/standardbutton-clear-128.png + images/standardbutton-clear-16.png + images/standardbutton-clear-32.png + images/standardbutton-close-128.png + images/standardbutton-close-16.png + images/standardbutton-close-32.png + images/standardbutton-closetab-16.png + images/standardbutton-closetab-down-16.png + images/standardbutton-closetab-hover-16.png + images/standardbutton-delete-128.png + images/standardbutton-delete-16.png + images/standardbutton-delete-32.png + images/standardbutton-help-128.png + images/standardbutton-help-16.png + images/standardbutton-help-32.png + images/standardbutton-no-128.png + images/standardbutton-no-16.png + images/standardbutton-no-32.png + images/standardbutton-ok-128.png + images/standardbutton-ok-16.png + images/standardbutton-ok-32.png + images/standardbutton-open-128.png + images/standardbutton-open-16.png + images/standardbutton-open-32.png + images/standardbutton-save-128.png + images/standardbutton-save-16.png + images/standardbutton-save-32.png + images/standardbutton-yes-128.png + images/standardbutton-yes-16.png + images/standardbutton-yes-32.png + images/stop-24.png + images/stop-32.png + images/titlebar-contexthelp-16.png + images/titlebar-contexthelp-32.png + images/titlebar-contexthelp-48.png + images/titlebar-max-16.png + images/titlebar-max-32.png + images/titlebar-max-48.png + images/titlebar-min-16.png + images/titlebar-min-32.png + images/titlebar-min-48.png + images/titlebar-shade-16.png + images/titlebar-shade-32.png + images/titlebar-shade-48.png + images/titlebar-unshade-16.png + images/titlebar-unshade-32.png + images/titlebar-unshade-48.png + images/toolbar-ext-h-16.png + images/toolbar-ext-h-32.png + images/toolbar-ext-h-8.png + images/toolbar-ext-h-rtl-16.png + images/toolbar-ext-h-rtl-32.png + images/toolbar-ext-h-rtl-8.png + images/toolbar-ext-v-10.png + images/toolbar-ext-v-20.png + images/toolbar-ext-v-5.png + images/trash-128.png + images/trash-16.png + images/trash-32.png + images/up-128.png + images/up-16.png + images/up-32.png + images/viewdetailed-128.png + images/viewdetailed-16.png + images/viewdetailed-32.png + images/viewlist-128.png + images/viewlist-16.png + images/viewlist-32.png) +set_source_files_properties("styles/images/closedock-down-macstyle-16.png" + PROPERTIES alias "images/closedock-down-16.png") +set_source_files_properties("styles/images/closedock-macstyle-16.png" + PROPERTIES alias "images/closedock-16.png") +set_source_files_properties("styles/images/dockdock-down-macstyle-16.png" + PROPERTIES alias "images/dockdock-down-16.png") +set_source_files_properties("styles/images/dockdock-macstyle-16.png" + PROPERTIES alias "images/dockdock-16.png") +set_source_files_properties("styles/images/toolbar-ext-macstyle.png" + PROPERTIES alias "images/toolbar-ext.png") +set_source_files_properties("styles/images/toolbar-ext-macstyle@2x.png" + PROPERTIES alias "images/toolbar-ext@2x.png") +add_qt_resource(Widgets "qstyle1" PREFIX "/qt-project.org/styles/macstyle" BASE "styles" FILES + images/closedock-down-macstyle-16.png + images/closedock-macstyle-16.png + images/dockdock-down-macstyle-16.png + images/dockdock-macstyle-16.png + images/toolbar-ext-macstyle.png + images/toolbar-ext-macstyle@2x.png) + + +#### Keys ignored in scope 1:.:.:widgets.pro:: +# CONFIG = "$$MODULE_CONFIG" "qt_tracepoints" +# MODULE_CONFIG = "uic" +# MODULE_PLUGIN_TYPES = "styles" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtWidgets.dynlist" +# QMAKE_LIBS = "$$QMAKE_LIBS_GUI" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(Widgets CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x65000000" +) + +extend_target(Widgets CONDITION APPLE_OSX + SOURCES + kernel/qmacgesturerecognizer.cpp kernel/qmacgesturerecognizer_p.h + util/qscroller_mac.mm + widgets/qmaccocoaviewcontainer_mac.h widgets/qmaccocoaviewcontainer_mac.mm + widgets/qmacnativewidget_mac.h widgets/qmacnativewidget_mac.mm + LIBRARIES + ${FWAppKit} + z +) + +extend_target(Widgets CONDITION WIN32 + INCLUDE_DIRECTORIES + ../3rdparty/wintab +) + +extend_target(Widgets CONDITION WIN32 AND NOT WINRT + LIBRARIES + dwmapi + shell32 + uxtheme +) + +extend_target(Widgets CONDITION QT_FEATURE_graphicseffect + SOURCES + effects/qgraphicseffect.cpp effects/qgraphicseffect.h effects/qgraphicseffect_p.h + effects/qpixmapfilter.cpp effects/qpixmapfilter_p.h +) + +#### Keys ignored in scope 6:.:.:widgets.pro:testcocoon: +# _LOADED = "testcocoon" + +extend_target(Widgets CONDITION QT_FEATURE_opengl + SOURCES + kernel/qopenglwidget.cpp kernel/qopenglwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_formlayout + SOURCES + kernel/qformlayout.cpp kernel/qformlayout.h +) + +extend_target(Widgets CONDITION QT_FEATURE_whatsthis + SOURCES + kernel/qwhatsthis.cpp kernel/qwhatsthis.h +) + +extend_target(Widgets CONDITION QT_FEATURE_animation + SOURCES + styles/qstyleanimation.cpp styles/qstyleanimation_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_style_windows + SOURCES + styles/qwindowsstyle.cpp styles/qwindowsstyle_p.h + styles/qwindowsstyle_p_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_style_fusion + SOURCES + styles/qfusionstyle.cpp styles/qfusionstyle_p.h + styles/qfusionstyle_p_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_abstractbutton + SOURCES + widgets/qabstractbutton.cpp widgets/qabstractbutton.h widgets/qabstractbutton_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_abstractslider + SOURCES + widgets/qabstractslider.cpp widgets/qabstractslider.h widgets/qabstractslider_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_buttongroup + SOURCES + widgets/qbuttongroup.cpp widgets/qbuttongroup.h widgets/qbuttongroup_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_calendarwidget + SOURCES + widgets/qcalendarwidget.cpp widgets/qcalendarwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_checkbox + SOURCES + widgets/qcheckbox.cpp widgets/qcheckbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_combobox + SOURCES + widgets/qcombobox.cpp widgets/qcombobox.h widgets/qcombobox_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_commandlinkbutton + SOURCES + widgets/qcommandlinkbutton.cpp widgets/qcommandlinkbutton.h +) + +extend_target(Widgets CONDITION QT_FEATURE_datetimeedit + SOURCES + widgets/qdatetimeedit.cpp widgets/qdatetimeedit.h widgets/qdatetimeedit_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dial + SOURCES + widgets/qdial.cpp widgets/qdial.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dockwidget + SOURCES + widgets/qdockarealayout.cpp widgets/qdockarealayout_p.h + widgets/qdockwidget.cpp widgets/qdockwidget.h widgets/qdockwidget_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_effects + SOURCES + widgets/qeffects.cpp widgets/qeffects_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_fontcombobox + SOURCES + widgets/qfontcombobox.cpp widgets/qfontcombobox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_groupbox + SOURCES + widgets/qgroupbox.cpp widgets/qgroupbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_keysequenceedit + SOURCES + widgets/qkeysequenceedit.cpp widgets/qkeysequenceedit.h widgets/qkeysequenceedit_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_label + SOURCES + widgets/qlabel.cpp widgets/qlabel.h widgets/qlabel_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_lcdnumber + SOURCES + widgets/qlcdnumber.cpp widgets/qlcdnumber.h +) + +extend_target(Widgets CONDITION QT_FEATURE_lineedit + SOURCES + widgets/qlineedit.cpp widgets/qlineedit.h widgets/qlineedit_p.cpp widgets/qlineedit_p.h + widgets/qwidgetlinecontrol.cpp widgets/qwidgetlinecontrol_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_mainwindow + SOURCES + widgets/qmainwindow.cpp widgets/qmainwindow.h + widgets/qmainwindowlayout.cpp widgets/qmainwindowlayout_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_mdiarea + SOURCES + widgets/qmdiarea.cpp widgets/qmdiarea.h widgets/qmdiarea_p.h + widgets/qmdisubwindow.cpp widgets/qmdisubwindow.h widgets/qmdisubwindow_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_menu + SOURCES + widgets/qmenu.cpp widgets/qmenu.h widgets/qmenu_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_menubar + SOURCES + widgets/qmenubar.cpp widgets/qmenubar.h widgets/qmenubar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_progressbar + SOURCES + widgets/qprogressbar.cpp widgets/qprogressbar.h +) + +extend_target(Widgets CONDITION QT_FEATURE_pushbutton + SOURCES + widgets/qpushbutton.cpp widgets/qpushbutton.h widgets/qpushbutton_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_radiobutton + SOURCES + widgets/qradiobutton.cpp widgets/qradiobutton.h +) + +extend_target(Widgets CONDITION QT_FEATURE_resizehandler + SOURCES + widgets/qwidgetresizehandler.cpp widgets/qwidgetresizehandler_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dialogbuttonbox + SOURCES + widgets/qdialogbuttonbox.cpp widgets/qdialogbuttonbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_rubberband + SOURCES + widgets/qrubberband.cpp widgets/qrubberband.h +) + +extend_target(Widgets CONDITION QT_FEATURE_scrollarea + SOURCES + widgets/qscrollarea.cpp widgets/qscrollarea.h widgets/qscrollarea_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_scrollbar + SOURCES + widgets/qscrollbar.cpp widgets/qscrollbar.h widgets/qscrollbar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_sizegrip + SOURCES + widgets/qsizegrip.cpp widgets/qsizegrip.h +) + +extend_target(Widgets CONDITION QT_FEATURE_slider + SOURCES + widgets/qslider.cpp widgets/qslider.h +) + +extend_target(Widgets CONDITION QT_FEATURE_spinbox + SOURCES + widgets/qabstractspinbox.cpp widgets/qabstractspinbox.h widgets/qabstractspinbox_p.h + widgets/qspinbox.cpp widgets/qspinbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_splashscreen + SOURCES + widgets/qsplashscreen.cpp widgets/qsplashscreen.h +) + +extend_target(Widgets CONDITION QT_FEATURE_splitter + SOURCES + widgets/qsplitter.cpp widgets/qsplitter.h widgets/qsplitter_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_stackedwidget + SOURCES + widgets/qstackedwidget.cpp widgets/qstackedwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_statusbar + SOURCES + widgets/qstatusbar.cpp widgets/qstatusbar.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tabbar + SOURCES + widgets/qtabbar.cpp widgets/qtabbar.h widgets/qtabbar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_textedit + SOURCES + widgets/qplaintextedit.cpp widgets/qplaintextedit.h widgets/qplaintextedit_p.h + widgets/qtextedit.cpp widgets/qtextedit.h widgets/qtextedit_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_textbrowser + SOURCES + widgets/qtextbrowser.cpp widgets/qtextbrowser.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tabwidget + SOURCES + widgets/qtabwidget.cpp widgets/qtabwidget.h +) + +extend_target(Widgets CONDITION QT_FEATURE_toolbar + SOURCES + widgets/qtoolbar.cpp widgets/qtoolbar.h widgets/qtoolbar_p.h + widgets/qtoolbararealayout.cpp widgets/qtoolbararealayout_p.h + widgets/qtoolbarlayout.cpp widgets/qtoolbarlayout_p.h + widgets/qtoolbarseparator.cpp widgets/qtoolbarseparator_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_toolbox + SOURCES + widgets/qtoolbox.cpp widgets/qtoolbox.h +) + +extend_target(Widgets CONDITION QT_FEATURE_toolbutton + SOURCES + widgets/qtoolbarextension.cpp widgets/qtoolbarextension_p.h + widgets/qtoolbutton.cpp widgets/qtoolbutton.h +) + +extend_target(Widgets CONDITION QT_FEATURE_widgettextcontrol + SOURCES + widgets/qwidgettextcontrol.cpp widgets/qwidgettextcontrol_p.h + widgets/qwidgettextcontrol_p_p.h +) + +extend_target(Widgets CONDITION APPLE_OSX AND (QT_FEATURE_menu OR QT_FEATURE_menubar) + SOURCES + widgets/qmenu_mac.mm +) + +extend_target(Widgets CONDITION QT_FEATURE_colordialog + SOURCES + dialogs/qcolordialog.cpp dialogs/qcolordialog.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dialog + SOURCES + dialogs/qdialog.cpp dialogs/qdialog.h dialogs/qdialog_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_errormessage + SOURCES + dialogs/qerrormessage.cpp dialogs/qerrormessage.h +) + +extend_target(Widgets CONDITION QT_FEATURE_filedialog + SOURCES + dialogs/qfiledialog.cpp dialogs/qfiledialog.h dialogs/qfiledialog.ui dialogs/qfiledialog_p.h + dialogs/qsidebar.cpp dialogs/qsidebar_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_filesystemmodel + SOURCES + dialogs/qfileinfogatherer.cpp dialogs/qfileinfogatherer_p.h + dialogs/qfilesystemmodel.cpp dialogs/qfilesystemmodel.h dialogs/qfilesystemmodel_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_fontdialog + SOURCES + dialogs/qfontdialog.cpp dialogs/qfontdialog.h dialogs/qfontdialog_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_fscompleter + SOURCES + dialogs/qfscompleter_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_inputdialog + SOURCES + dialogs/qinputdialog.cpp dialogs/qinputdialog.h +) + +extend_target(Widgets CONDITION QT_FEATURE_messagebox + SOURCES + dialogs/qmessagebox.cpp dialogs/qmessagebox.h +) + +# Resources: +add_qt_resource(Widgets "qmessagebox" PREFIX "/qt-project.org/qmessagebox" BASE "dialogs" FILES + images/qtlogo-64.png) + + +extend_target(Widgets CONDITION QT_FEATURE_progressdialog + SOURCES + dialogs/qprogressdialog.cpp dialogs/qprogressdialog.h +) + +extend_target(Widgets CONDITION QT_FEATURE_wizard + SOURCES + dialogs/qwizard.cpp dialogs/qwizard.h +) + +extend_target(Widgets CONDITION QT_FEATURE_wizard AND WIN32 + SOURCES + dialogs/qwizard_win.cpp dialogs/qwizard_win_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_accessibility + SOURCES + accessible/complexwidgets.cpp accessible/complexwidgets_p.h + accessible/qaccessiblemenu.cpp accessible/qaccessiblemenu_p.h + accessible/qaccessiblewidget.cpp accessible/qaccessiblewidget.h + accessible/qaccessiblewidgetfactory.cpp accessible/qaccessiblewidgetfactory_p.h + accessible/qaccessiblewidgets.cpp accessible/qaccessiblewidgets_p.h + accessible/rangecontrols.cpp accessible/rangecontrols_p.h + accessible/simplewidgets.cpp accessible/simplewidgets_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_accessibility AND QT_FEATURE_itemviews + SOURCES + accessible/itemviews.cpp accessible/itemviews_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_itemviews + SOURCES + itemviews/qabstractitemdelegate.cpp itemviews/qabstractitemdelegate.h itemviews/qabstractitemdelegate_p.h + itemviews/qabstractitemview.cpp itemviews/qabstractitemview.h itemviews/qabstractitemview_p.h + itemviews/qbsptree.cpp itemviews/qbsptree_p.h + itemviews/qheaderview.cpp itemviews/qheaderview.h itemviews/qheaderview_p.h + itemviews/qitemdelegate.cpp itemviews/qitemdelegate.h + itemviews/qitemeditorfactory.cpp itemviews/qitemeditorfactory.h itemviews/qitemeditorfactory_p.h + itemviews/qstyleditemdelegate.cpp itemviews/qstyleditemdelegate.h + itemviews/qwidgetitemdata_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_columnview + SOURCES + itemviews/qcolumnview.cpp itemviews/qcolumnview.h itemviews/qcolumnview_p.h + itemviews/qcolumnviewgrip.cpp itemviews/qcolumnviewgrip_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_datawidgetmapper + SOURCES + itemviews/qdatawidgetmapper.cpp itemviews/qdatawidgetmapper.h +) + +extend_target(Widgets CONDITION QT_FEATURE_dirmodel + SOURCES + itemviews/qdirmodel.cpp itemviews/qdirmodel.h +) + +extend_target(Widgets CONDITION QT_FEATURE_listview + SOURCES + itemviews/qlistview.cpp itemviews/qlistview.h itemviews/qlistview_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_listwidget + SOURCES + itemviews/qlistwidget.cpp itemviews/qlistwidget.h itemviews/qlistwidget_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tableview + SOURCES + itemviews/qtableview.cpp itemviews/qtableview.h itemviews/qtableview_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_tablewidget + SOURCES + itemviews/qtablewidget.cpp itemviews/qtablewidget.h itemviews/qtablewidget_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_treeview + SOURCES + itemviews/qtreeview.cpp itemviews/qtreeview.h itemviews/qtreeview_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_treewidget + SOURCES + itemviews/qtreewidget.cpp itemviews/qtreewidget.h itemviews/qtreewidget_p.h + itemviews/qtreewidgetitemiterator.cpp itemviews/qtreewidgetitemiterator.h +) + +extend_target(Widgets CONDITION QT_FEATURE_graphicsview + SOURCES + graphicsview/qgraph_p.h + graphicsview/qgraphicsanchorlayout.cpp graphicsview/qgraphicsanchorlayout.h graphicsview/qgraphicsanchorlayout_p.cpp graphicsview/qgraphicsanchorlayout_p.h + graphicsview/qgraphicsgridlayout.cpp graphicsview/qgraphicsgridlayout.h + graphicsview/qgraphicsgridlayoutengine.cpp graphicsview/qgraphicsgridlayoutengine_p.h + graphicsview/qgraphicsitem.cpp graphicsview/qgraphicsitem.h graphicsview/qgraphicsitem_p.h + graphicsview/qgraphicsitemanimation.cpp graphicsview/qgraphicsitemanimation.h + graphicsview/qgraphicslayout.cpp graphicsview/qgraphicslayout.h graphicsview/qgraphicslayout_p.cpp graphicsview/qgraphicslayout_p.h + graphicsview/qgraphicslayoutitem.cpp graphicsview/qgraphicslayoutitem.h graphicsview/qgraphicslayoutitem_p.h + graphicsview/qgraphicslayoutstyleinfo.cpp graphicsview/qgraphicslayoutstyleinfo_p.h + graphicsview/qgraphicslinearlayout.cpp graphicsview/qgraphicslinearlayout.h + graphicsview/qgraphicsproxywidget.cpp graphicsview/qgraphicsproxywidget.h graphicsview/qgraphicsproxywidget_p.h + graphicsview/qgraphicsscene.cpp graphicsview/qgraphicsscene.h graphicsview/qgraphicsscene_p.h + graphicsview/qgraphicsscene_bsp.cpp graphicsview/qgraphicsscene_bsp_p.h + graphicsview/qgraphicsscenebsptreeindex.cpp graphicsview/qgraphicsscenebsptreeindex_p.h + graphicsview/qgraphicssceneevent.cpp graphicsview/qgraphicssceneevent.h + graphicsview/qgraphicssceneindex.cpp graphicsview/qgraphicssceneindex_p.h + graphicsview/qgraphicsscenelinearindex.cpp graphicsview/qgraphicsscenelinearindex_p.h + graphicsview/qgraphicstransform.cpp graphicsview/qgraphicstransform.h graphicsview/qgraphicstransform_p.h + graphicsview/qgraphicsview.cpp graphicsview/qgraphicsview.h graphicsview/qgraphicsview_p.h + graphicsview/qgraphicswidget.cpp graphicsview/qgraphicswidget.h graphicsview/qgraphicswidget_p.cpp graphicsview/qgraphicswidget_p.h + graphicsview/qsimplex_p.cpp graphicsview/qsimplex_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_completer + SOURCES + util/qcompleter.cpp util/qcompleter.h util/qcompleter_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_scroller + SOURCES + util/qflickgesture.cpp util/qflickgesture_p.h + util/qscroller.cpp util/qscroller.h util/qscroller_p.h + util/qscrollerproperties.cpp util/qscrollerproperties.h util/qscrollerproperties_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_undocommand + SOURCES + util/qundostack.cpp util/qundostack.h util/qundostack_p.h +) + +extend_target(Widgets CONDITION QT_FEATURE_undogroup + SOURCES + util/qundogroup.cpp util/qundogroup.h +) + +extend_target(Widgets CONDITION QT_FEATURE_undoview + SOURCES + util/qundoview.cpp util/qundoview.h +) + +extend_target(Widgets CONDITION QT_FEATURE_xcb + SOURCES + util/qsystemtrayicon_x11.cpp +) + +extend_target(Widgets CONDITION NOT QT_FEATURE_xcb + SOURCES + util/qsystemtrayicon_qpa.cpp +) + +extend_target(Widgets CONDITION QT_FEATURE_statemachine + SOURCES + statemachine/qguistatemachine.cpp +) + +extend_target(Widgets CONDITION QT_FEATURE_qeventtransition + SOURCES + statemachine/qbasickeyeventtransition.cpp statemachine/qbasickeyeventtransition_p.h + statemachine/qbasicmouseeventtransition.cpp statemachine/qbasicmouseeventtransition_p.h + statemachine/qkeyeventtransition.cpp statemachine/qkeyeventtransition.h + statemachine/qmouseeventtransition.cpp statemachine/qmouseeventtransition.h +) + + +qt_create_tracepoints(Widgets qtwidgets.tracepoints) +add_qt_docs( + doc/qtwidgets.qdocconf +) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index d73dc8789dc..83400dc82a0 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -39,7 +39,6 @@ add_qt_module(Widgets styles/qpixmapstyle_p_p.h styles/qproxystyle.cpp styles/qproxystyle.h styles/qproxystyle_p.h styles/qstyle.cpp styles/qstyle.h - styles/qstyleanimation.cpp styles/qstyleanimation_p.h styles/qstylefactory.cpp styles/qstylefactory.h styles/qstylehelper.cpp styles/qstylehelper_p.h styles/qstyleoption.cpp styles/qstyleoption.h @@ -63,15 +62,6 @@ add_qt_module(Widgets PUBLIC_LIBRARIES Qt::Core Qt::Gui - # CONFIG = "$$MODULE_CONFIG" "qt_tracepoints" - # KERNEL_P = "kernel" - # MODULE_CONFIG = "uic" - # MODULE_PLUGIN_TYPES = "styles" - # PRECOMPILED_HEADER = "kernel/qt_widgets_pch.h" - # QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtWidgets.dynlist" - # QMAKE_LIBS = "$$QMAKE_LIBS_GUI" - # TRACEPOINT_PROVIDER = "$$PWD/qtwidgets.tracepoints" - # _LOADED = "qt_module" ) add_dependencies(Widgets ${QT_CMAKE_EXPORT_NAMESPACE}::uic) # special case @@ -263,10 +253,18 @@ add_qt_resource(Widgets "qstyle1" PREFIX "/qt-project.org/styles/macstyle" BASE images/toolbar-ext-macstyle@2x.png) +#### Keys ignored in scope 1:.:.:widgets.pro:: +# CONFIG = "$$MODULE_CONFIG" "qt_tracepoints" +# MODULE_CONFIG = "uic" +# MODULE_PLUGIN_TYPES = "styles" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtWidgets.dynlist" +# QMAKE_LIBS = "$$QMAKE_LIBS_GUI" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### -extend_target(Widgets CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") +extend_target(Widgets CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x65000000" ) @@ -291,9 +289,9 @@ extend_target(Widgets CONDITION WIN32 extend_target(Widgets CONDITION WIN32 AND NOT WINRT LIBRARIES + dwmapi shell32 uxtheme - dwmapi ) extend_target(Widgets CONDITION QT_FEATURE_graphicseffect @@ -301,10 +299,9 @@ extend_target(Widgets CONDITION QT_FEATURE_graphicseffect effects/qgraphicseffect.cpp effects/qgraphicseffect.h effects/qgraphicseffect_p.h effects/qpixmapfilter.cpp effects/qpixmapfilter_p.h ) -# -#extend_target(Widgets CONDITION testcocoon -# # _LOADED = "testcocoon" -#) + +#### Keys ignored in scope 6:.:.:widgets.pro:testcocoon: +# _LOADED = "testcocoon" extend_target(Widgets CONDITION QT_FEATURE_opengl SOURCES @@ -321,6 +318,11 @@ extend_target(Widgets CONDITION QT_FEATURE_whatsthis kernel/qwhatsthis.cpp kernel/qwhatsthis.h ) +extend_target(Widgets CONDITION QT_FEATURE_animation + SOURCES + styles/qstyleanimation.cpp styles/qstyleanimation_p.h +) + extend_target(Widgets CONDITION QT_FEATURE_style_windows SOURCES styles/qwindowsstyle.cpp styles/qwindowsstyle_p.h @@ -787,6 +789,7 @@ extend_target(Widgets CONDITION QT_FEATURE_qeventtransition ) -qt_create_tracepoints(Widgets ./qtwidgets.tracepoints) - -add_qt_docs(./doc/qtwidgets.qdocconf) +qt_create_tracepoints(Widgets qtwidgets.tracepoints) +add_qt_docs( + doc/qtwidgets.qdocconf +) From b1746c1da1dd3c98405979737e65dd4835ec3ede Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:13:28 +0200 Subject: [PATCH 0522/1322] Regenerate network And add the first version of the .prev file. Change-Id: I9d298e483032081a02a63b4f887f4d682ea7ccd4 Reviewed-by: Tobias Hunger --- src/network/.prev_CMakeLists.txt | 416 +++++++++++++++++++++++++++++++ src/network/CMakeLists.txt | 10 +- 2 files changed, 425 insertions(+), 1 deletion(-) create mode 100644 src/network/.prev_CMakeLists.txt diff --git a/src/network/.prev_CMakeLists.txt b/src/network/.prev_CMakeLists.txt new file mode 100644 index 00000000000..d48c3920fc6 --- /dev/null +++ b/src/network/.prev_CMakeLists.txt @@ -0,0 +1,416 @@ +# Generated from network.pro. + +##################################################################### +## Network Module: +##################################################################### + +add_qt_module(Network + SOURCES + access/qabstractnetworkcache.cpp access/qabstractnetworkcache.h access/qabstractnetworkcache_p.h + access/qhsts.cpp access/qhsts_p.h + access/qhstspolicy.cpp access/qhstspolicy.h + access/qnetworkaccessauthenticationmanager.cpp access/qnetworkaccessauthenticationmanager_p.h + access/qnetworkaccessbackend.cpp access/qnetworkaccessbackend_p.h + access/qnetworkaccesscache.cpp access/qnetworkaccesscache_p.h + access/qnetworkaccesscachebackend.cpp access/qnetworkaccesscachebackend_p.h + access/qnetworkaccessdebugpipebackend.cpp access/qnetworkaccessdebugpipebackend_p.h + access/qnetworkaccessfilebackend.cpp access/qnetworkaccessfilebackend_p.h + access/qnetworkaccessmanager.cpp access/qnetworkaccessmanager.h access/qnetworkaccessmanager_p.h + access/qnetworkcookie.cpp access/qnetworkcookie.h access/qnetworkcookie_p.h + access/qnetworkcookiejar.cpp access/qnetworkcookiejar.h access/qnetworkcookiejar_p.h + access/qnetworkfile.cpp access/qnetworkfile_p.h + access/qnetworkreply.cpp access/qnetworkreply.h access/qnetworkreply_p.h + access/qnetworkreplydataimpl.cpp access/qnetworkreplydataimpl_p.h + access/qnetworkreplyfileimpl.cpp access/qnetworkreplyfileimpl_p.h + access/qnetworkreplyimpl.cpp access/qnetworkreplyimpl_p.h + access/qnetworkrequest.cpp access/qnetworkrequest.h access/qnetworkrequest_p.h + bearer/qbearerengine.cpp bearer/qbearerengine_p.h + bearer/qbearerplugin.cpp bearer/qbearerplugin_p.h + bearer/qnetworkconfigmanager.cpp bearer/qnetworkconfigmanager.h bearer/qnetworkconfigmanager_p.cpp bearer/qnetworkconfigmanager_p.h + bearer/qnetworkconfiguration.cpp bearer/qnetworkconfiguration.h bearer/qnetworkconfiguration_p.h + bearer/qnetworksession.cpp bearer/qnetworksession.h bearer/qnetworksession_p.h + bearer/qsharednetworksession.cpp bearer/qsharednetworksession_p.h + kernel/qauthenticator.cpp kernel/qauthenticator.h kernel/qauthenticator_p.h + kernel/qhostaddress.cpp kernel/qhostaddress.h kernel/qhostaddress_p.h + kernel/qhostinfo.cpp kernel/qhostinfo.h kernel/qhostinfo_p.h + kernel/qnetworkdatagram.cpp kernel/qnetworkdatagram.h kernel/qnetworkdatagram_p.h + kernel/qnetworkinterface.cpp kernel/qnetworkinterface.h kernel/qnetworkinterface_p.h + kernel/qnetworkinterface_unix_p.h + kernel/qnetworkproxy.cpp kernel/qnetworkproxy.h + kernel/qtnetworkglobal.h kernel/qtnetworkglobal_p.h + socket/qabstractsocket.cpp socket/qabstractsocket.h socket/qabstractsocket_p.h + socket/qabstractsocketengine.cpp socket/qabstractsocketengine_p.h + socket/qtcpserver.cpp socket/qtcpserver.h socket/qtcpserver_p.h + socket/qtcpsocket.cpp socket/qtcpsocket.h socket/qtcpsocket_p.h + socket/qudpsocket.cpp socket/qudpsocket.h + ssl/qasn1element.cpp ssl/qasn1element_p.h + ssl/qpassworddigestor.cpp ssl/qpassworddigestor.h + ssl/qssl.cpp ssl/qssl.h ssl/qssl_p.h + ssl/qsslcertificate.cpp ssl/qsslcertificate.h ssl/qsslcertificate_p.h + ssl/qsslcertificateextension.cpp ssl/qsslcertificateextension.h ssl/qsslcertificateextension_p.h + DEFINES + QT_NO_FOREACH + QT_NO_USING_NAMESPACE + INCLUDE_DIRECTORIES + kernel + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + +#### Keys ignored in scope 1:.:.:network.pro:: +# MODULE_PLUGIN_TYPES = "bearer" +# MODULE_WINRT_CAPABILITIES = "internetClient" "internetClientServer" "privateNetworkClientServer" +# QMAKE_LIBS = "$$QMAKE_LIBS_NETWORK" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(Network CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x64000000" +) + +#### Keys ignored in scope 3:.:.:network.pro:QT_FEATURE_bearermanagement: +# ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroidBearer.jar" +# ANDROID_LIB_DEPENDENCIES = "plugins/bearer/libqandroidbearer.so" +# ANDROID_PERMISSIONS = "android.permission.ACCESS_NETWORK_STATE" +# MODULE_PLUGIN_TYPES = "bearer" + +extend_target(Network CONDITION QT_FEATURE_ftp + SOURCES + access/qftp.cpp access/qftp_p.h + access/qnetworkaccessftpbackend.cpp access/qnetworkaccessftpbackend_p.h + kernel/qurlinfo.cpp kernel/qurlinfo_p.h +) + +extend_target(Network CONDITION QT_FEATURE_networkdiskcache + SOURCES + access/qnetworkdiskcache.cpp access/qnetworkdiskcache.h access/qnetworkdiskcache_p.h +) + +extend_target(Network CONDITION QT_FEATURE_settings + SOURCES + access/qhstsstore.cpp access/qhstsstore_p.h +) + +extend_target(Network CONDITION APPLE_OSX + SOURCES + kernel/qnetworkproxy_mac.cpp + LIBRARIES + ${FWCoreFoundation} + ${FWSecurity} +) + +extend_target(Network CONDITION WASM + SOURCES + access/qnetworkreplywasmimpl.cpp access/qnetworkreplywasmimpl_p.h +) + +extend_target(Network CONDITION QT_FEATURE_http + SOURCES + access/http2/bitstreams.cpp access/http2/bitstreams_p.h + access/http2/hpack.cpp access/http2/hpack_p.h + access/http2/hpacktable.cpp access/http2/hpacktable_p.h + access/http2/http2frames.cpp access/http2/http2frames_p.h + access/http2/http2protocol.cpp access/http2/http2protocol_p.h + access/http2/http2streams.cpp access/http2/http2streams_p.h + access/http2/huffman.cpp access/http2/huffman_p.h + access/qabstractprotocolhandler.cpp access/qabstractprotocolhandler_p.h + access/qhttp2protocolhandler.cpp access/qhttp2protocolhandler_p.h + access/qhttpmultipart.cpp access/qhttpmultipart.h access/qhttpmultipart_p.h + access/qhttpnetworkconnection.cpp access/qhttpnetworkconnection_p.h + access/qhttpnetworkconnectionchannel.cpp access/qhttpnetworkconnectionchannel_p.h + access/qhttpnetworkheader.cpp access/qhttpnetworkheader_p.h + access/qhttpnetworkreply.cpp access/qhttpnetworkreply_p.h + access/qhttpnetworkrequest.cpp access/qhttpnetworkrequest_p.h + access/qhttpprotocolhandler.cpp access/qhttpprotocolhandler_p.h + access/qhttpthreaddelegate.cpp access/qhttpthreaddelegate_p.h + access/qnetworkreplyhttpimpl.cpp access/qnetworkreplyhttpimpl_p.h + socket/qhttpsocketengine.cpp socket/qhttpsocketengine_p.h +) + +extend_target(Network CONDITION QT_FEATURE_http AND QT_FEATURE_ssl + SOURCES + access/qspdyprotocolhandler.cpp access/qspdyprotocolhandler_p.h +) + +extend_target(Network CONDITION QT_FEATURE_dnslookup + SOURCES + kernel/qdnslookup.cpp kernel/qdnslookup.h kernel/qdnslookup_p.h +) + +extend_target(Network CONDITION UNIX + SOURCES + kernel/qhostinfo_unix.cpp + socket/qnativesocketengine_unix.cpp + socket/qnet_unix_p.h +) + +extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY + SOURCES + kernel/qdnslookup_unix.cpp +) + +extend_target(Network CONDITION QT_FEATURE_dlopen AND UNIX + LIBRARIES + ${CMAKE_DL_LIBS} +) + +extend_target(Network CONDITION QT_FEATURE_linux_netlink AND UNIX + SOURCES + kernel/qnetworkinterface_linux.cpp +) + +extend_target(Network CONDITION UNIX AND NOT QT_FEATURE_linux_netlink + SOURCES + kernel/qnetworkinterface_unix.cpp +) + +extend_target(Network CONDITION ANDROID AND QT_FEATURE_dnslookup + SOURCES + -kernel/qdnslookup_unix.cpp + kernel/qdnslookup_android.cpp +) + +extend_target(Network CONDITION WIN32 + SOURCES + kernel/qhostinfo_win.cpp +) + +extend_target(Network CONDITION WIN32 AND NOT WINRT + SOURCES + kernel/qnetworkinterface_win.cpp + kernel/qnetworkproxy_win.cpp + socket/qnativesocketengine_win.cpp + LIBRARIES + advapi32 + dnsapi + iphlpapi +) + +extend_target(Network CONDITION QT_FEATURE_dnslookup AND WIN32 AND NOT WINRT + SOURCES + kernel/qdnslookup_win.cpp +) + +extend_target(Network CONDITION WINRT + SOURCES + kernel/qnetworkinterface_winrt.cpp + socket/qnativesocketengine_winrt.cpp socket/qnativesocketengine_winrt_p.h +) + +extend_target(Network CONDITION QT_FEATURE_dnslookup AND WINRT + SOURCES + kernel/qdnslookup_winrt.cpp +) + +extend_target(Network CONDITION APPLE_OSX AND NOT APPLE_UIKIT + LIBRARIES + ${FWCoreServices} + ${FWSystemConfiguration} +) + +extend_target(Network CONDITION QT_FEATURE_gssapi + LIBRARIES + gssapi_krb5 +) + +extend_target(Network CONDITION APPLE_UIKIT + SOURCES + kernel/qnetworkinterface_uikit_p.h +) + +extend_target(Network CONDITION QT_FEATURE_libproxy AND NOT APPLE_OSX AND (UNIX OR WINRT) + SOURCES + kernel/qnetworkproxy_libproxy.cpp + LIBRARIES + ${CMAKE_DL_LIBS} + PkgConfig::Libproxy +) + +extend_target(Network CONDITION NOT APPLE_OSX AND NOT QT_FEATURE_libproxy AND (UNIX OR WINRT) + SOURCES + kernel/qnetworkproxy_generic.cpp +) + +extend_target(Network CONDITION QT_FEATURE_socks5 + SOURCES + socket/qsocks5socketengine.cpp socket/qsocks5socketengine_p.h +) + +extend_target(Network CONDITION QT_FEATURE_sctp + SOURCES + socket/qsctpserver.cpp socket/qsctpserver.h socket/qsctpserver_p.h + socket/qsctpsocket.cpp socket/qsctpsocket.h socket/qsctpsocket_p.h +) + +extend_target(Network CONDITION NOT WINRT + SOURCES + socket/qnativesocketengine.cpp socket/qnativesocketengine_p.h +) + +extend_target(Network CONDITION MSVC + MOC_OPTIONS + "-D_WINSOCK_DEPRECATED_NO_WARNINGS" +) + +extend_target(Network CONDITION QT_FEATURE_localserver + SOURCES + socket/qlocalserver.cpp socket/qlocalserver.h socket/qlocalserver_p.h + socket/qlocalsocket.cpp socket/qlocalsocket.h socket/qlocalsocket_p.h +) + +extend_target(Network CONDITION QT_FEATURE_localserver AND (INTEGRITY OR WINRT) + SOURCES + socket/qlocalserver_tcp.cpp + socket/qlocalsocket_tcp.cpp + DEFINES + QT_LOCALSOCKET_TCP +) + +extend_target(Network CONDITION QT_FEATURE_localserver AND UNIX AND NOT INTEGRITY AND NOT WINRT + SOURCES + socket/qlocalserver_unix.cpp + socket/qlocalsocket_unix.cpp +) + +extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32 AND NOT WINRT + SOURCES + socket/qlocalserver_win.cpp + socket/qlocalsocket_win.cpp +) + +extend_target(Network CONDITION QT_FEATURE_system_proxies + DEFINES + QT_USE_SYSTEM_PROXIES +) + +extend_target(Network CONDITION NOT QT_FEATURE_openssl + SOURCES + ssl/qsslcertificate_qt.cpp +) + +extend_target(Network CONDITION QT_FEATURE_ssl + SOURCES + ssl/qocspresponse.cpp ssl/qocspresponse.h ssl/qocspresponse_p.h + ssl/qsslcipher.cpp ssl/qsslcipher.h ssl/qsslcipher_p.h + ssl/qsslconfiguration.cpp ssl/qsslconfiguration.h ssl/qsslconfiguration_p.h + ssl/qssldiffiehellmanparameters.cpp ssl/qssldiffiehellmanparameters.h ssl/qssldiffiehellmanparameters_p.h + ssl/qsslellipticcurve.cpp ssl/qsslellipticcurve.h + ssl/qsslerror.cpp ssl/qsslerror.h + ssl/qsslkey.h ssl/qsslkey_p.cpp ssl/qsslkey_p.h + ssl/qsslpresharedkeyauthenticator.cpp ssl/qsslpresharedkeyauthenticator.h ssl/qsslpresharedkeyauthenticator_p.h + ssl/qsslsocket.cpp ssl/qsslsocket.h ssl/qsslsocket_p.h +) + +extend_target(Network CONDITION QT_FEATURE_ssl AND WINRT + SOURCES + ssl/qsslcertificate_winrt.cpp + ssl/qssldiffiehellmanparameters_dummy.cpp + ssl/qsslellipticcurve_dummy.cpp + ssl/qsslkey_qt.cpp + ssl/qsslkey_winrt.cpp + ssl/qsslsocket_winrt.cpp ssl/qsslsocket_winrt_p.h +) + +extend_target(Network CONDITION QT_FEATURE_schannel AND QT_FEATURE_ssl + SOURCES + ssl/qsslcertificate_schannel.cpp + ssl/qssldiffiehellmanparameters_dummy.cpp + ssl/qsslellipticcurve_dummy.cpp + ssl/qsslkey_qt.cpp + ssl/qsslkey_schannel.cpp + ssl/qsslsocket_qt.cpp + ssl/qsslsocket_schannel.cpp ssl/qsslsocket_schannel_p.h + LIBRARIES + Crypt32 + Secur32 + bcrypt + ncrypt +) + +extend_target(Network CONDITION QT_FEATURE_securetransport AND QT_FEATURE_ssl + SOURCES + ssl/qssldiffiehellmanparameters_dummy.cpp + ssl/qsslellipticcurve_dummy.cpp + ssl/qsslkey_mac.cpp + ssl/qsslkey_qt.cpp + ssl/qsslsocket_mac.cpp ssl/qsslsocket_mac_p.h + ssl/qsslsocket_mac_shared.cpp + ssl/qsslsocket_qt.cpp +) + +extend_target(Network CONDITION QT_FEATURE_dtls AND QT_FEATURE_ssl + SOURCES + ssl/qdtls.cpp ssl/qdtls.h ssl/qdtls_p.h +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl + SOURCES + ssl/qsslcertificate_openssl.cpp + ssl/qsslcontext_openssl.cpp ssl/qsslcontext_openssl_p.h + ssl/qssldiffiehellmanparameters_openssl.cpp + ssl/qsslellipticcurve_openssl.cpp + ssl/qsslkey_openssl.cpp + ssl/qsslsocket_openssl.cpp ssl/qsslsocket_openssl_p.h + ssl/qsslsocket_openssl_symbols.cpp ssl/qsslsocket_openssl_symbols_p.h +) + +extend_target(Network CONDITION QT_FEATURE_dtls AND QT_FEATURE_openssl AND QT_FEATURE_ssl + SOURCES + ssl/qdtls_openssl.cpp ssl/qdtls_openssl_p.h +) + +extend_target(Network CONDITION QT_FEATURE_ocsp AND QT_FEATURE_openssl AND QT_FEATURE_ssl + SOURCES + ssl/qocsp_p.h +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_opensslv11 AND QT_FEATURE_ssl + SOURCES + ssl/qsslcontext_openssl11.cpp + ssl/qsslsocket_openssl11.cpp + ssl/qsslsocket_openssl11_symbols_p.h + DEFINES + OPENSSL_API_COMPAT=0x10100000L +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_opensslv11 + SOURCES + ssl/qsslcontext_opensslpre11.cpp + ssl/qsslsocket_opensslpre11.cpp + ssl/qsslsocket_opensslpre11_symbols_p.h +) + +extend_target(Network CONDITION APPLE AND QT_FEATURE_openssl AND QT_FEATURE_ssl + SOURCES + ssl/qsslsocket_mac_shared.cpp +) + +extend_target(Network CONDITION ANDROID AND QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT ANDROID_EMBEDDED + SOURCES + ssl/qsslsocket_openssl_android.cpp +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_openssl_linked AND QT_FEATURE_ssl + LIBRARIES + OpenSSL::SSL +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND NOT QT_FEATURE_openssl_linked + LIBRARIES + OpenSSL::SSL_nolink +) + +extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 + SOURCES + ssl/qwindowscarootfetcher.cpp ssl/qwindowscarootfetcher_p.h + LIBRARIES + crypt32 +) +add_qt_docs( + doc/qtnetwork.qdocconf +) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 3ce9a3aa0a2..20add1192e1 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -49,8 +49,8 @@ add_qt_module(Network ssl/qsslcertificate.cpp ssl/qsslcertificate.h ssl/qsslcertificate_p.h ssl/qsslcertificateextension.cpp ssl/qsslcertificateextension.h ssl/qsslcertificateextension_p.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE INCLUDE_DIRECTORIES kernel LIBRARIES @@ -148,6 +148,14 @@ extend_target(Network CONDITION UNIX kernel/qhostinfo_unix.cpp socket/qnativesocketengine_unix.cpp socket/qnet_unix_p.h +) + +extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY + SOURCES + kernel/qdnslookup_unix.cpp +) + +extend_target(Network CONDITION QT_FEATURE_dlopen AND UNIX LIBRARIES ${CMAKE_DL_LIBS} ) From 79d820f8a93daaada4a29ca0184cf0bfb62ecaa7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:18:15 +0200 Subject: [PATCH 0523/1322] Regenerate opengl And add the first version of the .prev file. Change-Id: I96f27bce6d1c3107fb8c7b3758b29cfd944cf374 Reviewed-by: Tobias Hunger --- src/opengl/.prev_CMakeLists.txt | 65 +++++++++++++++++++++++++++++++++ src/opengl/CMakeLists.txt | 2 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 src/opengl/.prev_CMakeLists.txt diff --git a/src/opengl/.prev_CMakeLists.txt b/src/opengl/.prev_CMakeLists.txt new file mode 100644 index 00000000000..759b1a70832 --- /dev/null +++ b/src/opengl/.prev_CMakeLists.txt @@ -0,0 +1,65 @@ +# Generated from opengl.pro. + +##################################################################### +## OpenGL Module: +##################################################################### + +add_qt_module(OpenGL + SOURCES + gl2paintengineex/qgl2pexvertexarray.cpp gl2paintengineex/qgl2pexvertexarray_p.h + gl2paintengineex/qglcustomshaderstage.cpp gl2paintengineex/qglcustomshaderstage_p.h + gl2paintengineex/qglengineshadermanager.cpp gl2paintengineex/qglengineshadermanager_p.h + gl2paintengineex/qglengineshadersource_p.h + gl2paintengineex/qglgradientcache.cpp gl2paintengineex/qglgradientcache_p.h + gl2paintengineex/qglshadercache_p.h + gl2paintengineex/qpaintengineex_opengl2.cpp gl2paintengineex/qpaintengineex_opengl2_p.h + gl2paintengineex/qtextureglyphcache_gl.cpp gl2paintengineex/qtextureglyphcache_gl_p.h + qgl.cpp qgl.h qgl_p.h + qglbuffer.cpp qglbuffer.h + qglcolormap.cpp qglcolormap.h + qglframebufferobject.cpp qglframebufferobject.h qglframebufferobject_p.h + qglfunctions.cpp qglfunctions.h + qglpaintdevice.cpp qglpaintdevice_p.h + qglpixelbuffer.cpp qglpixelbuffer.h qglpixelbuffer_p.h + qglshaderprogram.cpp qglshaderprogram.h + qtopenglglobal.h + DEFINES + QT_NO_FOREACH + QT_NO_USING_NAMESPACE + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Widgets +) + +#### Keys ignored in scope 1:.:.:opengl.pro:: +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(OpenGL CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x63000000" +) + +#### Keys ignored in scope 3:.:.:opengl.pro:solaris-cc_x_: +# QMAKE_CXXFLAGS_RELEASE = "--O2" + +#### Keys ignored in scope 4:.:.:opengl.pro:QT_FEATURE_opengl: +# CONFIG = "opengl" + +#### Keys ignored in scope 5:.:.:opengl.pro:QT_FEATURE_opengles2: +# CONFIG = "opengles2" + +extend_target(OpenGL CONDITION QT_FEATURE_graphicseffect + SOURCES + qgraphicsshadereffect.cpp qgraphicsshadereffect_p.h +) +add_qt_docs( + doc/qtopengl.qdocconf +) diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 705bf8e3d05..af77dde8a22 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -24,8 +24,8 @@ add_qt_module(OpenGL qglshaderprogram.cpp qglshaderprogram.h qtopenglglobal.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE LIBRARIES Qt::CorePrivate Qt::GuiPrivate From 0711d497d9c03a396193f9f305fecfc8096a91af Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:19:21 +0200 Subject: [PATCH 0524/1322] Regenerate dbus And add the first version of the .prev file. Change-Id: I8375591a8cfc087291774370b8308c808dd5f0b4 Reviewed-by: Tobias Hunger --- src/dbus/.prev_CMakeLists.txt | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/dbus/.prev_CMakeLists.txt diff --git a/src/dbus/.prev_CMakeLists.txt b/src/dbus/.prev_CMakeLists.txt new file mode 100644 index 00000000000..0e0ae9351d5 --- /dev/null +++ b/src/dbus/.prev_CMakeLists.txt @@ -0,0 +1,73 @@ +# Generated from dbus.pro. + +##################################################################### +## DBus Module: +##################################################################### + +add_qt_module(DBus + SOURCES + dbus_minimal_p.h + qdbus_symbols.cpp qdbus_symbols_p.h + qdbusabstractadaptor.cpp qdbusabstractadaptor.h qdbusabstractadaptor_p.h + qdbusabstractinterface.cpp qdbusabstractinterface.h qdbusabstractinterface_p.h + qdbusargument.cpp qdbusargument.h qdbusargument_p.h + qdbusconnection.cpp qdbusconnection.h qdbusconnection_p.h + qdbusconnectioninterface.cpp qdbusconnectioninterface.h + qdbusconnectionmanager_p.h + qdbuscontext.cpp qdbuscontext.h qdbuscontext_p.h + qdbuserror.cpp qdbuserror.h + qdbusextratypes.cpp qdbusextratypes.h + qdbusintegrator.cpp qdbusintegrator_p.h + qdbusinterface.cpp qdbusinterface.h qdbusinterface_p.h + qdbusinternalfilters.cpp + qdbusintrospection.cpp qdbusintrospection_p.h + qdbusmarshaller.cpp + qdbusmessage.cpp qdbusmessage.h qdbusmessage_p.h + qdbusmetaobject.cpp + qdbusmetatype.cpp qdbusmetatype.h + qdbusmisc.cpp + qdbuspendingcall.cpp qdbuspendingcall.h qdbuspendingcall_p.h + qdbuspendingreply.cpp qdbuspendingreply.h + qdbusreply.cpp qdbusreply.h + qdbusserver.cpp qdbusserver.h + qdbusservicewatcher.cpp qdbusservicewatcher.h + qdbusthreaddebug_p.h + qdbusunixfiledescriptor.cpp qdbusunixfiledescriptor.h + qdbusutil.cpp qdbusutil_p.h + qdbusvirtualobject.cpp qdbusvirtualobject.h + qdbusxmlgenerator.cpp + qdbusxmlparser.cpp qdbusxmlparser_p.h + qtdbusglobal.h qtdbusglobal_p.h + DEFINES + DBUS_API_SUBJECT_TO_CHANGE + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + +#### Keys ignored in scope 1:.:.:dbus.pro:: +# MODULE_CONFIG = "dbusadaptors" "dbusinterfaces" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(DBus CONDITION QT_FEATURE_dbus_linked + DEFINES + QT_LINKED_LIBDBUS + LIBRARIES + dbus-1 +) + +extend_target(DBus CONDITION WIN32 + LIBRARIES + advapi32 + netapi32 + user32 + ws2_32 +) +add_qt_docs( + doc/qtdbus.qdocconf +) From a9376322581408706b08e716bc4c2a991b9c8cd1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:19:47 +0200 Subject: [PATCH 0525/1322] Regenerate concurrent Change-Id: Iccb993e7e38dc04be2e3960d0f49ddf241c675e7 Reviewed-by: Tobias Hunger --- src/concurrent/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index 36fe0666d65..56eb2163da0 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -22,8 +22,8 @@ add_qt_module(Concurrent qtconcurrentstoredfunctioncall.h qtconcurrentthreadengine.cpp qtconcurrentthreadengine.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE LIBRARIES Qt::CorePrivate PUBLIC_LIBRARIES From 17865396bf4e90adf2e6ca35c88bb815065e6cf1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:21:13 +0200 Subject: [PATCH 0526/1322] Regenerate platformheaders And add the first version of the .prev file. Change-Id: I87d33dd175ddcbccd202f068f469f260944e4ada Reviewed-by: Tobias Hunger --- src/platformheaders/.prev_CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/platformheaders/.prev_CMakeLists.txt diff --git a/src/platformheaders/.prev_CMakeLists.txt b/src/platformheaders/.prev_CMakeLists.txt new file mode 100644 index 00000000000..5456de5c804 --- /dev/null +++ b/src/platformheaders/.prev_CMakeLists.txt @@ -0,0 +1,2 @@ +# Generated from platformheaders.pro. + From 8cf45a6848525bd3d6e22468abf1362f51132d23 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:23:26 +0200 Subject: [PATCH 0527/1322] Regenerate printsupport No .prev file cause it's a clean conversion. Change-Id: I33e02dccb9c8da336891c36cd0e1454d29152065 Reviewed-by: Tobias Hunger --- src/printsupport/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index b23a61e55d7..a689aa8d708 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -18,21 +18,22 @@ add_qt_module(PrintSupport kernel/qprinterinfo.cpp kernel/qprinterinfo.h kernel/qprinterinfo_p.h kernel/qtprintsupportglobal.h kernel/qtprintsupportglobal_p.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE INCLUDE_DIRECTORIES - widgets dialogs + widgets LIBRARIES Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate - PUBLIC_LIBRARIES # special case + PUBLIC_LIBRARIES + Qt::Core Qt::Gui Qt::Widgets ) -#### Keys ignored in scope 1:.:printsupport.pro:: +#### Keys ignored in scope 1:.:.:printsupport.pro:: # MODULE_PLUGIN_TYPES = "printsupport" # QMAKE_LIBS = "$$QMAKE_LIBS_PRINTSUPPORT" # _LOADED = "qt_module" @@ -143,5 +144,6 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewdialog SOURCES dialogs/qprintpreviewdialog.cpp dialogs/qprintpreviewdialog.h ) - -add_qt_docs(./doc/qtprintsupport.qdocconf) +add_qt_docs( + doc/qtprintsupport.qdocconf +) From fbbfbcf360f5935a0f609bf2a9f152b293ee9333 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 16:24:35 +0200 Subject: [PATCH 0528/1322] Regenerate sql Change-Id: I495678a5c77557ae297b7dd028f1253ebcce9ef7 Reviewed-by: Tobias Hunger --- src/sql/CMakeLists.txt | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index d438b784460..f84d12dc12e 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -19,23 +19,25 @@ add_qt_module(Sql kernel/qsqlresult.cpp kernel/qsqlresult.h kernel/qsqlresult_p.h kernel/qtsqlglobal.h kernel/qtsqlglobal_p.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_CAST_FROM_ASCII QT_NO_FOREACH + QT_NO_USING_NAMESPACE LIBRARIES Qt::CorePrivate - PUBLIC_LIBRARIES # special case + PUBLIC_LIBRARIES Qt::Core - # MODULE_PLUGIN_TYPES = "sqldrivers" - # PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" - # SQL_P = "sql" - # _LOADED = "qt_module" ) +#### Keys ignored in scope 1:.:.:sql.pro:: +# MODULE_PLUGIN_TYPES = "sqldrivers" +# PRECOMPILED_HEADER = "../corelib/global/qt_pch.h" +# SQL_P = "sql" +# _LOADED = "qt_module" + ## Scopes: ##################################################################### -extend_target(Sql CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") +extend_target(Sql CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x62000000" ) @@ -47,5 +49,6 @@ extend_target(Sql CONDITION QT_FEATURE_sqlmodel models/qsqlrelationaltablemodel.cpp models/qsqlrelationaltablemodel.h models/qsqltablemodel.cpp models/qsqltablemodel.h models/qsqltablemodel_p.h ) - -add_qt_docs(./doc/qtsql.qdocconf) +add_qt_docs( + doc/qtsql.qdocconf +) From f1d428b6434b5c8529d135717e0ef2a1e3ad3f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 16 May 2019 15:08:38 +0200 Subject: [PATCH 0529/1322] Fix typo in module_config.yaml The command executed is jom not nmake. Change-Id: Ieae487a3b50884d901ca2a431f3c3ea615a80e8b Reviewed-by: Liang Qi --- coin/module_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 041209b2fd2..2e7b3061665 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -31,7 +31,7 @@ build_instructions: maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > - Failed to call nmake install. Contact Liang then. + Failed to call jom install. Contact Liang then. disable_if: condition: property property: host.os From 42c8c38564c11a86a553139f21322ad232ab5957 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 15:53:26 +0200 Subject: [PATCH 0530/1322] Regenerate corelib And add the first version of the .prev file. Change-Id: I5d8f2354f86bc279e185e31173df4aeeb6e46116 Reviewed-by: Tobias Hunger --- src/corelib/.prev_CMakeLists.txt | 963 +++++++++++++++++++++++++++++++ src/corelib/CMakeLists.txt | 32 +- 2 files changed, 981 insertions(+), 14 deletions(-) create mode 100644 src/corelib/.prev_CMakeLists.txt diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt new file mode 100644 index 00000000000..1e459bb7341 --- /dev/null +++ b/src/corelib/.prev_CMakeLists.txt @@ -0,0 +1,963 @@ +# Generated from corelib.pro. + +##################################################################### +## Core Module: +##################################################################### + +add_qt_module(Core + SOURCES + ../3rdparty/harfbuzz/src/harfbuzz.h + ../3rdparty/harfbuzz/src/harfbuzz-buffer.c + ../3rdparty/harfbuzz/src/harfbuzz-gdef.c + ../3rdparty/harfbuzz/src/harfbuzz-gpos.c + ../3rdparty/harfbuzz/src/harfbuzz-gsub.c + ../3rdparty/harfbuzz/src/harfbuzz-impl.c + ../3rdparty/harfbuzz/src/harfbuzz-open.c + ../3rdparty/harfbuzz/src/harfbuzz-shaper-all.cpp + ../3rdparty/harfbuzz/src/harfbuzz-stream.c + codecs/qtextcodec_p.h + codecs/qutfcodec.cpp codecs/qutfcodec_p.h + global/archdetect.cpp + global/qcompilerdetection.h + global/qendian.cpp global/qendian.h global/qendian_p.h + global/qflags.h + global/qfloat16.cpp global/qfloat16.h + global/qglobal.cpp global/qglobal.h + global/qglobalstatic.h + global/qhooks.cpp global/qhooks_p.h + global/qisenum.h + global/qlibraryinfo.cpp global/qlibraryinfo.h + global/qlogging.cpp global/qlogging.h + global/qmalloc.cpp + global/qnamespace.h + global/qnumeric.cpp global/qnumeric.h global/qnumeric_p.h + global/qoperatingsystemversion.cpp global/qoperatingsystemversion.h global/qoperatingsystemversion_p.h + global/qprocessordetection.h + global/qrandom.cpp global/qrandom.h global/qrandom_p.h + global/qsysinfo.h + global/qsystemdetection.h + global/qtypeinfo.h + global/qtypetraits.h + global/qversiontagging.h + io/qabstractfileengine.cpp io/qabstractfileengine_p.h + io/qbuffer.cpp io/qbuffer.h + io/qdataurl.cpp io/qdataurl_p.h + io/qdebug.cpp io/qdebug.h io/qdebug_p.h + io/qdir.cpp io/qdir.h io/qdir_p.h + io/qdiriterator.cpp io/qdiriterator.h + io/qfile.cpp io/qfile.h + io/qfiledevice.cpp io/qfiledevice.h io/qfiledevice_p.h + io/qfileinfo.cpp io/qfileinfo.h io/qfileinfo_p.h + io/qfileselector.cpp io/qfileselector.h io/qfileselector_p.h + io/qfilesystemengine.cpp io/qfilesystemengine_p.h + io/qfilesystementry.cpp io/qfilesystementry_p.h + io/qfilesystemiterator_p.h + io/qfilesystemmetadata_p.h + io/qfsfileengine.cpp io/qfsfileengine_p.h + io/qfsfileengine_iterator.cpp io/qfsfileengine_iterator_p.h + io/qiodevice.cpp io/qiodevice.h io/qiodevice_p.h + io/qipaddress.cpp io/qipaddress_p.h + io/qlockfile.cpp io/qlockfile.h io/qlockfile_p.h + io/qloggingcategory.cpp io/qloggingcategory.h + io/qloggingregistry.cpp io/qloggingregistry_p.h + io/qnoncontiguousbytedevice.cpp io/qnoncontiguousbytedevice_p.h + io/qresource.cpp io/qresource_p.h + io/qresource_iterator.cpp io/qresource_iterator_p.h + io/qsavefile.cpp io/qsavefile.h + io/qstandardpaths.cpp io/qstandardpaths.h + io/qstorageinfo.cpp io/qstorageinfo.h io/qstorageinfo_p.h + io/qtemporarydir.cpp io/qtemporarydir.h + io/qtemporaryfile.cpp io/qtemporaryfile.h io/qtemporaryfile_p.h + io/qtldurl.cpp io/qtldurl_p.h + io/qurl.cpp io/qurl.h io/qurl_p.h + io/qurlidna.cpp + io/qurlquery.cpp io/qurlquery.h + io/qurlrecode.cpp + io/qurltlds_p.h + itemmodels/qabstractitemmodel.cpp itemmodels/qabstractitemmodel.h itemmodels/qabstractitemmodel_p.h + itemmodels/qitemselectionmodel.cpp itemmodels/qitemselectionmodel.h itemmodels/qitemselectionmodel_p.h + kernel/qabstracteventdispatcher.cpp kernel/qabstracteventdispatcher.h kernel/qabstracteventdispatcher_p.h + kernel/qabstractnativeeventfilter.cpp kernel/qabstractnativeeventfilter.h + kernel/qbasictimer.cpp kernel/qbasictimer.h + kernel/qcoreapplication.cpp kernel/qcoreapplication.h kernel/qcoreapplication_p.h + kernel/qcorecmdlineargs_p.h + kernel/qcoreevent.cpp kernel/qcoreevent.h + kernel/qcoreglobaldata.cpp kernel/qcoreglobaldata_p.h + kernel/qdeadlinetimer.cpp kernel/qdeadlinetimer.h kernel/qdeadlinetimer_p.h + kernel/qelapsedtimer.cpp kernel/qelapsedtimer.h + kernel/qeventloop.cpp kernel/qeventloop.h + kernel/qfunctions_p.h + kernel/qmath.cpp kernel/qmath.h + kernel/qmetaobject.cpp kernel/qmetaobject.h kernel/qmetaobject_p.h + kernel/qmetaobject_moc_p.h + kernel/qmetaobjectbuilder.cpp kernel/qmetaobjectbuilder_p.h + kernel/qmetatype.cpp kernel/qmetatype.h kernel/qmetatype_p.h + kernel/qmetatypeswitcher_p.h + kernel/qmimedata.cpp kernel/qmimedata.h + kernel/qobject.cpp kernel/qobject.h kernel/qobject_p.h + kernel/qobject_impl.h + kernel/qobjectcleanuphandler.cpp kernel/qobjectcleanuphandler.h + kernel/qobjectdefs.h + kernel/qobjectdefs_impl.h + kernel/qpointer.cpp kernel/qpointer.h + kernel/qsharedmemory.cpp kernel/qsharedmemory.h kernel/qsharedmemory_p.h + kernel/qsignalmapper.cpp kernel/qsignalmapper.h + kernel/qsocketnotifier.cpp kernel/qsocketnotifier.h + kernel/qsystemerror.cpp kernel/qsystemerror_p.h + kernel/qsystemsemaphore.cpp kernel/qsystemsemaphore.h kernel/qsystemsemaphore_p.h + kernel/qtestsupport_core.cpp kernel/qtestsupport_core.h + kernel/qtimer.cpp kernel/qtimer.h + kernel/qtranslator.cpp kernel/qtranslator.h kernel/qtranslator_p.h + kernel/qvariant.cpp kernel/qvariant.h kernel/qvariant_p.h + plugin/qfactoryinterface.cpp plugin/qfactoryinterface.h + plugin/qfactoryloader.cpp plugin/qfactoryloader_p.h + plugin/qplugin.h plugin/qplugin_p.h + plugin/qpluginloader.cpp plugin/qpluginloader.h + plugin/quuid.cpp plugin/quuid.h + serialization/qcborarray.h + serialization/qcborcommon.h + serialization/qcbordiagnostic.cpp + serialization/qcbormap.h + serialization/qcborstream.cpp serialization/qcborstream.h + serialization/qcborvalue.cpp serialization/qcborvalue.h serialization/qcborvalue_p.h + serialization/qdatastream.cpp serialization/qdatastream.h serialization/qdatastream_p.h + serialization/qjson.cpp serialization/qjson_p.h + serialization/qjsonarray.cpp serialization/qjsonarray.h + serialization/qjsoncbor.cpp + serialization/qjsondocument.cpp serialization/qjsondocument.h + serialization/qjsonobject.cpp serialization/qjsonobject.h + serialization/qjsonparser.cpp serialization/qjsonparser_p.h + serialization/qjsonvalue.cpp serialization/qjsonvalue.h + serialization/qjsonwriter.cpp serialization/qjsonwriter_p.h + serialization/qtextstream.cpp serialization/qtextstream.h serialization/qtextstream_p.h + serialization/qxmlstream.cpp serialization/qxmlstream.h serialization/qxmlstream_p.h + serialization/qxmlutils.cpp serialization/qxmlutils_p.h + statemachine/qabstractstate.cpp statemachine/qabstractstate.h statemachine/qabstractstate_p.h + statemachine/qabstracttransition.cpp statemachine/qabstracttransition.h statemachine/qabstracttransition_p.h + statemachine/qfinalstate.cpp statemachine/qfinalstate.h statemachine/qfinalstate_p.h + statemachine/qhistorystate.cpp statemachine/qhistorystate.h statemachine/qhistorystate_p.h + statemachine/qsignaleventgenerator_p.h + statemachine/qsignaltransition.cpp statemachine/qsignaltransition.h statemachine/qsignaltransition_p.h + statemachine/qstate.cpp statemachine/qstate.h statemachine/qstate_p.h + statemachine/qstatemachine.cpp statemachine/qstatemachine.h statemachine/qstatemachine_p.h + thread/qmutex.h + thread/qreadwritelock.h + thread/qrunnable.cpp thread/qrunnable.h + thread/qthread.cpp thread/qthread.h + thread/qthreadstorage.h + thread/qwaitcondition.h + tools/qalgorithms.h + tools/qarraydata.cpp tools/qarraydata.h + tools/qarraydataops.h + tools/qarraydatapointer.h + tools/qbitarray.cpp tools/qbitarray.h + tools/qbytearray.cpp tools/qbytearray.h tools/qbytearray_p.h + tools/qbytearraylist.cpp tools/qbytearraylist.h + tools/qbytearraymatcher.cpp tools/qbytearraymatcher.h + tools/qbytedata_p.h + tools/qcache.h + tools/qchar.h + tools/qcollator.cpp tools/qcollator.h tools/qcollator_p.h + tools/qcontainerfwd.h + tools/qcontiguouscache.cpp tools/qcontiguouscache.h + tools/qcryptographichash.cpp tools/qcryptographichash.h + tools/qdatetime.cpp tools/qdatetime.h tools/qdatetime_p.h + tools/qdoublescanprint_p.h + tools/qeasingcurve.cpp tools/qeasingcurve.h + tools/qfreelist.cpp tools/qfreelist_p.h + tools/qharfbuzz.cpp tools/qharfbuzz_p.h + tools/qhash.cpp tools/qhash.h + tools/qhashfunctions.h + tools/qiterator.h + tools/qline.cpp tools/qline.h + tools/qlinkedlist.cpp tools/qlinkedlist.h + tools/qlist.cpp tools/qlist.h + tools/qlocale.cpp tools/qlocale.h tools/qlocale_p.h + tools/qlocale_data_p.h + tools/qlocale_tools.cpp tools/qlocale_tools_p.h + tools/qmakearray_p.h + tools/qmap.cpp tools/qmap.h + tools/qmargins.cpp tools/qmargins.h + tools/qmessageauthenticationcode.cpp tools/qmessageauthenticationcode.h + tools/qoffsetstringarray_p.h + tools/qpair.h + tools/qpoint.cpp tools/qpoint.h + tools/qqueue.h + tools/qrect.cpp tools/qrect.h + tools/qrefcount.cpp tools/qrefcount.h + tools/qregexp.cpp tools/qregexp.h + tools/qringbuffer.cpp tools/qringbuffer_p.h + tools/qscopedpointer.h tools/qscopedpointer_p.h + tools/qscopedvaluerollback.h + tools/qscopeguard.h + tools/qset.h + tools/qshareddata.cpp tools/qshareddata.h + tools/qsharedpointer.cpp tools/qsharedpointer.h + tools/qsharedpointer_impl.h + tools/qsimd.cpp tools/qsimd_p.h + tools/qsize.cpp tools/qsize.h + tools/qstack.h + tools/qstring.cpp tools/qstring.h + tools/qstring_compat.cpp + tools/qstringalgorithms.h tools/qstringalgorithms_p.h + tools/qstringbuilder.cpp tools/qstringbuilder.h + tools/qstringiterator_p.h + tools/qstringlist.cpp tools/qstringlist.h + tools/qstringliteral.h + tools/qstringmatcher.h + tools/qstringview.cpp tools/qstringview.h + tools/qtextboundaryfinder.cpp tools/qtextboundaryfinder.h + tools/qtimeline.cpp tools/qtimeline.h + tools/qtools_p.h + tools/qunicodetables_p.h + tools/qunicodetools.cpp tools/qunicodetools_p.h + tools/qvarlengtharray.h + tools/qvector.h + tools/qversionnumber.cpp tools/qversionnumber.h + tools/qvsnprintf.cpp + DEFINES + QT_NO_FOREACH + QT_NO_USING_NAMESPACE + INCLUDE_DIRECTORIES + ${PROJECT_BUILD_DIR}/src/corelib/global + ../3rdparty/harfbuzz/src + ../3rdparty/md4 + ../3rdparty/md5 + ../3rdparty/sha3 + ../3rdparty/tinycbor/src + LIBRARIES + ZLIB::ZLIB + doubleconversion +) +add_qt_simd_part(Core SIMD mips_dsp + SOURCES + ../gui/painting/qt_mips_asm_dsp_p.h + tools/qstring_mips_dsp_asm.S +) + + +#### Keys ignored in scope 1:.:.:corelib.pro:: +# ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" +# ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" +# ANDROID_PERMISSIONS = "android.permission.INTERNET" "android.permission.WRITE_EXTERNAL_STORAGE" +# CMAKE_DISABLED_FEATURES = "$$joinQT_DISABLED_FEATURES,"$$escape_expand(\\n) "" +# CMAKE_HOST_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA/src],$$[QT_INSTALL_PREFIX]" +# CMAKE_INSTALL_DATA_DIR = "$$cmakeRelativePath$$[QT_HOST_DATA],$$[QT_INSTALL_PREFIX]" +# CONFIG = "exceptions" "qt_tracepoints" "$$MODULE_CONFIG" "simd" "optimize_full" +# HOST_BINS = "$$[QT_HOST_BINS]" +# INSTALLS = "ctest_qt5_module_files" "cmake_qt5_umbrella_module_files" +# MODULE = "core" +# MODULE_CONFIG = "moc" "resources" +# QMAKE_DSYM_DEBUG_SCRIPT = "$$PWD/debug_script.py" +# QMAKE_DYNAMIC_LIST_FILE = "$$PWD/QtCore.dynlist" +# QMAKE_PKGCONFIG_VARIABLES = "host_bins" "qt_conf" +# QMAKE_SUBSTITUTES = "ctest_macros_file" "cmake_umbrella_config_file" "cmake_umbrella_config_module_location" "cmake_umbrella_config_module_location_for_install" "cmake_umbrella_config_version_file" "cmake_extras_mkspec_dir" "cmake_extras_mkspec_dir_for_install" +# _LOADED = "qt_module" "cmake_functions" +# cmake_extras_mkspec_dir.input = "$$PWD/Qt5CoreConfigExtrasMkspecDir.cmake.in" +# cmake_extras_mkspec_dir.output = "$$DESTDIR/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" +# cmake_extras_mkspec_dir_for_install.input = "$$PWD/Qt5CoreConfigExtrasMkspecDirForInstall.cmake.in" +# cmake_extras_mkspec_dir_for_install.output = "$$DESTDIR/cmake/install/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake" +# cmake_qt5_umbrella_module_files.files = "$$cmake_umbrella_config_file.output" "$$cmake_umbrella_config_version_file.output" "$$cmake_umbrella_config_module_location_for_install.output" +# cmake_qt5_umbrella_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5" +# cmake_umbrella_config_file.input = "$$PWD/Qt5Config.cmake.in" +# cmake_umbrella_config_file.output = "$$DESTDIR/cmake/Qt5/Qt5Config.cmake" +# cmake_umbrella_config_module_location.input = "$$PWD/Qt5ModuleLocation.cmake.in" +# cmake_umbrella_config_module_location.output = "$$DESTDIR/cmake/Qt5/Qt5ModuleLocation.cmake" +# cmake_umbrella_config_module_location_for_install.input = "$$PWD/Qt5ModuleLocationForInstall.cmake.in" +# cmake_umbrella_config_module_location_for_install.output = "$$DESTDIR/cmake/install/Qt5/Qt5ModuleLocation.cmake" +# cmake_umbrella_config_version_file.input = "$$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in" +# cmake_umbrella_config_version_file.output = "$$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake" +# ctest_macros_file.CONFIG = "verbatim" +# ctest_macros_file.input = "$$PWD/Qt5CTestMacros.cmake" +# ctest_macros_file.output = "$$DESTDIR/cmake/Qt5Core/Qt5CTestMacros.cmake" +# ctest_qt5_module_files.files = "$$ctest_macros_file.output" "$$cmake_extras_mkspec_dir_for_install.output" +# ctest_qt5_module_files.path = "$$[QT_INSTALL_LIBS]/cmake/Qt5Core" +# host_bins.name = "host_bins" +# host_bins.variable = "HOST_BINS" +# qt_conf.name = "qt_config" +# qt_conf.variable = "QT_CONFIG" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:corelib.pro:QT_FEATURE_gc_binaries: +# MODULE_CONFIG = "gc_binaries" + +#### Keys ignored in scope 3:.:.:corelib.pro:NOT QT_NAMESPACE_ISEMPTY: +# MODULE_DEFINES = "QT_NAMESPACE=$$QT_NAMESPACE" + +extend_target(Core CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") + LINK_OPTIONS + "/BASE:0x67000000" +) + +#### Keys ignored in scope 5:.:.:corelib.pro:FREEBSD OR OPENBSD: +# QMAKE_LFLAGS_NOUNDEF = + +extend_target(Core CONDITION QT_FEATURE_animation + SOURCES + animation/qabstractanimation.cpp animation/qabstractanimation.h animation/qabstractanimation_p.h + animation/qanimationgroup.cpp animation/qanimationgroup.h animation/qanimationgroup_p.h + animation/qparallelanimationgroup.cpp animation/qparallelanimationgroup.h animation/qparallelanimationgroup_p.h + animation/qpauseanimation.cpp animation/qpauseanimation.h + animation/qpropertyanimation.cpp animation/qpropertyanimation.h animation/qpropertyanimation_p.h + animation/qsequentialanimationgroup.cpp animation/qsequentialanimationgroup.h animation/qsequentialanimationgroup_p.h + animation/qvariantanimation.cpp animation/qvariantanimation.h animation/qvariantanimation_p.h +) + +extend_target(Core CONDITION WIN32 + SOURCES + global/qoperatingsystemversion_win.cpp global/qoperatingsystemversion_win_p.h + io/qfilesystemengine_win.cpp + io/qfsfileengine_win.cpp + io/qlockfile_win.cpp + kernel/qcoreapplication_win.cpp + kernel/qelapsedtimer_win.cpp + kernel/qsharedmemory_win.cpp + kernel/qsystemsemaphore_win.cpp + kernel/qwineventnotifier.cpp kernel/qwineventnotifier.h kernel/qwineventnotifier_p.h + plugin/qsystemlibrary.cpp plugin/qsystemlibrary_p.h + thread/qatomic_msvc.h + thread/qthread_win.cpp + DEFINES + -QT_NO_CAST_TO_ASCII + LIBRARIES + ws2_32 +) + +extend_target(Core CONDITION WIN32 AND NOT WINRT + SOURCES + io/qstandardpaths_win.cpp + io/qstorageinfo_win.cpp + io/qwindowspipereader.cpp io/qwindowspipereader_p.h + io/qwindowspipewriter.cpp io/qwindowspipewriter_p.h + kernel/qeventdispatcher_win.cpp kernel/qeventdispatcher_win_p.h + LIBRARIES + advapi32 + kernel32 + ole32 + shell32 + user32 + uuid + version + winmm + PUBLIC_LIBRARIES + mpr + netapi32 + userenv +) + +extend_target(Core CONDITION APPLE + SOURCES + global/qoperatingsystemversion_darwin.mm + LIBRARIES + ${FWCoreFoundation} + ${FWFoundation} +) + +extend_target(Core CONDITION APPLE_OSX + SOURCES + io/qstandardpaths_mac.mm + io/qstorageinfo_mac.cpp + kernel/qcfsocketnotifier.cpp kernel/qcfsocketnotifier_p.h + kernel/qcore_foundation.mm + kernel/qcore_mac.cpp kernel/qcore_mac_p.h + kernel/qcore_mac_objc.mm + kernel/qcoreapplication_mac.cpp + kernel/qeventdispatcher_cf.mm kernel/qeventdispatcher_cf_p.h + LIBRARIES + ${FWAppKit} + ${FWApplicationServices} + ${FWCoreServices} + ${FWFoundation} + ${FWSecurity} + PUBLIC_LIBRARIES + ${FWDiskArbitration} + ${FWIOKit} +) + +extend_target(Core CONDITION INTEGRITY + LIBRARIES + ivfs + net + posix + shm_client + socket + COMPILE_OPTIONS + --pending_instantiations=128 +) + +#### Keys ignored in scope 13:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR): +# CMAKE_HOST_DATA_DIR = "$$[QT_HOST_DATA/src]/" +# CMAKE_HOST_DATA_DIR_IS_ABSOLUTE = "True" + +#### Keys ignored in scope 14:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_INSTALL_DATA_DIR): +# CMAKE_INSTALL_DATA_DIR = "$$[QT_HOST_DATA]/" +# CMAKE_INSTALL_DATA_DIR_IS_ABSOLUTE = "True" + +#### Keys ignored in scope 17:.:global:global/global.pri:QT_CPU_FEATURES__ss_QT_ARCH___contains___f16c: +# f16c_cxx = "true" + +#### Keys ignored in scope 19:.:global:global/global.pri:CLANG OR intel_icl OR ICC: +# f16c_cxx = "false" + +#### Keys ignored in scope 21:.:global:global/global.pri:GCC AND f16c AND x86SimdAlways: +# f16c_cxx = "true" + +#### Keys ignored in scope 23:.:global:global/global.pri:MSVC AND QT_CPU_FEATURES__ss_QT_ARCH___contains___avx: +# f16c_cxx = "true" + +#### Keys ignored in scope 24:.:global:global/global.pri:else: +# f16c_cxx = "false" + +extend_target(Core CONDITION _ss_f16c_cxx + DEFINES + QFLOAT16_INCLUDE_FAST +) + +#### Keys ignored in scope 26:.:global:global/global.pri:else: +# F16C_SOURCES = "global/qfloat16_f16c.c" + +extend_target(Core CONDITION linux_x_ OR hurd_x_ AND NOT cross_compile AND NOT static AND NOT _x_-armcc_x_ + DEFINES + ELF_INTERPRETER=\\\"=Creadelf-l/bin/ls|perl-n-e\'/programinterpreter:.*]/{print$1;}\'\\\" + LINK_OPTIONS + "-Wl,-e,qt_core_boilerplate" +) + +extend_target(Core CONDITION LINUX AND NOT static + SOURCES + global/minimum-linux_p.h +) + +#### Keys ignored in scope 31:.:global:global/global.pri:precompile_header: +# NO_PCH_ASM = "global/minimum-linux.S" +# QMAKE_EXTRA_COMPILERS = "no_pch_assembler" +# no_pch_assembler.commands = "$$QMAKE_CC" "-c" "$(CFLAGS)" "$(INCPATH)" "${QMAKE_FILE_IN}" "-o" "${QMAKE_FILE_OUT}" +# no_pch_assembler.dependency_type = "TYPE_C" +# no_pch_assembler.input = "NO_PCH_ASM" +# no_pch_assembler.name = "compiling[no_pch]" "${QMAKE_FILE_IN}" +# no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" + +#### Keys ignored in scope 32:.:global:global/global.pri:silent: +# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&" + +extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static + SOURCES + global/minimum-linux.S +) + +extend_target(Core CONDITION QT_FEATURE_slog2 + LIBRARIES + Slog2::Slog2 +) + +extend_target(Core CONDITION QT_FEATURE_journald + LIBRARIES + PkgConfig::Libsystemd +) + +#### Keys ignored in scope 36:.:global:global/global.pri:GCC AND ltcg: +# QMAKE_EXTRA_COMPILERS = "versiontagging_compiler" +# versiontagging_compiler.commands = "$$QMAKE_CXX" "-c" "$(CXXFLAGS)" "$(INCPATH)" "-fno-lto" "-o" "${QMAKE_FILE_OUT}" "${QMAKE_FILE_IN}" +# versiontagging_compiler.dependency_type = "TYPE_C" +# versiontagging_compiler.input = "VERSIONTAGGING_SOURCES" +# versiontagging_compiler.name = "compiling[versiontagging]" "${QMAKE_FILE_IN}" +# versiontagging_compiler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" +# versiontagging_compiler.variable_out = "OBJECTS" + +#### Keys ignored in scope 37:.:global:global/global.pri:silent: +# versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&" + +extend_target(Core CONDITION UNIX + SOURCES + io/qfilesystemengine_unix.cpp + io/qfilesystemiterator_unix.cpp + io/qfsfileengine_unix.cpp + io/qlockfile_unix.cpp + kernel/qcore_unix.cpp kernel/qcore_unix_p.h + kernel/qeventdispatcher_unix.cpp kernel/qeventdispatcher_unix_p.h + kernel/qpoll_p.h + kernel/qtimerinfo_unix.cpp kernel/qtimerinfo_unix_p.h + thread/qthread_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread + SOURCES + thread/qatomic.cpp thread/qatomic.h + thread/qatomic_bootstrap.h + thread/qatomic_cxx11.h + thread/qbasicatomic.h + thread/qfutex_p.h + thread/qgenericatomic.h + thread/qmutex.cpp thread/qmutex_p.h + thread/qmutexpool.cpp thread/qmutexpool_p.h + thread/qorderedmutexlocker_p.h + thread/qreadwritelock.cpp thread/qreadwritelock_p.h + thread/qsemaphore.cpp thread/qsemaphore.h + thread/qthread_p.h + thread/qthreadpool.cpp thread/qthreadpool.h thread/qthreadpool_p.h + thread/qthreadstorage.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread AND WIN32 + SOURCES + thread/qmutex_win.cpp + thread/qwaitcondition_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread AND UNIX + SOURCES + thread/qwaitcondition_unix.cpp +) + +extend_target(Core CONDITION APPLE AND QT_FEATURE_thread + SOURCES + thread/qmutex_mac.cpp +) + +extend_target(Core CONDITION LINUX AND QT_FEATURE_thread + SOURCES + thread/qmutex_linux.cpp +) + +extend_target(Core CONDITION QT_FEATURE_thread AND UNIX AND NOT APPLE AND NOT LINUX + SOURCES + thread/qmutex_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_future + SOURCES + thread/qexception.cpp thread/qexception.h + thread/qfuture.h + thread/qfutureinterface.cpp thread/qfutureinterface.h thread/qfutureinterface_p.h + thread/qfuturesynchronizer.h + thread/qfuturewatcher.cpp thread/qfuturewatcher.h thread/qfuturewatcher_p.h + thread/qresultstore.cpp thread/qresultstore.h +) + +extend_target(Core CONDITION QT_FEATURE_std_atomic64 + PUBLIC_LIBRARIES + Atomic +) + +extend_target(Core CONDITION ICC + COMPILE_OPTIONS + -fp-model + strict +) + +extend_target(Core CONDITION MSVC + SOURCES + tools/qvector_msvc.cpp +) + +extend_target(Core CONDITION APPLE_OSX AND NOT NACL + SOURCES + kernel/qelapsedtimer_mac.cpp + tools/qlocale_mac.mm +) + +extend_target(Core CONDITION UNIX AND (NACL OR NOT APPLE_OSX) + SOURCES + tools/qlocale_unix.cpp +) + +extend_target(Core CONDITION WIN32 AND (NACL OR NOT APPLE_OSX) + SOURCES + tools/qlocale_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_icu + SOURCES + tools/qcollator_icu.cpp + tools/qlocale_icu.cpp + LIBRARIES + ICU::i18n ICU::uc ICU::data +) + +extend_target(Core CONDITION WIN32 AND NOT QT_FEATURE_icu + SOURCES + tools/qcollator_win.cpp +) + +extend_target(Core CONDITION APPLE_OSX AND NOT QT_FEATURE_icu + SOURCES + tools/qcollator_macx.cpp +) + +extend_target(Core CONDITION UNIX AND NOT APPLE_OSX AND NOT QT_FEATURE_icu + SOURCES + tools/qcollator_posix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone + SOURCES + tools/qtimezone.cpp tools/qtimezone.h + tools/qtimezoneprivate.cpp tools/qtimezoneprivate_p.h + tools/qtimezoneprivate_data_p.h +) + +extend_target(Core CONDITION APPLE AND QT_FEATURE_timezone AND NOT NACL + SOURCES + tools/qtimezoneprivate_mac.mm +) + +extend_target(Core CONDITION ANDROID AND QT_FEATURE_timezone AND NOT ANDROID_EMBEDDED AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_android.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_tz.cpp +) + +extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND UNIX AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_icu.cpp +) + +extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_timezone AND WIN32 AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_icu.cpp +) + +extend_target(Core CONDITION QT_FEATURE_timezone AND WIN32 AND NOT QT_FEATURE_icu AND (ANDROID_EMBEDDED OR NOT ANDROID) AND (NACL OR NOT APPLE) + SOURCES + tools/qtimezoneprivate_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_datetimeparser + SOURCES + tools/qdatetimeparser.cpp tools/qdatetimeparser_p.h +) + +extend_target(Core CONDITION QT_FEATURE_regularexpression + SOURCES + tools/qregularexpression.cpp tools/qregularexpression.h + LIBRARIES + PCRE2 +) + +extend_target(Core CONDITION QT_FEATURE_commandlineparser + SOURCES + tools/qcommandlineoption.cpp tools/qcommandlineoption.h + tools/qcommandlineparser.cpp tools/qcommandlineparser.h +) + +extend_target(Core CONDITION UNIX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS AND NOT WASM AND (NOT APPLE_OSX OR NOT ICC) + LIBRARIES + m +) + +extend_target(Core CONDITION QT_FEATURE_zstd + LIBRARIES + ZSTD::ZSTD +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher + SOURCES + io/qfilesystemwatcher.cpp io/qfilesystemwatcher.h io/qfilesystemwatcher_p.h + io/qfilesystemwatcher_polling.cpp io/qfilesystemwatcher_polling_p.h +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND WIN32 + SOURCES + io/qfilesystemwatcher_win.cpp io/qfilesystemwatcher_win_p.h +) + +extend_target(Core CONDITION APPLE_OSX AND QT_FEATURE_filesystemwatcher + SOURCES + io/qfilesystemwatcher_fsevents.mm io/qfilesystemwatcher_fsevents_p.h +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND QT_FEATURE_inotify AND UNIX AND NOT APPLE_OSX + SOURCES + io/qfilesystemwatcher_inotify.cpp io/qfilesystemwatcher_inotify_p.h +) + +extend_target(Core CONDITION QT_FEATURE_filesystemwatcher AND UNIX AND NOT APPLE_OSX AND NOT QT_FEATURE_inotify AND (APPLE OR FREEBSD OR NETBSD OR OPENBSD) + SOURCES + io/qfilesystemwatcher_kqueue.cpp io/qfilesystemwatcher_kqueue_p.h +) + +extend_target(Core CONDITION QT_FEATURE_processenvironment + SOURCES + io/qprocess.cpp io/qprocess.h io/qprocess_p.h +) + +extend_target(Core CONDITION QT_FEATURE_processenvironment AND WIN32 AND NOT WINRT + SOURCES + io/qprocess_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_processenvironment AND UNIX + SOURCES + io/qprocess_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_settings + SOURCES + io/qsettings.cpp io/qsettings.h io/qsettings_p.h +) + +extend_target(Core CONDITION QT_FEATURE_settings AND WIN32 AND NOT WINRT + SOURCES + io/qsettings_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_settings AND WINRT + SOURCES + io/qsettings_winrt.cpp +) + +extend_target(Core CONDITION APPLE AND QT_FEATURE_settings AND NOT NACL + SOURCES + io/qsettings_mac.cpp +) + +extend_target(Core CONDITION QT_FEATURE_filesystemiterator AND WIN32 + SOURCES + io/qfilesystemiterator_win.cpp +) + +extend_target(Core CONDITION WINRT + SOURCES + io/qstandardpaths_winrt.cpp + io/qstorageinfo_stub.cpp + kernel/qeventdispatcher_winrt.cpp kernel/qeventdispatcher_winrt_p.h + kernel/qfunctions_fake_env_p.h + kernel/qfunctions_winrt.cpp kernel/qfunctions_winrt.h +) + +extend_target(Core CONDITION UNIX AND NOT APPLE_UIKIT AND NOT INTEGRITY + SOURCES + ../3rdparty/forkfd/forkfd.h + io/forkfd_qt.cpp + INCLUDE_DIRECTORIES + ../3rdparty/forkfd +) + +extend_target(Core CONDITION APPLE_OSX AND QT_FEATURE_processenvironment + SOURCES + io/qprocess_darwin.mm +) + +extend_target(Core CONDITION ANDROID AND NOT ANDROID_EMBEDDED + SOURCES + io/qstandardpaths_android.cpp + io/qstorageinfo_unix.cpp + kernel/qjni.cpp kernel/qjni_p.h + kernel/qjnihelpers.cpp kernel/qjnihelpers_p.h + kernel/qjnionload.cpp +) + +extend_target(Core CONDITION HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) + SOURCES + io/qstandardpaths_haiku.cpp + io/qstorageinfo_unix.cpp + PUBLIC_LIBRARIES + be +) + +extend_target(Core CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND (ANDROID_EMBEDDED OR NOT ANDROID) + SOURCES + io/qstandardpaths_unix.cpp + io/qstorageinfo_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_proxymodel + SOURCES + itemmodels/qabstractproxymodel.cpp itemmodels/qabstractproxymodel.h itemmodels/qabstractproxymodel_p.h +) + +extend_target(Core CONDITION QT_FEATURE_concatenatetablesproxymodel AND QT_FEATURE_proxymodel + SOURCES + itemmodels/qconcatenatetablesproxymodel.cpp itemmodels/qconcatenatetablesproxymodel.h +) + +extend_target(Core CONDITION QT_FEATURE_identityproxymodel AND QT_FEATURE_proxymodel + SOURCES + itemmodels/qidentityproxymodel.cpp itemmodels/qidentityproxymodel.h +) + +extend_target(Core CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_sortfilterproxymodel + SOURCES + itemmodels/qsortfilterproxymodel.cpp itemmodels/qsortfilterproxymodel.h +) + +extend_target(Core CONDITION QT_FEATURE_proxymodel AND QT_FEATURE_transposeproxymodel + SOURCES + itemmodels/qtransposeproxymodel.cpp itemmodels/qtransposeproxymodel.h itemmodels/qtransposeproxymodel_p.h +) + +extend_target(Core CONDITION QT_FEATURE_stringlistmodel + SOURCES + itemmodels/qstringlistmodel.cpp itemmodels/qstringlistmodel.h +) + +extend_target(Core CONDITION QT_FEATURE_library + SOURCES + plugin/qelfparser_p.cpp plugin/qelfparser_p.h + plugin/qlibrary.cpp plugin/qlibrary.h plugin/qlibrary_p.h + plugin/qmachparser.cpp plugin/qmachparser_p.h +) + +extend_target(Core CONDITION QT_FEATURE_library AND UNIX + SOURCES + plugin/qlibrary_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_library AND WIN32 + SOURCES + plugin/qlibrary_win.cpp +) + +extend_target(Core CONDITION QT_FEATURE_dlopen AND QT_FEATURE_library + LIBRARIES + ${CMAKE_DL_LIBS} +) + +extend_target(Core CONDITION APPLE_OSX AND (APPLE_IOS OR APPLE_TVOS) + LIBRARIES + ${FWUIKit} +) + +extend_target(Core CONDITION APPLE_OSX AND APPLE_WATCHOS + LIBRARIES + ${FWWatchKit} +) + +extend_target(Core CONDITION NACL + SOURCES + kernel/qfunctions_nacl.cpp kernel/qfunctions_nacl.h +) + +extend_target(Core CONDITION INTEGRITY OR (NACL AND UNIX) OR (UNIX AND NOT APPLE) + SOURCES + kernel/qelapsedtimer_unix.cpp +) + +extend_target(Core CONDITION QT_FEATURE_poll_select AND UNIX + SOURCES + kernel/qpoll.cpp +) + +extend_target(Core CONDITION QT_FEATURE_glib AND UNIX + SOURCES + kernel/qeventdispatcher_glib.cpp kernel/qeventdispatcher_glib_p.h + LIBRARIES + GLIB2::GLIB2 +) + +extend_target(Core CONDITION QT_FEATURE_clock_gettime AND UNIX + LIBRARIES + WrapRt +) + +extend_target(Core CONDITION UNIX AND NOT ANDROID + SOURCES + kernel/qsharedmemory_posix.cpp + kernel/qsharedmemory_systemv.cpp + kernel/qsharedmemory_unix.cpp + kernel/qsystemsemaphore_posix.cpp + kernel/qsystemsemaphore_systemv.cpp + kernel/qsystemsemaphore_unix.cpp +) + +extend_target(Core CONDITION ANDROID + SOURCES + kernel/qsharedmemory_android.cpp + kernel/qsystemsemaphore_android.cpp +) + +extend_target(Core CONDITION VXWORKS + SOURCES + kernel/qfunctions_vxworks.cpp kernel/qfunctions_vxworks.h +) + +extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps + SOURCES + kernel/qppsattribute.cpp kernel/qppsattribute_p.h + kernel/qppsattributeprivate_p.h + kernel/qppsobject.cpp kernel/qppsobject_p.h + kernel/qppsobjectprivate_p.h + LIBRARIES + PPS::PPS +) + +extend_target(Core CONDITION QT_FEATURE_textcodec + SOURCES + codecs/qlatincodec.cpp codecs/qlatincodec_p.h + codecs/qsimplecodec.cpp codecs/qsimplecodec_p.h + codecs/qtextcodec.cpp codecs/qtextcodec.h +) + +extend_target(Core CONDITION QT_FEATURE_codecs AND QT_FEATURE_textcodec + SOURCES + codecs/qisciicodec.cpp codecs/qisciicodec_p.h + codecs/qtsciicodec.cpp codecs/qtsciicodec_p.h +) + +extend_target(Core CONDITION QT_FEATURE_icu AND QT_FEATURE_textcodec + SOURCES + codecs/qicucodec.cpp codecs/qicucodec_p.h +) + +extend_target(Core CONDITION QT_FEATURE_big_codecs AND QT_FEATURE_textcodec AND NOT QT_FEATURE_icu + SOURCES + codecs/qbig5codec.cpp codecs/qbig5codec_p.h + codecs/qeucjpcodec.cpp codecs/qeucjpcodec_p.h + codecs/qeuckrcodec.cpp codecs/qeuckrcodec_p.h + codecs/qgb18030codec.cpp codecs/qgb18030codec_p.h + codecs/qjiscodec.cpp codecs/qjiscodec_p.h + codecs/qjpunicode.cpp + codecs/qsjiscodec.cpp codecs/qsjiscodec_p.h +) + +extend_target(Core CONDITION QT_FEATURE_iconv AND QT_FEATURE_textcodec AND NOT QT_FEATURE_icu + SOURCES + codecs/qiconvcodec.cpp codecs/qiconvcodec_p.h + LIBRARIES + iconv +) + +extend_target(Core CONDITION QT_FEATURE_textcodec AND WIN32 AND NOT QT_FEATURE_icu + SOURCES + codecs/qwindowscodec.cpp codecs/qwindowscodec_p.h +) + +extend_target(Core CONDITION QT_FEATURE_qeventtransition + SOURCES + statemachine/qeventtransition.cpp statemachine/qeventtransition.h statemachine/qeventtransition_p.h +) + +extend_target(Core CONDITION QT_FEATURE_mimetype + SOURCES + mimetypes/qmimedatabase.cpp mimetypes/qmimedatabase.h mimetypes/qmimedatabase_p.h + mimetypes/qmimeglobpattern.cpp mimetypes/qmimeglobpattern_p.h + mimetypes/qmimemagicrule.cpp mimetypes/qmimemagicrule_p.h + mimetypes/qmimemagicrulematcher.cpp mimetypes/qmimemagicrulematcher_p.h + mimetypes/qmimeprovider.cpp mimetypes/qmimeprovider_p.h + mimetypes/qmimetype.cpp mimetypes/qmimetype.h mimetypes/qmimetype_p.h + mimetypes/qmimetypeparser.cpp mimetypes/qmimetypeparser_p.h +) + +# Resources: +set_source_files_properties("mimetypes/mime/packages/freedesktop.org.xml" + PROPERTIES alias "freedesktop.org.xml") +add_qt_resource(Core "mimetypes" PREFIX "/qt-project.org/qmime/packages" BASE "mimetypes" FILES + mime/packages/freedesktop.org.xml) + + +extend_target(Core CONDITION WASM + SOURCES + platform/wasm/qstdweb.cpp platform/wasm/qstdweb_p.h +) + + +qt_create_tracepoints(Core qtcore.tracepoints) +add_qt_docs( + doc/qtcore.qdocconf +) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 3846c38cded..59ad7dcdd6d 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -219,8 +219,8 @@ add_qt_module(Core tools/qversionnumber.cpp tools/qversionnumber.h tools/qvsnprintf.cpp DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/global # special case # special case: remove ../3rdparty/... @@ -300,13 +300,14 @@ if (LINUX AND NOT CMAKE_CROSSCOMPILING AND BUILD_SHARED_LIBS) target_compile_definitions(Core PRIVATE ELF_INTERPRETER="${ELF_INTERPRETER}") endif() endif() +# special case end add_qt_simd_part(Core SIMD mips_dsp SOURCES ../gui/painting/qt_mips_asm_dsp_p.h tools/qstring_mips_dsp_asm.S ) -# special case end + #### Keys ignored in scope 1:.:.:corelib.pro:: # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" @@ -455,7 +456,7 @@ extend_target(Core CONDITION INTEGRITY shm_client socket COMPILE_OPTIONS - "--pending_instantiations=128" + --pending_instantiations=128 ) #### Keys ignored in scope 13:.:.:corelib.pro:pathIsAbsolute(_ss_CMAKE_HOST_DATA_DIR): @@ -508,7 +509,7 @@ extend_target(Core CONDITION LINUX AND NOT static # no_pch_assembler.output = "${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${firstQMAKE_EXT_OBJ}" #### Keys ignored in scope 32:.:global:global/global.pri:silent: -# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&" "$$no_pch_assembler.commands" +# no_pch_assembler.commands = "@echo" "compiling[no_pch]" "${QMAKE_FILE_IN}" "&&" extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static SOURCES @@ -517,12 +518,12 @@ extend_target(Core CONDITION LINUX AND NOT precompile_header AND NOT static extend_target(Core CONDITION QT_FEATURE_slog2 LIBRARIES - slog2 + Slog2::Slog2 ) extend_target(Core CONDITION QT_FEATURE_journald LIBRARIES - journald + PkgConfig::Libsystemd ) #### Keys ignored in scope 36:.:global:global/global.pri:GCC AND ltcg: @@ -535,7 +536,7 @@ extend_target(Core CONDITION QT_FEATURE_journald # versiontagging_compiler.variable_out = "OBJECTS" #### Keys ignored in scope 37:.:global:global/global.pri:silent: -# versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&" "$$versiontagging_compiler.commands" +# versiontagging_compiler.commands = "@echo" "compiling[versiontagging]" "${QMAKE_FILE_IN}" "&&" extend_target(Core CONDITION UNIX SOURCES @@ -611,8 +612,8 @@ extend_target(Core CONDITION QT_FEATURE_std_atomic64 extend_target(Core CONDITION ICC COMPILE_OPTIONS - "-fp-model" - "strict" + -fp-model + strict ) extend_target(Core CONDITION MSVC @@ -870,8 +871,6 @@ extend_target(Core CONDITION QT_FEATURE_library plugin/qelfparser_p.cpp plugin/qelfparser_p.h plugin/qlibrary.cpp plugin/qlibrary.h plugin/qlibrary_p.h plugin/qmachparser.cpp plugin/qmachparser_p.h - LIBRARIES - ${CMAKE_DL_LIBS} ) extend_target(Core CONDITION QT_FEATURE_library AND UNIX @@ -884,6 +883,11 @@ extend_target(Core CONDITION QT_FEATURE_library AND WIN32 plugin/qlibrary_win.cpp ) +extend_target(Core CONDITION QT_FEATURE_dlopen AND QT_FEATURE_library + LIBRARIES + ${CMAKE_DL_LIBS} +) + extend_target(Core CONDITION APPLE_OSX AND (APPLE_IOS OR APPLE_TVOS) LIBRARIES ${FWUIKit} @@ -949,7 +953,7 @@ extend_target(Core CONDITION QNX AND QT_FEATURE_qqnx_pps kernel/qppsobject.cpp kernel/qppsobject_p.h kernel/qppsobjectprivate_p.h LIBRARIES - pps + PPS::PPS ) extend_target(Core CONDITION QT_FEATURE_textcodec @@ -1064,7 +1068,7 @@ endif() qt_internal_add_link_flags_gc_sections(Core PRIVATE) # special case end -qt_create_tracepoints(Core ./qtcore.tracepoints) +qt_create_tracepoints(Core qtcore.tracepoints) add_qt_docs( - ./doc/qtcore.qdocconf + doc/qtcore.qdocconf ) From e4b8c488bd8b350f1a19874c4859ae2699afc747 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 14:22:57 +0200 Subject: [PATCH 0531/1322] Improve configure2cmake to find_package only in certain conditions It doesn't make much sense to look for X11 related packages on macOS and Windows by default. Usually they would not be there, and as a result the configuration step would show a long list of scary not found packages, and also eat precious configure time. Change the conversion script to allow putting conditions around generated find_package calls. These conditions can be manually set in the conversion script library mapping, using the emit_if argument, which we do for the X11 and Wayland related packages. They are also computed by checking which features use a given library, and if the feature is protected by a simple emitIf condition like config.linux, the relevant library find_package call will be protected by the same condition. If a developer still wishes to look for all packages, they can define the CACHE variable QT_FIND_ALL_PACKAGES_ALWAYS to ON. The relevant configure.cmake files are regenerated in this patch. Change-Id: I6f918a94f50257ec41d6216305dae9774933389a Reviewed-by: Tobias Hunger --- src/corelib/configure.cmake | 4 +- src/gui/configure.cmake | 80 +++++++++++++++++++++++-------- util/cmake/configurejson2cmake.py | 24 +++++++++- util/cmake/helper.py | 39 +++++++++++++-- 4 files changed, 120 insertions(+), 27 deletions(-) diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index a5b40b56a03..4f943967a0e 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -18,7 +18,9 @@ qt_find_package(WrapRt PROVIDED_TARGETS WrapRt) qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST) qt_find_package(PCRE2 PROVIDED_TARGETS PCRE2) set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) -qt_find_package(PPS PROVIDED_TARGETS PPS::PPS) +if((QNX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(PPS PROVIDED_TARGETS PPS::PPS) +endif() qt_find_package(Slog2 PROVIDED_TARGETS Slog2::Slog2) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index c7a9a5f8481..9d2cf7148d4 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -38,26 +38,66 @@ qt_find_package(OpenGL PROVIDED_TARGETS OpenGL::GL) qt_find_package(GLESv2 PROVIDED_TARGETS GLESv2::GLESv2) qt_find_package(Tslib PROVIDED_TARGETS PkgConfig::Tslib) qt_find_package(Vulkan PROVIDED_TARGETS Vulkan::Vulkan) -qt_find_package(Wayland PROVIDED_TARGETS Wayland::Server) -qt_find_package(X11 PROVIDED_TARGETS X11::XCB) -qt_find_package(X11 PROVIDED_TARGETS ${X11_SM_LIB} ${X11_ICE_LIB}) -qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB) -qt_find_package(XCB COMPONENTS ICCCM PROVIDED_TARGETS XCB::ICCCM) -qt_find_package(XCB COMPONENTS IMAGE PROVIDED_TARGETS XCB::IMAGE) -qt_find_package(XCB COMPONENTS KEYSYMS PROVIDED_TARGETS XCB::KEYSYMS) -qt_find_package(XCB COMPONENTS RENDERUTIL PROVIDED_TARGETS XCB::RENDERUTIL) -qt_find_package(XCB COMPONENTS RANDR PROVIDED_TARGETS XCB::RANDR) -qt_find_package(XCB COMPONENTS SHAPE PROVIDED_TARGETS XCB::SHAPE) -qt_find_package(XCB COMPONENTS SHM PROVIDED_TARGETS XCB::SHM) -qt_find_package(XCB COMPONENTS SYNC PROVIDED_TARGETS XCB::SYNC) -qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES) -qt_find_package(XCB COMPONENTS XINERAMA PROVIDED_TARGETS XCB::XINERAMA) -qt_find_package(XCB COMPONENTS XKB PROVIDED_TARGETS XCB::XKB) -qt_find_package(XCB COMPONENTS RENDER PROVIDED_TARGETS XCB::RENDER) -qt_find_package(XCB COMPONENTS GLX PROVIDED_TARGETS XCB::GLX) -qt_find_package(XCB COMPONENTS XINPUT PROVIDED_TARGETS XCB::XINPUT) -qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) -qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(Wayland PROVIDED_TARGETS Wayland::Server) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(X11 PROVIDED_TARGETS X11::XCB) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(X11 PROVIDED_TARGETS ${X11_SM_LIB} ${X11_ICE_LIB}) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB 1.9 PROVIDED_TARGETS XCB::XCB) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS ICCCM PROVIDED_TARGETS XCB::ICCCM) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS IMAGE PROVIDED_TARGETS XCB::IMAGE) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS KEYSYMS PROVIDED_TARGETS XCB::KEYSYMS) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS RENDERUTIL PROVIDED_TARGETS XCB::RENDERUTIL) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS RANDR PROVIDED_TARGETS XCB::RANDR) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS SHAPE PROVIDED_TARGETS XCB::SHAPE) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS SHM PROVIDED_TARGETS XCB::SHM) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS SYNC PROVIDED_TARGETS XCB::SYNC) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS XINERAMA PROVIDED_TARGETS XCB::XINERAMA) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS XKB PROVIDED_TARGETS XCB::XKB) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS RENDER PROVIDED_TARGETS XCB::RENDER) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS GLX PROVIDED_TARGETS XCB::GLX) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XCB COMPONENTS XINPUT PROVIDED_TARGETS XCB::XINPUT) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) +endif() +if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) + qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) +endif() #### Tests diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 040e8ee7b43..d1646ed0826 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -181,9 +181,29 @@ def parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set): if newlib.targetName in cmake_find_packages_set: return + # If certain libraries are used within a feature, but the feature + # is only emitted conditionally with a simple condition (like + # 'on Windows' or 'on Linux'), we should enclose the find_package + # call for the library into the same condition. + emit_if = newlib.emit_if + + # Only look through features if a custom emit_if wasn't provided. + if not emit_if: + for feature in data['features']: + feature_data = data['features'][feature] + if 'condition' in feature_data and \ + 'libs.{}'.format(lib) in feature_data['condition'] and \ + 'emitIf' in feature_data and \ + 'config.' in feature_data['emitIf']: + emit_if = feature_data['emitIf'] + break + + if emit_if: + emit_if = map_condition(emit_if) + cmake_find_packages_set.add(newlib.targetName) - cm_fh.write(generate_find_package_info(newlib)) + cm_fh.write(generate_find_package_info(newlib, emit_if=emit_if)) def lineify(label, value, quote=True): @@ -890,7 +910,7 @@ def processLibraries(ctx, data, cm_fh): return for lib in data['libraries']: - parseLib(ctx, lib, data['libraries'][lib], cm_fh, cmake_find_packages_set) + parseLib(ctx, lib, data, cm_fh, cmake_find_packages_set) def processSubconfigs(dir, ctx, data): diff --git a/util/cmake/helper.py b/util/cmake/helper.py index ee4274abd7b..d9e9fd16e3c 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -35,7 +35,8 @@ class LibraryMapping: targetName: typing.Optional[str], *, resultVariable: typing.Optional[str] = None, extra: typing.List[str] = [], - appendFoundSuffix: bool = True) -> None: + appendFoundSuffix: bool = True, + emit_if: str = '') -> None: self.soName = soName self.packageName = packageName self.resultVariable = resultVariable @@ -43,6 +44,10 @@ class LibraryMapping: self.extra = extra self.targetName = targetName + # if emit_if is non-empty, the generated find_package call + # for a library will be surrounded by this condition. + self.emit_if = emit_if + def is_qt(self) -> bool: return self.packageName == 'Qt' \ or self.packageName == 'Qt5' \ @@ -172,6 +177,7 @@ _qt_library_map = [ # qtzlib: No longer supported. ] +# Note that the library map is adjusted dynamically further down. _library_map = [ # 3rd party: LibraryMapping('atspi', 'ATSPI2', 'PkgConfig::ATSPI2'), @@ -247,6 +253,20 @@ _library_map = [ ] +def _adjust_library_map(): + # Assign a Linux condition on all x and wayland related packages. + # We don't want to get pages of package not found messages on + # Windows and macOS, and this also improves configure time on + # those platforms. + linux_package_prefixes = ['xcb', 'x11', 'xkb', 'xrender', 'xlib', 'wayland'] + for i, _ in enumerate(_library_map): + if any([_library_map[i].soName.startswith(p) for p in linux_package_prefixes]): + _library_map[i].emit_if = 'config.linux' + + +_adjust_library_map() + + def find_3rd_party_library_mapping(soName: str) -> typing.Optional[LibraryMapping]: for i in _library_map: if i.soName == soName: @@ -356,8 +376,10 @@ def map_3rd_party_library(lib: str) -> str: return mapping.targetName + libpostfix -def generate_find_package_info(lib: LibraryMapping, use_qt_find_package: bool=True, *, - indent: int = 0) -> str: +def generate_find_package_info(lib: LibraryMapping, + use_qt_find_package: bool=True, *, + indent: int = 0, + emit_if: str = '') -> str: isRequired = False extra = lib.extra.copy() @@ -377,7 +399,8 @@ def generate_find_package_info(lib: LibraryMapping, use_qt_find_package: bool=Tr extra += ['PROVIDED_TARGETS', cmake_target_name] result = '' - ind = ' ' * indent + one_ind = ' ' + ind = one_ind * indent if use_qt_find_package: if extra: @@ -393,4 +416,12 @@ def generate_find_package_info(lib: LibraryMapping, use_qt_find_package: bool=Tr else: result = '{}find_package({})\n'.format(ind, lib.packageName) + # If a package should be found only in certain conditions, wrap + # the find_package call within that condition. + if emit_if: + result = "if(({emit_if}) OR QT_FIND_ALL_PACKAGES_ALWAYS)\n" \ + "{ind}{result}endif()\n".format(emit_if=emit_if, + result=result, + ind=one_ind) + return result From 76f5b784ce54730ed8d6ad4bb9c39c9a05c5d81d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 17 May 2019 18:31:19 +0200 Subject: [PATCH 0532/1322] Fix the fix to correctly handle comments in multi-line assignments The previous fix where the Grammar comment style was changed to remove the newlines was incorrect, because if you have foo=1#comment bar=2 after the Grammar comment ignoring, it would transform into foo=1bar=2 which will clearly fail to parse, so the new line has to stay. But we would still have the following case which would fail: foo=a \ # comment b Apparently qmake things that's the equivalent of foo=a b but the grammar parses it as foo=a \ \n (newline) b Thus the parsing fails because there's a newline and then some weird 'b' token which the grammar does not expect. The best fix I found is to preprocess the source, to remove completely commented out lines. So: foo=a \ # comment b gets transformed into foo=a \ b Change-Id: I2487a0dbf94a6ad4d917d0a0ce05247341e9b7da Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 29 ++++++++++++++++++----- util/cmake/tests/data/lc_with_comment.pro | 18 ++++++++++++++ util/cmake/tests/test_parsing.py | 2 +- 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ba77e0e51f4..0036c658d68 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -155,6 +155,27 @@ def fixup_linecontinuation(contents: str) -> str: return contents +def fixup_comments(contents: str) -> str: + # Get rid of completely commented out lines. + # So any line which starts with a '#' char and ends with a new line + # will be replaced by a single new line. + # + # This is needed because qmake syntax is weird. In a multi line + # assignment (separated by backslashes and newlines aka + # # \\\n ), if any of the lines are completely commented out, in + # principle the assignment should fail. + # + # It should fail because you would have a new line separating + # the previous value from the next value, and the next value would + # not be interpreted as a value, but as a new token / operation. + # qmake is lenient though, and accepts that, so we need to take + # care of it as well, as if the commented line didn't exist in the + # first place. + + contents = re.sub(r'\n#[^\n]*?\n', '\n', contents, re.DOTALL) + return contents + + def spaces(indent: int) -> str: return ' ' * indent @@ -782,12 +803,7 @@ class QmakeParser: expr.setDebug() Grammar = StatementGroup('statements') - - # Ignore comment lines, including the final line break, - # otherwise parsing fails when looking at multi line assignments - # with comments in between. - Comment = pp.Regex(r"#.*\n").setName("qmake style comment") - Grammar.ignore(Comment()) + Grammar.ignore(pp.pythonStyleComment()) return Grammar @@ -799,6 +815,7 @@ class QmakeParser: old_contents = contents contents = fixup_linecontinuation(contents) + contents = fixup_comments(contents) if old_contents != contents: print('Warning: Fixed line continuation in .pro-file!\n' diff --git a/util/cmake/tests/data/lc_with_comment.pro b/util/cmake/tests/data/lc_with_comment.pro index c087dadacc1..176913dfc8a 100644 --- a/util/cmake/tests/data/lc_with_comment.pro +++ b/util/cmake/tests/data/lc_with_comment.pro @@ -2,3 +2,21 @@ SUBDIRS = \ # dds \ tga \ wbmp + +MYVAR = foo # comment +MYVAR = foo2# comment +MYVAR = foo3# comment # + +MYVAR = foo4# comment # + +## +# +# +## + + # + # +# + # # + +MYVAR = foo5# comment # # diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 4b6f48b931e..c8feeb18114 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -308,4 +308,4 @@ def test_realworld_lc(): def test_realworld_lc_with_comment_in_between(): result = parse_file(_tests_path + '/data/lc_with_comment.pro') - assert len(result) == 1 + assert len(result) == 6 From a859cb508ce7152c107acd251b45c3213659903c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 20 May 2019 09:46:38 +0200 Subject: [PATCH 0533/1322] Automatically install repo specific cmake find modules Some qt modules need to find 3rd party packages for which there are no Config files. We need to write custom CMake Find modules to find those packages. These find modules need to be installed so that they are used when a user consumes the Qt packages. Automatically include and install these find modules if they exist, as part of qt_build_repo_end(). Change-Id: I14aad35ed2999cac8bdda65ca4aeaf74d04fdb71 Reviewed-by: Tobias Hunger Reviewed-by: Liang Qi --- .../QtBuildInternals/QtBuildInternalsConfig.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index a3b7bddb1af..34e40365caf 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -19,6 +19,11 @@ macro(qt_build_repo_begin) # Set up the paths for the modules. set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}") list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH}) + + # If the repo has its own cmake modules, include those in the module path. + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + endif() endif() # Qt specific setup common for all modules: @@ -30,6 +35,16 @@ macro(qt_build_repo_end) # Delayed actions on some of the Qt targets: include(QtPostProcess) + # Install the repo-specific cmake find modules. + qt_path_join(__qt_repo_install_dir ${QT_CONFIG_INSTALL_DIR} ${INSTALL_CMAKE_NAMESPACE}) + + if(NOT PROJECT_NAME STREQUAL "QtBase") + qt_copy_or_install(DIRECTORY cmake/ + DESTINATION "${__qt_repo_install_dir}" + FILES_MATCHING PATTERN "Find*.cmake" + ) + endif() + # Print a feature summary: feature_summary(WHAT PACKAGES_FOUND REQUIRED_PACKAGES_NOT_FOUND From d61ca95fc09531479e3d9343bf55d77065844c28 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 21 May 2019 09:04:27 +0200 Subject: [PATCH 0534/1322] Simplify top-level CMakeLists.txt for modules Implement some aspects of qt_parts.prf to simplify the top-level CMakeLists.txt for repositories that follow the common qt structure (src, tools, tests, examples). Change-Id: Ia35f4e9207e92c1cf0406353561b0cc52dcb0e59 Reviewed-by: Liang Qi Reviewed-by: Alexandru Croitor --- .../QtBuildInternalsConfig.cmake | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 34e40365caf..767a9dc45fe 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -53,3 +53,23 @@ macro(qt_build_repo_end) RUNTIME_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) endmacro() + +macro(qt_build_repo) + qt_build_repo_begin(${ARGN}) + + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src") + add_subdirectory(src) + endif() + + if (BUILD_TESTING) + find_package(Qt5 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test Xml) + add_subdirectory(tests) + endif() + + if (BUILD_EXAMPLES) + # TODO: Implement me + #add_subdirectory(examples) + endif() + + qt_build_repo_end() +endmacro() From f8e4f94a141855d78245b0f83cac0ff8dd1575b8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 21 May 2019 10:29:50 +0200 Subject: [PATCH 0535/1322] Avoid accidental clash with .qrc files that are checked in Add a prefix for generated .qrc files so for in-source builds we don't end up overwriting htem. Change-Id: I8eef582479eb45d67585f6aab87b288393bbadb5 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 50722a54758..a18a858e0cd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1480,7 +1480,7 @@ function(add_qt_resource target resourceName) # string(APPEND qrcContents " \n\n") - set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/${resourceName}.qrc") + set(generatedResourceFile "${CMAKE_CURRENT_BINARY_DIR}/generated_${resourceName}.qrc") file(GENERATE OUTPUT "${generatedResourceFile}" CONTENT "${qrcContents}") # Process .qrc file: From 4e7756a6cd48716ff37d071fe660bb0e9edfa89f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 21 May 2019 16:51:10 +0200 Subject: [PATCH 0536/1322] Add a few more 3rd party libraries to helper.py Handle a few more libraries that are used in qtimageformats repi. Change-Id: Ia3b9a845bc6cb8ce98a477b9355011bbadc32c1a Reviewed-by: Liang Qi Reviewed-by: Simon Hausmann --- util/cmake/helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index d9e9fd16e3c..682e2ec15fd 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -250,6 +250,9 @@ _library_map = [ LibraryMapping('xrender', 'XRender', 'PkgConfig::xrender'), LibraryMapping('zlib', 'ZLIB', 'ZLIB::ZLIB', extra=['REQUIRED']), LibraryMapping('zstd', 'ZSTD', 'ZSTD::ZSTD'), + LibraryMapping('tiff', 'TIFF', 'TIFF::TIFF'), + LibraryMapping('webp', 'WrapWebP', 'WrapWebP::WrapWebP'), + LibraryMapping('jasper', 'WrapJasper', 'WrapJasper::WrapJasper'), ] From 774088b677b03cd1857fd352f305a5fe15b9f5eb Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 21 May 2019 17:09:47 +0200 Subject: [PATCH 0537/1322] Build and use double-conversion library shipped by Qt when needed Some Linux distros might not have a double-conversion library. Because it is such an essential library for QtCore, compile and use the the copy of the library bundled with Qt. Also change library name to be a proper target with double colons, so that in case the library is not found for some reason, the CMake configure step would fail, instead of failing at link time. Task-number: QTBUG-74133 Change-Id: I9f3b4298ae6e952891a7a89541d46878176bf1ce Fixes: QTBUG-75891 Reviewed-by: Liang Qi Reviewed-by: Simon Hausmann --- cmake/FindWrapDoubleConversion.cmake | 20 +++++++++++++----- src/3rdparty/CMakeLists.txt | 1 + src/3rdparty/double-conversion/CMakeLists.txt | 21 +++++++++++++++++++ src/corelib/CMakeLists.txt | 5 +++-- 4 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 src/3rdparty/double-conversion/CMakeLists.txt diff --git a/cmake/FindWrapDoubleConversion.cmake b/cmake/FindWrapDoubleConversion.cmake index cfb70a09819..1164f6ba445 100644 --- a/cmake/FindWrapDoubleConversion.cmake +++ b/cmake/FindWrapDoubleConversion.cmake @@ -1,16 +1,17 @@ -include(CheckCXXSourceCompiles) - -add_library(WrapDoubleConversion INTERFACE IMPORTED) +add_library(WrapDoubleConversion::WrapDoubleConversion INTERFACE IMPORTED) find_package(double-conversion) if (double-conversion_FOUND) include(FeatureSummary) set_package_properties(double-conversion PROPERTIES TYPE REQUIRED) - target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion) + target_link_libraries(WrapDoubleConversion::WrapDoubleConversion + INTERFACE double-conversion::double-conversion) set(WrapDoubleConversion_FOUND 1) return() endif() +include(CheckCXXSourceCompiles) + check_cxx_source_compiles(" #include #include @@ -36,8 +37,17 @@ int main(int argc, char *argv[]) { return 0; }" HAVE_SPRINTF_L) +# In a static build, we need to find the package to bring the target into scope. +find_package(QtDoubleConversion QUIET) + if (HAVE__SPRINTF_L OR HAVE_SPRINTF_L) - target_compile_definitions(WrapDoubleConversion INTERFACE QT_NO_DOUBLECONVERSION) + target_compile_definitions(WrapDoubleConversion::WrapDoubleConversion + INTERFACE QT_NO_DOUBLECONVERSION) + set(WrapDoubleConversion_FOUND 1) +elseif(TARGET QtDoubleConversion) + # If a Config package wasn't found, and the C++ library doesn't contain the necessary functions, + # use the library bundled with Qt. + target_link_libraries(WrapDoubleConversion::WrapDoubleConversion INTERFACE QtDoubleConversion) set(WrapDoubleConversion_FOUND 1) else() set(WrapDoubleConversion_FOUND 0) diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index 77c4970f499..d3b30fea651 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory(tinycbor) add_subdirectory(harfbuzz) +add_subdirectory(double-conversion) diff --git a/src/3rdparty/double-conversion/CMakeLists.txt b/src/3rdparty/double-conversion/CMakeLists.txt new file mode 100644 index 00000000000..7450bc48ec2 --- /dev/null +++ b/src/3rdparty/double-conversion/CMakeLists.txt @@ -0,0 +1,21 @@ +# special case begin + +add_library(QtDoubleConversion STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/bignum.cc + ${CMAKE_CURRENT_SOURCE_DIR}/bignum-dtoa.cc + ${CMAKE_CURRENT_SOURCE_DIR}/cached-powers.cc + ${CMAKE_CURRENT_SOURCE_DIR}/diy-fp.cc + ${CMAKE_CURRENT_SOURCE_DIR}/double-conversion.cc + ${CMAKE_CURRENT_SOURCE_DIR}/fast-dtoa.cc + ${CMAKE_CURRENT_SOURCE_DIR}/fixed-dtoa.cc + ${CMAKE_CURRENT_SOURCE_DIR}/strtod.cc + ) + +target_include_directories(QtDoubleConversion PUBLIC + $ + $ + $ + ) + +qt_install_3rdparty_library(QtDoubleConversion) +# special case end diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 59ad7dcdd6d..cae1e981116 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -2,7 +2,8 @@ # special case begin qt_find_package(Threads PROVIDED_TARGETS Threads::Threads) -qt_find_package(WrapDoubleConversion REQUIRED PROVIDED_TARGETS WrapDoubleConversion) +qt_find_package(WrapDoubleConversion REQUIRED + PROVIDED_TARGETS WrapDoubleConversion::WrapDoubleConversion) if (NOT WrapDoubleConversion_FOUND) message(FATAL_ERROR "Your C library does not provide \ @@ -231,7 +232,7 @@ add_qt_module(Core QtHarfBuzz # special case Threads::Threads # special case tinycbor # special case - WrapDoubleConversion # special case + WrapDoubleConversion::WrapDoubleConversion # special case PUBLIC_LIBRARIES # special case: Qt::Platform # special case: DISABLE_AUTOGEN_TOOLS # special case: From c7fd10a022d07a3c1271bce771d30de32562a358 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 22 May 2019 10:22:08 +0200 Subject: [PATCH 0538/1322] Allow building the tests directory as a standalone CMake project At the moment, Coin builds tests as a separate qmake invocation against an installed Qt. We need to support the same with CMake. Change the tests subdirectory to be a standalone CMake project when CMake does not detect an existing QtTest target while processing the subdirectory. If the target exists, it means we are building the whole repo, if the target does not exist, we need to call find_package to find the installed Qt. Refactor and move around a few things to make standalone tests build successfully: - add a new macro to set up paths to find QtSetup - add a new macro to find all macOS frameworks - add a new macro to set up building tests - add a new macro that actually builds the tests - export the INSTALL_CMAKE_NAMESPACE value into the BuildInternals Config file - export the CMAKE_BUILD_TYPE value, because a test project doesn't have a .git subdir and thus defaults to be built in Release mode, even though qtbase might have been built in Debug, so to avoid the mixing, the propagate the build type - stop overriding INSTALL_CMAKE_NAMESPACE and QT_CMAKE_EXPORT_NAMESPACE inside QtSetup if they are set, because the tests project doesn't specify a major version, and if we override the values, the moc / uic targets don't get the correct major version prefix and configuration fails Change-Id: Ibdb03687302567fe325a15f6d1cb922c76240675 Fixes: QTBUG-75090 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 35 +++++++++++++++++-- .../QtBuildInternalsConfig.cmake | 35 ++++++++++++++----- cmake/QtPostProcess.cmake | 4 +++ qmake/CMakeLists.txt | 4 +-- src/CMakeLists.txt | 22 +----------- tests/CMakeLists.txt | 17 ++++++++- 6 files changed, 82 insertions(+), 35 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a18a858e0cd..afcd165f0ef 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -36,9 +36,17 @@ set(INSTALL_SYSCONFDIR "etc/xdg" CACHE PATH set(INSTALL_EXAMPLESDIR "examples" CACHE PATH "Examples [PREFIX/examples]") set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]") -set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]") +# The variables might have already been set in QtBuildInternalsExtra.cmake if the file is included +# while building a new module and not QtBase. In that case, stop overriding the value. +if(NOT INSTALL_CMAKE_NAMESPACE) + set(INSTALL_CMAKE_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" + CACHE STRING "CMake namespace [Qt${PROJECT_VERSION_MAJOR}]") +endif() +if(NOT QT_CMAKE_EXPORT_NAMESPACE) + set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" + CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]") +endif() -set(QT_CMAKE_EXPORT_NAMESPACE "Qt${PROJECT_VERSION_MAJOR}" CACHE STRING "CMake namespace used when exporting targets [Qt${PROJECT_VERSION_MAJOR}]") set(QT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}") # the default RPATH to be used when installing, but only if it's not a system directory @@ -1837,3 +1845,26 @@ function(qt_install_3rdparty_library target) qt_install_3rdparty_config_files(${target} EXPORT ${target} ${ARGN}) endfunction() +macro(qt_find_apple_system_frameworks) + if(APPLE) + find_library(FWAppKit AppKit) + find_library(FWApplicationServices ApplicationServices) + find_library(FWCarbon Carbon) + find_library(FWCoreFoundation CoreFoundation) + find_library(FWCoreServices CoreServices) + find_library(FWCoreVideo CoreVideo) + find_library(FWcups cups) + find_library(FWDiskArbitration DiskArbitration) + find_library(FWFoundation Foundation) + find_library(FWIOKit IOKit) + find_library(FWIOSurface IOSurface) + find_library(FWImageIO ImageIO) + find_library(FWMetal Metal) + find_library(FWMobileCoreServices MobileCoreServices) + find_library(FWQuartzCore QuartzCore) + find_library(FWSecurity Security) + find_library(FWSystemConfiguration SystemConfiguration) + find_library(FWUIKit UIKit) + find_library(FWWatchKit WatchKit) + endif() +endmacro() diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 767a9dc45fe..6f0708bd804 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -12,18 +12,22 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake") include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake) endif() +macro(qt_set_up_build_internals_paths) + # Set up the paths for the modules. + set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}") + list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH}) + + # If the repo has its own cmake modules, include those in the module path. + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + endif() +endmacro() + macro(qt_build_repo_begin) if(${ARGC} EQUAL 1 AND "${ARGV0}" STREQUAL "SKIP_CMAKE_MODULE_PATH_ADDITION") # No-op. else() - # Set up the paths for the modules. - set(QT_CMAKE_MODULE_PATH "${QT_BUILD_INTERNALS_PATH}/../${QT_CMAKE_EXPORT_NAMESPACE}") - list(APPEND CMAKE_MODULE_PATH ${QT_CMAKE_MODULE_PATH}) - - # If the repo has its own cmake modules, include those in the module path. - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake") - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") - endif() + qt_set_up_build_internals_paths() endif() # Qt specific setup common for all modules: @@ -73,3 +77,18 @@ macro(qt_build_repo) qt_build_repo_end() endmacro() + +macro(qt_set_up_standalone_tests_build) + qt_set_up_build_internals_paths() + include(QtSetup) + qt_find_apple_system_frameworks() +endmacro() + +macro(qt_build_tests) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/auto/CMakeLists.txt") + add_subdirectory(auto) + endif() + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/CMakeLists.txt") + add_subdirectory(benchmarks) + endif() +endmacro() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index b1fb07c3943..b43af42eec7 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -174,6 +174,10 @@ option(BUILD_SHARED_LIBS \"Build Qt statically or dynamically\" ${BUILD_SHARED_L string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +set(INSTALL_CMAKE_NAMESPACE ${INSTALL_CMAKE_NAMESPACE})") + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " +set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})") + string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " set(QT_BUILD_INTERNALS_PATH \"\${CMAKE_CURRENT_LIST_DIR}\")") # Propagate the original install prefix, so that a developer building a child module can diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index a1e7625650b..04b89c3f959 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -8,9 +8,7 @@ qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${mkspecs_install_dir}) # special case end -find_library(FWApplicationServices ApplicationServices) # special case -find_library(FWCoreServices CoreServices) # special case -find_library(FWFoundation Foundation) # special case +qt_find_apple_system_frameworks() # special case ##################################################################### ## qmake Binary: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dbd6f159231..1bc66bee9d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,24 +1,4 @@ -if(APPLE) - find_library(FWAppKit AppKit) - find_library(FWApplicationServices ApplicationServices) - find_library(FWCarbon Carbon) - find_library(FWCoreFoundation CoreFoundation) - find_library(FWCoreServices CoreServices) - find_library(FWCoreVideo CoreVideo) - find_library(FWcups cups) - find_library(FWDiskArbitration DiskArbitration) - find_library(FWFoundation Foundation) - find_library(FWIOKit IOKit) - find_library(FWIOSurface IOSurface) - find_library(FWImageIO ImageIO) - find_library(FWMetal Metal) - find_library(FWMobileCoreServices MobileCoreServices) - find_library(FWQuartzCore QuartzCore) - find_library(FWSecurity Security) - find_library(FWSystemConfiguration SystemConfiguration) - find_library(FWUIKit UIKit) - find_library(FWWatchKit WatchKit) -endif() +qt_find_apple_system_frameworks() add_subdirectory(3rdparty) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0653827192a..109a165d74f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1 +1,16 @@ -add_subdirectory(auto) +# special case begin +if(NOT TARGET Qt::Test) + cmake_minimum_required(VERSION 3.14.0) + project(QtBaseTests C CXX ASM) + find_package(Qt5 REQUIRED COMPONENTS BuildInternals Core Test) + find_package(Qt5 COMPONENTS DBus Gui OpenGL Widgets Xml) + qt_set_up_standalone_tests_build() + + # Find a few packages that are usually found in configure.cmake, + # because a few tests link directly against those libraries. + qt_find_package(WrapDBus1 PROVIDED_TARGETS dbus-1) + qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) +endif() +# special case end + +qt_build_tests() From b611936ca85b57f4b405e920e2efa31f02f1ac70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 16 May 2019 15:07:43 +0200 Subject: [PATCH 0539/1322] Cleanup module_config.yaml The number of CPUs is set implicitly by MAKEFLAGS and NIJAFLAGS. Change-Id: Ie9296f9a7872253c696536d7b3d6235c7881d42b Reviewed-by: Liang Qi --- coin/module_config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 2e7b3061665..fd849399b30 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -17,7 +17,7 @@ build_instructions: userMessageOnFailure: > Failed to call cmake. Contact Liang then. - type: ExecuteCommand - command: make DESTDIR={{.InstallRoot}} -j {{.NumCPU}} install + command: make DESTDIR={{.InstallRoot}} install maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > @@ -27,7 +27,7 @@ build_instructions: property: host.os equals_value: Windows - type: ExecuteCommand - command: jom DESTDIR={{.InstallRoot}} -j {{.NumCPU}} install + command: jom DESTDIR={{.InstallRoot}} install maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > From d932ac44df2c0691bcf1005366a52014fb08f45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 16 May 2019 15:09:55 +0200 Subject: [PATCH 0540/1322] Adjust timeouts in module_config.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signing package may take more then 10s while calling echo really should take less then 60s ;-) Change-Id: I1798981492d1467bb8b20099ea705b08ea9b0914 Reviewed-by: Liang Qi Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index fd849399b30..9463bc7253e 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -42,6 +42,8 @@ build_instructions: property: host.os not_equals_value: Windows directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 - type: UploadArtifact archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" transferType: UploadModuleBuildArtifact @@ -50,7 +52,7 @@ build_instructions: test_instructions: - type: ExecuteCommand command: echo "hello world - test" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 + maxTimeInSeconds: 60 + maxTimeBetweenOutput: 12 userMessageOnFailure: > Failed to call echo. Contact Liang then. From 8aab0cfabaccb9860e88ea00d25df60c900608f5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 22 May 2019 13:59:26 +0200 Subject: [PATCH 0541/1322] Reset main_module_tool_deps in QtPostProcess The variable was not reset when interating through all the Qt targets, which resulted in QtTest wronlgy depending on QtWidgetTools. Task-number: QTBUG-75875 Change-Id: I24da495fa53e9163992a1ed53f5cd7e1c6da5e51 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger --- cmake/QtPostProcess.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index b43af42eec7..32612842187 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -25,6 +25,7 @@ function(qt_internal_create_depends_files) set(third_party_deps_seen "") set(tool_deps "") set(tool_deps_seen "") + set(main_module_tool_deps "") foreach (dep ${depends}) # Normalize module by stripping leading "Qt::" and trailing "Private" From 87bb219a7218b4f6c66bf3d2b237c21cd24b7036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Wed, 22 May 2019 16:30:47 +0200 Subject: [PATCH 0542/1322] Move some configure arguments from qt5 configuration file These arguments are specific to the build and changes to them are _not_ affecting configuration. Change-Id: I8c46a0dbea8978f13e78c5cb8f41987f4fde09c8 Reviewed-by: Qt CMake Build Bot Reviewed-by: Liang Qi --- coin/module_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 9463bc7253e..5290784a197 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -11,7 +11,7 @@ build_instructions: - type: ChangeDirectory directory: "{{.BuildDir}}" - type: ExecuteCommand - command: cmake {{.Env.CONFIGURE_ARGS}} + command: cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} {{.SourceDir}} maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > From 0425ee06102410026f436adfd440aa2f0b3efd61 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 22 May 2019 15:09:39 +0200 Subject: [PATCH 0543/1322] Change the default enabled AUTOGEN tools list to contain only moc Before this patch we enabled AUTOMOC, AUTORCC, AUTOUIC for all targets that did not opt out. Aside from being wasteful from a performance point of view, this also caused issues when trying to build qtimageformats which does not depend on Widgets which is the package that exposes uic. To avoid this, enable only AUTOMOC for all targets by default, and UIC and RCC can be opted in via the ENABLE_AUTOGEN_TOOLS option. To facilitate this some refactoring had to be done, like moving some common setup for all autogen tools into a separate call, and making sure that extend_target understands the autogen options, because some ui files are only added conditionally. Also the conversion script has been adapted to output the ENABLE_AUTOGEN_TOOLS option whenever a .pro file contains at least one FORMS += foo assignment. Note that we don't really use AUTORCC while building Qt, so nothing opts into that at the moment. Task-number: QTBUG-75875 Change-Id: I889c4980e9fb1b74ba361abed4044737f8842ea4 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 98 ++++++++++++++++++++++++++--------------- util/cmake/pro2cmake.py | 8 ++++ 2 files changed, 71 insertions(+), 35 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index afcd165f0ef..ff2298f36be 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -538,44 +538,67 @@ function(qt_internal_module_info result target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS;DISABLE_AUTOGEN_TOOLS") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS;DISABLE_AUTOGEN_TOOLS;ENABLE_AUTOGEN_TOOLS") set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES;PUBLIC_COMPILE_OPTIONS;PUBLIC_LINK_OPTIONS") option(QT_CMAKE_DEBUG_EXTEND_TARGET "Debug extend_target calls in Qt's build system" OFF) -# This function checks which autotools should be used: AUTOMOC/UIC/RCC -function(qt_autogen_tools target) - qt_parse_all_arguments(arg "qt_autogen_tools" "" "" "${__default_private_args}" ${ARGN}) +# Initial autogen setup for a target to specify certain CMake properties which are common +# to all autogen tools. Also enable AUTOMOC by default. +function(qt_autogen_tools_initial_setup target) + set_property(TARGET "${target}" PROPERTY INTERFACE_QT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) + set_property(TARGET "${target}" APPEND PROPERTY COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION) - set_property(TARGET "${target}" PROPERTY INTERFACE_QT_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) - set_property(TARGET "${target}" APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION - ) + set_directory_properties(PROPERTIES + QT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} + QT_VERSION_MINOR ${PROJECT_VERSION_MINOR}) - list(APPEND autogen_tools "moc" "uic" "rcc") - if (arg_DISABLE_AUTOGEN_TOOLS) - foreach(disable_tool ${arg_DISABLE_AUTOGEN_TOOLS}) - list(REMOVE_ITEM autogen_tools "${disable_tool}") - endforeach() - endif() + qt_enable_autogen_tool(${target} "moc" ON) +endfunction() - foreach(autogen_tool ${autogen_tools}) - string(TOUPPER "${autogen_tool}" captitalAutogenTool) +# Enables or disables an autogen tool like moc, uic or rcc on ${target}. +function(qt_enable_autogen_tool target tool enable) + string(TOUPPER "${tool}" captitalAutogenTool) + + get_target_property(tool_enabled ${target} AUTO${captitalAutogenTool}) + get_target_property(autogen_target_depends ${target} AUTOGEN_TARGET_DEPENDS) + + if(NOT autogen_target_depends) + set(autogen_target_depends "") + endif() + set(tool_executable "$") + set(tool_target_name ${QT_CMAKE_EXPORT_NAMESPACE}::${tool}) + + if(enable) + list(APPEND autogen_target_depends ${tool_target_name}) + else() + list(REMOVE_ITEM autogen_target_depends ${tool_target_name}) + endif() set_target_properties("${target}" PROPERTIES - AUTO${captitalAutogenTool} ON - AUTO${captitalAutogenTool}_EXECUTABLE - "$") - set_property(TARGET ${target} APPEND PROPERTY - AUTOGEN_TARGET_DEPENDS - ${QT_CMAKE_EXPORT_NAMESPACE}::${autogen_tool}) - endforeach() + AUTO${captitalAutogenTool} "${enable}" + AUTO${captitalAutogenTool}_EXECUTABLE "${tool_executable}" + AUTOGEN_TARGET_DEPENDS "${autogen_target_depends}" + ) +endfunction() - set_directory_properties(PROPERTIES - QT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR} - QT_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +# This function adds or removes additional AUTOGEN tools to a target: AUTOMOC/UIC/RCC +function(qt_autogen_tools target) + qt_parse_all_arguments(arg "qt_autogen_tools" "" "" "${__default_private_args}" ${ARGN}) + + if (arg_ENABLE_AUTOGEN_TOOLS) + foreach(tool ${arg_ENABLE_AUTOGEN_TOOLS}) + qt_enable_autogen_tool(${target} ${tool} ON) + endforeach() + endif() + + if (arg_DISABLE_AUTOGEN_TOOLS) + foreach(tool ${arg_DISABLE_AUTOGEN_TOOLS}) + qt_enable_autogen_tool(${target} ${tool} OFF) + endforeach() + endif() endfunction() # This function can be used to add sources/libraries/etc. to the specified CMake target @@ -643,6 +666,10 @@ function(extend_target target) AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}" _qt_target_deps "${target_deps}" ) + qt_autogen_tools(${target} + ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS}) + else() if(QT_CMAKE_DEBUG_EXTEND_TARGET) message("extend_target(${target} CONDITION ${arg_CONDITION} ...): Skipped") @@ -837,9 +864,7 @@ function(add_qt_module target) qt_internal_library_deprecation_level(deprecation_define) - qt_autogen_tools("${target}" - DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} - ) + qt_autogen_tools_initial_setup(${target}) extend_target("${target}" SOURCES ${arg_SOURCES} @@ -878,6 +903,8 @@ function(add_qt_module target) LINK_OPTIONS ${arg_LINK_OPTIONS} PUBLIC_LINK_OPTIONS ${arg_PUBLIC_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} + ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") @@ -1143,9 +1170,7 @@ function(add_qt_plugin target) qt_internal_library_deprecation_level(deprecation_define) - qt_autogen_tools("${target}" - DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} - ) + qt_autogen_tools_initial_setup(${target}) set(static_plugin_define "") if (arg_STATIC OR NOT QT_BUILD_SHARED_LIBS) @@ -1187,6 +1212,8 @@ function(add_qt_plugin target) LINK_OPTIONS ${arg_LINK_OPTIONS} PUBLIC_LINK_OPTIONS ${arg_PUBLIC_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} + ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) set(export_name "${target}Targets") @@ -1225,9 +1252,7 @@ function(add_qt_executable name) add_executable("${name}" ${arg_EXE_FLAGS}) - qt_autogen_tools("${name}" - DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} - ) + qt_autogen_tools_initial_setup(${name}) set(extra_libraries "") if(NOT arg_BOOTSTRAP AND NOT arg_NO_QT) @@ -1250,6 +1275,8 @@ function(add_qt_executable name) COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} + ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} + DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) set_target_properties("${name}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" @@ -1291,6 +1318,7 @@ function(add_qt_test name) COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} + ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0036c658d68..3f9b4ccb530 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1080,6 +1080,12 @@ def write_library_section(cm_fh: typing.IO[str], scope: Scope, *, write_list(cm_fh, public_dependencies, 'PUBLIC_LIBRARIES', indent + 1) +def write_autogen_section(cm_fh: typing.IO[str], scope: Scope, *, + indent: int = 0): + forms = scope.get_files('FORMS') + if forms: + write_list(cm_fh, ['uic'], 'ENABLE_AUTOGEN_TOOLS', indent) + def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, indent: int = 0, known_libraries=set()): @@ -1115,6 +1121,8 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, write_compile_options(cm_fh, scope, 'COMPILE_OPTIONS', indent=indent + 1) + write_autogen_section(cm_fh, scope, indent=indent + 1) + link_options = scope.get('QMAKE_LFLAGS') if link_options: cm_fh.write('{} LINK_OPTIONS\n'.format(ind)) From fa21d29b7506e21db8a433e117aebb9f3c724f03 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 22 May 2019 16:23:24 +0200 Subject: [PATCH 0544/1322] Rerun pro2cmake on projects that use .ui files Task-number: QTBUG-75875 Change-Id: I95109b07fc4a6e09fe7911a21fc5f27f2c895d77 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- .../corelib/ipc/sharedmemory/CMakeLists.txt | 6 ++- examples/dbus/chat/CMakeLists.txt | 4 +- .../controller/CMakeLists.txt | 4 +- examples/embedded/flightinfo/CMakeLists.txt | 6 ++- examples/embedded/styleexample/CMakeLists.txt | 4 +- examples/network/bearermonitor/CMakeLists.txt | 8 +-- examples/network/http/CMakeLists.txt | 4 +- examples/network/network-chat/CMakeLists.txt | 4 +- examples/sql/books/CMakeLists.txt | 9 ++-- examples/sql/sqlbrowser/CMakeLists.txt | 8 +-- .../widgets/animation/easing/CMakeLists.txt | 4 +- .../embeddeddialogs/CMakeLists.txt | 6 ++- .../graphicsview/padnavigator/CMakeLists.txt | 8 +-- .../editabletreemodel/CMakeLists.txt | 4 +- .../painting/fontsampler/CMakeLists.txt | 6 ++- examples/widgets/tools/undo/CMakeLists.txt | 6 ++- examples/widgets/touch/dials/CMakeLists.txt | 4 +- .../tutorials/notepad/.prev_CMakeLists.txt | 49 +++++++++++++++++++ .../widgets/tutorials/notepad/CMakeLists.txt | 8 +-- .../widgets/widgets/stylesheet/CMakeLists.txt | 4 +- .../widgets/widgets/validators/CMakeLists.txt | 2 + src/corelib/CMakeLists.txt | 2 - src/printsupport/CMakeLists.txt | 6 +++ src/tools/uic/CMakeLists.txt | 2 - src/widgets/.prev_CMakeLists.txt | 2 + src/widgets/CMakeLists.txt | 2 + .../widgets/kernel/qgridlayout/CMakeLists.txt | 18 ++++++- 27 files changed, 149 insertions(+), 41 deletions(-) create mode 100644 examples/widgets/tutorials/notepad/.prev_CMakeLists.txt diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt index 125cfbd2432..a9874333021 100644 --- a/examples/corelib/ipc/sharedmemory/CMakeLists.txt +++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt @@ -11,9 +11,11 @@ add_qt_executable(sharedmemory SOURCES dialog.cpp dialog.h dialog.ui main.cpp - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) -#### Keys ignored in scope 1:.:sharedmemory.pro:: +#### Keys ignored in scope 1:.:.:sharedmemory.pro:: # EXAMPLE_FILES = "*.png" diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt index 68abe95da67..9f321bbce38 100644 --- a/examples/dbus/chat/CMakeLists.txt +++ b/examples/dbus/chat/CMakeLists.txt @@ -16,7 +16,9 @@ add_qt_executable(chat org.example.chat.xml DBUS_INTERFACE_SOURCES org.example.chat.xml - LIBRARIES + PUBLIC_LIBRARIES Qt::DBus Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt index c9902e2519f..3f360fa51b1 100644 --- a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt @@ -13,7 +13,9 @@ add_qt_executable(controller main.cpp DBUS_INTERFACE_SOURCES car.xml - LIBRARIES + PUBLIC_LIBRARIES Qt::DBus Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) diff --git a/examples/embedded/flightinfo/CMakeLists.txt b/examples/embedded/flightinfo/CMakeLists.txt index b7d8441b961..a4276bf2d86 100644 --- a/examples/embedded/flightinfo/CMakeLists.txt +++ b/examples/embedded/flightinfo/CMakeLists.txt @@ -11,9 +11,11 @@ add_qt_executable(flightinfo SOURCES flightinfo.cpp form.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Network Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: @@ -21,5 +23,5 @@ add_qt_resource(flightinfo "flightinfo" PREFIX "/" FILES aircraft.png) -#### Keys ignored in scope 1:.:flightinfo.pro:: +#### Keys ignored in scope 1:.:.:flightinfo.pro:: # TEMPLATE = "app" diff --git a/examples/embedded/styleexample/CMakeLists.txt b/examples/embedded/styleexample/CMakeLists.txt index 9c82adc99de..d14acc8b5ae 100644 --- a/examples/embedded/styleexample/CMakeLists.txt +++ b/examples/embedded/styleexample/CMakeLists.txt @@ -11,8 +11,10 @@ add_qt_executable(styleexample SOURCES main.cpp stylewidget.cpp stylewidget.h stylewidget.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: diff --git a/examples/network/bearermonitor/CMakeLists.txt b/examples/network/bearermonitor/CMakeLists.txt index 001e5c7e2ed..83c45fb21a9 100644 --- a/examples/network/bearermonitor/CMakeLists.txt +++ b/examples/network/bearermonitor/CMakeLists.txt @@ -13,19 +13,21 @@ add_qt_executable(bearermonitor bearermonitor_640_480.ui main.cpp sessionwidget.cpp sessionwidget.h sessionwidget.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Gui Qt::Network Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) -#### Keys ignored in scope 1:.:bearermonitor.pro:: +#### Keys ignored in scope 1:.:.:bearermonitor.pro:: # CONFIG = "console" ## Scopes: ##################################################################### extend_target(bearermonitor CONDITION WIN32 - LIBRARIES + PUBLIC_LIBRARIES ws2_32 ) diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt index d1c61f1c98c..30f6b900e20 100644 --- a/examples/network/http/CMakeLists.txt +++ b/examples/network/http/CMakeLists.txt @@ -12,7 +12,9 @@ add_qt_executable(http authenticationdialog.ui httpwindow.cpp httpwindow.h main.cpp - LIBRARIES + PUBLIC_LIBRARIES Qt::Network Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt index 56cd632529c..d620d899d13 100644 --- a/examples/network/network-chat/CMakeLists.txt +++ b/examples/network/network-chat/CMakeLists.txt @@ -15,7 +15,9 @@ add_qt_executable(network-chat main.cpp peermanager.cpp peermanager.h server.cpp server.h - LIBRARIES + PUBLIC_LIBRARIES Qt::Network Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt index e01adc14025..7a25b95cde5 100644 --- a/examples/sql/books/CMakeLists.txt +++ b/examples/sql/books/CMakeLists.txt @@ -14,11 +14,12 @@ add_qt_executable(books initdb.h main.cpp INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_SOURCE_DIR} - LIBRARIES + . + PUBLIC_LIBRARIES Qt::Sql Qt::Widgets - Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: @@ -26,5 +27,5 @@ add_qt_resource(books "books" PREFIX "/" FILES images/star.png) -#### Keys ignored in scope 1:.:books.pro:: +#### Keys ignored in scope 1:.:.:books.pro:: # TEMPLATE = "app" diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt index 03111e90490..a2e0ed951d9 100644 --- a/examples/sql/sqlbrowser/CMakeLists.txt +++ b/examples/sql/sqlbrowser/CMakeLists.txt @@ -14,16 +14,18 @@ add_qt_executable(sqlbrowser connectionwidget.cpp connectionwidget.h main.cpp qsqlconnectiondialog.cpp qsqlconnectiondialog.h qsqlconnectiondialog.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Sql Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) -#### Keys ignored in scope 1:.:sqlbrowser.pro:: +#### Keys ignored in scope 1:.:.:sqlbrowser.pro:: # TEMPLATE = "app" ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:sqlbrowser.pro:build_all AND NOT build_pass: +#### Keys ignored in scope 2:.:.:sqlbrowser.pro:build_all AND NOT build_pass: # CONFIG = "-build_all" "release" diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt index ba391d082b4..b7444412a68 100644 --- a/examples/widgets/animation/easing/CMakeLists.txt +++ b/examples/widgets/animation/easing/CMakeLists.txt @@ -13,8 +13,10 @@ add_qt_executable(easing form.ui main.cpp window.cpp window.h - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt index d31e15102e4..dda61e0f684 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt +++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt @@ -12,8 +12,10 @@ add_qt_executable(embeddeddialogs customproxy.cpp customproxy.h embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui main.cpp - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: @@ -24,5 +26,5 @@ add_qt_resource(embeddeddialogs "embeddeddialogs" FILES ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:embeddeddialogs.pro:build_all AND NOT build_pass: +#### Keys ignored in scope 2:.:.:embeddeddialogs.pro:build_all AND NOT build_pass: # CONFIG = "-build_all" "release" diff --git a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt index ad879d3a8b2..9c4282391e6 100644 --- a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt +++ b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt @@ -14,8 +14,10 @@ add_qt_executable(padnavigator padnavigator.cpp padnavigator.h roundrectitem.cpp roundrectitem.h splashitem.cpp splashitem.h - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: @@ -31,13 +33,13 @@ add_qt_resource(padnavigator "padnavigator" FILES images/minitools.png) -#### Keys ignored in scope 1:.:padnavigator.pro:: +#### Keys ignored in scope 1:.:.:padnavigator.pro:: # CONFIG = "console" ## Scopes: ##################################################################### extend_target(padnavigator CONDITION TARGET Qt::OpenGL - LIBRARIES + PUBLIC_LIBRARIES Qt::OpenGL ) diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt index 699dfb17330..9cb49e0a25e 100644 --- a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt +++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt @@ -13,8 +13,10 @@ add_qt_executable(editabletreemodel mainwindow.cpp mainwindow.h mainwindow.ui treeitem.cpp treeitem.h treemodel.cpp treemodel.h - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt index a32b10589f7..38bb59eb6cb 100644 --- a/examples/widgets/painting/fontsampler/CMakeLists.txt +++ b/examples/widgets/painting/fontsampler/CMakeLists.txt @@ -12,14 +12,16 @@ add_qt_executable(fontsampler main.cpp mainwindow.cpp mainwindow.h mainwindowbase.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) ## Scopes: ##################################################################### extend_target(fontsampler CONDITION TARGET Qt::PrintSupport - LIBRARIES + PUBLIC_LIBRARIES Qt::PrintSupport ) diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt index 751026bd626..f3f1a5a4366 100644 --- a/examples/widgets/tools/undo/CMakeLists.txt +++ b/examples/widgets/tools/undo/CMakeLists.txt @@ -13,8 +13,10 @@ add_qt_executable(undo document.cpp document.h main.cpp mainwindow.cpp mainwindow.h mainwindow.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: @@ -40,5 +42,5 @@ add_qt_resource(undo "undo" PREFIX "/" FILES ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:undo.pro:build_all AND NOT build_pass: +#### Keys ignored in scope 2:.:.:undo.pro:build_all AND NOT build_pass: # CONFIG = "-build_all" "release" diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt index 0266bc4e3b8..76920b0f3ca 100644 --- a/examples/widgets/touch/dials/CMakeLists.txt +++ b/examples/widgets/touch/dials/CMakeLists.txt @@ -11,6 +11,8 @@ add_qt_executable(dials SOURCES dials.ui main.cpp - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) diff --git a/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt b/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt new file mode 100644 index 00000000000..6634c8c1488 --- /dev/null +++ b/examples/widgets/tutorials/notepad/.prev_CMakeLists.txt @@ -0,0 +1,49 @@ +# Generated from notepad.pro. + +##################################################################### +## notepad Binary: +##################################################################### + +add_qt_executable(notepad + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad" + SOURCES + main.cpp + notepad.cpp notepad.h notepad.ui + ENABLE_AUTOGEN_TOOLS + uic +) + +# Resources: +add_qt_resource(notepad "notepad" PREFIX "/" FILES + images/bold.png + images/copy.png + images/create.png + images/cut.png + images/edit_redo.png + images/edit_undo.png + images/exit.png + images/font.png + images/info.png + images/italic.png + images/new.png + images/open.png + images/paste.png + images/pencil.png + images/print.png + images/save.png + images/save_as.png + images/underline.png) + + +#### Keys ignored in scope 1:.:.:notepad.pro:: +# TEMPLATE = "app" + +## Scopes: +##################################################################### + +extend_target(notepad CONDITION TARGET Qt::PrintSupport + PUBLIC_LIBRARIES + Qt::PrintSupport +) diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt index 9dcf98fe4cf..d34d3ca846e 100644 --- a/examples/widgets/tutorials/notepad/CMakeLists.txt +++ b/examples/widgets/tutorials/notepad/CMakeLists.txt @@ -11,8 +11,10 @@ add_qt_executable(notepad SOURCES main.cpp notepad.cpp notepad.h notepad.ui + ENABLE_AUTOGEN_TOOLS + uic LIBRARIES # special case - Qt::Widgets + Qt::Widgets # special case ) # Resources: @@ -37,13 +39,13 @@ add_qt_resource(notepad "notepad" PREFIX "/" FILES images/underline.png) -#### Keys ignored in scope 1:.:notepad.pro:: +#### Keys ignored in scope 1:.:.:notepad.pro:: # TEMPLATE = "app" ## Scopes: ##################################################################### extend_target(notepad CONDITION TARGET Qt::PrintSupport - LIBRARIES + PUBLIC_LIBRARIES Qt::PrintSupport ) diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt index dfb52a1a47e..227eb13b68c 100644 --- a/examples/widgets/widgets/stylesheet/CMakeLists.txt +++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt @@ -12,8 +12,10 @@ add_qt_executable(stylesheet main.cpp mainwindow.cpp mainwindow.h mainwindow.ui stylesheeteditor.cpp stylesheeteditor.h stylesheeteditor.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt index 9da1da775ed..ef981d9eb70 100644 --- a/examples/widgets/widgets/validators/CMakeLists.txt +++ b/examples/widgets/widgets/validators/CMakeLists.txt @@ -16,6 +16,8 @@ add_qt_executable(validators validatorwidget.cpp validatorwidget.h PUBLIC_LIBRARIES Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index cae1e981116..bd1aad0406e 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -235,8 +235,6 @@ add_qt_module(Core WrapDoubleConversion::WrapDoubleConversion # special case PUBLIC_LIBRARIES # special case: Qt::Platform # special case: - DISABLE_AUTOGEN_TOOLS # special case: - uic # special case: DISABLE_TOOLS_EXPORT # special case: ) diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index a689aa8d708..bdb93042d51 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -68,6 +68,8 @@ extend_target(PrintSupport CONDITION QT_FEATURE_cups AND UNIX AND NOT APPLE extend_target(PrintSupport CONDITION QT_FEATURE_cupsjobwidget AND UNIX AND NOT APPLE SOURCES widgets/qcupsjobwidget.cpp widgets/qcupsjobwidget.ui widgets/qcupsjobwidget_p.h + ENABLE_AUTOGEN_TOOLS + uic ) extend_target(PrintSupport CONDITION QT_FEATURE_printdialog @@ -76,6 +78,8 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printdialog dialogs/qpagesetupdialog.cpp dialogs/qpagesetupdialog.h dialogs/qpagesetupdialog_p.h dialogs/qpagesetupwidget.ui dialogs/qprintdialog.h + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: @@ -138,6 +142,8 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND UNIX AND NOT APP dialogs/qprintwidget.ui INCLUDE_DIRECTORIES ${PROJECT_SOURCE_DIR}/src/plugins/printsupport/cups + ENABLE_AUTOGEN_TOOLS + uic ) extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewdialog diff --git a/src/tools/uic/CMakeLists.txt b/src/tools/uic/CMakeLists.txt index e110049c1ca..9e030528634 100644 --- a/src/tools/uic/CMakeLists.txt +++ b/src/tools/uic/CMakeLists.txt @@ -34,8 +34,6 @@ add_qt_tool(uic cpp # ${CMAKE_CURRENT_BINARY_DIR} # special case: remove python - DISABLE_AUTOGEN_TOOLS # special case: - uic rcc ) #### Keys ignored in scope 1:.:.:uic.pro:: diff --git a/src/widgets/.prev_CMakeLists.txt b/src/widgets/.prev_CMakeLists.txt index 76b90226506..bd1f19fb0e2 100644 --- a/src/widgets/.prev_CMakeLists.txt +++ b/src/widgets/.prev_CMakeLists.txt @@ -586,6 +586,8 @@ extend_target(Widgets CONDITION QT_FEATURE_filedialog SOURCES dialogs/qfiledialog.cpp dialogs/qfiledialog.h dialogs/qfiledialog.ui dialogs/qfiledialog_p.h dialogs/qsidebar.cpp dialogs/qsidebar_p.h + ENABLE_AUTOGEN_TOOLS + uic ) extend_target(Widgets CONDITION QT_FEATURE_filesystemmodel diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 83400dc82a0..d946bc8e1d2 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -590,6 +590,8 @@ extend_target(Widgets CONDITION QT_FEATURE_filedialog SOURCES dialogs/qfiledialog.cpp dialogs/qfiledialog.h dialogs/qfiledialog.ui dialogs/qfiledialog_p.h dialogs/qsidebar.cpp dialogs/qsidebar_p.h + ENABLE_AUTOGEN_TOOLS + uic ) extend_target(Widgets CONDITION QT_FEATURE_filesystemmodel diff --git a/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt b/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt index 6cfd4ab4278..c879f7306e9 100644 --- a/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt +++ b/tests/auto/widgets/kernel/qgridlayout/CMakeLists.txt @@ -1,10 +1,24 @@ -add_qt_test("tst_qgridlayout" +# Generated from qgridlayout.pro. + +##################################################################### +## tst_qgridlayout Test: +##################################################################### + +add_qt_test(tst_qgridlayout SOURCES sortdialog.ui tst_qgridlayout.cpp LIBRARIES - Qt::WidgetsPrivate Qt::CorePrivate Qt::GuiPrivate Qt::TestPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::Gui + Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) + +#### Keys ignored in scope 1:.:.:qgridlayout.pro:: +# CONFIG = "testcase" From 837f592c5e98d8d06854421cadb6a4fd2c0a7a3d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 23 May 2019 10:44:52 +0200 Subject: [PATCH 0545/1322] Regenerate more projects that are using uic Amends fa21d29b7506e21db8a433e117aebb9f3c724f03 Change-Id: I54d9cca77122d61016e06c4057949747b19472bb Reviewed-by: Simon Hausmann --- .../network/securesocketclient/CMakeLists.txt | 4 +- .../network/secureudpclient/CMakeLists.txt | 8 ++-- .../network/secureudpserver/CMakeLists.txt | 8 ++-- examples/network/torrent/.prev_CMakeLists.txt | 42 +++++++++++++++++++ examples/network/torrent/CMakeLists.txt | 6 ++- 5 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 examples/network/torrent/.prev_CMakeLists.txt diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt index e6fdd6b2ca4..fd9a12e4bb4 100644 --- a/examples/network/securesocketclient/CMakeLists.txt +++ b/examples/network/securesocketclient/CMakeLists.txt @@ -13,9 +13,11 @@ add_qt_executable(securesocketclient main.cpp sslclient.cpp sslclient.h sslclient.ui sslerrors.ui - LIBRARIES + PUBLIC_LIBRARIES Qt::Network Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt index 02dfd77fe07..5516b36cc3c 100644 --- a/examples/network/secureudpclient/CMakeLists.txt +++ b/examples/network/secureudpclient/CMakeLists.txt @@ -13,10 +13,12 @@ add_qt_executable(secureudpclient association.cpp association.h main.cpp mainwindow.cpp mainwindow.h mainwindow.ui - LIBRARIES - Qt::Widgets + PUBLIC_LIBRARIES Qt::Network + Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) -#### Keys ignored in scope 1:.:secureudpclient.pro:: +#### Keys ignored in scope 1:.:.:secureudpclient.pro:: # TEMPLATE = "app" diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt index c7d97420ae5..6d4968c9f7f 100644 --- a/examples/network/secureudpserver/CMakeLists.txt +++ b/examples/network/secureudpserver/CMakeLists.txt @@ -13,10 +13,12 @@ add_qt_executable(secureudpserver mainwindow.cpp mainwindow.h mainwindow.ui nicselector.cpp nicselector.h nicselector.ui server.cpp server.h - LIBRARIES - Qt::Widgets + PUBLIC_LIBRARIES Qt::Network + Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) -#### Keys ignored in scope 1:.:secureudpserver.pro:: +#### Keys ignored in scope 1:.:.:secureudpserver.pro:: # TEMPLATE = "app" diff --git a/examples/network/torrent/.prev_CMakeLists.txt b/examples/network/torrent/.prev_CMakeLists.txt new file mode 100644 index 00000000000..5d23f5e74b0 --- /dev/null +++ b/examples/network/torrent/.prev_CMakeLists.txt @@ -0,0 +1,42 @@ +# Generated from torrent.pro. + +##################################################################### +## torrent Binary: +##################################################################### + +add_qt_executable(torrent + GUI + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" + SOURCES + addtorrentdialog.cpp addtorrentdialog.h + bencodeparser.cpp bencodeparser.h + connectionmanager.cpp connectionmanager.h + filemanager.cpp filemanager.h + forms/addtorrentform.ui + main.cpp + mainwindow.cpp mainwindow.h + metainfo.cpp metainfo.h + peerwireclient.cpp peerwireclient.h + ratecontroller.cpp ratecontroller.h + torrentclient.cpp torrentclient.h + torrentserver.cpp torrentserver.h + trackerclient.cpp trackerclient.h + PUBLIC_LIBRARIES + Qt::Network + Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic +) + +# Resources: +add_qt_resource(torrent "icons" PREFIX "/" FILES + icons/1downarrow.png + icons/1uparrow.png + icons/bottom.png + icons/exit.png + icons/peertopeer.png + icons/player_pause.png + icons/player_play.png + icons/player_stop.png) + diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt index f8cbc071ff8..448335e7aa2 100644 --- a/examples/network/torrent/CMakeLists.txt +++ b/examples/network/torrent/CMakeLists.txt @@ -22,11 +22,13 @@ add_qt_executable(torrent torrentclient.cpp torrentclient.h torrentserver.cpp torrentserver.h trackerclient.cpp trackerclient.h - INCLUDE_DIRECTORIES + INCLUDE_DIRECTORIES # special case forms # special case - LIBRARIES + PUBLIC_LIBRARIES Qt::Network Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic ) # Resources: From 80271e82807b4ac51d158398d08554925b9fcdd5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 23 May 2019 10:59:05 +0200 Subject: [PATCH 0546/1322] Improve qmake parser debug output in pro2cmake Override the default debug actions to be decorated with proper indentation for easier reading. The setup only has to be done once, and not on each QMakeParser creation. Change-Id: If5f965b462c782c654ee8ebfdd33570e8f94b084 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 3f9b4ccb530..ea68b57a197 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -683,6 +683,33 @@ class QmakeParser: def __init__(self, *, debug: bool = False) -> None: self._Grammar = self._generate_grammar(debug) + @staticmethod + def set_up_py_parsing_nicer_debug_output(): + indent = -1 + + def increase_indent(fn): + def wrapper_function(*args): + nonlocal indent + indent += 1 + print("> " * indent, end="") + return fn(*args) + + return wrapper_function + + def decrease_indent(fn): + def wrapper_function(*args): + nonlocal indent + print("> " * indent, end="") + indent -= 1 + return fn(*args) + + return wrapper_function + + pp._defaultStartDebugAction = increase_indent(pp._defaultStartDebugAction) + pp._defaultSuccessDebugAction = decrease_indent(pp._defaultSuccessDebugAction) + pp._defaultExceptionDebugAction = decrease_indent(pp._defaultExceptionDebugAction) + + def _generate_grammar(self, debug: bool): # Define grammar: pp.ParserElement.setDefaultWhitespaceChars(' \t') @@ -829,6 +856,9 @@ class QmakeParser: return result +QmakeParser.set_up_py_parsing_nicer_debug_output() + + def parseProFile(file: str, *, debug=False): parser = QmakeParser(debug=debug) return parser.parseFile(file) From 6dfeb81bcb05360e83a55b519886014c55e8e771 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 23 May 2019 11:53:41 +0200 Subject: [PATCH 0547/1322] Improve qmake syntax parser in pro2cmake.py Some qtdeclarative pro files caused exceptions when trying to parse them using the script. This included the following: - handling conditions divided by newlines and backslashes - handling conditions that have no scope The parser has been fixed to deal with those cases and relevant tests were added. After the change, all qtdeclarative project files are parseable by the script. Change-Id: Ib9736423f7fb3bcc1944b26cfb3114306b4db9a7 Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 25 ++++++++++++++----- .../tests/data/condition_without_scope.pro | 2 ++ .../data/multi_condition_divided_by_lc.pro | 3 +++ .../tests/data/nested_function_calls.pro | 2 ++ util/cmake/tests/test_parsing.py | 15 +++++++++++ 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 util/cmake/tests/data/condition_without_scope.pro create mode 100644 util/cmake/tests/data/multi_condition_divided_by_lc.pro create mode 100644 util/cmake/tests/data/nested_function_calls.pro diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index ea68b57a197..fbf153b057b 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -794,13 +794,26 @@ class QmakeParser: + pp.Optional(LC) + (pp.Literal(':') \ | pp.Literal('{') \ | pp.Literal('|')))) - ConditionPart = ((pp.Optional('!') + Identifier + pp.Optional(BracedValue)) \ - ^ pp.CharsNotIn('#{}|:=\\\n')) + pp.Optional(LC) + ConditionEnd - Condition = pp.Combine(ConditionPart \ - + pp.ZeroOrMore((pp.Literal('|') ^ pp.Literal(':')) \ - + ConditionPart)) + + ConditionPart1 = (pp.Optional('!') + Identifier + pp.Optional(BracedValue)) + ConditionPart2 = pp.CharsNotIn('#{}|:=\\\n') + ConditionPart = (ConditionPart1 ^ ConditionPart2) + pp.Optional(LC) + ConditionEnd + + ConditionOp = pp.Literal('|') ^ pp.Literal(':') + ConditionLC = pp.Suppress(pp.Optional(pp.White(' ') + LC + pp.White(' '))) + + ConditionRepeated = pp.ZeroOrMore((ConditionOp) + ConditionLC + ConditionPart) + + Condition = pp.Combine(ConditionPart + ConditionRepeated) Condition.setParseAction(lambda x: ' '.join(x).strip().replace(':', ' && ').strip(' && ')) + # Weird thing like write_file(a)|error() where error() is the alternative condition + # which happens to be a function call. In this case there is no scope, but our code expects + # a scope with a list of statements, so create a fake empty statement. + ConditionEndingInFunctionCall = pp.Suppress(ConditionOp) + FunctionCall \ + + pp.Empty().setParseAction(lambda x: [[]])\ + .setResultsName('statements') + SingleLineScope = pp.Suppress(pp.Literal(':')) + pp.Optional(LC) \ + pp.Group(Block | (Statement + EOL))('statements') MultiLineScope = pp.Optional(LC) + Block('statements') @@ -811,7 +824,7 @@ class QmakeParser: ElseBranch = pp.Suppress(Else) + (SingleLineElse | MultiLineElse) Scope <<= pp.Optional(LC) \ + pp.Group(Condition('condition') \ - + (SingleLineScope | MultiLineScope) \ + + (SingleLineScope | MultiLineScope | ConditionEndingInFunctionCall) \ + pp.Optional(ElseBranch)('else_statements')) if debug: diff --git a/util/cmake/tests/data/condition_without_scope.pro b/util/cmake/tests/data/condition_without_scope.pro new file mode 100644 index 00000000000..2aa1237c12b --- /dev/null +++ b/util/cmake/tests/data/condition_without_scope.pro @@ -0,0 +1,2 @@ +write_file("a", contents)|error() + diff --git a/util/cmake/tests/data/multi_condition_divided_by_lc.pro b/util/cmake/tests/data/multi_condition_divided_by_lc.pro new file mode 100644 index 00000000000..23254231df5 --- /dev/null +++ b/util/cmake/tests/data/multi_condition_divided_by_lc.pro @@ -0,0 +1,3 @@ +equals(a): \ + greaterThan(a):flags += 1 + diff --git a/util/cmake/tests/data/nested_function_calls.pro b/util/cmake/tests/data/nested_function_calls.pro new file mode 100644 index 00000000000..5ecc53f1ccc --- /dev/null +++ b/util/cmake/tests/data/nested_function_calls.pro @@ -0,0 +1,2 @@ +requires(qtConfig(dlopen)) + diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index c8feeb18114..11d1ed093f9 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -309,3 +309,18 @@ def test_realworld_lc(): def test_realworld_lc_with_comment_in_between(): result = parse_file(_tests_path + '/data/lc_with_comment.pro') assert len(result) == 6 + + +def test_condition_without_scope(): + result = parse_file(_tests_path + '/data/condition_without_scope.pro') + assert len(result) == 1 + + +def test_multi_condition_divided_by_lc(): + result = parse_file(_tests_path + '/data/multi_condition_divided_by_lc.pro') + assert len(result) == 1 + + +def test_nested_function_calls(): + result = parse_file(_tests_path + '/data/nested_function_calls.pro') + assert len(result) == 1 From a2e0f19b61453dc472bca657935310dcfbf9fc86 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 23 May 2019 15:20:41 +0200 Subject: [PATCH 0548/1322] Make debug token output actually work for the pro2cmake qmake parser setName() and setDebug() need to be called on a parser element before the parser element is used as a sub-element in another parser element, otherwise the debug output is not shown. Hence the "iterate over all locals" approach works only partially. Instead add a new decorating function add_element() for the construction of each parser element, and make sure to enable debugging inside that function. Unfortunately there is no clean way to avoid duplicating the parser element name both in the local variable and in the function argument. Change-Id: Iaa9ed9b7dbb22ec084070b9c049cf51c841d442c Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 224 +++++++++++++++++++++++----------------- 1 file changed, 129 insertions(+), 95 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fbf153b057b..0f3f796227c 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -681,7 +681,8 @@ class Scope(object): class QmakeParser: def __init__(self, *, debug: bool = False) -> None: - self._Grammar = self._generate_grammar(debug) + self.debug = debug + self._Grammar = self._generate_grammar() @staticmethod def set_up_py_parsing_nicer_debug_output(): @@ -709,54 +710,72 @@ class QmakeParser: pp._defaultSuccessDebugAction = decrease_indent(pp._defaultSuccessDebugAction) pp._defaultExceptionDebugAction = decrease_indent(pp._defaultExceptionDebugAction) - - def _generate_grammar(self, debug: bool): + def _generate_grammar(self): # Define grammar: pp.ParserElement.setDefaultWhitespaceChars(' \t') - LC = pp.Suppress(pp.Literal('\\\n')) - EOL = pp.Suppress(pp.LineEnd()) - Else = pp.Keyword('else') - Identifier = pp.Word(pp.alphas + '_', bodyChars=pp.alphanums+'_-./') - BracedValue = pp.nestedExpr(ignoreExpr=pp.quotedString \ - | pp.QuotedString(quoteChar='$(', - endQuoteChar=')', - escQuote='\\', - unquoteResults=False) - ).setParseAction(lambda s, l, t: ['(', *t[0], ')']) + def add_element(name: str, value: pp.ParserElement): + nonlocal self + if self.debug: + value.setName(name) + value.setDebug() + return value + + LC = add_element('LC', pp.Suppress(pp.Literal('\\\n'))) + + EOL = add_element('EOL', pp.Suppress(pp.LineEnd())) + Else = add_element('Else', pp.Keyword('else')) + Identifier = add_element('Identifier', pp.Word(pp.alphas + '_', + bodyChars=pp.alphanums+'_-./')) + BracedValue = add_element('BracedValue', + pp.nestedExpr( + ignoreExpr=pp.quotedString | + pp.QuotedString(quoteChar='$(', + endQuoteChar=')', + escQuote='\\', + unquoteResults=False) + ).setParseAction(lambda s, l, t: ['(', *t[0], ')'])) Substitution \ - = pp.Combine(pp.Literal('$') - + (((pp.Literal('$') + Identifier - + pp.Optional(pp.nestedExpr())) - | (pp.Literal('(') + Identifier + pp.Literal(')')) - | (pp.Literal('{') + Identifier + pp.Literal('}')) - | (pp.Literal('$') + pp.Literal('{') - + Identifier + pp.Optional(pp.nestedExpr()) - + pp.Literal('}')) - | (pp.Literal('$') + pp.Literal('[') + Identifier - + pp.Literal(']')) - ))) - LiteralValuePart = pp.Word(pp.printables, excludeChars='$#{}()') + = add_element('Substitution', + pp.Combine(pp.Literal('$') + + (((pp.Literal('$') + Identifier + + pp.Optional(pp.nestedExpr())) + | (pp.Literal('(') + Identifier + pp.Literal(')')) + | (pp.Literal('{') + Identifier + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('{') + + Identifier + pp.Optional(pp.nestedExpr()) + + pp.Literal('}')) + | (pp.Literal('$') + pp.Literal('[') + Identifier + + pp.Literal(']')) + )))) + LiteralValuePart = add_element('LiteralValuePart', + pp.Word(pp.printables, excludeChars='$#{}()')) SubstitutionValue \ - = pp.Combine(pp.OneOrMore(Substitution | LiteralValuePart - | pp.Literal('$'))) - Value = pp.NotAny(Else | pp.Literal('}') | EOL) \ - + (pp.QuotedString(quoteChar='"', escChar='\\') - | SubstitutionValue - | BracedValue) + = add_element('SubstitutionValue', + pp.Combine(pp.OneOrMore(Substitution + | LiteralValuePart + | pp.Literal('$')))) + Value \ + = add_element('Value', + pp.NotAny(Else | pp.Literal('}') | EOL) \ + + (pp.QuotedString(quoteChar='"', escChar='\\') + | SubstitutionValue + | BracedValue)) - Values = pp.ZeroOrMore(Value + pp.Optional(LC))('value') + Values = add_element('Values', pp.ZeroOrMore(Value + pp.Optional(LC))('value')) - Op = pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') \ - | pp.Literal('*=') + Op = add_element('OP', + pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') \ + | pp.Literal('*=')) - Key = Identifier + Key = add_element('Key', Identifier) - Operation = Key('key') + pp.Optional(LC) \ - + Op('operation') + pp.Optional(LC) \ - + Values('value') - CallArgs = pp.Optional(LC) + pp.nestedExpr()\ + Operation = add_element('Operation', + Key('key') + pp.Optional(LC) \ + + Op('operation') + pp.Optional(LC) \ + + Values('value')) + CallArgs = add_element('CallArgs', pp.Optional(LC) + pp.nestedExpr()) def parse_call_args(results): out = '' @@ -768,80 +787,95 @@ class QmakeParser: return out CallArgs.setParseAction(parse_call_args) - Load = pp.Keyword('load') + CallArgs('loaded') - Include = pp.Keyword('include') + CallArgs('included') - Option = pp.Keyword('option') + CallArgs('option') - DefineTestDefinition = pp.Suppress(pp.Keyword('defineTest') + CallArgs - + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing... - ForLoop = pp.Suppress(pp.Keyword('for') + CallArgs - + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd())) # ignore the whole thing... - ForLoopSingleLine = pp.Suppress(pp.Keyword('for') + CallArgs - + pp.Literal(':') + pp.SkipTo(EOL, ignore=LC)) # ignore the whole thing... - FunctionCall = pp.Suppress(Identifier + pp.nestedExpr()) - Scope = pp.Forward() + Load = add_element('Load', pp.Keyword('load') + CallArgs('loaded')) + Include = add_element('Include', pp.Keyword('include') + CallArgs('included')) + Option = add_element('Option', pp.Keyword('option') + CallArgs('option')) - Statement = pp.Group(Load | Include | Option | ForLoop | ForLoopSingleLine \ - | DefineTestDefinition | FunctionCall | Operation) - StatementLine = Statement + (EOL | pp.FollowedBy('}')) - StatementGroup = pp.ZeroOrMore(StatementLine | Scope | pp.Suppress(EOL)) + # ignore the whole thing... + DefineTestDefinition = add_element( + 'DefineTestDefinition', + pp.Suppress(pp.Keyword('defineTest') + CallArgs + + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd()))) - Block = pp.Suppress('{') + pp.Optional(LC | EOL) \ - + StatementGroup + pp.Optional(LC | EOL) \ - + pp.Suppress('}') + pp.Optional(LC | EOL) + # ignore the whole thing... + ForLoop = add_element( + 'ForLoop', + pp.Suppress(pp.Keyword('for') + CallArgs + + pp.nestedExpr(opener='{', closer='}', ignoreExpr=pp.LineEnd()))) - ConditionEnd = pp.FollowedBy((pp.Optional(pp.White()) - + pp.Optional(LC) + (pp.Literal(':') \ - | pp.Literal('{') \ - | pp.Literal('|')))) + # ignore the whole thing... + ForLoopSingleLine = add_element( + 'ForLoopSingleLine', + pp.Suppress(pp.Keyword('for') + CallArgs + + pp.Literal(':') + pp.SkipTo(EOL, ignore=LC))) - ConditionPart1 = (pp.Optional('!') + Identifier + pp.Optional(BracedValue)) - ConditionPart2 = pp.CharsNotIn('#{}|:=\\\n') - ConditionPart = (ConditionPart1 ^ ConditionPart2) + pp.Optional(LC) + ConditionEnd + # ignore the whole thing... + FunctionCall = add_element('FunctionCall', pp.Suppress(Identifier + pp.nestedExpr())) - ConditionOp = pp.Literal('|') ^ pp.Literal(':') - ConditionLC = pp.Suppress(pp.Optional(pp.White(' ') + LC + pp.White(' '))) + Scope = add_element('Scope', pp.Forward()) - ConditionRepeated = pp.ZeroOrMore((ConditionOp) + ConditionLC + ConditionPart) + Statement = add_element('Statement', + pp.Group(Load | Include | Option | ForLoop | ForLoopSingleLine + | DefineTestDefinition | FunctionCall | Operation)) + StatementLine = add_element('StatementLine', Statement + (EOL | pp.FollowedBy('}'))) + StatementGroup = add_element('StatementGroup', + pp.ZeroOrMore(StatementLine | Scope | pp.Suppress(EOL))) - Condition = pp.Combine(ConditionPart + ConditionRepeated) + Block = add_element('Block', + pp.Suppress('{') + pp.Optional(LC | EOL) + + StatementGroup + pp.Optional(LC | EOL) + + pp.Suppress('}') + pp.Optional(LC | EOL)) + + ConditionEnd = add_element('ConditionEnd', + pp.FollowedBy((pp.Optional(pp.White()) + + pp.Optional(LC) + (pp.Literal(':') + | pp.Literal('{') + | pp.Literal('|'))))) + + ConditionPart1 = add_element('ConditionPart1', + (pp.Optional('!') + Identifier + pp.Optional(BracedValue))) + ConditionPart2 = add_element('ConditionPart2', pp.CharsNotIn('#{}|:=\\\n')) + ConditionPart = add_element( + 'ConditionPart', + (ConditionPart1 ^ ConditionPart2) + pp.Optional(LC) + ConditionEnd) + + ConditionOp = add_element('ConditionOp', pp.Literal('|') ^ pp.Literal(':')) + ConditionLC = add_element('ConditionLC', + pp.Suppress(pp.Optional(pp.White(' ') + LC + pp.White(' ')))) + + ConditionRepeated = add_element('ConditionRepeated', + pp.ZeroOrMore((ConditionOp) + ConditionLC + ConditionPart)) + + Condition = add_element('Condition', pp.Combine(ConditionPart + ConditionRepeated)) Condition.setParseAction(lambda x: ' '.join(x).strip().replace(':', ' && ').strip(' && ')) # Weird thing like write_file(a)|error() where error() is the alternative condition # which happens to be a function call. In this case there is no scope, but our code expects # a scope with a list of statements, so create a fake empty statement. - ConditionEndingInFunctionCall = pp.Suppress(ConditionOp) + FunctionCall \ - + pp.Empty().setParseAction(lambda x: [[]])\ - .setResultsName('statements') + ConditionEndingInFunctionCall = add_element( + 'ConditionEndingInFunctionCall', pp.Suppress(ConditionOp) + FunctionCall + + pp.Empty().setParseAction(lambda x: [[]]) + .setResultsName('statements')) - SingleLineScope = pp.Suppress(pp.Literal(':')) + pp.Optional(LC) \ - + pp.Group(Block | (Statement + EOL))('statements') - MultiLineScope = pp.Optional(LC) + Block('statements') + SingleLineScope = add_element('SingleLineScope', + pp.Suppress(pp.Literal(':')) + pp.Optional(LC) + + pp.Group(Block | (Statement + EOL))('statements')) + MultiLineScope = add_element('MultiLineScope', + pp.Optional(LC) + Block('statements')) - SingleLineElse = pp.Suppress(pp.Literal(':')) + pp.Optional(LC) \ - + (Scope | Block | (Statement + pp.Optional(EOL))) - MultiLineElse = Block - ElseBranch = pp.Suppress(Else) + (SingleLineElse | MultiLineElse) + SingleLineElse = add_element('SingleLineElse', + pp.Suppress(pp.Literal(':')) + pp.Optional(LC) + + (Scope | Block | (Statement + pp.Optional(EOL)))) + MultiLineElse = add_element('MultiLineElse', Block) + ElseBranch = add_element('ElseBranch', pp.Suppress(Else) + (SingleLineElse | MultiLineElse)) + + # Scope is already add_element'ed in the forward declaration above. Scope <<= pp.Optional(LC) \ - + pp.Group(Condition('condition') \ - + (SingleLineScope | MultiLineScope | ConditionEndingInFunctionCall) \ + + pp.Group(Condition('condition') + + (SingleLineScope | MultiLineScope | ConditionEndingInFunctionCall) + pp.Optional(ElseBranch)('else_statements')) - if debug: - for ename in 'LC EOL ' \ - 'Condition ConditionPart ConditionEnd ' \ - 'Else ElseBranch SingleLineElse MultiLineElse ' \ - 'SingleLineScope MultiLineScope ' \ - 'Identifier ' \ - 'Key Op Values Value BracedValue ' \ - 'Scope Block ' \ - 'StatementGroup StatementLine Statement '\ - 'Load Include Option DefineTestDefinition ForLoop ' \ - 'FunctionCall CallArgs Operation'.split(): - expr = locals()[ename] - expr.setName(ename) - expr.setDebug() - Grammar = StatementGroup('statements') Grammar.ignore(pp.pythonStyleComment()) From bfed22e3b7b6de27359d41f1a51ea345f7284ce2 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 23 May 2019 15:57:59 +0200 Subject: [PATCH 0549/1322] Remove all line continuations when processing qmake syntax We constantly had to adjust the qmake grammar to handle line continuations (\\\n) in weird places. Instead of doing that, just do a preprocess step to remove all the LCs like we do with comments, and simplify the grammar not to take into account the LCs. From some manual testing it doesn't look like we get any regressions. Change-Id: I2017d59396004cf67b6cb54977583db65c65e7d3 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 59 +++++++++++++++---------------- util/cmake/tests/test_lc_fixup.py | 8 ++--- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0f3f796227c..5a2db68e670 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -149,9 +149,12 @@ def process_qrc_file(target: str, filepath: str, base_dir: str = '') -> str: def fixup_linecontinuation(contents: str) -> str: - contents = re.sub(r'([^\t ])\\[ \t]*\n', '\\1 \\\n', contents) - contents = re.sub(r'\\[ \t]*\n', '\\\n', contents) - + # Remove all line continuations, aka a backslash followed by + # a newline character with an arbitrary amount of whitespace + # between the backslash and the newline. + # This greatly simplifies the qmake parsing grammar. + contents = re.sub(r'([^\t ])\\[ \t]*\n', '\\1 ', contents) + contents = re.sub(r'\\[ \t]*\n', '', contents) return contents @@ -721,8 +724,6 @@ class QmakeParser: value.setDebug() return value - LC = add_element('LC', pp.Suppress(pp.Literal('\\\n'))) - EOL = add_element('EOL', pp.Suppress(pp.LineEnd())) Else = add_element('Else', pp.Keyword('else')) Identifier = add_element('Identifier', pp.Word(pp.alphas + '_', @@ -763,7 +764,7 @@ class QmakeParser: | SubstitutionValue | BracedValue)) - Values = add_element('Values', pp.ZeroOrMore(Value + pp.Optional(LC))('value')) + Values = add_element('Values', pp.ZeroOrMore(Value)('value')) Op = add_element('OP', pp.Literal('=') | pp.Literal('-=') | pp.Literal('+=') \ @@ -771,11 +772,8 @@ class QmakeParser: Key = add_element('Key', Identifier) - Operation = add_element('Operation', - Key('key') + pp.Optional(LC) \ - + Op('operation') + pp.Optional(LC) \ - + Values('value')) - CallArgs = add_element('CallArgs', pp.Optional(LC) + pp.nestedExpr()) + Operation = add_element('Operation', Key('key') + Op('operation') + Values('value')) + CallArgs = add_element('CallArgs', pp.nestedExpr()) def parse_call_args(results): out = '' @@ -807,8 +805,7 @@ class QmakeParser: # ignore the whole thing... ForLoopSingleLine = add_element( 'ForLoopSingleLine', - pp.Suppress(pp.Keyword('for') + CallArgs - + pp.Literal(':') + pp.SkipTo(EOL, ignore=LC))) + pp.Suppress(pp.Keyword('for') + CallArgs + pp.Literal(':') + pp.SkipTo(EOL))) # ignore the whole thing... FunctionCall = add_element('FunctionCall', pp.Suppress(Identifier + pp.nestedExpr())) @@ -823,29 +820,30 @@ class QmakeParser: pp.ZeroOrMore(StatementLine | Scope | pp.Suppress(EOL))) Block = add_element('Block', - pp.Suppress('{') + pp.Optional(LC | EOL) - + StatementGroup + pp.Optional(LC | EOL) - + pp.Suppress('}') + pp.Optional(LC | EOL)) + pp.Suppress('{') + pp.Optional(EOL) + + StatementGroup + pp.Optional(EOL) + + pp.Suppress('}') + pp.Optional(EOL)) ConditionEnd = add_element('ConditionEnd', pp.FollowedBy((pp.Optional(pp.White()) - + pp.Optional(LC) + (pp.Literal(':') - | pp.Literal('{') - | pp.Literal('|'))))) + + (pp.Literal(':') + | pp.Literal('{') + | pp.Literal('|'))))) ConditionPart1 = add_element('ConditionPart1', (pp.Optional('!') + Identifier + pp.Optional(BracedValue))) ConditionPart2 = add_element('ConditionPart2', pp.CharsNotIn('#{}|:=\\\n')) ConditionPart = add_element( 'ConditionPart', - (ConditionPart1 ^ ConditionPart2) + pp.Optional(LC) + ConditionEnd) + (ConditionPart1 ^ ConditionPart2) + ConditionEnd) ConditionOp = add_element('ConditionOp', pp.Literal('|') ^ pp.Literal(':')) - ConditionLC = add_element('ConditionLC', - pp.Suppress(pp.Optional(pp.White(' ') + LC + pp.White(' ')))) + ConditionWhiteSpace = add_element('ConditionWhiteSpace', + pp.Suppress(pp.Optional(pp.White(' ')))) ConditionRepeated = add_element('ConditionRepeated', - pp.ZeroOrMore((ConditionOp) + ConditionLC + ConditionPart)) + pp.ZeroOrMore(ConditionOp + + ConditionWhiteSpace + ConditionPart)) Condition = add_element('Condition', pp.Combine(ConditionPart + ConditionRepeated)) Condition.setParseAction(lambda x: ' '.join(x).strip().replace(':', ' && ').strip(' && ')) @@ -859,22 +857,21 @@ class QmakeParser: .setResultsName('statements')) SingleLineScope = add_element('SingleLineScope', - pp.Suppress(pp.Literal(':')) + pp.Optional(LC) + pp.Suppress(pp.Literal(':')) + pp.Group(Block | (Statement + EOL))('statements')) - MultiLineScope = add_element('MultiLineScope', - pp.Optional(LC) + Block('statements')) + MultiLineScope = add_element('MultiLineScope', Block('statements')) SingleLineElse = add_element('SingleLineElse', - pp.Suppress(pp.Literal(':')) + pp.Optional(LC) + pp.Suppress(pp.Literal(':')) + (Scope | Block | (Statement + pp.Optional(EOL)))) MultiLineElse = add_element('MultiLineElse', Block) ElseBranch = add_element('ElseBranch', pp.Suppress(Else) + (SingleLineElse | MultiLineElse)) # Scope is already add_element'ed in the forward declaration above. - Scope <<= pp.Optional(LC) \ - + pp.Group(Condition('condition') - + (SingleLineScope | MultiLineScope | ConditionEndingInFunctionCall) - + pp.Optional(ElseBranch)('else_statements')) + Scope <<= \ + pp.Group(Condition('condition') + + (SingleLineScope | MultiLineScope | ConditionEndingInFunctionCall) + + pp.Optional(ElseBranch)('else_statements')) Grammar = StatementGroup('statements') Grammar.ignore(pp.pythonStyleComment()) diff --git a/util/cmake/tests/test_lc_fixup.py b/util/cmake/tests/test_lc_fixup.py index d3680e895d5..841e11615ea 100755 --- a/util/cmake/tests/test_lc_fixup.py +++ b/util/cmake/tests/test_lc_fixup.py @@ -29,18 +29,18 @@ from pro2cmake import fixup_linecontinuation -from textwrap import dedent - def test_no_change(): input = "test \\\nline2\n line3" + output = "test line2\n line3" result = fixup_linecontinuation(input) - assert input == result + assert output == result def test_fix(): input = "test \\\t\nline2\\\n line3\\ \nline4 \\ \t\nline5\\\n\n\n" + output = "test line2 line3 line4 line5 \n\n" result = fixup_linecontinuation(input) - assert 'test \\\nline2 \\\n line3 \\\nline4 \\\nline5 \\\n\n\n' == result + assert output == result From 13e9d88e5656847719d9eab0fb6c305fc2d089c2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 24 May 2019 10:33:17 +0200 Subject: [PATCH 0550/1322] Update vcpkg instructions Let's recommend vcpkg only on Windows for now. That's best maintained and works best there. Change-Id: Ied06b6a3cb26d9e56d3f525c1d5a410223754fba Reviewed-by: Liang Qi Reviewed-by: Kai Koehne --- cmake/README.md | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 57f87e0d849..544aec46339 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -20,36 +20,20 @@ to be supplied from the outside to the build now. You may find apt-get/brew/etc. * For the time being we try to keep qmake working so that we do not interfere too much with ongoing development. -# Building against VCPKG +# Building against VCPKG on Windows You may use vcpkg to install dependencies needed to build QtBase. * ```git clone -b qt https://github.com/tronical/vcpkg``` * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` - * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to - * Linux: ``x64-linux`` - * macOS: ``x64-osx`` - * Windows: ``qt-x86-windows-static`` - * Build Qt dependencies: ``vcpkg install zlib pcre2 double-conversion harfbuzz freetype`` - * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake`` + * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``qt-x64-windows-static`` or ``qt-x86-windows-static`` + * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl`` + * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET%`` Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_FILE. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). -# Building VCPKG on macOS - -vcpkg doesn't currently buid on macOS with Xcode provided clang, due to missing filesystem headers. It's expected to be fixed in Xcode 11. - -See https://github.com/Microsoft/vcpkg/issues/4475 and https://github.com/Microsoft/vcpkg/issues/6068. - -Vcpkg can be built with homebrew provided gcc though. - - * Install homebrew: ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` - * Install gcc via homebrew: ``brew install gcc`` - -After installing gcc, just follow the vcpkg instructions in the section above. - # Building against homebrew on macOS -Instead of using vcpkg, you can also use homebrew to get the 3rd party dependencies. +You may use brew to install dependencies needed to build QtBase. * Install homebrew: ```/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"``` * Build Qt dependencies: ``brew install pcre2 harfbuzz freetype`` From e4f0680c4a722b02fb31fc1693e09059e94326f4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 24 May 2019 11:59:52 +0200 Subject: [PATCH 0551/1322] Fix static zstd linkage Upstream's cmake build system installs libzstd_static for static builds, so look for that as well. Now we can also recommend installing it via vcpkg. Change-Id: I0ba4c45ecd90bf7b1c9f1e5f84a440caa976a23c Reviewed-by: Tobias Hunger --- cmake/FindZSTD.cmake | 2 +- cmake/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/FindZSTD.cmake b/cmake/FindZSTD.cmake index 4f4590d357d..90d667dc291 100644 --- a/cmake/FindZSTD.cmake +++ b/cmake/FindZSTD.cmake @@ -27,7 +27,7 @@ find_path(ZSTD_INCLUDE_DIRS PATH_SUFFIXES zstd) find_library(ZSTD_LIBRARIES - NAMES zstd + NAMES zstd zstd_static HINTS ${PC_ZSTD_LIBDIR} ) diff --git a/cmake/README.md b/cmake/README.md index 544aec46339..7b38877831a 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -27,7 +27,7 @@ You may use vcpkg to install dependencies needed to build QtBase. * ```git clone -b qt https://github.com/tronical/vcpkg``` * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``qt-x64-windows-static`` or ``qt-x86-windows-static`` - * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl`` + * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET%`` Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_FILE. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). From cbb143e9f1396c8180401c4f8a5b1fe579902559 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 24 May 2019 17:29:21 +0200 Subject: [PATCH 0552/1322] Improve configurejson2cmake.py to handle non-compliant qmake JSON Some configure.json files contain new lines inside quoted strings, which is not conformant with the JSON spec. Add a new json_parser python module which uses pyparsing to preprocess the json files to remove the new lines inside the quoted strings, and then hands over the preprocessed content to the regular json module. Change-Id: I5f8938492068dda5640465cc78f5a7b6be0e709a Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- util/cmake/configurejson2cmake.py | 6 +- util/cmake/helper.py | 26 ++++++++ util/cmake/json_parser.py | 100 ++++++++++++++++++++++++++++++ util/cmake/pro2cmake.py | 31 +-------- 4 files changed, 131 insertions(+), 32 deletions(-) create mode 100644 util/cmake/json_parser.py diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index d1646ed0826..09f76a272d0 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -27,7 +27,7 @@ ## ############################################################################# -import json +import json_parser import os.path import re import sys @@ -154,8 +154,8 @@ def readJsonFromDir(dir): print('Reading {}...'.format(path)) assert os.path.exists(path) - with open(path, 'r') as fh: - return json.load(fh) + parser = json_parser.QMakeSpecificJSONParser() + return parser.parse(path) def processFiles(ctx, data): diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 682e2ec15fd..b7d91921fa4 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -428,3 +428,29 @@ def generate_find_package_info(lib: LibraryMapping, ind=one_ind) return result + + +def _set_up_py_parsing_nicer_debug_output(pp): + indent = -1 + + def increase_indent(fn): + def wrapper_function(*args): + nonlocal indent + indent += 1 + print("> " * indent, end="") + return fn(*args) + + return wrapper_function + + def decrease_indent(fn): + def wrapper_function(*args): + nonlocal indent + print("> " * indent, end="") + indent -= 1 + return fn(*args) + + return wrapper_function + + pp._defaultStartDebugAction = increase_indent(pp._defaultStartDebugAction) + pp._defaultSuccessDebugAction = decrease_indent(pp._defaultSuccessDebugAction) + pp._defaultExceptionDebugAction = decrease_indent(pp._defaultExceptionDebugAction) diff --git a/util/cmake/json_parser.py b/util/cmake/json_parser.py new file mode 100644 index 00000000000..6ead008f081 --- /dev/null +++ b/util/cmake/json_parser.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python3 +############################################################################# +## +## Copyright (C) 2019 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the plugins of the Qt Toolkit. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import pyparsing as pp +import json +import re +from helper import _set_up_py_parsing_nicer_debug_output +_set_up_py_parsing_nicer_debug_output(pp) + + +class QMakeSpecificJSONParser: + def __init__(self, *, debug: bool = False) -> None: + self.debug = debug + self.grammar = self.create_py_parsing_grammar() + + def create_py_parsing_grammar(self): + # Keep around all whitespace. + pp.ParserElement.setDefaultWhitespaceChars('') + + def add_element(name: str, value: pp.ParserElement): + nonlocal self + if self.debug: + value.setName(name) + value.setDebug() + return value + + # Our grammar is pretty simple. We want to remove all newlines + # inside quoted strings, to make the quoted strings JSON + # compliant. So our grammar should skip to the first quote while + # keeping everything before it as-is, process the quoted string + # skip to the next quote, and repeat that until the end of the + # file. + + EOF = add_element('EOF', pp.StringEnd()) + SkipToQuote = add_element('SkipToQuote', pp.SkipTo('"')) + SkipToEOF = add_element('SkipToEOF', pp.SkipTo(EOF)) + + def remove_newlines_and_whitespace_in_quoted_string(tokens): + first_string = tokens[0] + replaced_string = re.sub(r'\n[ ]*', ' ', first_string) + return replaced_string + + QuotedString = add_element('QuotedString', pp.QuotedString(quoteChar='"', + multiline=True, + unquoteResults=False)) + QuotedString.setParseAction(remove_newlines_and_whitespace_in_quoted_string) + + QuotedTerm = add_element('QuotedTerm', pp.Optional(SkipToQuote) + QuotedString) + Grammar = add_element('Grammar', pp.OneOrMore(QuotedTerm) + SkipToEOF) + + return Grammar + + def parse_file_using_py_parsing(self, file: str): + print('Pre processing "{}" using py parsing to remove incorrect newlines.'.format(file)) + try: + with open(file, 'r') as file_fd: + contents = file_fd.read() + + parser_result = self.grammar.parseString(contents, parseAll=True) + token_list = parser_result.asList() + joined_string = ''.join(token_list) + + return joined_string + except pp.ParseException as pe: + print(pe.line) + print(' '*(pe.col-1) + '^') + print(pe) + raise pe + + def parse(self, file: str): + pre_processed_string = self.parse_file_using_py_parsing(file) + print('Parsing "{}" using json.loads().'.format(file)) + json_parsed = json.loads(pre_processed_string) + return json_parsed diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5a2db68e670..7c2a6254890 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -41,6 +41,8 @@ import typing from sympy.logic import (simplify_logic, And, Or, Not,) import pyparsing as pp +from helper import _set_up_py_parsing_nicer_debug_output +_set_up_py_parsing_nicer_debug_output(pp) from helper import map_qt_library, map_3rd_party_library, is_known_3rd_party_library, \ featureName, map_platform, find_library_info_for_target, generate_find_package_info, \ @@ -687,32 +689,6 @@ class QmakeParser: self.debug = debug self._Grammar = self._generate_grammar() - @staticmethod - def set_up_py_parsing_nicer_debug_output(): - indent = -1 - - def increase_indent(fn): - def wrapper_function(*args): - nonlocal indent - indent += 1 - print("> " * indent, end="") - return fn(*args) - - return wrapper_function - - def decrease_indent(fn): - def wrapper_function(*args): - nonlocal indent - print("> " * indent, end="") - indent -= 1 - return fn(*args) - - return wrapper_function - - pp._defaultStartDebugAction = increase_indent(pp._defaultStartDebugAction) - pp._defaultSuccessDebugAction = decrease_indent(pp._defaultSuccessDebugAction) - pp._defaultExceptionDebugAction = decrease_indent(pp._defaultExceptionDebugAction) - def _generate_grammar(self): # Define grammar: pp.ParserElement.setDefaultWhitespaceChars(' \t') @@ -900,9 +876,6 @@ class QmakeParser: return result -QmakeParser.set_up_py_parsing_nicer_debug_output() - - def parseProFile(file: str, *, debug=False): parser = QmakeParser(debug=debug) return parser.parseFile(file) From f96778dee27f10e84865c4b0a32ef333287c5fe7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sun, 26 May 2019 16:55:15 +0200 Subject: [PATCH 0553/1322] Enable export of compile commands database For developer builds, enable the compile commands database by default. This allows Qt developers to use tools that utilize these (such as clang-tidy, etc.) without any extra setup. Change-Id: I79d70ef7dbe7c59864e93593c75f9ff6cd67c2ce Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- cmake/QtSetup.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 3b02633ed7f..769e17dfb85 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -35,6 +35,11 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) if(FEATURE_developer_build) + if(DEFINED QT_CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_EXPORT_COMPILE_COMMANDS ${QT_CMAKE_EXPORT_COMPILE_COMMANDS}) + else() + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + endif() set(QT_WILL_INSTALL OFF) # Handle non-prefix builds by setting the cmake install prefix to the project binary dir. if(PROJECT_NAME STREQUAL "QtBase") From cae4c5c2cef9399193d6aa477565b86c5718570e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 May 2019 14:13:27 +0200 Subject: [PATCH 0554/1322] Add some qtdeclarative related functions to QtBuild QtQml uses QLALR to generate a grammar, but the qmake qlalr feature seems to be a general one, so the corresponding CMake implementations are kept in qtbase for now. Change-Id: Ibe916878b18155ddc5bb08793dd2075ebfa8f282 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- cmake/QtBuild.cmake | 49 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ff2298f36be..acdeaaca950 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1896,3 +1896,52 @@ macro(qt_find_apple_system_frameworks) find_library(FWWatchKit WatchKit) endif() endmacro() + +# Match the pattern 'regex' in 'input_line', replace the match with 'replacement' +# and set that result in 'out_var' in the parent scope. +function(qt_regex_match_and_get input_line regex replacement out_var) + string(REGEX MATCH "${regex}" match "${input_line}") + if(match) + string(REGEX REPLACE "${regex}" "${replacement}" match "${input_line}") + string(STRIP ${match} match) + set(${out_var} "${match}" PARENT_SCOPE) + endif() +endfunction() + +# Match 'regex' in a list of lines. When found, set the value to 'out_var' and break early. +function(qt_qlalr_find_option_in_list input_list regex out_var) + foreach(line ${input_list}) + qt_regex_match_and_get("${line}" "${regex}" "\\1" option) + if(option) + string(TOLOWER ${option} option) + set(${out_var} "${option}" PARENT_SCOPE) + return() + endif() + endforeach() + message(FATAL_ERROR "qt_qlalr_find_option_in_list: Could not extract ${out_var}") +endfunction() + +# Generate a few output files using qlalr, and assign those to 'consuming_target'. +# 'input_file_list' is a list of 'foo.g' file paths. +# 'flags' are extra flags to be passed to qlalr. +function(qt_process_qlalr input_file_list consuming_target flags) + foreach(input_file ${input_file_list}) + file(STRINGS ${input_file} input_file_lines) + qt_qlalr_find_option_in_list("${input_file_lines}" "^%parser(.+)" "parser") + qt_qlalr_find_option_in_list("${input_file_lines}" "^%decl(.+)" "decl") + qt_qlalr_find_option_in_list("${input_file_lines}" "^%impl(.+)" "impl") + get_filename_component(base_file_name ${input_file} NAME_WE) + + set(cpp_file "${parser}.cpp") + set(private_file "${parser}_p.h") + set(decl_file "${decl}") + set(impl_file "${impl}") + add_custom_command( + OUTPUT ${cpp_file} ${private_file} ${decl_file} ${impl_file} + COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qlalr ${flags} ${input_file} + MAIN_DEPENDENCY ${input_file} + ) + target_sources(${consuming_target} PRIVATE ${cpp_file} ${impl_file}) + endforeach() +endfunction() + From 499771f3eaf48a3a22769298efcb8dee7db6a04a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 May 2019 14:16:01 +0200 Subject: [PATCH 0555/1322] Enhance the porting scripts with some new functionality These were some hard requirements while porting QtQml .pro files so that the generated CMake code is syntactically correct and the result buildable. This include handling of a few more different condition scopes and disabling the c++ make_unique feature test. Change-Id: Iae875ffaf8d100296e8b56b57d076455e5d72006 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- util/cmake/configurejson2cmake.py | 2 ++ util/cmake/pro2cmake.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 09f76a272d0..148109e2a4b 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -620,6 +620,8 @@ def parseFeature(ctx, feature, data, cm_fh): 'c++14': None, 'c++1y': None, 'c++1z': None, + # FIXME: used in qtdeclarative, drop when we require C++14 + 'cxx14_make_unique': None, 'c89': None, 'c99': None, 'ccache': None, diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 7c2a6254890..2f4c74b8213 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -889,6 +889,17 @@ def map_condition(condition: str) -> str: condition = re.sub(r'\bequals\s*\((.*?),\s*"?(.*?)"?\)', r'\1___equals___\2', condition) condition = re.sub(r'\s*==\s*', '___STREQUAL___', condition) + condition = re.sub(r'\bexists\s*\((.*?)\)', r'EXISTS \1', condition) + + pattern = r'CONFIG\((debug|release),debug\|release\)' + match_result = re.match(pattern, condition) + if match_result: + build_type = match_result.group(1) + if build_type == 'debug': + build_type = 'Debug' + elif build_type == 'release': + build_type = 'Release' + condition = re.sub(pattern, '(CMAKE_BUILD_TYPE STREQUAL {})'.format(build_type), condition) condition = condition.replace('*', '_x_') condition = condition.replace('.$$', '__ss_') From d843bceb0cf6ab5178fea43c194493d843665fdf Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Tue, 28 May 2019 15:42:21 +0200 Subject: [PATCH 0556/1322] Add Library Mapping for QtNetworkAuth Added library mapping information for any projects referencing the QtNetworkAuth project. Change-Id: I9c4309d26ee9895f94995d4844ffde4ee4444766 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- util/cmake/helper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index b7d91921fa4..bb2b239aa04 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -114,6 +114,7 @@ _qt_library_map = [ LibraryMapping('multimedia', 'Qt5', 'Qt::Multimedia', extra = ['COMPONENTS', 'Multimedia']), LibraryMapping('multimediawidgets', 'Qt5', 'Qt::MultimediaWidgets', extra = ['COMPONENTS', 'MultimediaWidgets']), LibraryMapping('network', 'Qt5', 'Qt::Network', extra = ['COMPONENTS', 'Network']), + LibraryMapping('networkauth', 'Qt5', 'Qt::NetworkAuth', extra = ['COMPONENTS', 'NetworkAuth']), LibraryMapping('nfc', 'Qt5', 'Qt::Nfc', extra = ['COMPONENTS', 'Nfc']), LibraryMapping('oauth', 'Qt5', 'Qt::NetworkAuth', extra = ['COMPONENTS', 'NetworkAuth']), LibraryMapping('openglextensions', 'Qt5', 'Qt::OpenGLExtensions', extra = ['COMPONENTS', 'OpenGLExtensions']), From 3122e7c01a2ea163ba3c571e43e2ed7f768d27b5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 24 May 2019 19:18:21 +0200 Subject: [PATCH 0557/1322] Fix qt_build_repo to be more robust Check for the existence of CMakeLists.txt files before trying to call add_subdirectory on examples, tests and src folders. Change-Id: I7be76de5f7520c1dd181c610fd1dc2200ac74672 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 6f0708bd804..125c8aba92c 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -61,18 +61,17 @@ endmacro() macro(qt_build_repo) qt_build_repo_begin(${ARGN}) - if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src") + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt") add_subdirectory(src) endif() - if (BUILD_TESTING) + if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") find_package(Qt5 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test Xml) add_subdirectory(tests) endif() - if (BUILD_EXAMPLES) - # TODO: Implement me - #add_subdirectory(examples) + if (BUILD_EXAMPLES AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt") + add_subdirectory(examples) endif() qt_build_repo_end() From c3663076dc93b7df7ea66c048a97260a7c875ad9 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 24 May 2019 19:19:51 +0200 Subject: [PATCH 0558/1322] Fix syncqt call and injected file forwarding and add comments about it The location of the forwarding headers when not yet installed, depends on whether we do a prefix or non prefix build. In a prefix build the /include folder should be in the current repo build dir. In a non prefix build, it should be under qtbase/include. But the actual generated files to which the forwarding headers point, are always in the current repo build directory. Also syncqt needs to know both the current repo build directory specified by -builddir, and the output directory specified by -outdir. In a prefix build, both are the same. In a non-prefix build, builddir should be the current repo build dir, and outddir should be qtbase's build dir. Also for non-qtbase repo build directories (like declarative), examples need to have the current_repo_build_dir/include directory as an include path, so that framework style includes like #include work correctly. Take care of all that, and add a bunch of comments explaining the whole injected / generated headers interaction. Change-Id: I612ad7549ce499c4979ee994e998b558716d45ca Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 50 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index acdeaaca950..41e33f38570 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -695,41 +695,68 @@ function(qt_install_injections module build_dir install_dir) # examples: # SYNCQT.INJECTIONS = src/corelib/global/qconfig.h:qconfig.h:QtConfig src/corelib/global/qconfig_p.h:5.12.0/QtCore/private/qconfig_p.h # SYNCQT.INJECTIONS = src/gui/vulkan/qvulkanfunctions.h:^qvulkanfunctions.h:QVulkanFunctions:QVulkanDeviceFunctions src/gui/vulkan/qvulkanfunctions_p.h:^5.12.0/QtGui/private/qvulkanfunctions_p.h + # The are 3 parts to the assignment, divded by colons ':'. + # The first part contains a path to a generated file in a build folder. + # The second part contains the file name that the forwarding header should have, which points + # to the file in the first part. + # The third part contains multiple UpperCaseFileNames that should be forwarding headers to the + # header specified in the second part. separate_arguments(injections UNIX_COMMAND "${injections}") foreach(injection ${injections}) string(REPLACE ":" ";" injection ${injection}) + # Part 1. list(GET injection 0 file) + # Part 2. list(GET injection 1 destination) string(REGEX REPLACE "^\\^" "" destination "${destination}") list(REMOVE_AT injection 0 1) + # Part 3. set(fwd_hdrs ${injection}) get_filename_component(destinationdir ${destination} DIRECTORY) get_filename_component(destinationname ${destination} NAME) get_filename_component(original_file_name ${file} NAME) - # Generate lower case forwarding header located in include/${module}, - # which points to the injected (generated) file, for example qconfig.h. + # This describes a concrete example for easier comprehension: + # A file 'qtqml-config.h' is generated by qt_internal_feature_write_file into + # ${qtdeclarative_build_dir}/src/{module}/qtqml-config.h (part 1). + # + # Generate a lower case forwarding header (part 2) 'qtqml-config.h' at the following + # location: + # ${some_prefix}/include/${module}/qtqml-config.h. + # + # Inside this file, we #include the originally generated file, + # ${qtdeclarative_build_dir}/src/{module}/qtqml-config.h. + # + # ${some_prefix}'s value depends on the build type. + # If doing a prefix build, it should point to + # ${current_repo_build_dir} which is ${qtdeclarative_build_dir}. + # If doing a non-prefix build, it should point to + # ${qtbase_build_dir}. + # + # In the code below, ${some_prefix} == ${build_dir}. set(lower_case_forwarding_header_path "${build_dir}/${INSTALL_INCLUDEDIR}/${module}") if(destinationdir) string(APPEND lower_case_forwarding_header_path "/${destinationdir}") endif() + set(current_repo_build_dir "${PROJECT_BINARY_DIR}") file(RELATIVE_PATH relpath "${lower_case_forwarding_header_path}" - "${build_dir}/${file}") + "${current_repo_build_dir}/${file}") set(main_contents "#include \"${relpath}\"") file(GENERATE OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" CONTENT "${main_contents}") # Copy the actual injected (generated) header file (not the just created forwarding one) - # to its install location. + # to its install location when doing a prefix build. In an non-prefix build, the qt_install + # will be a no-op. qt_path_join(install_destination ${install_dir} ${INSTALL_INCLUDEDIR} ${module} ${destinationdir}) - qt_install(FILES ${build_dir}/${file} + qt_install(FILES ${current_repo_build_dir}/${file} DESTINATION ${install_destination} RENAME ${destinationname} OPTIONAL) - # Generate upper case forwarding headers. + # Generate UpperCaseNamed forwarding headers (part 3). foreach(fwd_hdr ${fwd_hdrs}) set(upper_case_forwarding_header_path "${INSTALL_INCLUDEDIR}/${module}") if(destinationdir) @@ -843,7 +870,15 @@ function(add_qt_module target) # So we either write the generated files into the qtbase non-prefix build root, or the # module specific build root. qt_ensure_sync_qt() - execute_process(COMMAND "${HOST_PERL}" -w "${QT_SYNCQT}" -quiet -module "${module}" -version "${PROJECT_VERSION}" -outdir "${QT_BUILD_DIR}" "${PROJECT_SOURCE_DIR}") + set(syncqt_full_command "${HOST_PERL}" -w "${QT_SYNCQT}" + -quiet + -check-includes + -module "${module}" + -version "${PROJECT_VERSION}" + -outdir "${QT_BUILD_DIR}" + -builddir "${PROJECT_BINARY_DIR}" + "${PROJECT_SOURCE_DIR}") + execute_process(COMMAND ${syncqt_full_command}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS ON) @@ -869,6 +904,7 @@ function(add_qt_module target) extend_target("${target}" SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES + $ $ $ ${arg_PUBLIC_INCLUDE_DIRECTORIES} From 9864ff22aab9915e7f63c5d19e66b0e149432455 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 May 2019 13:33:42 +0200 Subject: [PATCH 0559/1322] Optionally include ${repo}Setup.cmake file in qt_build_repo_begin This is meant to keep repo specific functions and macros that should not pollute QtSetup.cmake. For example QtDeclarativeSetup.cmake will automatically be included when building qtdeclarative. Change-Id: I4d26cbb1a7ffafb153a888fc918af337000d5e41 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 125c8aba92c..91e1efa23a6 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -33,6 +33,9 @@ macro(qt_build_repo_begin) # Qt specific setup common for all modules: include(QtSetup) include(FeatureSummary) + + # Optionally include a repo specific Setup module. + include(${PROJECT_NAME}Setup OPTIONAL) endmacro() macro(qt_build_repo_end) From d908e0a47db862a43fbb11fe3f2beae01a42244b Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 29 May 2019 09:57:34 +0200 Subject: [PATCH 0560/1322] Fix uncessary relative dir suffix in pro2cmake.py When we replace the PWD key from qmake files and both the base and current directory are the same, there's no need to add an extra './' to the current working directory. This also fixes a unit test in qtsvg as it requires the passed in path to match exactly to the one outputed in the log files. Change-Id: Ide9ca6a70493e8039d3af84a9e576d8f6a313f2a Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 2f4c74b8213..89bc8442617 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -591,10 +591,19 @@ class Scope(object): return result def get(self, key: str, *, ignore_includes: bool = False, inherrit: bool = False) -> typing.List[str]: + + is_same_path = self.currentdir == self.basedir + if key == 'PWD': - return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] + if is_same_path: + return ['${CMAKE_CURRENT_SOURCE_DIR}'] + else: + return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] if key == 'OUT_PWD': - return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] + if is_same_path: + return ['${CMAKE_CURRENT_BUILD_DIR}'] + else: + return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] return self._evalOps(key, None, [], inherrit=inherrit) From bcca64944052618b8aa8e3f9be82eb5ccad5807e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 29 May 2019 10:09:52 +0200 Subject: [PATCH 0561/1322] Fix architecture detection when targeting plain arm We record extra CPU features such as neon, etc. in the sub-architecture field, which may very well be empty. Allow for that and avoid cmake warnings about indexed string access beyond the string boundaries. Change-Id: I63e61c6427d156180039b8ac6f5b0f5f55c36ee8 Reviewed-by: Alexandru Croitor --- cmake/QtBaseConfigureTests.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index 7a5502bc651..d8024787f89 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -13,13 +13,14 @@ function(run_config_test_architecture) file(STRINGS "${_arch_file}" _arch_lines LENGTH_MINIMUM 16 LENGTH_MAXIMUM 1024 ENCODING UTF-8) foreach (_line ${_arch_lines}) + string(LENGTH "${line}" lineLength) string(FIND "${_line}" "==Qt=magic=Qt== Architecture:" _pos) if (_pos GREATER -1) math(EXPR _pos "${_pos}+29") string(SUBSTRING "${_line}" ${_pos} -1 _architecture) endif() string(FIND "${_line}" "==Qt=magic=Qt== Sub-architecture:" _pos) - if (_pos GREATER -1) + if (_pos GREATER -1 AND ${lineLength} GREATER 33) math(EXPR _pos "${_pos}+34") string(SUBSTRING "${_line}" ${_pos} -1 _sub_architecture) string(REPLACE " " ";" _sub_architecture "${_sub_architecture}") @@ -31,7 +32,7 @@ function(run_config_test_architecture) endif() endforeach() - if (NOT _architecture OR NOT _sub_architecture OR NOT _build_abi) + if (NOT _architecture OR NOT _build_abi) message(FATAL_ERROR "Failed to extract architecture data from file.") endif() From c9c5ca99973e5145f8ecd3759fa00994e41a4904 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 29 May 2019 10:08:56 +0200 Subject: [PATCH 0562/1322] Fix linker flag detection on Android Since LINUX is not set when targeting Android, we must extend these conditions manually. Change-Id: Ie78167d452e0806bfa64773c1e311a99f4a28f8c Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 41e33f38570..8b0dfa5c7aa 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -441,7 +441,7 @@ function(qt_internal_add_link_flags_no_undefined target) if (GCC OR CLANG) if(APPLE) set(no_undefined_flag "-Wl,-undefined,error") - elseif(LINUX OR MINGW) + elseif(LINUX OR MINGW OR ANDROID) set(no_undefined_flag "-Wl,--no-undefined") else() message(FATAL_ERROR "Platform linker doesn't support erroring upon encountering undefined symbols. Target:\"${target}\".") @@ -460,7 +460,7 @@ function(qt_internal_add_link_flags_gc_sections target visibility) if (GCC OR CLANG) if(APPLE) set(gc_sections_flag "-Wl,-dead_strip") - elseif(LINUX OR BSD OR SOLARIS OR WIN32) + elseif(LINUX OR BSD OR SOLARIS OR WIN32 OR ANDROID) set(gc_sections_flag "-Wl,--gc-sections") else() message(FATAL_ERROR "Platform linker doesn't support gc sections. Target:\"${target}\".") From c9651374486e49a7bce40ac7fefef1ec74b1c1cc Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 29 May 2019 16:05:52 +0200 Subject: [PATCH 0563/1322] Fix build against sysroots Toolchain files from sysroots (such as Yocto or Android) typically set the CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to ONLY to ensure that no external packages are accidentally found. Similar to how we discover the Qt tools packages for cross-compiling, we need to temporarily change the mode to BOTH to locate our build internals. Change-Id: Ib4374ee4a974379213218b7ec430637857ed02e7 Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f0a8ef2a969..d70beff2e93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ list(APPEND CMAKE_MODULE_PATH list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) -find_package(QtBuildInternals) +find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH) qt_build_repo_begin(SKIP_CMAKE_MODULE_PATH_ADDITION) From fc6d4af08d049909071a4eefdc91c26ac2e3df40 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 29 May 2019 16:22:38 +0200 Subject: [PATCH 0564/1322] Fix Android build Make sure that we can qplatformdefs.h. Change-Id: I781fe77d1332ab97b8711e25cc819862ccf28fd0 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8b0dfa5c7aa..924a6fa78f9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -83,6 +83,12 @@ elseif(LINUX) elseif(CLANG) set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/linux-clang) endif() +elseif(ANDROID) + if(GCC) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/android-g++) + elseif(CLANG) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/android-clang) + endif() elseif(APPLE) set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/macx-clang) endif() From 8fa646dbe2eba9674809042ff15e98f0eb1018d5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 29 May 2019 16:56:49 +0200 Subject: [PATCH 0565/1322] Add basic support for compiling applications with qmake * Generate module .pri files * Generate qconfig.pri * Propagate MODULE_CONFIG from the .pro files This enables the basic use-case of simple application builds that for example use the moc. Omitted from the patch is support for private module configurations, prl files (should we do this?) and possibly more hidden gems that need to be implemented to for example support building Qt modules with qmake. Task-number: QTBUG-75666 Change-Id: Icbf0d9ccea4cd683e4c38340b9a2320bf7951d0d Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger --- cmake/QtBaseGlobalTargets.cmake | 2 + cmake/QtBuild.cmake | 94 +++++++++++++++++++++++++++++++- src/corelib/.prev_CMakeLists.txt | 1 + src/corelib/CMakeLists.txt | 1 + src/dbus/.prev_CMakeLists.txt | 1 + src/dbus/CMakeLists.txt | 1 + src/widgets/.prev_CMakeLists.txt | 1 + src/widgets/CMakeLists.txt | 1 + util/cmake/pro2cmake.py | 4 ++ 9 files changed, 105 insertions(+), 1 deletion(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 7bb55ba3d9c..82fd4ed2daf 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -70,6 +70,8 @@ qt_feature_module_begin(NO_MODULE include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") qt_feature_module_end(GlobalConfig OUT_VAR_PREFIX "__GlobalConfig_") +qt_generate_global_config_pri_file() + add_library(Qt::GlobalConfig ALIAS GlobalConfig) add_library(GlobalConfigPrivate INTERFACE) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 924a6fa78f9..80b7a32fb7c 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -281,6 +281,91 @@ function(qt_set_up_developer_build) endif() endfunction() +# Generates module .pri files for consumption by qmake +function(qt_generate_module_pri_file target target_path pri_file_name_var) + set(flags) + set(options) + set(multiopts QMAKE_MODULE_CONFIG) + cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) + + qt_internal_module_info(module "${target}") + qt_path_join(pri_file_name "${target_path}" "qt_lib_${module_lower}.pri") + set("${pri_file_name_var}" "${pri_file_name}" PARENT_SCOPE) + + get_target_property(enabled_features "${target}" QT_ENABLED_PUBLIC_FEATURES) + get_target_property(disabled_features "${target}" QT_DISABLED_PUBLIC_FEATURES) + string (REPLACE ";" " " enabled_features "${enabled_features}") + string (REPLACE ";" " " disabled_features "${disabled_features}") + + if(arg_QMAKE_MODULE_CONFIG) + string(REPLACE ";" " " module_config "${arg_QMAKE_MODULE_CONFIG}") + set(module_config "\nQT.${module_lower}.CONFIG = ${module_config}") + else() + set(module_config "") + endif() + + file(GENERATE + OUTPUT "${pri_file_name}" + CONTENT + "QT.${module_lower}.VERSION = ${PROJECT_VERSION} +QT.${module_lower}.name = ${module} +QT.${module_lower}.module = ${module_versioned} +QT.${module_lower}.libs = $$QT_MODULE_LIB_BASE +QT.${module_lower}.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/${module} +QT.${module_lower}.frameworks = +QT.${module_lower}.bins = $$QT_MODULE_BIN_BASE +QT.${module_lower}.depends = +QT.${module_lower}.uses = +QT.${module_lower}.module_config = v2 +QT.${module_lower}.DEFINES = QT_${module_upper}_LIB +QT.${module_lower}.enabled_features = ${enabled_features} +QT.${module_lower}.disabled_features = ${disabled_features}${module_config} +QT_MODULES += ${module_lower} +" + ) +endfunction() + +function(qt_generate_global_config_pri_file) + qt_path_join(qconfig_pri_target_path ${PROJECT_BINARY_DIR} mkspecs) + qt_path_join(qconfig_pri_target_path "${qconfig_pri_target_path}" "qconfig.pri") + + get_target_property(enabled_features GlobalConfig INTERFACE_QT_ENABLED_PUBLIC_FEATURES) + get_target_property(disabled_features GlobalConfig INTERFACE_QT_DISABLED_PUBLIC_FEATURES) + + # configure2cmake skips the "static" feature, so emulate it here for qmake support: + if(${QT_BUILD_SHARED_LIBS}) + list(APPEND enabled_features shared) + list(APPEND disabled_features static) + else() + list(APPEND enabled_features static) + list(APPEND disabled_features shared) + endif() + + # configure2cmake skips the "rpath" feature, so emulate it here for qmake support: + if(CMAKE_SKIP_RPATH) + list(APPEND disabled_features rpath) + elseif(LINUX OR APPLE) + list(APPEND enabled_features rpath) + endif() + + string (REPLACE ";" " " enabled_features "${enabled_features}") + string (REPLACE ";" " " disabled_features "${disabled_features}") + + file(GENERATE + OUTPUT "${qconfig_pri_target_path}" + CONTENT + "QT.global.enabled_features = ${enabled_features} +QT.global.disabled_features = ${disabled_features} +QT_VERSION = ${PROJECT_VERSION} +QT_MAJOR_VERSION = ${PROJECT_VERSION_MAJOR} +QT_MINOR_VERSION = ${PROJECT_VERSION_MINOR} +QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH} +CONFIG -= link_prl # we do not create prl files right now +" + ) + qt_install(FILES "${qconfig_pri_target_path}" DESTINATION mkspecs) +endfunction() + # Takes a list of path components and joins them into one path separated by forward slashes "/", # and saves the path in out_var. function(qt_path_join out_var) @@ -845,7 +930,7 @@ function(add_qt_module target) qt_parse_all_arguments(arg "add_qt_module" "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT" "CONFIG_MODULE_NAME" - "${__default_private_args};${__default_public_args}" ${ARGN}) + "${__default_private_args};${__default_public_args};QMAKE_MODULE_CONFIG" ${ARGN}) if(NOT DEFINED arg_CONFIG_MODULE_NAME) set(arg_CONFIG_MODULE_NAME "${module_lower}") @@ -1055,6 +1140,13 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} CONFIG_INSTALL_DIR "${config_install_dir}") + qt_path_join(pri_target_path ${PROJECT_BINARY_DIR} mkspecs/modules) + qt_generate_module_pri_file("${target}" "${pri_target_path}" module_pri_file_name + QMAKE_MODULE_CONFIG + ${arg_QMAKE_MODULE_CONFIG} + ) + qt_install(FILES "${module_pri_file_name}" DESTINATION mkspecs/modules) + ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. qt_internal_add_link_flags_no_undefined("${target}") diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt index 1e459bb7341..13b2a444570 100644 --- a/src/corelib/.prev_CMakeLists.txt +++ b/src/corelib/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Core + QMAKE_MODULE_CONFIG moc resources SOURCES ../3rdparty/harfbuzz/src/harfbuzz.h ../3rdparty/harfbuzz/src/harfbuzz-buffer.c diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index bd1aad0406e..f4d5329ee66 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -17,6 +17,7 @@ endif() ##################################################################### add_qt_module(Core + QMAKE_MODULE_CONFIG moc resources SOURCES # special case: remove ../3rdparty/harfbuzz codecs/qtextcodec_p.h diff --git a/src/dbus/.prev_CMakeLists.txt b/src/dbus/.prev_CMakeLists.txt index 0e0ae9351d5..852ba7b03f5 100644 --- a/src/dbus/.prev_CMakeLists.txt +++ b/src/dbus/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(DBus + QMAKE_MODULE_CONFIG dbusadaptors dbusinterfaces SOURCES dbus_minimal_p.h qdbus_symbols.cpp qdbus_symbols_p.h diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index 4768460e05e..9810167bca8 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(DBus + QMAKE_MODULE_CONFIG dbusadaptors dbusinterfaces SOURCES dbus_minimal_p.h qdbus_symbols.cpp qdbus_symbols_p.h diff --git a/src/widgets/.prev_CMakeLists.txt b/src/widgets/.prev_CMakeLists.txt index bd1f19fb0e2..44f4d5de104 100644 --- a/src/widgets/.prev_CMakeLists.txt +++ b/src/widgets/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Widgets + QMAKE_MODULE_CONFIG uic SOURCES itemviews/qfileiconprovider.cpp itemviews/qfileiconprovider.h itemviews/qfileiconprovider_p.h kernel/qaction.cpp kernel/qaction.h kernel/qaction_p.h diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index d946bc8e1d2..95ee3bed651 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Widgets + QMAKE_MODULE_CONFIG uic SOURCES itemviews/qfileiconprovider.cpp itemviews/qfileiconprovider.h itemviews/qfileiconprovider_p.h kernel/qaction.cpp kernel/qaction.h kernel/qaction_p.h diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 89bc8442617..e2625af2661 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1575,6 +1575,10 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, if 'no_module_headers' in scope.get('CONFIG'): extra.append('NO_MODULE_HEADERS') + module_config = scope.get("MODULE_CONFIG") + if len(module_config): + extra.append('QMAKE_MODULE_CONFIG {}'.format(" ".join(module_config))) + write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, extra_lines=extra, indent=indent, known_libraries={}, extra_keys=[]) From b99e4387f66fe8f89fb7470c0dec5f6378a94c7d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 31 May 2019 10:58:43 +0200 Subject: [PATCH 0566/1322] Add architecture and abi to generated qconfig.pri Task-number: QTBUG-75666 Change-Id: If2933005038557c2b5041da6bd02c5890ac786ef Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 80b7a32fb7c..184cb5e19f9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -354,7 +354,9 @@ function(qt_generate_global_config_pri_file) file(GENERATE OUTPUT "${qconfig_pri_target_path}" CONTENT - "QT.global.enabled_features = ${enabled_features} + "QT_ARCH = ${TEST_architecture_arch} +QT_BUILDABI = ${TEST_buildAbi} +QT.global.enabled_features = ${enabled_features} QT.global.disabled_features = ${disabled_features} QT_VERSION = ${PROJECT_VERSION} QT_MAJOR_VERSION = ${PROJECT_VERSION_MAJOR} From d53f22e2fbcd860622d4f51ab46dc821c17766a7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 31 May 2019 16:30:09 +0200 Subject: [PATCH 0567/1322] Improve qconfig.cpp generation We used to copy a qconfig.cpp.in file verbatim. Add some plumbing to actually compute the strings and their lengths as it is done in qtbase/configure.pri. Also make sure to replace the hardcoded linux mkspec with one that is automatically determined. Of course both the detection of the mkspec, and the hardcoded strings for include, lib, etc. should be fixed in the future. This is a stepping stone to allow building a Qt application using the qmake built by CMake. Change-Id: I2e6754f44b20b09b09d14fd85785d56288e6517b Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 73 +++++++++++++++++++++++++++---- src/corelib/CMakeLists.txt | 2 +- src/corelib/global/qconfig.cpp.in | 44 ++----------------- 3 files changed, 70 insertions(+), 49 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 184cb5e19f9..ff430dd1198 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -64,33 +64,41 @@ SET(CMAKE_INSTALL_RPATH "${_default_install_rpath}" CACHE PATH "RPATH for instal SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) # Platform define path, etc. +set(QT_QMAKE_TARGET_MKSPEC "") if(WIN32) set(QT_DEFAULT_PLATFORM_DEFINITIONS UNICODE _UNICODE WIN32 _ENABLE_EXTENDED_ALIGNED_STORAGE) if(CMAKE_SIZEOF_VOID_P EQUAL 8) list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS WIN64 _WIN64) endif() if(MSVC) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-msvc) + set(QT_QMAKE_TARGET_MKSPEC win32-msvc) elseif(CLANG) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-clang) + set(QT_QMAKE_TARGET_MKSPEC win32-clang) elseif(MINGW) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/win32-g++) + set(QT_QMAKE_TARGET_MKSPEC win32-g++) list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS _WIN32_WINNT=0x0601) endif() elseif(LINUX) if(GCC) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/linux-g++) + set(QT_QMAKE_TARGET_MKSPEC linux-g++) elseif(CLANG) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/linux-clang) + set(QT_QMAKE_TARGET_MKSPEC linux-clang) endif() elseif(ANDROID) if(GCC) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/android-g++) + set(QT_QMAKE_TARGET_MKSPEC android-g++) elseif(CLANG) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/android-clang) + set(QT_QMAKE_TARGET_MKSPEC android-clang) endif() elseif(APPLE) - set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/macx-clang) + set(QT_QMAKE_TARGET_MKSPEC macx-clang) +endif() + +# TODO: Fixme to be correct. +set(QT_QMAKE_HOST_MKSPEC "${QT_QMAKE_TARGET_MKSPEC}") + +if(QT_QMAKE_TARGET_MKSPEC) + set(QT_DEFAULT_PLATFORM_DEFINITION_DIR mkspecs/${QT_QMAKE_TARGET_MKSPEC}) endif() if(NOT DEFINED QT_DEFAULT_PLATFORM_DEFINITIONS) @@ -2081,3 +2089,52 @@ function(qt_process_qlalr input_file_list consuming_target flags) endforeach() endfunction() +macro(qt_add_string_to_qconfig_cpp str) + string(LENGTH "${str}" length) + string(APPEND QT_CONFIG_STRS " \"${str}\\0\"\n") + string(APPEND QT_CONFIG_STR_OFFSETS " ${QT_CONFIG_STR_OFFSET},\n") + math(EXPR QT_CONFIG_STR_OFFSET "${QT_CONFIG_STR_OFFSET}+${length}+1") +endmacro() + +function(qt_generate_qconfig_cpp) + set(QT_CONFIG_STR_OFFSET "0") + set(QT_CONFIG_STR_OFFSETS "") + set(QT_CONFIG_STRS "") + + # Start first part. + qt_add_string_to_qconfig_cpp("doc") + qt_add_string_to_qconfig_cpp("include") + qt_add_string_to_qconfig_cpp("lib") + qt_add_string_to_qconfig_cpp("libexec") + qt_add_string_to_qconfig_cpp("bin") + qt_add_string_to_qconfig_cpp("plugins") + qt_add_string_to_qconfig_cpp("imports") + qt_add_string_to_qconfig_cpp("qml") + qt_add_string_to_qconfig_cpp(".") + qt_add_string_to_qconfig_cpp(".") + qt_add_string_to_qconfig_cpp("translations") + qt_add_string_to_qconfig_cpp("examples") + qt_add_string_to_qconfig_cpp("tests") + + # Save first part. + set(QT_CONFIG_STR_OFFSETS_FIRST "${QT_CONFIG_STR_OFFSETS}") + set(QT_CONFIG_STRS_FIRST "${QT_CONFIG_STRS}") + + # Start second part. + set(QT_CONFIG_STR_OFFSETS "") + set(QT_CONFIG_STRS "") + + qt_add_string_to_qconfig_cpp("") + qt_add_string_to_qconfig_cpp("false") + qt_add_string_to_qconfig_cpp("bin") + qt_add_string_to_qconfig_cpp("lib") + qt_add_string_to_qconfig_cpp(".") + qt_add_string_to_qconfig_cpp("${QT_QMAKE_TARGET_MKSPEC}") + qt_add_string_to_qconfig_cpp("${QT_QMAKE_HOST_MKSPEC}") + + # Save second part. + set(QT_CONFIG_STR_OFFSETS_SECOND "${QT_CONFIG_STR_OFFSETS}") + set(QT_CONFIG_STRS_SECOND "${QT_CONFIG_STRS}") + + configure_file(global/qconfig.cpp.in global/qconfig.cpp @ONLY) +endfunction() diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index f4d5329ee66..611a610fb55 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -250,7 +250,7 @@ else() target_compile_definitions(Core PUBLIC "QT_NAMESPACE=${QT_NAMESPACE}") endif() -configure_file(global/qconfig.cpp.in global/qconfig.cpp) +qt_generate_qconfig_cpp() # Handle QObject: Automoc does not work for this as it would # require to spill internals into users: diff --git a/src/corelib/global/qconfig.cpp.in b/src/corelib/global/qconfig.cpp.in index 6f589b37711..7a5eeb0b048 100644 --- a/src/corelib/global/qconfig.cpp.in +++ b/src/corelib/global/qconfig.cpp.in @@ -7,51 +7,15 @@ static const char qt_configure_ext_prefix_path_str [12+256] = "qt_epfxpath=@CM static const char qt_configure_host_prefix_path_str [12+256] = "qt_hpfxpath=@CMAKE_INSTALL_PREFIX@"; #endif static const short qt_configure_str_offsets[] = { - 0, - 4, - 12, - 16, - 24, - 28, - 36, - 44, - 48, - 50, - 52, - 65, - 74, +@QT_CONFIG_STR_OFFSETS_FIRST@ #ifdef QT_BUILD_QMAKE - 80, - 81, - 87, - 91, - 95, - 97, - 107, +@QT_CONFIG_STR_OFFSETS_SECOND@ #endif }; static const char qt_configure_strs[] = - "doc\0" - "include\0" - "lib\0" - "libexec\0" - "bin\0" - "plugins\0" - "imports\0" - "qml\0" - ".\0" - ".\0" - "translations\0" - "examples\0" - "tests\0" +@QT_CONFIG_STRS_FIRST@ #ifdef QT_BUILD_QMAKE - "\0" - "false\0" - "bin\0" - "lib\0" - ".\0" - "linux-g++\0" - "linux-g++\0" +@QT_CONFIG_STRS_SECOND@ #endif ; #define QT_CONFIGURE_SETTINGS_PATH "etc/xdg" From 3966ab8e9f601a9315f19eea1bf24628664d79d9 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 31 May 2019 16:40:51 +0200 Subject: [PATCH 0568/1322] Add build type (debug) and static vs dynamic to CONFIG in qconfig.pri Also fix the QT_BUILD_SHARED_LIBS usage. While building qtbase, it is assigned later than the call for qt_generate_global_config_pri_file(), so it used always choose static. Make sure to check for BUILD_SHARED_LIBS as well. Change-Id: I66f03e5adacc89646147fc96154bee8002b2b9cc Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ff430dd1198..0db99d07f14 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -341,12 +341,14 @@ function(qt_generate_global_config_pri_file) get_target_property(disabled_features GlobalConfig INTERFACE_QT_DISABLED_PUBLIC_FEATURES) # configure2cmake skips the "static" feature, so emulate it here for qmake support: - if(${QT_BUILD_SHARED_LIBS}) + if(QT_BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) list(APPEND enabled_features shared) list(APPEND disabled_features static) + set(qt_build_config_type "shared") else() list(APPEND enabled_features static) list(APPEND disabled_features shared) + set(qt_build_config_type "static") endif() # configure2cmake skips the "rpath" feature, so emulate it here for qmake support: @@ -359,6 +361,16 @@ function(qt_generate_global_config_pri_file) string (REPLACE ";" " " enabled_features "${enabled_features}") string (REPLACE ";" " " disabled_features "${disabled_features}") + # Add some required CONFIG entries. + set(config_entries "") + if(CMAKE_BUILD_TYPE STREQUAL Debug) + list(APPEND config_entries "debug") + elseif(CMAKE_BUILD_TYPE STREQUAL Release) + list(APPEND config_entries "release") + endif() + list(APPEND config_entries "${qt_build_config_type}") + string (REPLACE ";" " " config_entries "${config_entries}") + file(GENERATE OUTPUT "${qconfig_pri_target_path}" CONTENT @@ -371,6 +383,7 @@ QT_MAJOR_VERSION = ${PROJECT_VERSION_MAJOR} QT_MINOR_VERSION = ${PROJECT_VERSION_MINOR} QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH} CONFIG -= link_prl # we do not create prl files right now +CONFIG += ${config_entries} " ) qt_install(FILES "${qconfig_pri_target_path}" DESTINATION mkspecs) From 4c31ce68d5367a6ec4dd3cf2f55e4b226add876d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 3 Jun 2019 11:06:07 +0200 Subject: [PATCH 0569/1322] Improve finding of sqlite with vcpkg We use qt_find_package(SQLite3 PROVIDED_TARGETS SQLite::SQLite3) which intends to find cmake's FindSQLite3.cmake and expects the existence of the corresponding target. However qt_find_package first tries to call find_package in config mode, which does not interact well with vcpkg's sqlite, where sqlite3-config.cmake is provided to support multi-config targets. So that call will appear to succeed, yet the expected targets are not there of course. Therefore this patch adds a sanity check for the target existence and allows for a fallback to the module mode for find_package, in order to find CMake's FindSQLite3.cmake. Change-Id: I660f26c38369c3504df1c590e9d3a51ff1f65c6c Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 0db99d07f14..fd9cc095729 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1901,6 +1901,24 @@ macro(qt_find_package) set(config_package_arg ${arg_UNPARSED_ARGUMENTS}) list(APPEND config_package_arg "CONFIG;QUIET") find_package(${config_package_arg}) + + # Double check that in config mode the targets become visible. Sometimes + # only the module mode creates the targets. For example with vcpkg, the sqlite + # package provides sqlite3-config.cmake, which offers multi-config targets but + # in their own way. CMake has FindSQLite3.cmake and with the original + # qt_find_package(SQLite3) call it is our intention to use the cmake package + # in module mode. + if (${ARGV0}_FOUND AND arg_PROVIDED_TARGETS) + foreach(expected_target ${arg_PROVIDED_TARGETS}) + if (TARGET ${expected_target}) + set(any_target_found TRUE) + break() + endif() + endforeach() + if(NOT any_target_found) + set(${ARGV0}_FOUND) + endif() + endif() endif() # Ensure the options are back in the original unparsed arguments From 28306fc1ed11c6502e3883bb180ce7eda298b106 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 3 Jun 2019 13:31:19 +0200 Subject: [PATCH 0570/1322] Fix cmake generate step when cross-compilation against Android We have find module wrappers for various system libs that use FindPkgConfig. The _FOUND variable will be set to 1 if pkg-config --exists returned true, but the imported target will not be created when for example the provided library paths or header include paths are outside of the sysroot - a good sanity check by cmake. We require the targets for use though, so therefore we must unset the _FOUND variable if we can't locate the targets. Change-Id: Ia0dea657684a1847148664521265c42585890645 Reviewed-by: Alexandru Croitor --- cmake/FindLibproxy.cmake | 4 ++++ cmake/FindLibsystemd.cmake | 4 ++++ cmake/FindLibudev.cmake | 4 ++++ cmake/FindMtdev.cmake | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/cmake/FindLibproxy.cmake b/cmake/FindLibproxy.cmake index 611a8bd7d56..95d86d1617e 100644 --- a/cmake/FindLibproxy.cmake +++ b/cmake/FindLibproxy.cmake @@ -1,3 +1,7 @@ find_package(PkgConfig) pkg_check_modules(Libproxy libproxy-1.0 IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::Libproxy) + set(Libproxy_FOUND 0) +endif() diff --git a/cmake/FindLibsystemd.cmake b/cmake/FindLibsystemd.cmake index 9c0082fd39a..09c64529329 100644 --- a/cmake/FindLibsystemd.cmake +++ b/cmake/FindLibsystemd.cmake @@ -1,3 +1,7 @@ find_package(PkgConfig) pkg_check_modules(Libsystemd systemd IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::Libsystemd) + set(Libsystemd_FOUND 0) +endif() diff --git a/cmake/FindLibudev.cmake b/cmake/FindLibudev.cmake index 7eeb800e093..637c7c6d88b 100644 --- a/cmake/FindLibudev.cmake +++ b/cmake/FindLibudev.cmake @@ -1,3 +1,7 @@ find_package(PkgConfig) pkg_check_modules(Libudev libudev IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::Libudev) + set(Libudev_FOUND 0) +endif() diff --git a/cmake/FindMtdev.cmake b/cmake/FindMtdev.cmake index 39d98232077..c852a77c1cc 100644 --- a/cmake/FindMtdev.cmake +++ b/cmake/FindMtdev.cmake @@ -1,3 +1,7 @@ find_package(PkgConfig) pkg_check_modules(Mtdev mtdev IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::MtDev) + set(Mtdev_FOUND 0) +endif() From bedb16ca614edcbf45bef57c84ac40509d5b7e5d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 31 May 2019 17:12:50 +0200 Subject: [PATCH 0571/1322] Stop the flood of warnings due to qt_find_package() usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The warning used to be a fatal error, until we found out that certain packages might provide optional targets, or provide one target out of a possible set. Until we figure out a better way to deal with that, remove the barrage of warnings while configuring. Change-Id: Iacf93a997a8f87f81167ac7c4cc991212e7fca5d Reviewed-by: Qt CMake Build Bot Reviewed-by: Jean-Michaël Celerier Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index fd9cc095729..8e86590d331 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1959,10 +1959,6 @@ macro(qt_find_package) set_property(TARGET ${qt_find_package_target_name} PROPERTY IMPORTED_GLOBAL TRUE) endif() - else() - message(AUTHOR_WARNING - "Error while trying to mark target '${qt_find_package_target_name}' as part" - " of the ${ARGV0} package. Provided target name does not exist.") endif() endforeach() From 1080142ec35c2c739c7de3a0fa92c525b74c7da9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 3 Jun 2019 13:43:22 +0200 Subject: [PATCH 0572/1322] Fix Android build Do not set ANDROID_EMBEDDED unconditionally, as that for now is the least likely configuration and it won't compile when the sysroot is real Android. If this gets revived, then it can be done by setting ANDROID_EMBEDDED in the cache file directly via the cmake command line. Change-Id: Ic1e1731f981414bd90b89fe91eaf0543a87d8c88 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtPlatformSupport.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index 45479a3a7ea..20feb1cc4a9 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -28,8 +28,6 @@ set01(APPLE_IOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "ios") # FIXME: set01(APPLE_TVOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "tvos") # FIXME: How to identify this? set01(APPLE_WATCHOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "watchos") # FIXME: How to identify this? -set01(ANDROID_EMBEDDED ANDROID) # FIXME: How to identify this? - set01(GCC CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set01(CLANG CMAKE_CXX_COMPILER_ID MATCHES "Clang") set01(ICC CMAKE_C_COMPILER MATCHES "icc|icl") From f32a6cfb6b6236533508901f114ab57396da8ff3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 3 Jun 2019 13:47:23 +0200 Subject: [PATCH 0573/1322] Fix cmake configure step on Android Now that ANDROID_EMBEDDED is not set by default anymore, we start descending into Android specific sub-directories. This patch generates a stub file but the Java bits still need to be ported. Change-Id: Icbfc3ad2c1ef266980161bca081c7c4275873efd Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- src/plugins/bearer/android/CMakeLists.txt | 5 ++++ src/plugins/bearer/android/src/CMakeLists.txt | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/plugins/bearer/android/CMakeLists.txt create mode 100644 src/plugins/bearer/android/src/CMakeLists.txt diff --git a/src/plugins/bearer/android/CMakeLists.txt b/src/plugins/bearer/android/CMakeLists.txt new file mode 100644 index 00000000000..a5f5393378c --- /dev/null +++ b/src/plugins/bearer/android/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from android.pro. + +add_subdirectory(src) +# TODO: +# add_subdirectory(jar) diff --git a/src/plugins/bearer/android/src/CMakeLists.txt b/src/plugins/bearer/android/src/CMakeLists.txt new file mode 100644 index 00000000000..260e9081707 --- /dev/null +++ b/src/plugins/bearer/android/src/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from src.pro. + +##################################################################### +## qandroidbearer Plugin: +##################################################################### + +add_qt_plugin(qandroidbearer + TYPE bearer + SOURCES + ../../qbearerengine_impl.h + ../../qnetworksession_impl.cpp ../../qnetworksession_impl.h + main.cpp + qandroidbearerengine.cpp qandroidbearerengine.h + wrappers/androidconnectivitymanager.cpp wrappers/androidconnectivitymanager.h + INCLUDE_DIRECTORIES + wrappers + LIBRARIES + Qt::CorePrivate + Qt::NetworkPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Network +) + +#### Keys ignored in scope 1:.:.:src.pro:: +# PLUGIN_CLASS_NAME = "QAndroidBearerEnginePlugin" +# _LOADED = "qt_plugin" From 46effc7319582fb10c5d3fc4737f6e1b2f9c3e8b Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 3 Jun 2019 15:28:52 +0200 Subject: [PATCH 0574/1322] Add some basic instructions for cross-compiling for Android Change-Id: I0113a7b1e4e3b4d2fc7f93f9809d08fcaf4715d7 Reviewed-by: Leander Beernaert Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmake/README.md b/cmake/README.md index 7b38877831a..e7c7ced2271 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -121,6 +121,21 @@ In order to make sure that Qt picks up the code generator tools from the host bu The specified path needs to point to a directory that contains an installed host build of Qt. +### Cross Compiling for Android + +In order to cross-compile Qt to Android, the above instructions apply. In addition, it is necessary to install the Android NDK as well as vcpkg. Vcpkg is needed to supply third-party libraries that Qt requires but that are not part of the Android NDK. + +Vcpkg for Android can be set up using the following steps: + + * ```git clone -b qt https://github.com/tronical/vcpkg``` + * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` + * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``arm-android`` + * Set the ``ANDROID_NDK_HOME`` environment variable to the path where you have installed the Android NDK. + * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` + +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build`` + + # Debugging CMake files CMake allows specifying the ``--trace`` and ``--trace-expand`` options, which work like ``qmake -d -d``: As the cmake code is evaluated, the values of parameters and variables is shown. This can be a lot of output, so you may want to redirect it to a file. From e88864578a881c0a14ef2dc958ee52e2aa036134 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 May 2019 16:19:42 +0200 Subject: [PATCH 0575/1322] Generate the c++xx standard features instead of skipping them The features are reused in qtdeclarative (and maybe somewhere else too), so they should be present. We can still map the conditions to proper CMake compile feature tests. Change-Id: I4d307d29d4d293cc23ab005b195ea346087c7162 Reviewed-by: Tobias Hunger Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- configure.cmake | 39 ++++++++++++++++++++++++++++++- util/cmake/configurejson2cmake.py | 6 ----- util/cmake/helper.py | 5 +++- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/configure.cmake b/configure.cmake index 957d7fb13b0..330c5347c54 100644 --- a/configure.cmake +++ b/configure.cmake @@ -15,6 +15,27 @@ qt_find_package(Libudev PROVIDED_TARGETS PkgConfig::Libudev) #### Tests +# c++2a +qt_config_compile_test(cxx2a + LABEL "C++2a support" +"#if __cplusplus > 201703L +// Compiler claims to support experimental C++2a, trust it +#else +# error __cplusplus must be > 201703L (the value for C++17) +#endif + + +int main(int argc, char **argv) +{ + (void)argc; (void)argv; + /* BEGIN TEST: */ + + /* END TEST: */ + return 0; +} +"# FIXME: qmake: CONFIG += c++11 c++14 c++1z c++2a +) + # precompile_header qt_config_compile_test(precompile_header LABEL "precompiled header support" @@ -245,9 +266,25 @@ qt_feature("framework" PUBLIC qt_feature_definition("framework" "QT_MAC_FRAMEWORK_BUILD") qt_feature("largefile" LABEL "Large file support" - CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT WINRT + CONDITION NOT ANDROID AND NOT INTEGRITY AND NOT WINRT AND NOT rtems ) qt_feature_definition("largefile" "QT_LARGEFILE_SUPPORT" VALUE "64") +qt_feature("cxx11" PUBLIC + LABEL "C++11" +) +qt_feature("cxx14" PUBLIC + LABEL "C++14" + CONDITION QT_FEATURE_cxx11 AND $ +) +qt_feature("cxx1z" PUBLIC + LABEL "C++17" + CONDITION QT_FEATURE_cxx14 AND $ +) +qt_feature("cxx2a" PUBLIC + LABEL "C++2a" + AUTODETECT OFF + CONDITION QT_FEATURE_cxx1z AND TEST_cxx2a +) qt_feature("reduce_exports" PRIVATE LABEL "Reduce amount of exported symbols" CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 148109e2a4b..890d4dfc5fe 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -615,13 +615,7 @@ def parseFeature(ctx, feature, data, cm_fh): 'alloc_malloc_h': None, 'alloc_stdlib_h': None, 'build_all': None, - 'c++11': None, # C and C++ versions 'c11': None, - 'c++14': None, - 'c++1y': None, - 'c++1z': None, - # FIXME: used in qtdeclarative, drop when we require C++14 - 'cxx14_make_unique': None, 'c89': None, 'c99': None, 'ccache': None, diff --git a/util/cmake/helper.py b/util/cmake/helper.py index bb2b239aa04..8f24a49d6bf 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -302,7 +302,10 @@ def find_library_info_for_target(targetName: str) -> typing.Optional[LibraryMapp def featureName(input: str) -> str: - return re.sub(r'[^a-zA-Z0-9_]', '_', input) + replacement_char = '_' + if input.startswith('c++'): + replacement_char = 'x' + return re.sub(r'[^a-zA-Z0-9_]', replacement_char, input) def map_qt_library(lib: str) -> str: From 0a96302dc12a968b3b5551c9d1168cffe5791668 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 29 May 2019 17:39:56 +0200 Subject: [PATCH 0576/1322] More fixes to conversion script while porting qtdeclarative Hardcode a few cases regarding scopes containing "qtConfig(opengl)". These arew few, and contain regular expressions, to just manually check and replace them. Add a new entry to _qt_library_map for handling QmlModels module. Fix Scope.children property to recursively access the .children property on included scopes (instead of just ._children) so that we get the full list of scopes from included children that include other scopes. This is needed for nested .pri files. Fix mapping of "win*" to WIN32. Change-Id: If949a8051f517683e56cda605733719daadb384a Reviewed-by: Simon Hausmann Reviewed-by: Tobias Hunger Reviewed-by: Qt CMake Build Bot --- util/cmake/helper.py | 2 ++ util/cmake/pro2cmake.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 8f24a49d6bf..97397e67ecb 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -132,6 +132,7 @@ _qt_library_map = [ LibraryMapping('qmldebug', 'Qt5', 'Qt::QmlDebug', extra = ['COMPONENTS', 'QmlDebug']), LibraryMapping('qmldevtools', 'Qt5', 'Qt::QmlDevTools', extra = ['COMPONENTS', 'QmlDevTools']), LibraryMapping('qml', 'Qt5', 'Qt::Qml', extra = ['COMPONENTS', 'Qml']), + LibraryMapping('qmlmodels', 'Qt5', 'Qt::QmlModels', extra = ['COMPONENTS', 'QmlModels']), LibraryMapping('qmltest', 'Qt5', 'Qt::QuickTest', extra = ['COMPONENTS', 'QuickTest']), LibraryMapping('qtmultimediaquicktools', 'Qt5', 'Qt::MultimediaQuick', extra = ['COMPONENTS', 'MultimediaQuick']), LibraryMapping('quick3danimation', 'Qt5', 'Qt::3DQuickAnimation', extra = ['COMPONENTS', '3DQuickAnimation']), @@ -325,6 +326,7 @@ def map_qt_library(lib: str) -> str: platform_mapping = { 'win32': 'WIN32', + 'win': 'WIN32', 'unix': 'UNIX', 'darwin': 'APPLE', 'linux': 'LINUX', diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index e2625af2661..b45f0e88054 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -523,7 +523,7 @@ class Scope(object): def children(self) -> typing.List['Scope']: result = list(self._children) for include_scope in self._included_children: - result += include_scope._children + result += include_scope.children return result def dump(self, *, indent: int = 0) -> None: @@ -891,6 +891,13 @@ def parseProFile(file: str, *, debug=False): def map_condition(condition: str) -> str: + # Some hardcoded cases that are too bothersome to generalize. + condition = re.sub(r'^qtConfig\(opengl\(es1\|es2\)\?\)$', + r'QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3', + condition) + condition = re.sub(r'^qtConfig\(opengl\.\*\)$', r'QT_FEATURE_opengl', condition) + condition = re.sub(r'^win\*$', r'win', condition) + condition = re.sub(r'\bif\s*\((.*?)\)', r'\1', condition) condition = re.sub(r'\bisEmpty\s*\((.*?)\)', r'\1_ISEMPTY', condition) condition = re.sub(r'\bcontains\s*\((.*?),\s*"?(.*?)"?\)', From 6686774fdc3da8bd64ad2766e67966b3cabb29b7 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 3 Jun 2019 20:47:37 +0200 Subject: [PATCH 0577/1322] QtConfig.cmake.in: Fix typo This var needs the cmake namespace as prefix. Follow-up commit of c5e2838b642d2a50d951efe7b582d9261d55dfb7 Change-Id: I595306301313b1ff911134776480d28b3194bcf8 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- cmake/QtConfig.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index df6068f9a37..db9ac360b5d 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -28,7 +28,7 @@ foreach(module ${@INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS}) if (@INSTALL_CMAKE_NAMESPACE@_FIND_REQUIRED_${module}) set(_Qt_NOTFOUND_MESSAGE "${_Qt_NOTFOUND_MESSAGE}Failed to find Qt component \"${module}\" config file at \"${_expected_module_location}\"\n") - elseif(NOT Qt_FIND_QUIETLY) + elseif(NOT @INSTALL_CMAKE_NAMESPACE@_FIND_QUIETLY) message(WARNING "Failed to find Qt component \"${module}\" config file at \"${_expected_module_location}\"") endif() From 962ee4ea37f23000bbc342c5d50838abf0bcdb8e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 3 Jun 2019 17:42:43 +0200 Subject: [PATCH 0578/1322] Handle a few more condition types in pro2cmake qtdeclarative has a few conditions that check the gcc version via variables like QT_GCC_MAJOR_VERSION. To handle that, parse the CMake compiler version using qt_parse_version_string() into separate variables like QT_COMPILER_VERSION_MAJOR, QT_COMPILER_VERSION_MINOR and QT_COMPILER_VERSION_PATCH. We can then map the conditions appropriately. Also, handle isEqual(foo, bar), which is equivalent equals(foo,bar). Change-Id: I74575c733b44f1f42451e00038b3f113fd353915 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtPlatformSupport.cmake | 39 +++++++++++++++++++++++++++++++++++ util/cmake/pro2cmake.py | 25 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index 20feb1cc4a9..2468932179b 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -38,3 +38,42 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8) elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) set(QT_32BIT TRUE) endif() + +# Parses a version string like "xx.yy.zz" and sets the major, minor and patch variables. +function(qt_parse_version_string version_string out_var_prefix) + string(REPLACE "." ";" version_list ${version_string}) + list(LENGTH version_list length) + + set(out_var "${out_var_prefix}_MAJOR") + set(value "") + if(length GREATER 0) + list(GET version_list 0 value) + list(REMOVE_AT version_list 0) + endif() + set(${out_var} "${value}" PARENT_SCOPE) + + set(out_var "${out_var_prefix}_MINOR") + set(value "") + if(length GREATER 0) + list(GET version_list 0 value) + set(${out_var} "${value}" PARENT_SCOPE) + list(REMOVE_AT version_list 0) + endif() + set(${out_var} "${value}" PARENT_SCOPE) + + set(out_var "${out_var_prefix}_PATCH") + set(value "") + if(length GREATER 0) + list(GET version_list 0 value) + set(${out_var} "${value}" PARENT_SCOPE) + list(REMOVE_AT version_list 0) + + endif() + set(${out_var} "${value}" PARENT_SCOPE) +endfunction() + +# Set up the separate version components for the compiler version, to allow mapping of qmake +# conditions like 'equals(QT_GCC_MAJOR_VERSION,5)'. +if(CMAKE_CXX_COMPILER_VERSION) + qt_parse_version_string("${CMAKE_CXX_COMPILER_VERSION}" "QT_COMPILER_VERSION") +endif() diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index b45f0e88054..dfe407da6d0 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -898,12 +898,37 @@ def map_condition(condition: str) -> str: condition = re.sub(r'^qtConfig\(opengl\.\*\)$', r'QT_FEATURE_opengl', condition) condition = re.sub(r'^win\*$', r'win', condition) + def gcc_version_handler(match_obj: re.Match): + operator = match_obj.group(1) + version_type = match_obj.group(2) + if operator == 'equals': + operator = 'STREQUAL' + elif operator == 'greaterThan': + operator = 'STRGREATER' + elif operator == 'lessThan': + operator = 'STRLESS' + + version = match_obj.group(3) + return '(QT_COMPILER_VERSION_{} {} {})'.format(version_type, operator, version) + + # TODO: Possibly fix for other compilers. + pattern = r'(equals|greaterThan|lessThan)\(QT_GCC_([A-Z]+)_VERSION,[ ]*([0-9]+)\)' + condition = re.sub(pattern, gcc_version_handler, condition) + + # TODO: the current if(...) replacement makes the parentheses + # unbalanced when there are nested expressions. + # Need to fix this either with pypi regex recursive regexps, + # using pyparsing, or some other proper means of handling + # balanced parentheses. condition = re.sub(r'\bif\s*\((.*?)\)', r'\1', condition) + condition = re.sub(r'\bisEmpty\s*\((.*?)\)', r'\1_ISEMPTY', condition) condition = re.sub(r'\bcontains\s*\((.*?),\s*"?(.*?)"?\)', r'\1___contains___\2', condition) condition = re.sub(r'\bequals\s*\((.*?),\s*"?(.*?)"?\)', r'\1___equals___\2', condition) + condition = re.sub(r'\bisEqual\s*\((.*?),\s*"?(.*?)"?\)', + r'\1___equals___\2', condition) condition = re.sub(r'\s*==\s*', '___STREQUAL___', condition) condition = re.sub(r'\bexists\s*\((.*?)\)', r'EXISTS \1', condition) From 5715ef13d217b087b87162fef86b0abc561177aa Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 3 Jun 2019 17:41:45 +0200 Subject: [PATCH 0579/1322] Add private define _USE_MATH_DEFINES on Windows for every module It's needed when building QtQml on Windows, otherwise compilation fails. Add it as a private define for every module being built, as it is done in qt_module.prf. Change-Id: I1e322d1da15adea8b3f037a722b3260a552dfb62 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8e86590d331..ed6dba2daef 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1057,6 +1057,12 @@ function(add_qt_module target) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) + if(WIN32) + # Needed for M_PI define. Same as mkspecs/features/qt_module.prf. + # It's set for every module being built, but it's not propagated to user apps. + target_compile_definitions("${target}" PRIVATE _USE_MATH_DEFINES) + endif() + set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") qt_feature_module_begin( From 9e6781b69e19f66cb56b1875c583da4682909a85 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 09:19:17 +0200 Subject: [PATCH 0580/1322] cmake: Fix xcb build Need qt_find_package(X11_XCB) in src/gui/configure.cmake since we're using it in the file qt_feature("xcb_xlib" PRIVATE LABEL "XCB Xlib" CONDITION QT_FEATURE_xlib AND X11_XCB_FOUND ) Need qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) in src/plugins/platforms/xcb/CMakeLists.tx since we're using it in the file extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender PUBLIC_LIBRARIES PkgConfig::xrender ) Use capital XRender in pkgconfig to be more consistent on how XRender is called everywhere else Change-Id: I403ead2cc123b08f741c5142f20db88987657ba8 Reviewed-by: Alexandru Croitor Reviewed-by: Simon Hausmann --- cmake/FindXRender.cmake | 6 +++++- src/gui/CMakeLists.txt | 2 ++ src/gui/configure.cmake | 2 +- src/plugins/platforms/xcb/CMakeLists.txt | 4 +++- util/cmake/helper.py | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake/FindXRender.cmake b/cmake/FindXRender.cmake index f9b8b266c98..9f2e341208c 100644 --- a/cmake/FindXRender.cmake +++ b/cmake/FindXRender.cmake @@ -1,5 +1,9 @@ include(FindPkgConfig) -if(NOT TARGET PkgConfig::xrender) +if(NOT TARGET PkgConfig::XRender) pkg_check_modules(XRender xrender IMPORTED_TARGET) + + if (NOT TARGET PkgConfig::XRender) + set(XRender_FOUND 0) + endif() endif() diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index f8793256b92..b3f5a880b15 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -7,6 +7,8 @@ set(OpenGL_GL_PREFERENCE GLVND) # special case: ##################################################################### # special case begin +qt_find_package(X11_XCB) + if (QT_FEATURE_gui) if (WINRT) set(_default_platform "winrt") diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 2aa73cbefe6..71c3bb15c10 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -100,7 +100,7 @@ if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(XKB 0.4.1 PROVIDED_TARGETS XKB::XKB) endif() if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) - qt_find_package(XRender PROVIDED_TARGETS PkgConfig::xrender) + qt_find_package(XRender PROVIDED_TARGETS PkgConfig::XRender) endif() diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 77fda139cf5..2d5dbbef1dc 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -8,6 +8,7 @@ qt_find_package(XKB) qt_find_package(PkgConfig) qt_find_package(WrapFreetype) qt_find_package(GLIB2) +qt_find_package(XRender PROVIDED_TARGETS PkgConfig::XRender) pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) # special case # end special case: @@ -118,6 +119,7 @@ extend_target(XcbQpa CONDITION QT_FEATURE_draganddrop extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xlib PUBLIC_LIBRARIES X11::XCB + X11::X11 # special case ) extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xinput @@ -160,7 +162,7 @@ extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender PUBLIC_LIBRARIES - PkgConfig::xrender + PkgConfig::XRender ) extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_painting diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 97397e67ecb..60128a8b03f 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -249,7 +249,7 @@ _library_map = [ LibraryMapping('xkbcommon_x11', 'XKB', 'XKB::XKB', extra = ['0.4.1']), # see also xkbcommon LibraryMapping('xkbcommon', 'XKB', 'XKB::XKB', extra = ['0.4.1']), LibraryMapping('xlib', 'X11', 'X11::XCB'), # FIXME: Is this correct? - LibraryMapping('xrender', 'XRender', 'PkgConfig::xrender'), + LibraryMapping('xrender', 'XRender', 'PkgConfig::XRender'), LibraryMapping('zlib', 'ZLIB', 'ZLIB::ZLIB', extra=['REQUIRED']), LibraryMapping('zstd', 'ZSTD', 'ZSTD::ZSTD'), LibraryMapping('tiff', 'TIFF', 'TIFF::TIFF'), From 0900298d466e819dd6d8fd39c0be333dc09af189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 3 May 2019 16:03:15 +0200 Subject: [PATCH 0581/1322] cmake: register plug-ins, create dependencies file This commit introduces infrastructure work to allow static builds of Qt to handle importing of plug-ins. Change-Id: Ife0ca3ca7276ea8ec96fe0eb6adf934fad7620ec Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 158 +++++++-- cmake/QtFeature.cmake | 5 +- cmake/QtModuleConfig.cmake.in | 6 +- cmake/QtModuleDependencies.cmake.in | 1 + cmake/QtPluginConfig.cmake.in | 13 + cmake/QtPluginDependencies.cmake.in | 53 +++ cmake/QtPostProcess.cmake | 362 ++++++++++++-------- cmake/QtProperties.cmake | 8 + src/gui/CMakeLists.txt | 10 + src/plugins/imageformats/ico/CMakeLists.txt | 2 + src/sql/CMakeLists.txt | 2 + util/cmake/pro2cmake.py | 21 +- 12 files changed, 463 insertions(+), 178 deletions(-) create mode 100644 cmake/QtPluginConfig.cmake.in create mode 100644 cmake/QtPluginDependencies.cmake.in create mode 100644 cmake/QtProperties.cmake diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ed6dba2daef..20b7c5bec84 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -119,9 +119,13 @@ endif() macro(qt_internal_set_qt_known_modules) set(QT_KNOWN_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) endmacro() +macro(qt_internal_set_qt_known_plugins) + set(QT_KNOWN_PLUGINS ${ARGN} CACHE INTERNAL "Known Qt plugins" FORCE) +endmacro() # Reset: qt_internal_set_qt_known_modules("") +qt_internal_set_qt_known_plugins("") set(QT_KNOWN_MODULES_WITH_TOOLS "" CACHE INTERNAL "Known Qt modules with tools" FORCE) macro(qt_internal_append_known_modules_with_tools module) @@ -652,7 +656,8 @@ function(qt_internal_module_info result target) endfunction() -set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS;DISABLE_AUTOGEN_TOOLS;ENABLE_AUTOGEN_TOOLS") +set(__default_private_args "SOURCES;LIBRARIES;INCLUDE_DIRECTORIES;DEFINES;DBUS_ADAPTOR_BASENAME;DBUS_ADAPTOR_FLAGS;DBUS_ADAPTOR_SOURCES;DBUS_INTERFACE_BASENAME;DBUS_INTERFACE_FLAGS;DBUS_INTERFACE_SOURCES;FEATURE_DEPENDENCIES;COMPILE_OPTIONS;LINK_OPTIONS;MOC_OPTIONS;DISABLE_AUTOGEN_TOOLS;ENABLE_AUTOGEN_TOOLS;PLUGIN_TYPES") + set(__default_public_args "PUBLIC_LIBRARIES;PUBLIC_INCLUDE_DIRECTORIES;PUBLIC_DEFINES;PUBLIC_COMPILE_OPTIONS;PUBLIC_LINK_OPTIONS") @@ -715,6 +720,32 @@ function(qt_autogen_tools target) endif() endfunction() +# This function stores the list of Qt modules a library depend on, +# along with their version info, for usage in ${target}Depends.cmake file +function(qt_register_target_dependencies target public_libs private_libs) + get_target_property(target_deps "${target}" _qt_target_deps) + if(NOT target_deps) + set(target_deps "") + endif() + + # TODO: should this also be in extend_target ? From the looks of it I would say that + # it is not necessary but I'm not sure + foreach(lib IN LISTS public_libs private_libs) + if ("${lib}" MATCHES "^Qt::(.*)") + set(lib "${CMAKE_MATCH_1}") + if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig) + list(APPEND target_deps "Qt5\;${PROJECT_VERSION}") + elseif ("${lib}" MATCHES "(.*)Private") + list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${CMAKE_MATCH_1}\;${PROJECT_VERSION}") + else() + list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${lib}\;${PROJECT_VERSION}") + endif() + endif() + endforeach() + + set_target_properties("${target}" PROPERTIES _qt_target_deps "${target_deps}") +endfunction() + # This function can be used to add sources/libraries/etc. to the specified CMake target # if the provided CONDITION evaluates to true. function(extend_target target) @@ -1003,6 +1034,11 @@ function(add_qt_module target) set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") endif() + # Plugin types associated to a module + if(NOT "x${arg_PLUGIN_TYPES}" STREQUAL "x") + set_target_properties("${target}" PROPERTIES MODULE_PLUGIN_TYPES "${arg_PLUGIN_TYPES}") + endif() + set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}" RUNTIME_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}" @@ -1121,15 +1157,15 @@ function(add_qt_module target) list(APPEND extra_cmake_includes "${INSTALL_CMAKE_NAMESPACE}${target}ConfigExtras.cmake") endif() - set(extra_cmake_code "") + set(extra_cmake_code "") - if(target STREQUAL Core) - # Propagate non-build related variables that are needed for consuming Qt packages. - # Do this in CoreConfig instead of Qt5Config, so that consumers can also use - # find_package(Qt5Core) instead of find_package(Qt5 COMPONENTS Core) - string(APPEND extra_cmake_code " + if(target STREQUAL Core) + # Propagate non-build related variables that are needed for consuming Qt packages. + # Do this in CoreConfig instead of Qt5Config, so that consumers can also use + # find_package(Qt5Core) instead of find_package(Qt5 COMPONENTS Core) + string(APPEND extra_cmake_code " set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") - endif() + endif() configure_package_config_file( "${QT_CMAKE_DIR}/QtModuleConfig.cmake.in" @@ -1137,7 +1173,7 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") INSTALL_DESTINATION "${config_install_dir}" ) write_basic_package_version_file( - ${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) @@ -1198,27 +1234,7 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") $ ) - get_target_property(target_deps "${target}" _qt_target_deps) - if(NOT target_deps) - set(target_deps "") - endif() - - # TODO: should this also be in extend_target ? From the looks of it I would say that - # it is not necessary but I'm not sure - foreach(lib IN LISTS arg_PUBLIC_LIBRARIES qt_libs_private) - if ("${lib}" MATCHES "^Qt::(.*)") - set(lib "${CMAKE_MATCH_1}") - if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig) - list(APPEND target_deps "Qt5\;${PROJECT_VERSION}") - elseif ("${lib}" MATCHES "(.*)Private") - list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${CMAKE_MATCH_1}\;${PROJECT_VERSION}") - else() - list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${lib}\;${PROJECT_VERSION}") - endif() - endif() - endforeach() - - set_target_properties("${target}" PROPERTIES _qt_target_deps "${target_deps}") + qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}") if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) @@ -1299,18 +1315,41 @@ function(qt_internal_check_directory_or_type name dir type default result_var) endif() endfunction() +# Utility function to find the module to which a plug-in belongs. +# This will set the QT_MODULE target property on the plug-in - e.g. "Gui", "Sql"... +function(qt_get_module_for_plugin target target_type) + foreach(qt_module ${QT_KNOWN_MODULES}) + get_target_property(plugin_types "${qt_module}" MODULE_PLUGIN_TYPES) + if(plugin_types) + foreach(plugin_type ${plugin_types}) + if("${target_type}" STREQUAL "${plugin_type}") + set_target_properties("${target}" PROPERTIES QT_MODULE "${qt_module}") + return() + endif() + endforeach() + endif() + endforeach() + message(AUTHOR_WARNING "The plug-in '${target}' does not belong to any Qt module.") +endfunction() + # This is the main entry point for defining Qt plugins. # A CMake target is created with the given target. The TYPE parameter is needed to place the # plugin into the correct plugins/ sub-directory. function(add_qt_plugin target) qt_internal_module_info(module "${target}") + qt_internal_set_qt_known_plugins("${QT_KNOWN_PLUGINS}" "${target}") + qt_parse_all_arguments(arg "add_qt_plugin" "STATIC" - "TYPE;OUTPUT_DIRECTORY;INSTALL_DIRECTORY;ARCHIVE_INSTALL_DIRECTORY" + "TYPE;CLASS_NAME;OUTPUT_DIRECTORY;INSTALL_DIRECTORY;ARCHIVE_INSTALL_DIRECTORY" "${__default_private_args};${__default_public_args}" ${ARGN}) set(output_directory_default "${QT_BUILD_DIR}/${INSTALL_PLUGINSDIR}/${arg_TYPE}") + if ("x${arg_CLASS_NAME}" STREQUAL x) + message(AUTHOR_WARNING "add_qt_plugin called without setting CLASS_NAME.") + endif() + qt_internal_check_directory_or_type(OUTPUT_DIRECTORY "${arg_OUTPUT_DIRECTORY}" "${arg_TYPE}" "${output_directory_default}" output_directory) qt_internal_check_directory_or_type(INSTALL_DIRECTORY "${arg_INSTALL_DIRECTORY}" "${arg_TYPE}" @@ -1329,7 +1368,8 @@ function(add_qt_plugin target) set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${output_directory}" RUNTIME_OUTPUT_DIRECTORY "${output_directory}" - ARCHIVE_OUTPUT_DIRECTORY "${output_directory}") + ARCHIVE_OUTPUT_DIRECTORY "${output_directory}" + QT_PLUGIN_CLASS_NAME "${arg_CLASS_NAME}") qt_internal_library_deprecation_level(deprecation_define) @@ -1340,6 +1380,15 @@ function(add_qt_plugin target) set(static_plugin_define "QT_STATICPLUGIN") endif() + # Save the Qt module in the plug-in's properties + qt_get_module_for_plugin("${target}" "${arg_TYPE}") + get_target_property(qt_module "${target}" QT_MODULE) + + # Add the plug-in to the list of plug-ins of this module + if(TARGET "${qt_module}") + set_property(TARGET "${qt_module}" APPEND PROPERTY QT_PLUGINS "${target}") + endif() + extend_target("${target}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES @@ -1379,14 +1428,55 @@ function(add_qt_plugin target) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) + set(qt_libs_private "") + foreach(it ${QT_KNOWN_MODULES}) + list(FIND arg_LIBRARIES "Qt::${it}Private" pos) + if(pos GREATER -1) + list(APPEND qt_libs_private "Qt::${it}Private") + endif() + endforeach() + + qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}") + + # Handle creation of cmake files for consumers of find_package(). + # If we are part of a Qt module, the plugin cmake files are installed as part of that module. + if(qt_module) + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${qt_module}") + else() + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") + endif() + + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + + configure_package_config_file( + "${QT_CMAKE_DIR}/QtPluginConfig.cmake.in" + "${config_build_dir}/${target}Config.cmake" + INSTALL_DESTINATION "${config_install_dir}" + ) + write_basic_package_version_file( + "${config_build_dir}/${target}ConfigVersion.cmake" + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + qt_install(FILES + "${config_build_dir}/${target}Config.cmake" + "${config_build_dir}/${target}ConfigVersion.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + set(export_name "${target}Targets") qt_install(TARGETS "${target}" EXPORT ${export_name} LIBRARY DESTINATION "${install_directory}" - ARCHIVE DESTINATION "${archive_install_directory}") + ARCHIVE DESTINATION "${archive_install_directory}" + ) qt_install(EXPORT ${export_name} NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}:: - DESTINATION ${QT_CONFIG_INSTALL_DIR}) + DESTINATION "${config_install_dir}" + ) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index d11a7117880..c7e47647511 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -506,8 +506,8 @@ function(qt_config_compile_test_x86simd extension label) endfunction() function(qt_make_features_available target) - if(NOT "${target}" MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-z][a-zA-Z0-9_]*$") - message(FATAL_ERROR "${target} does not match ${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-z][a-zA-Z0-9_]*. INVALID NAME.") + if(NOT "${target}" MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-z][a-zA-Z0-9_-]*$") + message(FATAL_ERROR "${target} does not match ${QT_CMAKE_EXPORT_NAMESPACE}::[a-zA-z][a-zA-Z0-9_-]*. INVALID NAME.") endif() if(NOT TARGET ${target}) message(FATAL_ERROR "${target} not found.") @@ -537,3 +537,4 @@ function(qt_make_features_available target) endforeach() endfunction() + diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 6a68fdf3b0f..7c6c6545ded 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -17,7 +17,6 @@ endif() include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake") - foreach(extra_cmake_include @extra_cmake_includes@) include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}") endforeach() @@ -25,3 +24,8 @@ endforeach() include(${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/QtFeature.cmake) qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@) + +set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" TRUE) +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake") +endif() diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index 714d2b91ec0..f94ba22d9e6 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -3,6 +3,7 @@ set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@") list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/extra-cmake-modules/find-modules") +list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/kwin") # note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" set(_third_party_deps "@third_party_deps@") diff --git a/cmake/QtPluginConfig.cmake.in b/cmake/QtPluginConfig.cmake.in new file mode 100644 index 00000000000..b212d087644 --- /dev/null +++ b/cmake/QtPluginConfig.cmake.in @@ -0,0 +1,13 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) + +get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_import_prefix "${_import_prefix}" REALPATH) + +# Find required dependencies, if any. +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@target@Dependencies.cmake") +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/@target@Targets.cmake") diff --git a/cmake/QtPluginDependencies.cmake.in b/cmake/QtPluginDependencies.cmake.in new file mode 100644 index 00000000000..0b0db32ca13 --- /dev/null +++ b/cmake/QtPluginDependencies.cmake.in @@ -0,0 +1,53 @@ +# Save old module path, and append a new path that points to the copied over Find modules +# so that find_dependency() can find the third party packages. +set(old_CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}") +list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@") +list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/extra-cmake-modules/find-modules") +list(APPEND CMAKE_MODULE_PATH "${_import_prefix}/../@INSTALL_CMAKE_NAMESPACE@/3rdparty/kwin") + +# note: _third_party_deps example: "ICU\\;1.0\\;i18n uc data;ZLIB\\;\\;" +set(_third_party_deps "@third_party_deps@") + +foreach(_target_dep ${_third_party_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + list(GET _target_dep 2 components) + set(find_package_args "${pkg}") + if(version) + list(APPEND find_package_args "${version}") + endif() + + if(components) + list(APPEND find_package_args "COMPONENTS" ${components}) + endif() + + if (NOT ${pkg}_FOUND) + find_dependency(${find_package_args}) + endif() + + if (NOT ${pkg}_FOUND) + set(@target@_FOUND FALSE) + return() + endif() +endforeach() + +# Restore old module path. +set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") + +# note: target_deps example: "Qt5Core\;5.12.0;Qt5Gui\;5.12.0" +set(_target_deps "@target_deps@") +foreach(_target_dep ${_target_deps}) + list(GET _target_dep 0 pkg) + list(GET _target_dep 1 version) + + if (NOT ${pkg}_FOUND) + find_dependency(${pkg} ${version} + PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH + ) + endif() + + if (NOT ${pkg}_FOUND) + set(@target@_FOUND FALSE) + return() + endif() +endforeach() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 32612842187..d619aebdadb 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -12,157 +12,248 @@ function(qt_internal_write_depends_file target) file(GENERATE OUTPUT "${outfile}" CONTENT "${contents}") endfunction() -function(qt_internal_create_depends_files) - message("Generating depends files for ${QT_KNOWN_MODULES}...") - foreach (target ${QT_KNOWN_MODULES}) - get_target_property(depends "${target}" LINK_LIBRARIES) - get_target_property(public_depends "${target}" INTERFACE_LINK_LIBRARIES) - get_target_property(target_deps "${target}" _qt_target_deps) - set(target_deps_seen "") +macro(qt_collect_third_party_deps) + # If we are doing a non-static Qt build, we only want to propagate public dependencies. + # If we are doing a static Qt build, we need to propagate all dependencies. + set(depends_var "public_depends") + if(NOT QT_BUILD_SHARED_LIBS) + set(depends_var "depends") + endif() - set(qtdeps "") - set(third_party_deps "") - set(third_party_deps_seen "") - set(tool_deps "") - set(tool_deps_seen "") - set(main_module_tool_deps "") + foreach(dep ${${depends_var}}) + # Gather third party packages that should be found when using the Qt module. + # Also handle nolink target dependencies. + string(REGEX REPLACE "_nolink$" "" base_dep "${dep}") + if(NOT base_dep STREQUAL dep) + # Resets target name like Vulkan_nolink to Vulkan, because we need to call + # find_package(Vulkan). + set(dep ${base_dep}) + endif() - foreach (dep ${depends}) - # Normalize module by stripping leading "Qt::" and trailing "Private" - if (dep MATCHES "Qt::(.*)") - set(dep "${CMAKE_MATCH_1}") - endif() - if (dep MATCHES "(.*)Private") - set(dep "${CMAKE_MATCH_1}") - endif() + if(TARGET ${dep}) + list(FIND third_party_deps_seen ${dep} dep_seen) - list(FIND QT_KNOWN_MODULES "${dep}" _pos) - if (_pos GREATER -1) - list(APPEND qtdeps "${dep}") - - # Make the ModuleTool package depend on dep's ModuleTool package. - list(FIND tool_deps_seen ${dep} dep_seen) - if(dep_seen EQUAL -1 AND ${dep} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) - list(APPEND tool_deps_seen ${dep}) - list(APPEND tool_deps - "${INSTALL_CMAKE_NAMESPACE}${dep}Tools\;${PROJECT_VERSION}") + get_target_property(package_name ${dep} INTERFACE_QT_PACKAGE_NAME) + if(dep_seen EQUAL -1 AND package_name) + list(APPEND third_party_deps_seen ${dep}) + get_target_property(package_version ${dep} INTERFACE_QT_PACKAGE_VERSION) + if(NOT package_version) + set(package_version "") endif() - endif() - endforeach() - # If we are doing a non-static Qt build, we only want to propagate public dependencies. - # If we are doing a static Qt build, we need to propagate all dependencies. - set(depends_var "public_depends") - if(NOT QT_BUILD_SHARED_LIBS) - set(depends_var "depends") - endif() - - foreach(dep ${${depends_var}}) - # Gather third party packages that should be found when using the Qt module. - # Also handle nolink target dependencies. - string(REGEX REPLACE "_nolink$" "" base_dep "${dep}") - if(NOT base_dep STREQUAL dep) - # Resets target name like Vulkan_nolink to Vulkan, because we need to call - # find_package(Vulkan). - set(dep ${base_dep}) - endif() - - if(TARGET ${dep}) - list(FIND third_party_deps_seen ${dep} dep_seen) - - get_target_property(package_name ${dep} INTERFACE_QT_PACKAGE_NAME) - if(dep_seen EQUAL -1 AND package_name) - list(APPEND third_party_deps_seen ${dep}) - get_target_property(package_version ${dep} INTERFACE_QT_PACKAGE_VERSION) - if(NOT package_version) - set(package_version "") - endif() - - get_target_property(package_components ${dep} INTERFACE_QT_PACKAGE_COMPONENTS) - if(NOT package_components) - set(package_components "") - endif() - - list(APPEND third_party_deps - "${package_name}\;${package_version}\;${package_components}") + get_target_property(package_components ${dep} INTERFACE_QT_PACKAGE_COMPONENTS) + if(NOT package_components) + set(package_components "") endif() + + list(APPEND third_party_deps + "${package_name}\;${package_version}\;${package_components}") endif() - endforeach() + endif() + endforeach() +endmacro() - # Add dependency to the main ModuleTool package to ModuleDependencies file. - if(${target} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) - set(main_module_tool_deps - "${INSTALL_CMAKE_NAMESPACE}${target}Tools\;${PROJECT_VERSION}") +function(qt_internal_create_module_depends_file target) + get_target_property(depends "${target}" LINK_LIBRARIES) + get_target_property(public_depends "${target}" INTERFACE_LINK_LIBRARIES) + get_target_property(target_deps "${target}" _qt_target_deps) + set(target_deps_seen "") + + set(qtdeps "") + set(third_party_deps "") + set(third_party_deps_seen "") + set(tool_deps "") + set(tool_deps_seen "") + set(main_module_tool_deps "") + + foreach (dep ${depends}) + # Normalize module by stripping leading "Qt::" and trailing "Private" + if (dep MATCHES "Qt::(.*)") + set(dep "${CMAKE_MATCH_1}") + endif() + if (dep MATCHES "(.*)Private") + set(dep "${CMAKE_MATCH_1}") endif() - # Dirty hack because https://gitlab.kitware.com/cmake/cmake/issues/19200 - foreach(dep ${target_deps}) - if(dep) - list(FIND target_deps_seen "${dep}" dep_seen) - if(dep_seen EQUAL -1) - list(LENGTH dep len) - if(NOT (len EQUAL 2)) - message(FATAL_ERROR "List '${dep}' should look like QtFoo;version") - endif() - list(GET dep 0 dep_name) - list(GET dep 1 dep_ver) + list(FIND QT_KNOWN_MODULES "${dep}" _pos) + if (_pos GREATER -1) + list(APPEND qtdeps "${dep}") - list(APPEND target_deps_seen "${dep_name}\;${dep_ver}") - endif() + # Make the ModuleTool package depend on dep's ModuleTool package. + list(FIND tool_deps_seen ${dep} dep_seen) + if(dep_seen EQUAL -1 AND ${dep} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + list(APPEND tool_deps_seen ${dep}) + list(APPEND tool_deps + "${INSTALL_CMAKE_NAMESPACE}${dep}Tools\;${PROJECT_VERSION}") endif() - endforeach() - set(target_deps "${target_deps_seen}") - - if (DEFINED qtdeps) - list(REMOVE_DUPLICATES qtdeps) - endif() - - get_target_property(hasModuleHeaders "${target}" MODULE_HAS_HEADERS) - if (${hasModuleHeaders}) - qt_internal_write_depends_file("${target}" ${qtdeps}) - endif() - - if(third_party_deps OR main_module_tool_deps OR target_deps) - set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") - qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) - qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) - - # Configure and install ModuleDependencies file. - configure_file( - "${QT_CMAKE_DIR}/QtModuleDependencies.cmake.in" - "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" - @ONLY - ) - - qt_install(FILES - "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" - DESTINATION "${config_install_dir}" - COMPONENT Devel - ) - - endif() - if(tool_deps) - set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}Tools") - qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) - qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) - - # Configure and install ModuleToolDependencies file. - configure_file( - "${QT_CMAKE_DIR}/QtModuleToolsDependencies.cmake.in" - "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" - @ONLY - ) - - qt_install(FILES - "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" - DESTINATION "${config_install_dir}" - COMPONENT Devel - ) - endif() endforeach() + qt_collect_third_party_deps() + # Add dependency to the main ModuleTool package to ModuleDependencies file. + if(${target} IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + set(main_module_tool_deps + "${INSTALL_CMAKE_NAMESPACE}${target}Tools\;${PROJECT_VERSION}") + endif() + + # Dirty hack because https://gitlab.kitware.com/cmake/cmake/issues/19200 + foreach(dep ${target_deps}) + if(dep) + list(FIND target_deps_seen "${dep}" dep_seen) + if(dep_seen EQUAL -1) + list(LENGTH dep len) + if(NOT (len EQUAL 2)) + message(FATAL_ERROR "List '${dep}' should look like QtFoo;version") + endif() + list(GET dep 0 dep_name) + list(GET dep 1 dep_ver) + + list(APPEND target_deps_seen "${dep_name}\;${dep_ver}") + endif() + endif() + endforeach() + set(target_deps "${target_deps_seen}") + + if (DEFINED qtdeps) + list(REMOVE_DUPLICATES qtdeps) + endif() + + get_target_property(hasModuleHeaders "${target}" MODULE_HAS_HEADERS) + if (${hasModuleHeaders}) + qt_internal_write_depends_file("${target}" ${qtdeps}) + endif() + + if(third_party_deps OR main_module_tool_deps OR target_deps) + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + + # Configure and install ModuleDependencies file. + configure_file( + "${QT_CMAKE_DIR}/QtModuleDependencies.cmake.in" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" + @ONLY + ) + + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Dependencies.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + + endif() + if(tool_deps) + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}Tools") + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + + # Configure and install ModuleToolDependencies file. + configure_file( + "${QT_CMAKE_DIR}/QtModuleToolsDependencies.cmake.in" + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" + @ONLY + ) + + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}ToolsDependencies.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + + endif() +endfunction() + +function(qt_internal_create_plugin_depends_file target) + get_target_property(qt_module "${target}" QT_MODULE) + get_target_property(target_deps "${target}" _qt_target_deps) + set(target_deps_seen "") + + qt_collect_third_party_deps() + + # Dirty hack because https://gitlab.kitware.com/cmake/cmake/issues/19200 + foreach(dep ${target_deps}) + if(dep) + list(FIND target_deps_seen "${dep}" dep_seen) + if(dep_seen EQUAL -1) + list(LENGTH dep len) + if(NOT (len EQUAL 2)) + message(FATAL_ERROR "List '${dep}' should look like QtFoo;version") + endif() + list(GET dep 0 dep_name) + list(GET dep 1 dep_ver) + + list(APPEND target_deps_seen "${dep_name}\;${dep_ver}") + endif() + endif() + endforeach() + set(target_deps "${target_deps_seen}") + + if(third_party_deps OR target_deps) + # Setup build and install paths + if(qt_module) + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${qt_module}") + else() + set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}") + endif() + + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix}) + + # Configure and install ModuleDependencies file. + configure_file( + "${QT_CMAKE_DIR}/QtPluginDependencies.cmake.in" + "${config_build_dir}/${target}Dependencies.cmake" + @ONLY + ) + + qt_install(FILES + "${config_build_dir}/${target}Dependencies.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + endif() +endfunction() + +# Create Depends.cmake & Depends.h files for all modules and plug-ins. +function(qt_internal_create_depends_files) + message("Generating depends files for ${QT_KNOWN_MODULES}...") + foreach (target ${QT_KNOWN_MODULES}) + qt_internal_create_module_depends_file(${target}) + endforeach() + + message("Generating depends files for ${QT_KNOWN_PLUGINS}...") + foreach (target ${QT_KNOWN_PLUGINS}) + qt_internal_create_plugin_depends_file(${target}) + endforeach() +endfunction() + +# This function creates the QtPlugins.cmake used to list all +# the plug-in target files. +function(qt_internal_create_plugins_files) + message("Generating Plugins files for ${QT_KNOWN_MODULES}...") + foreach (target ${QT_KNOWN_MODULES}) + qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${INSTALL_CMAKE_NAMESPACE}${target}) + qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${INSTALL_CMAKE_NAMESPACE}${target}) + + set(_plugins_file "") + get_target_property(qt_plugins "${target}" QT_PLUGINS) + if(qt_plugins) + foreach (plugin ${qt_plugins}) + set(_plugins_file "${_plugins_file}include(\"\${CMAKE_CURRENT_LIST_DIR}/${plugin}Config.cmake\")\n") + endforeach() + + if(NOT ("x${_plugins_file}" STREQUAL "x")) + file(WRITE "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Plugins.cmake" "${_plugins_file}") + + qt_install(FILES + "${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Plugins.cmake" + DESTINATION "${config_install_dir}" + COMPONENT Devel + ) + endif() + endif() + endforeach() endfunction() function(qt_generate_build_internals_extra_cmake_code) @@ -203,3 +294,4 @@ endfunction() qt_internal_create_depends_files() qt_generate_build_internals_extra_cmake_code() +qt_internal_create_plugins_files() diff --git a/cmake/QtProperties.cmake b/cmake/QtProperties.cmake new file mode 100644 index 00000000000..f2bb2c5c592 --- /dev/null +++ b/cmake/QtProperties.cmake @@ -0,0 +1,8 @@ +define_property(TARGET + PROPERTY + QT_PLUGIN_CLASS_NAME + BRIEF_DOCS + "Class name of the Qt plug-in" + FULL_DOCS + "For instance, QICOPlugin for the qico plug-in" +) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b3f5a880b15..50e966d34dc 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -39,6 +39,16 @@ endif() # special case end add_qt_module(Gui + PLUGIN_TYPES + platforms + platforms/darwin + xcbglintegrations + platformthemes + platforminputcontexts + generic + iconengines + imageformats + egldeviceintegrations FEATURE_DEPENDENCIES # special case: Qt::Network # special case: SOURCES diff --git a/src/plugins/imageformats/ico/CMakeLists.txt b/src/plugins/imageformats/ico/CMakeLists.txt index 160b440dfff..976ab982663 100644 --- a/src/plugins/imageformats/ico/CMakeLists.txt +++ b/src/plugins/imageformats/ico/CMakeLists.txt @@ -13,6 +13,8 @@ add_qt_plugin(qico Qt::GuiPrivate # special case PUBLIC_LIBRARIES # special case Qt::Gui # special case + CLASS_NAME + QICOPlugin ) #### Keys ignored in scope 1:.:.:ico.pro:: diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index f84d12dc12e..8f728e70792 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -5,6 +5,8 @@ ##################################################################### add_qt_module(Sql + PLUGIN_TYPES + sqldrivers SOURCES kernel/qsqlcachedresult.cpp kernel/qsqlcachedresult_p.h kernel/qsqldatabase.cpp kernel/qsqldatabase.h diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index dfe407da6d0..3b37991cba5 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1193,11 +1193,6 @@ def write_sources_section(cm_fh: typing.IO[str], scope: Scope, *, # mark RESOURCES as visited: scope.get('RESOURCES') - plugin_type = scope.get_string('PLUGIN_TYPE') - - if plugin_type: - cm_fh.write('{} TYPE {}\n'.format(ind, plugin_type)) - write_all_source_file_lists(cm_fh, scope, 'SOURCES', indent=indent + 1) write_source_file_list(cm_fh, scope, 'DBUS_ADAPTOR_SOURCES', ['DBUS_ADAPTORS',], indent + 1) @@ -1611,6 +1606,10 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, if len(module_config): extra.append('QMAKE_MODULE_CONFIG {}'.format(" ".join(module_config))) + module_plugin_types = scope.get_files('MODULE_PLUGIN_TYPES') + if module_plugin_types: + extra.append('PLUGIN_TYPES {}'.format(" ".join(module_plugin_types))) + write_main_part(cm_fh, module_name[2:], 'Module', 'add_qt_module', scope, extra_lines=extra, indent=indent, known_libraries={}, extra_keys=[]) @@ -1726,8 +1725,18 @@ def write_plugin(cm_fh, scope, *, indent: int = 0): plugin_name = scope.TARGET assert plugin_name + extra = [] + + plugin_type = scope.get_string('PLUGIN_TYPE') + if plugin_type: + extra.append('TYPE {}'.format(plugin_type)) + + plugin_class_name = scope.get_string('PLUGIN_CLASS_NAME') + if plugin_class_name: + extra.append('CLASS_NAME {}'.format(plugin_class_name)) + write_main_part(cm_fh, plugin_name, 'Plugin', 'add_qt_plugin', scope, - indent=indent, known_libraries={}, extra_keys=[]) + indent=indent, extra_lines=extra, known_libraries={}, extra_keys=[]) def handle_app_or_lib(scope: Scope, cm_fh: typing.IO[str], *, From bb52bd49e1917bee787c0d5c8a56e2734bb77710 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Mon, 3 Jun 2019 18:39:28 +0200 Subject: [PATCH 0582/1322] Android: Fix linker erros for liblog & libc For the android platform library add dependencies on liblog and libc for every Qt target. The libraries are shipped by default in the Android NDK so they will always be present. Change-Id: Ic4a13be32118710b11effabfb16e27bd2d10809f Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 82fd4ed2daf..2bda1eddabb 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -10,6 +10,14 @@ target_include_directories(Platform ) target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS}) + +# When building on android we need to link against their logging and C library +# in order to satisfy linker dependencies. Both of these libraries are part of +# the NDK. +if (ANDROID) + target_link_libraries(Platform INTERFACE log c) +endif() + set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}") qt_path_join(__GlobalConfig_build_dir ${QT_CONFIG_BUILD_DIR} ${__GlobalConfig_path_suffix}) qt_path_join(__GlobalConfig_install_dir ${QT_CONFIG_INSTALL_DIR} ${__GlobalConfig_path_suffix}) From fae5691c7f78f8a0154c9cea28b6639327a90550 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 4 Jun 2019 12:02:14 +0200 Subject: [PATCH 0583/1322] CMake: Allow build with MinGW and Hunter 3rd party packages Hunter has recently added aliased target names that conform with upstream CMake find module target names. Extended the WrapFreetype to work with Hunter's freetype (lowercase) package name. Change-Id: I0e25f342c6930658f07f05d2e6a58cf94d2d168d Reviewed-by: Alexandru Croitor --- cmake/FindWrapFreetype.cmake | 9 ++++++++- cmake/QtBuild.cmake | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmake/FindWrapFreetype.cmake b/cmake/FindWrapFreetype.cmake index 521346cc233..ec7d2a8d243 100644 --- a/cmake/FindWrapFreetype.cmake +++ b/cmake/FindWrapFreetype.cmake @@ -6,7 +6,14 @@ if(TARGET WrapFreetype::WrapFreetype) endif() set(WrapFreetype_FOUND OFF) -find_package(Freetype) + +# Hunter has the package named freetype, but exports the Freetype::Freetype target as upstream +# First try the CONFIG package, and afterwards the MODULE if not found + +find_package(Freetype CONFIG NAMES Freetype freetype QUIET) +if(NOT Freetype_FOUND) + find_package(Freetype MODULE) +endif() if(Freetype_FOUND) # vcpkg defines a lower case target name, while upstream Find module defines a prefixed diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 20b7c5bec84..591c752f77e 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2036,6 +2036,12 @@ macro(qt_find_package) # all scopes. foreach(qt_find_package_target_name ${arg_PROVIDED_TARGETS}) if(TARGET ${qt_find_package_target_name}) + # Allow usage of aliased targets by setting properties on the actual target + get_target_property(aliased_target ${qt_find_package_target_name} ALIASED_TARGET) + if(aliased_target) + set(qt_find_package_target_name ${aliased_target}) + endif() + set_target_properties(${qt_find_package_target_name} PROPERTIES INTERFACE_QT_PACKAGE_NAME ${ARGV0}) if(package_version) From 5c954b89a9bd94b085a49d05dfa25644b2eda1c8 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 4 Jun 2019 12:07:20 +0200 Subject: [PATCH 0584/1322] Fix qFindTestData with cmake and ninja generator In order for test lib to locate the file requested via QFINDTESTDATA, it needs the build directory of the test (for example $builddir/tests/auto/foo/bar) and __FILE__ expanding to a path to the source relative to this build directory. With ninja, __FILE__ is a path that is always relative to the top-level build directory, not the per-test case one. Therefore the path resolution in testlib fails. To accommodate this, add_qt_test() now always sets QT_TESTCASE_BUILDDIR as well as the newly introduced QT_TESTCASE_SOURCEDIR, which, as an absolute path, removes the need to use __FILE__. Change-Id: I16c2b0001e38162e6da9fdb1a61f4f8ce634fe46 Reviewed-by: Ville Voutilainen --- cmake/QtBuild.cmake | 5 ++++- src/testlib/Qt5TestConfigExtras.cmake.in | 1 - src/testlib/qtestcase.cpp | 22 +++++++++++++++++++--- src/testlib/qtestcase.h | 11 ++++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) delete mode 100644 src/testlib/Qt5TestConfigExtras.cmake.in diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 591c752f77e..81b5298833e 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1565,7 +1565,10 @@ function(add_qt_test name) "${CMAKE_CURRENT_BINARY_DIR}" $ "${arg_INCLUDE_DIRECTORIES}" - DEFINES "${arg_DEFINES}" + DEFINES + "${arg_DEFINES}" + QT_TESTCASE_BUILDDIR="${CMAKE_CURRENT_BINARY_DIR}" + QT_TESTCASE_SOURCEDIR="${CMAKE_CURRENT_SOURCE_DIR}" PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Core ${QT_CMAKE_EXPORT_NAMESPACE}::Test LIBRARIES ${arg_LIBRARIES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} diff --git a/src/testlib/Qt5TestConfigExtras.cmake.in b/src/testlib/Qt5TestConfigExtras.cmake.in deleted file mode 100644 index 86a706ea9d9..00000000000 --- a/src/testlib/Qt5TestConfigExtras.cmake.in +++ /dev/null @@ -1 +0,0 @@ -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Test APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_TESTCASE_BUILDDIR="${CMAKE_BINARY_DIR}") diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 5faafba38d0..26ab61b793c 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -2157,7 +2157,8 @@ QSharedPointer QTest::qExtractTestData(const QString &dirName) /*! \internal */ -QString QTest::qFindTestData(const QString& base, const char *file, int line, const char *builddir) +QString QTest::qFindTestData(const QString& base, const char *file, int line, const char *builddir, + const char *sourcedir) { QString found; @@ -2267,6 +2268,20 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co } } + // 7. Try the supplied source directory + if (found.isEmpty() && sourcedir) { + const QString candidate = QFile::decodeName(sourcedir) % QLatin1Char('/') % base; + if (QFileInfo::exists(candidate)) { + found = candidate; + } else if (QTestLog::verboseLevel() >= 2) { + QTestLog::info(qPrintable( + QString::fromLatin1("testdata %1 not found in supplied source directory [%2]") + .arg(base, QDir::toNativeSeparators(candidate))), + file, line); + } + } + + if (found.isEmpty()) { QTest::qWarn(qPrintable( QString::fromLatin1("testdata %1 could not be located!").arg(base)), @@ -2282,9 +2297,10 @@ QString QTest::qFindTestData(const QString& base, const char *file, int line, co /*! \internal */ -QString QTest::qFindTestData(const char *base, const char *file, int line, const char *builddir) +QString QTest::qFindTestData(const char *base, const char *file, int line, const char *builddir, + const char *sourcedir) { - return qFindTestData(QFile::decodeName(base), file, line, builddir); + return qFindTestData(QFile::decodeName(base), file, line, builddir, sourcedir); } /*! \internal diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h index 794283ff782..81364527919 100644 --- a/src/testlib/qtestcase.h +++ b/src/testlib/qtestcase.h @@ -213,8 +213,13 @@ do {\ QTest::qWarn(static_cast(msg), __FILE__, __LINE__) #ifdef QT_TESTCASE_BUILDDIR + +#ifndef QT_TESTCASE_SOURCEDIR +#define QT_TESTCASE_SOURCEDIR nullptr +#endif + # define QFINDTESTDATA(basepath)\ - QTest::qFindTestData(basepath, __FILE__, __LINE__, QT_TESTCASE_BUILDDIR) + QTest::qFindTestData(basepath, __FILE__, __LINE__, QT_TESTCASE_BUILDDIR, QT_TESTCASE_SOURCEDIR) #else # define QFINDTESTDATA(basepath)\ QTest::qFindTestData(basepath, __FILE__, __LINE__) @@ -309,8 +314,8 @@ namespace QTest #if QT_CONFIG(temporaryfile) Q_TESTLIB_EXPORT QSharedPointer qExtractTestData(const QString &dirName); #endif - Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr); - Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr); + Q_TESTLIB_EXPORT QString qFindTestData(const char* basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr, const char* sourcedir = nullptr); + Q_TESTLIB_EXPORT QString qFindTestData(const QString& basepath, const char* file = nullptr, int line = 0, const char* builddir = nullptr, const char *sourcedir = nullptr); Q_TESTLIB_EXPORT void *qData(const char *tagName, int typeId); Q_TESTLIB_EXPORT void *qGlobalData(const char *tagName, int typeId); From ff68d84d3202d810efefeaebca2835cac4e05b4f Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Tue, 4 Jun 2019 10:58:55 +0200 Subject: [PATCH 0585/1322] Android: Fix incorrect build config for Network Fix build configuration for qdnslookup implementations for android as UNIX is also set when building for Android. We should only have the more specific conditions enabled. Change-Id: Ib891df34e5569a20b03ce270e1eab080325549b9 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- src/network/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 414a41581b8..4a642835b67 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -151,7 +151,7 @@ extend_target(Network CONDITION UNIX socket/qnet_unix_p.h ) -extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY +extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY AND NOT ANDROID SOURCES kernel/qdnslookup_unix.cpp ) @@ -161,12 +161,6 @@ extend_target(Network CONDITION QT_FEATURE_dlopen AND UNIX ${CMAKE_DL_LIBS} ) -# special case begin -# Do not add this to android! -extend_target(Network CONDITION QT_FEATURE_dnslookup AND UNIX AND NOT INTEGRITY AND NOT ANDROID - SOURCES - kernel/qdnslookup_unix.cpp -) # special case end extend_target(Network CONDITION QT_FEATURE_linux_netlink AND UNIX @@ -181,7 +175,6 @@ extend_target(Network CONDITION UNIX AND NOT QT_FEATURE_linux_netlink extend_target(Network CONDITION ANDROID AND QT_FEATURE_dnslookup SOURCES - # kernel/qdnslookup_unix.cpp # special case: No more need to remove this kernel/qdnslookup_android.cpp ) From 6d1c695b0e32b644d13a088ab3363b6aef75de68 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 11:47:30 +0200 Subject: [PATCH 0586/1322] cmake: Fix testlib/selftests Actually build tst_selftest Fix the subdirs of it not to be actually built as tests (so that ctest doesn't pick them up and tries to run them) Change-Id: Id9d069f44241027dbd103884d36551163382b216 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- tests/auto/testlib/selftests/CMakeLists.txt | 448 ++++++++++++++++-- .../testlib/selftests/assert/CMakeLists.txt | 25 +- .../testlib/selftests/badxml/CMakeLists.txt | 27 +- .../benchlibcallgrind/CMakeLists.txt | 25 +- .../selftests/benchlibcounting/CMakeLists.txt | 25 +- .../benchlibeventcounter/CMakeLists.txt | 25 +- .../selftests/benchliboptions/CMakeLists.txt | 25 +- .../benchlibtickcounter/CMakeLists.txt | 26 + .../selftests/benchlibwalltime/CMakeLists.txt | 25 +- .../selftests/blacklisted/CMakeLists.txt | 26 + .../testlib/selftests/cmptest/CMakeLists.txt | 29 ++ .../selftests/commandlinedata/CMakeLists.txt | 25 +- .../testlib/selftests/counting/CMakeLists.txt | 25 +- .../testlib/selftests/crashes/CMakeLists.txt | 25 +- .../selftests/datatable/CMakeLists.txt | 25 +- .../testlib/selftests/datetime/CMakeLists.txt | 25 +- .../selftests/deleteLater/CMakeLists.txt | 19 +- .../deleteLater_noApp/CMakeLists.txt | 19 +- .../selftests/differentexec/CMakeLists.txt | 25 +- .../selftests/exceptionthrow/CMakeLists.txt | 24 + .../selftests/expectfail/CMakeLists.txt | 25 +- .../selftests/failcleanup/CMakeLists.txt | 25 +- .../selftests/faildatatype/CMakeLists.txt | 24 + .../selftests/failfetchtype/CMakeLists.txt | 24 + .../testlib/selftests/failinit/CMakeLists.txt | 25 +- .../selftests/failinitdata/CMakeLists.txt | 25 +- .../selftests/fetchbogus/CMakeLists.txt | 25 +- .../selftests/findtestdata/CMakeLists.txt | 29 ++ .../testlib/selftests/float/CMakeLists.txt | 25 +- .../selftests/globaldata/CMakeLists.txt | 25 +- .../testlib/selftests/keyboard/CMakeLists.txt | 28 ++ .../selftests/longstring/CMakeLists.txt | 25 +- .../selftests/maxwarnings/CMakeLists.txt | 25 +- .../testlib/selftests/mouse/CMakeLists.txt | 28 ++ .../selftests/multiexec/CMakeLists.txt | 25 +- .../selftests/pairdiagnostics/CMakeLists.txt | 19 +- .../selftests/printdatatags/CMakeLists.txt | 25 +- .../CMakeLists.txt | 25 +- .../selftests/qexecstringlist/CMakeLists.txt | 25 +- .../selftests/signaldumper/CMakeLists.txt | 26 + .../testlib/selftests/silent/CMakeLists.txt | 26 + .../selftests/singleskip/CMakeLists.txt | 25 +- .../testlib/selftests/skip/CMakeLists.txt | 25 +- .../selftests/skipcleanup/CMakeLists.txt | 25 +- .../testlib/selftests/skipinit/CMakeLists.txt | 25 +- .../selftests/skipinitdata/CMakeLists.txt | 25 +- .../testlib/selftests/sleep/CMakeLists.txt | 25 +- .../testlib/selftests/strcmp/CMakeLists.txt | 25 +- .../testlib/selftests/subtest/CMakeLists.txt | 25 +- .../testlib/selftests/testlib/CMakeLists.txt | 24 + .../selftests/tuplediagnostics/CMakeLists.txt | 19 +- .../testlib/selftests/verbose1/CMakeLists.txt | 24 + .../testlib/selftests/verbose2/CMakeLists.txt | 24 + .../verifyexceptionthrown/CMakeLists.txt | 24 + .../testlib/selftests/warnings/CMakeLists.txt | 25 +- .../testlib/selftests/watchdog/CMakeLists.txt | 27 ++ .../testlib/selftests/xunit/CMakeLists.txt | 25 +- 57 files changed, 1758 insertions(+), 81 deletions(-) create mode 100644 tests/auto/testlib/selftests/benchlibtickcounter/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/blacklisted/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/cmptest/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/faildatatype/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failfetchtype/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/findtestdata/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/keyboard/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/mouse/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/signaldumper/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/silent/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/testlib/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/verbose1/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/verbose2/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/watchdog/CMakeLists.txt diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index ee1efa53fc7..ae710f8e525 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -1,42 +1,408 @@ -# add_subdirectory(alive) # TODO is commented in selftests.pri too. Investigate if should be readded -add_subdirectory(assert) -add_subdirectory(badxml) -add_subdirectory(benchlibcallgrind) -add_subdirectory(benchlibcounting) -add_subdirectory(benchlibeventcounter) -add_subdirectory(benchliboptions) -add_subdirectory(benchlibwalltime) -add_subdirectory(commandlinedata) -add_subdirectory(counting) -add_subdirectory(crashes) -add_subdirectory(datatable) -add_subdirectory(datetime) -add_subdirectory(deleteLater) -add_subdirectory(deleteLater_noApp) -add_subdirectory(differentexec) -add_subdirectory(expectfail) -add_subdirectory(failcleanup) -add_subdirectory(failinit) -add_subdirectory(failinitdata) -add_subdirectory(fetchbogus) -add_subdirectory(float) -add_subdirectory(globaldata) -add_subdirectory(longstring) -add_subdirectory(maxwarnings) -add_subdirectory(multiexec) -add_subdirectory(pairdiagnostics) -add_subdirectory(printdatatags) -add_subdirectory(printdatatagswithglobaltags) -add_subdirectory(qexecstringlist) -add_subdirectory(singleskip) -add_subdirectory(skip) -add_subdirectory(skipcleanup) -add_subdirectory(skipinit) -add_subdirectory(skipinitdata) -add_subdirectory(sleep) -add_subdirectory(strcmp) -add_subdirectory(subtest) -add_subdirectory(tuplediagnostics) -add_subdirectory(warnings) -add_subdirectory(xunit) +# special case begin - The whole file is manually generated +if(NOT WINRT) + add_subdirectory(assert) + add_subdirectory(badxml) + add_subdirectory(benchlibcallgrind) + add_subdirectory(benchlibcounting) + add_subdirectory(benchlibeventcounter) + add_subdirectory(benchliboptions) + add_subdirectory(benchlibtickcounter) + add_subdirectory(benchlibwalltime) + add_subdirectory(blacklisted) + add_subdirectory(cmptest) + add_subdirectory(commandlinedata) + add_subdirectory(counting) + add_subdirectory(crashes) + add_subdirectory(datatable) + add_subdirectory(datetime) + add_subdirectory(deleteLater) + add_subdirectory(deleteLater_noApp) + add_subdirectory(differentexec) + add_subdirectory(exceptionthrow) + add_subdirectory(expectfail) + add_subdirectory(failcleanup) + add_subdirectory(faildatatype) + add_subdirectory(failfetchtype) + add_subdirectory(failinit) + add_subdirectory(failinitdata) + add_subdirectory(fetchbogus) + add_subdirectory(findtestdata) + add_subdirectory(float) + add_subdirectory(globaldata) + add_subdirectory(longstring) + add_subdirectory(maxwarnings) + add_subdirectory(multiexec) + add_subdirectory(pairdiagnostics) + add_subdirectory(printdatatags) + add_subdirectory(printdatatagswithglobaltags) + add_subdirectory(qexecstringlist) + add_subdirectory(silent) + add_subdirectory(signaldumper) + add_subdirectory(singleskip) + add_subdirectory(skip) + add_subdirectory(skipcleanup) + add_subdirectory(skipinit) + add_subdirectory(skipinitdata) + add_subdirectory(sleep) + add_subdirectory(strcmp) + add_subdirectory(subtest) + add_subdirectory(testlib) + add_subdirectory(tuplediagnostics) + add_subdirectory(verbose1) + add_subdirectory(verbose2) + add_subdirectory(verifyexceptionthrown) + add_subdirectory(warnings) + add_subdirectory(watchdog) + add_subdirectory(xunit) + + if(TARGET Qt::Gui) + add_subdirectory(keyboard) + add_subdirectory(mouse) + endif() +endif() + +##################################################################### +## tst_selftests Test: +##################################################################### + +add_qt_test(tst_selftests + SOURCES + ../../../shared/emulationdetector.h + tst_selftests.cpp + INCLUDE_DIRECTORIES + ../../../shared + LIBRARIES + Qt::TestPrivate +) + +add_qt_resource(tst_selftests "expected_files" PREFIX "/" FILES + expected_assert.lightxml + expected_assert.tap + expected_assert.teamcity + expected_assert.txt + expected_assert.xml + expected_assert.xunitxml + expected_badxml.lightxml + expected_badxml.tap + expected_badxml.teamcity + expected_badxml.txt + expected_badxml.xml + expected_badxml.xunitxml + expected_benchlibcallgrind_0.txt + expected_benchlibcallgrind_1.txt + expected_benchlibcallgrind.csv + expected_benchlibcallgrind.lightxml + expected_benchlibcallgrind.tap + expected_benchlibcallgrind.teamcity + expected_benchlibcallgrind.xml + expected_benchlibcallgrind.xunitxml + expected_benchlibcounting.csv + expected_benchlibcounting.lightxml + expected_benchlibcounting.tap + expected_benchlibcounting.teamcity + expected_benchlibcounting.txt + expected_benchlibcounting.xml + expected_benchlibcounting.xunitxml + expected_benchlibeventcounter.csv + expected_benchlibeventcounter.lightxml + expected_benchlibeventcounter.tap + expected_benchlibeventcounter.teamcity + expected_benchlibeventcounter.txt + expected_benchlibeventcounter.xml + expected_benchlibeventcounter.xunitxml + expected_benchliboptions.csv + expected_benchliboptions.lightxml + expected_benchliboptions.tap + expected_benchliboptions.teamcity + expected_benchliboptions.txt + expected_benchliboptions.xml + expected_benchliboptions.xunitxml + expected_benchlibtickcounter.csv + expected_benchlibtickcounter.lightxml + expected_benchlibtickcounter.tap + expected_benchlibtickcounter.teamcity + expected_benchlibtickcounter.txt + expected_benchlibtickcounter.xml + expected_benchlibtickcounter.xunitxml + expected_benchlibwalltime.csv + expected_benchlibwalltime.lightxml + expected_benchlibwalltime.tap + expected_benchlibwalltime.teamcity + expected_benchlibwalltime.txt + expected_benchlibwalltime.xml + expected_benchlibwalltime.xunitxml + expected_blacklisted.lightxml + expected_blacklisted.tap + expected_blacklisted.teamcity + expected_blacklisted.txt + expected_blacklisted.xml + expected_blacklisted.xunitxml + expected_cmptest.lightxml + expected_cmptest.tap + expected_cmptest.teamcity + expected_cmptest.txt + expected_cmptest.xml + expected_cmptest.xunitxml + expected_commandlinedata.lightxml + expected_commandlinedata.tap + expected_commandlinedata.teamcity + expected_commandlinedata.txt + expected_commandlinedata.xml + expected_commandlinedata.xunitxml + expected_counting.lightxml + expected_counting.tap + expected_counting.teamcity + expected_counting.txt + expected_counting.xml + expected_counting.xunitxml + expected_crashes_1.txt + expected_crashes_2.txt + expected_crashes_3.txt + expected_crashes_4.txt + expected_crashes_5.txt + expected_datatable.lightxml + expected_datatable.tap + expected_datatable.teamcity + expected_datatable.txt + expected_datatable.xml + expected_datatable.xunitxml + expected_datetime.lightxml + expected_datetime.tap + expected_datetime.teamcity + expected_datetime.txt + expected_datetime.xml + expected_datetime.xunitxml + expected_differentexec.lightxml + expected_differentexec.tap + expected_differentexec.teamcity + expected_differentexec.txt + expected_differentexec.xml + expected_differentexec.xunitxml + expected_exceptionthrow.lightxml + expected_exceptionthrow.tap + expected_exceptionthrow.teamcity + expected_exceptionthrow.txt + expected_exceptionthrow.xml + expected_exceptionthrow.xunitxml + expected_expectfail.lightxml + expected_expectfail.tap + expected_expectfail.teamcity + expected_expectfail.txt + expected_expectfail.xml + expected_expectfail.xunitxml + expected_failcleanup.lightxml + expected_failcleanup.tap + expected_failcleanup.teamcity + expected_failcleanup.txt + expected_failcleanup.xml + expected_failcleanup.xunitxml + expected_faildatatype.lightxml + expected_faildatatype.tap + expected_faildatatype.teamcity + expected_faildatatype.txt + expected_faildatatype.xml + expected_faildatatype.xunitxml + expected_failfetchtype.lightxml + expected_failfetchtype.tap + expected_failfetchtype.teamcity + expected_failfetchtype.txt + expected_failfetchtype.xml + expected_failfetchtype.xunitxml + expected_failinitdata.lightxml + expected_failinitdata.tap + expected_failinitdata.teamcity + expected_failinitdata.txt + expected_failinitdata.xml + expected_failinitdata.xunitxml + expected_failinit.lightxml + expected_failinit.tap + expected_failinit.teamcity + expected_failinit.txt + expected_failinit.xml + expected_failinit.xunitxml + expected_fetchbogus.lightxml + expected_fetchbogus.tap + expected_fetchbogus.teamcity + expected_fetchbogus.txt + expected_fetchbogus.xml + expected_fetchbogus.xunitxml + expected_findtestdata.lightxml + expected_findtestdata.tap + expected_findtestdata.teamcity + expected_findtestdata.txt + expected_findtestdata.xml + expected_findtestdata.xunitxml + expected_float.lightxml + expected_float.tap + expected_float.teamcity + expected_float.txt + expected_float.xml + expected_float.xunitxml + expected_globaldata.lightxml + expected_globaldata.tap + expected_globaldata.teamcity + expected_globaldata.txt + expected_globaldata.xml + expected_globaldata.xunitxml + expected_keyboard.lightxml + expected_keyboard.tap + expected_keyboard.teamcity + expected_keyboard.txt + expected_keyboard.xml + expected_keyboard.xunitxml + expected_longstring.lightxml + expected_longstring.tap + expected_longstring.teamcity + expected_longstring.txt + expected_longstring.xml + expected_longstring.xunitxml + expected_maxwarnings.lightxml + expected_maxwarnings.tap + expected_maxwarnings.teamcity + expected_maxwarnings.txt + expected_maxwarnings.xml + expected_maxwarnings.xunitxml + expected_multiexec.lightxml + expected_multiexec.tap + expected_multiexec.teamcity + expected_multiexec.txt + expected_multiexec.xml + expected_multiexec.xunitxml + expected_pairdiagnostics.lightxml + expected_pairdiagnostics.tap + expected_pairdiagnostics.teamcity + expected_pairdiagnostics.txt + expected_pairdiagnostics.xml + expected_pairdiagnostics.xunitxml + expected_printdatatags.txt + expected_printdatatagswithglobaltags.txt + expected_qexecstringlist.lightxml + expected_qexecstringlist.tap + expected_qexecstringlist.teamcity + expected_qexecstringlist.txt + expected_qexecstringlist.xml + expected_qexecstringlist.xunitxml + expected_signaldumper.lightxml + expected_signaldumper.tap + expected_signaldumper.teamcity + expected_signaldumper.txt + expected_signaldumper.xml + expected_signaldumper.xunitxml + expected_silent.lightxml + expected_silent.tap + expected_silent.teamcity + expected_silent.txt + expected_silent.xml + expected_silent.xunitxml + expected_singleskip.lightxml + expected_singleskip.tap + expected_singleskip.teamcity + expected_singleskip.txt + expected_singleskip.xml + expected_singleskip.xunitxml + expected_skipcleanup.lightxml + expected_skipcleanup.tap + expected_skipcleanup.teamcity + expected_skipcleanup.txt + expected_skipcleanup.xml + expected_skipcleanup.xunitxml + expected_skipinitdata.lightxml + expected_skipinitdata.tap + expected_skipinitdata.teamcity + expected_skipinitdata.txt + expected_skipinitdata.xml + expected_skipinitdata.xunitxml + expected_skipinit.lightxml + expected_skipinit.tap + expected_skipinit.teamcity + expected_skipinit.txt + expected_skipinit.xml + expected_skipinit.xunitxml + expected_skip.lightxml + expected_skip.tap + expected_skip.teamcity + expected_skip.txt + expected_skip.xml + expected_skip.xunitxml + expected_sleep.lightxml + expected_sleep.tap + expected_sleep.teamcity + expected_sleep.txt + expected_sleep.xml + expected_sleep.xunitxml + expected_strcmp.lightxml + expected_strcmp.tap + expected_strcmp.teamcity + expected_strcmp.txt + expected_strcmp.xml + expected_strcmp.xunitxml + expected_subtest.lightxml + expected_subtest.tap + expected_subtest.teamcity + expected_subtest.txt + expected_subtest.xml + expected_subtest.xunitxml + expected_testlib.lightxml + expected_testlib.tap + expected_testlib.teamcity + expected_testlib.txt + expected_testlib.xml + expected_testlib.xunitxml + expected_tuplediagnostics.lightxml + expected_tuplediagnostics.tap + expected_tuplediagnostics.teamcity + expected_tuplediagnostics.txt + expected_tuplediagnostics.xml + expected_tuplediagnostics.xunitxml + expected_verbose1.lightxml + expected_verbose1.tap + expected_verbose1.teamcity + expected_verbose1.txt + expected_verbose1.xml + expected_verbose1.xunitxml + expected_verbose2.lightxml + expected_verbose2.tap + expected_verbose2.teamcity + expected_verbose2.txt + expected_verbose2.xml + expected_verbose2.xunitxml + expected_verifyexceptionthrown.lightxml + expected_verifyexceptionthrown.tap + expected_verifyexceptionthrown.teamcity + expected_verifyexceptionthrown.txt + expected_verifyexceptionthrown.xml + expected_verifyexceptionthrown.xunitxml + expected_warnings.lightxml + expected_warnings.tap + expected_warnings.teamcity + expected_warnings.txt + expected_warnings.xml + expected_warnings.xunitxml + expected_watchdog.lightxml + expected_watchdog.tap + expected_watchdog.teamcity + expected_watchdog.txt + expected_watchdog.xml + expected_watchdog.xunitxml + expected_xunit.lightxml + expected_xunit.tap + expected_xunit.teamcity + expected_xunit.txt + expected_xunit.xml + expected_xunit.xunitxml +) + + +#### Keys ignored in scope 1:.:.:test.pro:: +# CONFIG = "testcase" +# expected_files.base = "$$PWD/.." +# expected_files.files = "$$files$$PWD/../expected_*" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 5:.:.:test.pro:NOT ANDROID AND NOT WINRT AND for(file,SUBPROGRAMS): +# TEST_HELPER_INSTALLS = "../$${file}/$${file}" + +# special case end diff --git a/tests/auto/testlib/selftests/assert/CMakeLists.txt b/tests/auto/testlib/selftests/assert/CMakeLists.txt index f9882750380..e3516907c56 100644 --- a/tests/auto/testlib/selftests/assert/CMakeLists.txt +++ b/tests/auto/testlib/selftests/assert/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(assert SOURCES tst_assert.cpp) +# Generated from assert.pro. + +##################################################################### +## assert Binary: +##################################################################### + +add_qt_executable(assert + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_assert.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:assert.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:assert.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/badxml/CMakeLists.txt b/tests/auto/testlib/selftests/badxml/CMakeLists.txt index 9a709a2d7d0..201b198d336 100644 --- a/tests/auto/testlib/selftests/badxml/CMakeLists.txt +++ b/tests/auto/testlib/selftests/badxml/CMakeLists.txt @@ -1 +1,26 @@ -add_qt_test(badxml SOURCES tst_badxml.cpp LIBRARIES Qt::CorePrivate) +# Generated from badxml.pro. + +##################################################################### +## badxml Binary: +##################################################################### + +add_qt_executable(badxml + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_badxml.cpp + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:badxml.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:badxml.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt index f247623e6c4..9d6360a0329 100644 --- a/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt +++ b/tests/auto/testlib/selftests/benchlibcallgrind/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(benchlibcallgrind SOURCES tst_benchlibcallgrind.cpp) +# Generated from benchlibcallgrind.pro. + +##################################################################### +## benchlibcallgrind Binary: +##################################################################### + +add_qt_executable(benchlibcallgrind + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_benchlibcallgrind.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibcallgrind.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibcallgrind.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt index e8df2820d6f..1f483bdebf3 100644 --- a/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt +++ b/tests/auto/testlib/selftests/benchlibcounting/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(benchlibcounting SOURCES tst_benchlibcounting.cpp) +# Generated from benchlibcounting.pro. + +##################################################################### +## benchlibcounting Binary: +##################################################################### + +add_qt_executable(benchlibcounting + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_benchlibcounting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibcounting.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibcounting.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt index b98c46c870e..b5e8ddaf864 100644 --- a/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt +++ b/tests/auto/testlib/selftests/benchlibeventcounter/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(benchlibeventcounter SOURCES tst_benchlibeventcounter.cpp) +# Generated from benchlibeventcounter.pro. + +##################################################################### +## benchlibeventcounter Binary: +##################################################################### + +add_qt_executable(benchlibeventcounter + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_benchlibeventcounter.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibeventcounter.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibeventcounter.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt b/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt index c7e57e60809..9f70d019bc0 100644 --- a/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt +++ b/tests/auto/testlib/selftests/benchliboptions/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(benchliboptions SOURCES tst_benchliboptions.cpp) +# Generated from benchliboptions.pro. + +##################################################################### +## benchliboptions Binary: +##################################################################### + +add_qt_executable(benchliboptions + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_benchliboptions.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchliboptions.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchliboptions.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibtickcounter/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibtickcounter/CMakeLists.txt new file mode 100644 index 00000000000..461b19c9506 --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibtickcounter/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from benchlibtickcounter.pro. + +##################################################################### +## benchlibtickcounter Binary: +##################################################################### + +add_qt_executable(benchlibtickcounter + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_benchlibtickcounter.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibtickcounter.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibtickcounter.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt b/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt index d774fb95c08..2b060e73b95 100644 --- a/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt +++ b/tests/auto/testlib/selftests/benchlibwalltime/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(benchlibwalltime SOURCES tst_benchlibwalltime.cpp) +# Generated from benchlibwalltime.pro. + +##################################################################### +## benchlibwalltime Binary: +##################################################################### + +add_qt_executable(benchlibwalltime + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_benchlibwalltime.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibwalltime.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibwalltime.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/blacklisted/CMakeLists.txt b/tests/auto/testlib/selftests/blacklisted/CMakeLists.txt new file mode 100644 index 00000000000..5327109fb0c --- /dev/null +++ b/tests/auto/testlib/selftests/blacklisted/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from blacklisted.pro. + +##################################################################### +## blacklisted Binary: +##################################################################### + +add_qt_executable(blacklisted + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_blacklisted.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:blacklisted.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:blacklisted.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/cmptest/CMakeLists.txt b/tests/auto/testlib/selftests/cmptest/CMakeLists.txt new file mode 100644 index 00000000000..b875fb2743a --- /dev/null +++ b/tests/auto/testlib/selftests/cmptest/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from cmptest.pro. + +##################################################################### +## cmptest Binary: +##################################################################### + +add_qt_executable(cmptest + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_cmptest.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:cmptest.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +extend_target(cmptest CONDITION TARGET Qt::Gui + PUBLIC_LIBRARIES + Qt::Gui +) + +#### Keys ignored in scope 3:.:.:cmptest.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt b/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt index a9d4fee477e..b19434f9344 100644 --- a/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt +++ b/tests/auto/testlib/selftests/commandlinedata/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(commandlinedata SOURCES tst_commandlinedata.cpp) +# Generated from commandlinedata.pro. + +##################################################################### +## commandlinedata Binary: +##################################################################### + +add_qt_executable(commandlinedata + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_commandlinedata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:commandlinedata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:commandlinedata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/counting/CMakeLists.txt b/tests/auto/testlib/selftests/counting/CMakeLists.txt index bde163f6633..d9962b97712 100644 --- a/tests/auto/testlib/selftests/counting/CMakeLists.txt +++ b/tests/auto/testlib/selftests/counting/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(counting SOURCES tst_counting.cpp) +# Generated from counting.pro. + +##################################################################### +## counting Binary: +##################################################################### + +add_qt_executable(counting + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_counting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:counting.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:counting.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/crashes/CMakeLists.txt b/tests/auto/testlib/selftests/crashes/CMakeLists.txt index 046e0e0fcc1..5fe8ae06f75 100644 --- a/tests/auto/testlib/selftests/crashes/CMakeLists.txt +++ b/tests/auto/testlib/selftests/crashes/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(crashes SOURCES tst_crashes.cpp) +# Generated from crashes.pro. + +##################################################################### +## crashes Binary: +##################################################################### + +add_qt_executable(crashes + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_crashes.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:crashes.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:crashes.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/datatable/CMakeLists.txt b/tests/auto/testlib/selftests/datatable/CMakeLists.txt index a6f5bd10a76..1ebcfd871e7 100644 --- a/tests/auto/testlib/selftests/datatable/CMakeLists.txt +++ b/tests/auto/testlib/selftests/datatable/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(datatable SOURCES tst_datatable.cpp) +# Generated from datatable.pro. + +##################################################################### +## datatable Binary: +##################################################################### + +add_qt_executable(datatable + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_datatable.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:datatable.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:datatable.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/datetime/CMakeLists.txt b/tests/auto/testlib/selftests/datetime/CMakeLists.txt index 989f9b242cc..c47f94664f8 100644 --- a/tests/auto/testlib/selftests/datetime/CMakeLists.txt +++ b/tests/auto/testlib/selftests/datetime/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(datetime SOURCES tst_datetime.cpp) +# Generated from datetime.pro. + +##################################################################### +## datetime Binary: +##################################################################### + +add_qt_executable(datetime + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_datetime.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:datetime.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:datetime.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt b/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt index e07f87a1111..aa805809bbc 100644 --- a/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt +++ b/tests/auto/testlib/selftests/deleteLater/CMakeLists.txt @@ -1 +1,18 @@ -add_qt_test(tst_deleteLater SOURCES tst_deleteLater.cpp) +# Generated from deleteLater.pro. + +##################################################################### +## tst_deleteLater Binary: +##################################################################### + +add_qt_executable(tst_deleteLater + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_deleteLater.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:deleteLater.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt b/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt index cd2818e2f7f..ee246517579 100644 --- a/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt +++ b/tests/auto/testlib/selftests/deleteLater_noApp/CMakeLists.txt @@ -1 +1,18 @@ -add_qt_test(tst_deleteLater_noApp SOURCES tst_deleteLater_noApp.cpp) +# Generated from deleteLater_noApp.pro. + +##################################################################### +## tst_deleteLater_noApp Binary: +##################################################################### + +add_qt_executable(tst_deleteLater_noApp + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_deleteLater_noApp.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:deleteLater_noApp.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/differentexec/CMakeLists.txt b/tests/auto/testlib/selftests/differentexec/CMakeLists.txt index 9dd4fb2e891..b55ce5ed113 100644 --- a/tests/auto/testlib/selftests/differentexec/CMakeLists.txt +++ b/tests/auto/testlib/selftests/differentexec/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(differentexec SOURCES tst_differentexec.cpp) +# Generated from differentexec.pro. + +##################################################################### +## differentexec Binary: +##################################################################### + +add_qt_executable(differentexec + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_differentexec.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:differentexec.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:differentexec.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt b/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt new file mode 100644 index 00000000000..1e67b630bd1 --- /dev/null +++ b/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from exceptionthrow.pro. + +##################################################################### +## exceptionthrow Binary: +##################################################################### + +add_qt_executable(exceptionthrow + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_exceptionthrow.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:exceptionthrow.pro:: +# CONFIG = "-debug_and_release_target" "exceptions" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:exceptionthrow.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/expectfail/CMakeLists.txt b/tests/auto/testlib/selftests/expectfail/CMakeLists.txt index 72dd051b7cf..bedb74b8180 100644 --- a/tests/auto/testlib/selftests/expectfail/CMakeLists.txt +++ b/tests/auto/testlib/selftests/expectfail/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(expectfail SOURCES tst_expectfail.cpp) +# Generated from expectfail.pro. + +##################################################################### +## expectfail Binary: +##################################################################### + +add_qt_executable(expectfail + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_expectfail.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:expectfail.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:expectfail.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt b/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt index d6dae7593fa..eeff7b00753 100644 --- a/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt +++ b/tests/auto/testlib/selftests/failcleanup/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(failcleanup SOURCES tst_failcleanup.cpp) +# Generated from failcleanup.pro. + +##################################################################### +## failcleanup Binary: +##################################################################### + +add_qt_executable(failcleanup + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_failcleanup.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failcleanup.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failcleanup.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/faildatatype/CMakeLists.txt b/tests/auto/testlib/selftests/faildatatype/CMakeLists.txt new file mode 100644 index 00000000000..2a3a95e5b33 --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from faildatatype.pro. + +##################################################################### +## faildatatype Binary: +##################################################################### + +add_qt_executable(faildatatype + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_faildatatype.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:faildatatype.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:faildatatype.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failfetchtype/CMakeLists.txt b/tests/auto/testlib/selftests/failfetchtype/CMakeLists.txt new file mode 100644 index 00000000000..f1f02bcc127 --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from failfetchtype.pro. + +##################################################################### +## failfetchtype Binary: +##################################################################### + +add_qt_executable(failfetchtype + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_failfetchtype.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failfetchtype.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failfetchtype.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failinit/CMakeLists.txt b/tests/auto/testlib/selftests/failinit/CMakeLists.txt index 11c0cacf7f0..1966b3f007f 100644 --- a/tests/auto/testlib/selftests/failinit/CMakeLists.txt +++ b/tests/auto/testlib/selftests/failinit/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(failinit SOURCES tst_failinit.cpp) +# Generated from failinit.pro. + +##################################################################### +## failinit Binary: +##################################################################### + +add_qt_executable(failinit + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_failinit.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failinit.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failinit.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt b/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt index ac7f01423ef..7e9fcb49e14 100644 --- a/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt +++ b/tests/auto/testlib/selftests/failinitdata/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(failinitdata SOURCES tst_failinitdata.cpp) +# Generated from failinitdata.pro. + +##################################################################### +## failinitdata Binary: +##################################################################### + +add_qt_executable(failinitdata + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_failinitdata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failinitdata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failinitdata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt b/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt index 854f63ec203..782241505d3 100644 --- a/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt +++ b/tests/auto/testlib/selftests/fetchbogus/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(fetchbogus SOURCES tst_fetchbogus.cpp) +# Generated from fetchbogus.pro. + +##################################################################### +## fetchbogus Binary: +##################################################################### + +add_qt_executable(fetchbogus + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_fetchbogus.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:fetchbogus.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:fetchbogus.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/findtestdata/CMakeLists.txt b/tests/auto/testlib/selftests/findtestdata/CMakeLists.txt new file mode 100644 index 00000000000..81c171d1737 --- /dev/null +++ b/tests/auto/testlib/selftests/findtestdata/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from findtestdata.pro. + +##################################################################### +## findtestdata Binary: +##################################################################### + +add_qt_executable(findtestdata + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + findtestdata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +# Resources: +add_qt_resource(findtestdata "findtestdata" PREFIX "/qt/etc/" FILES + qt.conf) + + +#### Keys ignored in scope 1:.:.:findtestdata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:findtestdata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/float/CMakeLists.txt b/tests/auto/testlib/selftests/float/CMakeLists.txt index 6068aa3a1e7..c98c447fb28 100644 --- a/tests/auto/testlib/selftests/float/CMakeLists.txt +++ b/tests/auto/testlib/selftests/float/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(float SOURCES tst_float.cpp) +# Generated from float.pro. + +##################################################################### +## float Binary: +##################################################################### + +add_qt_executable(float + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_float.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:float.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:float.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/globaldata/CMakeLists.txt b/tests/auto/testlib/selftests/globaldata/CMakeLists.txt index 2722788c8e1..3e7ddc0d343 100644 --- a/tests/auto/testlib/selftests/globaldata/CMakeLists.txt +++ b/tests/auto/testlib/selftests/globaldata/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(globaldata SOURCES tst_globaldata.cpp) +# Generated from globaldata.pro. + +##################################################################### +## globaldata Binary: +##################################################################### + +add_qt_executable(globaldata + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_globaldata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:globaldata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:globaldata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/keyboard/CMakeLists.txt b/tests/auto/testlib/selftests/keyboard/CMakeLists.txt new file mode 100644 index 00000000000..7ace48d1e25 --- /dev/null +++ b/tests/auto/testlib/selftests/keyboard/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from keyboard.pro. + +##################################################################### +## keyboard Binary: +##################################################################### + +add_qt_executable(keyboard + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_keyboard.cpp + LIBRARIES + Qt::GuiPrivate + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Gui + Qt::Test +) + +#### Keys ignored in scope 1:.:.:keyboard.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:keyboard.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/longstring/CMakeLists.txt b/tests/auto/testlib/selftests/longstring/CMakeLists.txt index 56912b6cd10..0b221fe8ac1 100644 --- a/tests/auto/testlib/selftests/longstring/CMakeLists.txt +++ b/tests/auto/testlib/selftests/longstring/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(longstring SOURCES tst_longstring.cpp) +# Generated from longstring.pro. + +##################################################################### +## longstring Binary: +##################################################################### + +add_qt_executable(longstring + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_longstring.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:longstring.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:longstring.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt b/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt index c9077b32b0f..40595398283 100644 --- a/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt +++ b/tests/auto/testlib/selftests/maxwarnings/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(maxwarnings SOURCES maxwarnings.cpp) +# Generated from maxwarnings.pro. + +##################################################################### +## maxwarnings Binary: +##################################################################### + +add_qt_executable(maxwarnings + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + maxwarnings.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:maxwarnings.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:maxwarnings.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/mouse/CMakeLists.txt b/tests/auto/testlib/selftests/mouse/CMakeLists.txt new file mode 100644 index 00000000000..a30d5fecdf9 --- /dev/null +++ b/tests/auto/testlib/selftests/mouse/CMakeLists.txt @@ -0,0 +1,28 @@ +# Generated from mouse.pro. + +##################################################################### +## mouse Binary: +##################################################################### + +add_qt_executable(mouse + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_mouse.cpp + LIBRARIES + Qt::GuiPrivate + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Gui + Qt::Test +) + +#### Keys ignored in scope 1:.:.:mouse.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:mouse.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/multiexec/CMakeLists.txt b/tests/auto/testlib/selftests/multiexec/CMakeLists.txt index bee72b2b178..66d3760e0de 100644 --- a/tests/auto/testlib/selftests/multiexec/CMakeLists.txt +++ b/tests/auto/testlib/selftests/multiexec/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(multiexec SOURCES tst_multiexec.cpp) +# Generated from multiexec.pro. + +##################################################################### +## multiexec Binary: +##################################################################### + +add_qt_executable(multiexec + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_multiexec.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:multiexec.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:multiexec.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt b/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt index 677be5403a0..34e57684784 100644 --- a/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt +++ b/tests/auto/testlib/selftests/pairdiagnostics/CMakeLists.txt @@ -1 +1,18 @@ -add_qt_test(pairdiagnostics SOURCES tst_pairdiagnostics.cpp) +# Generated from pairdiagnostics.pro. + +##################################################################### +## pairdiagnostics Binary: +##################################################################### + +add_qt_executable(pairdiagnostics + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_pairdiagnostics.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:pairdiagnostics.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt b/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt index 778dcc184f8..cfe560ac177 100644 --- a/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt +++ b/tests/auto/testlib/selftests/printdatatags/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(printdatatags SOURCES tst_printdatatags.cpp) +# Generated from printdatatags.pro. + +##################################################################### +## printdatatags Binary: +##################################################################### + +add_qt_executable(printdatatags + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_printdatatags.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:printdatatags.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:printdatatags.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt b/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt index 0942ed15d41..56270f7f51a 100644 --- a/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt +++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(printdatatagswithglobaltags SOURCES tst_printdatatagswithglobaltags.cpp) +# Generated from printdatatagswithglobaltags.pro. + +##################################################################### +## printdatatagswithglobaltags Binary: +##################################################################### + +add_qt_executable(printdatatagswithglobaltags + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_printdatatagswithglobaltags.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:printdatatagswithglobaltags.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:printdatatagswithglobaltags.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt b/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt index 6429b5f5319..da12ddd7502 100644 --- a/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt +++ b/tests/auto/testlib/selftests/qexecstringlist/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(qexecstringlist SOURCES tst_qexecstringlist.cpp) +# Generated from qexecstringlist.pro. + +##################################################################### +## qexecstringlist Binary: +##################################################################### + +add_qt_executable(qexecstringlist + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_qexecstringlist.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:qexecstringlist.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:qexecstringlist.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/signaldumper/CMakeLists.txt b/tests/auto/testlib/selftests/signaldumper/CMakeLists.txt new file mode 100644 index 00000000000..53813102657 --- /dev/null +++ b/tests/auto/testlib/selftests/signaldumper/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from signaldumper.pro. + +##################################################################### +## signaldumper Binary: +##################################################################### + +add_qt_executable(signaldumper + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_signaldumper.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:signaldumper.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:signaldumper.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/silent/CMakeLists.txt b/tests/auto/testlib/selftests/silent/CMakeLists.txt new file mode 100644 index 00000000000..5fc3190c5b7 --- /dev/null +++ b/tests/auto/testlib/selftests/silent/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from silent.pro. + +##################################################################### +## silent Binary: +##################################################################### + +add_qt_executable(silent + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_silent.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:silent.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:silent.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/singleskip/CMakeLists.txt b/tests/auto/testlib/selftests/singleskip/CMakeLists.txt index 041b06aabb5..015698758db 100644 --- a/tests/auto/testlib/selftests/singleskip/CMakeLists.txt +++ b/tests/auto/testlib/selftests/singleskip/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(singleskip SOURCES tst_singleskip.cpp) +# Generated from singleskip.pro. + +##################################################################### +## singleskip Binary: +##################################################################### + +add_qt_executable(singleskip + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_singleskip.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:singleskip.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:singleskip.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skip/CMakeLists.txt b/tests/auto/testlib/selftests/skip/CMakeLists.txt index 974020cdbc0..4597729529a 100644 --- a/tests/auto/testlib/selftests/skip/CMakeLists.txt +++ b/tests/auto/testlib/selftests/skip/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(skip SOURCES tst_skip.cpp) +# Generated from skip.pro. + +##################################################################### +## skip Binary: +##################################################################### + +add_qt_executable(skip + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_skip.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skip.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skip.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt b/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt index bf8c6e7adeb..51b077e09ea 100644 --- a/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt +++ b/tests/auto/testlib/selftests/skipcleanup/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(skipcleanup SOURCES tst_skipcleanup.cpp) +# Generated from skipcleanup.pro. + +##################################################################### +## skipcleanup Binary: +##################################################################### + +add_qt_executable(skipcleanup + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_skipcleanup.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skipcleanup.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skipcleanup.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skipinit/CMakeLists.txt b/tests/auto/testlib/selftests/skipinit/CMakeLists.txt index a9eb542e1c4..35439d8ae8e 100644 --- a/tests/auto/testlib/selftests/skipinit/CMakeLists.txt +++ b/tests/auto/testlib/selftests/skipinit/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(skipinit SOURCES tst_skipinit.cpp) +# Generated from skipinit.pro. + +##################################################################### +## skipinit Binary: +##################################################################### + +add_qt_executable(skipinit + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_skipinit.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skipinit.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skipinit.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt b/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt index cc38fed14fa..ff32667e948 100644 --- a/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt +++ b/tests/auto/testlib/selftests/skipinitdata/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(skipinitdata SOURCES tst_skipinitdata.cpp) +# Generated from skipinitdata.pro. + +##################################################################### +## skipinitdata Binary: +##################################################################### + +add_qt_executable(skipinitdata + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_skipinitdata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skipinitdata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skipinitdata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/sleep/CMakeLists.txt b/tests/auto/testlib/selftests/sleep/CMakeLists.txt index 49c5e97ac20..f5f585a9619 100644 --- a/tests/auto/testlib/selftests/sleep/CMakeLists.txt +++ b/tests/auto/testlib/selftests/sleep/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(sleep SOURCES tst_sleep.cpp) +# Generated from sleep.pro. + +##################################################################### +## sleep Binary: +##################################################################### + +add_qt_executable(sleep + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_sleep.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:sleep.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:sleep.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/strcmp/CMakeLists.txt b/tests/auto/testlib/selftests/strcmp/CMakeLists.txt index cb50518af22..7660153592d 100644 --- a/tests/auto/testlib/selftests/strcmp/CMakeLists.txt +++ b/tests/auto/testlib/selftests/strcmp/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(strcmp SOURCES tst_strcmp.cpp) +# Generated from strcmp.pro. + +##################################################################### +## strcmp Binary: +##################################################################### + +add_qt_executable(strcmp + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_strcmp.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:strcmp.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:strcmp.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/subtest/CMakeLists.txt b/tests/auto/testlib/selftests/subtest/CMakeLists.txt index 434fd88563f..2193ab1745f 100644 --- a/tests/auto/testlib/selftests/subtest/CMakeLists.txt +++ b/tests/auto/testlib/selftests/subtest/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(subtest SOURCES tst_subtest.cpp) +# Generated from subtest.pro. + +##################################################################### +## subtest Binary: +##################################################################### + +add_qt_executable(subtest + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_subtest.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:subtest.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:subtest.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/testlib/CMakeLists.txt b/tests/auto/testlib/selftests/testlib/CMakeLists.txt new file mode 100644 index 00000000000..8be09409c97 --- /dev/null +++ b/tests/auto/testlib/selftests/testlib/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from testlib.pro. + +##################################################################### +## testlib Binary: +##################################################################### + +add_qt_executable(testlib + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_testlib.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:testlib.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:testlib.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt b/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt index 1dfe64c642a..880ee099d60 100644 --- a/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt +++ b/tests/auto/testlib/selftests/tuplediagnostics/CMakeLists.txt @@ -1 +1,18 @@ -add_qt_test(tuplediagnostics SOURCES tst_tuplediagnostics.cpp) +# Generated from tuplediagnostics.pro. + +##################################################################### +## tuplediagnostics Binary: +##################################################################### + +add_qt_executable(tuplediagnostics + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_tuplediagnostics.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:tuplediagnostics.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/verbose1/CMakeLists.txt b/tests/auto/testlib/selftests/verbose1/CMakeLists.txt new file mode 100644 index 00000000000..7b93c0c5715 --- /dev/null +++ b/tests/auto/testlib/selftests/verbose1/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from verbose1.pro. + +##################################################################### +## verbose1 Binary: +##################################################################### + +add_qt_executable(verbose1 + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + ../counting/tst_counting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:verbose1.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:verbose1.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/verbose2/CMakeLists.txt b/tests/auto/testlib/selftests/verbose2/CMakeLists.txt new file mode 100644 index 00000000000..14d1319c3d5 --- /dev/null +++ b/tests/auto/testlib/selftests/verbose2/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from verbose2.pro. + +##################################################################### +## verbose2 Binary: +##################################################################### + +add_qt_executable(verbose2 + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + ../counting/tst_counting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:verbose2.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:verbose2.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt b/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt new file mode 100644 index 00000000000..817eddaee87 --- /dev/null +++ b/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from verifyexceptionthrown.pro. + +##################################################################### +## verifyexceptionthrown Binary: +##################################################################### + +add_qt_executable(verifyexceptionthrown + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_verifyexceptionthrown.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:verifyexceptionthrown.pro:: +# CONFIG = "-debug_and_release_target" "exceptions" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:verifyexceptionthrown.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/warnings/CMakeLists.txt b/tests/auto/testlib/selftests/warnings/CMakeLists.txt index 35f53f2822d..e61d35c6e13 100644 --- a/tests/auto/testlib/selftests/warnings/CMakeLists.txt +++ b/tests/auto/testlib/selftests/warnings/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(warnings SOURCES tst_warnings.cpp) +# Generated from warnings.pro. + +##################################################################### +## warnings Binary: +##################################################################### + +add_qt_executable(warnings + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_warnings.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:warnings.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:warnings.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/watchdog/CMakeLists.txt b/tests/auto/testlib/selftests/watchdog/CMakeLists.txt new file mode 100644 index 00000000000..c932676b1ad --- /dev/null +++ b/tests/auto/testlib/selftests/watchdog/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from watchdog.pro. + +##################################################################### +## watchdog Binary: +##################################################################### + +add_qt_executable(watchdog + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_watchdog.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:watchdog.pro:: +# CONFIG = "-debug_and_release_target" +# QT_TOOL_ENV = "checkenv" +# checkenv.name = "QTEST_FUNCTION_TIMEOUT" +# checkenv.value = "100" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:watchdog.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/xunit/CMakeLists.txt b/tests/auto/testlib/selftests/xunit/CMakeLists.txt index 8c151ab1acc..cbbcb52080e 100644 --- a/tests/auto/testlib/selftests/xunit/CMakeLists.txt +++ b/tests/auto/testlib/selftests/xunit/CMakeLists.txt @@ -1 +1,24 @@ -add_qt_test(xunit SOURCES tst_xunit.cpp) +# Generated from xunit.pro. + +##################################################################### +## xunit Binary: +##################################################################### + +add_qt_executable(xunit + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + GUI + SOURCES + tst_xunit.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:xunit.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:xunit.pro:APPLE_OSX: +# CONFIG = "-app_bundle" From 4d72497e6e7147c103ed1932e7c1b682e19c9a72 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 12:02:41 +0200 Subject: [PATCH 0587/1322] cmake: Fix tests that need helper binaries Compile the binaries where they are expected not in builddir/bin Change-Id: I5c9461424a4b3f9fb7f39f5b9d3cd9b96887cfbc Reviewed-by: Alexandru Croitor --- tests/auto/corelib/global/qlogging/CMakeLists.txt | 9 +++++++-- .../dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt | 2 ++ .../dbus/qdbusabstractinterface/qpinger/CMakeLists.txt | 2 ++ tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/auto/corelib/global/qlogging/CMakeLists.txt b/tests/auto/corelib/global/qlogging/CMakeLists.txt index 05b5bdb63b3..a83ebab98ad 100644 --- a/tests/auto/corelib/global/qlogging/CMakeLists.txt +++ b/tests/auto/corelib/global/qlogging/CMakeLists.txt @@ -1,10 +1,15 @@ if(NOT WINRT) - add_qt_test_helper(qlogging_helper SOURCES app/main.cpp DEFINES QT_MESSAGELOGCONTEXT LIBRARIES Qt::Core) + add_qt_executable(qlogging_helper + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case + SOURCES app/main.cpp + DEFINES QT_MESSAGELOGCONTEXT + LIBRARIES Qt::Core) endif() add_qt_test(tst_qlogging SOURCES tst_qlogging.cpp DEFINES QT_MESSAGELOGCONTEXT QT_DISABLE_DEPRECATED_BEFORE=0 - HELPER_BINARY="qlogging_helper" + HELPER_BINARY="${CMAKE_CURRENT_BINARY_DIR}/qlogging_helper" # special case ) diff --git a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt index e8d542056c0..651388be410 100644 --- a/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractadaptor/qmyserver/CMakeLists.txt @@ -5,6 +5,8 @@ ##################################################################### add_qt_executable(qmyserver + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case SOURCES ../myobject.h qmyserver.cpp diff --git a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt index c2bf6ea3e3b..59e69c877be 100644 --- a/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt +++ b/tests/auto/dbus/qdbusabstractinterface/qpinger/CMakeLists.txt @@ -5,6 +5,8 @@ ##################################################################### add_qt_executable(qpinger + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case SOURCES ../interface.cpp ../interface.h qpinger.cpp diff --git a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt index 81427017bd3..fdbe5877853 100644 --- a/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt +++ b/tests/auto/dbus/qdbusinterface/qmyserver/CMakeLists.txt @@ -8,6 +8,8 @@ # already has a executable target named like that, so use # a different target name and then rename the binary add_qt_executable(qmyserver_qdbusinterface + NO_INSTALL # special case + OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case SOURCES ../myobject.h qmyserver.cpp From 3bf6682ad468f2aedea6a0e1a483a46b85b60437 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 4 Jun 2019 13:40:57 +0200 Subject: [PATCH 0588/1322] CMake: Install dlls on Windows Dlls were missing from the install_dir/bin directory. Change-Id: I0b5ef685b779c91969bbfa877f226be2060f6e56 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 81b5298833e..c73e00be47a 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1191,6 +1191,7 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") set(export_name "${INSTALL_CMAKE_NAMESPACE}${target}Targets") qt_install(TARGETS ${exported_targets} EXPORT ${export_name} + RUNTIME DESTINATION ${INSTALL_BINDIR} LIBRARY DESTINATION ${INSTALL_LIBDIR} ARCHIVE DESTINATION ${INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/${module} From 624891e7c529e7dd94a26c1786e785a26953e918 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 4 Jun 2019 14:01:39 +0200 Subject: [PATCH 0589/1322] Fix build with clang 8.0 When qt_parse_version_string tries to parse the compiler version into separate fields, it tries to accommodate for different number of digits separate by dots by checking the length of the list as it is mutated. Unfortunately the length variable is not a live variable, so after removing an entry from the list we must change the length variable manually. Change-Id: Ieaeb091581484e8c723fbb467697f73036e64ec9 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- cmake/QtPlatformSupport.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index 2468932179b..ac9973905af 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -49,6 +49,7 @@ function(qt_parse_version_string version_string out_var_prefix) if(length GREATER 0) list(GET version_list 0 value) list(REMOVE_AT version_list 0) + math(EXPR length "${length}-1") endif() set(${out_var} "${value}" PARENT_SCOPE) @@ -58,6 +59,7 @@ function(qt_parse_version_string version_string out_var_prefix) list(GET version_list 0 value) set(${out_var} "${value}" PARENT_SCOPE) list(REMOVE_AT version_list 0) + math(EXPR length "${length}-1") endif() set(${out_var} "${value}" PARENT_SCOPE) @@ -67,7 +69,7 @@ function(qt_parse_version_string version_string out_var_prefix) list(GET version_list 0 value) set(${out_var} "${value}" PARENT_SCOPE) list(REMOVE_AT version_list 0) - + math(EXPR length "${length}-1") endif() set(${out_var} "${value}" PARENT_SCOPE) endfunction() From 64c111e10fcb2f69855432177d76649b6b789fac Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Tue, 4 Jun 2019 14:09:13 +0200 Subject: [PATCH 0590/1322] Android: Use lld as default linker for Qt Modules We can't use the gold linker with the android NDK, which is the default option. Using the gold linker results in linker crashes. QMake builds also disables the gold linker. Change-Id: I73de93150b160b4411715007bc7e40238b96d400 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c73e00be47a..fab4543b3ee 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1240,6 +1240,12 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) endif() + + # We can't use the gold linker on android with the NDK, which is the default + # linker. To build our own target we will use the lld linker. + if (ANDROID) + target_link_options("${target}" PRIVATE -fuse-ld=lld) + endif() endfunction() function(qt_export_tools module_name) From b61c4e6a7dcf71b49951f887fb11af640a56a60d Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 4 Jun 2019 14:25:18 +0200 Subject: [PATCH 0591/1322] CMake: Install plugins on Windows The plugin dll files were missing from install_dir/plugins/ Change-Id: I68655faf949e4b8fcab153c6c9b8ee14d3ad8ecc Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- cmake/QtBuild.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index fab4543b3ee..2c9b8867fa2 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1477,6 +1477,7 @@ function(add_qt_plugin target) set(export_name "${target}Targets") qt_install(TARGETS "${target}" EXPORT ${export_name} + RUNTIME DESTINATION "${install_directory}" LIBRARY DESTINATION "${install_directory}" ARCHIVE DESTINATION "${archive_install_directory}" ) From 653666008c6822376c59fa08173d156c80bab486 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 4 Jun 2019 14:38:24 +0200 Subject: [PATCH 0592/1322] CMake: Treat Qt plugins as MODULE libraries CMake will complain if you try to use a plugin in target_link_libraries, and it won't produce import libraries on windows, or use .so.number on Linux. Change-Id: I6f0cf8267b3c0e6e5c888703596afe59b3a39141 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 2c9b8867fa2..6eae0481dd0 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1368,7 +1368,7 @@ function(add_qt_plugin target) if(arg_STATIC) add_library("${target}" STATIC) else() - add_library("${target}") + add_library("${target}" MODULE) endif() qt_internal_add_target_aliases("${target}") From 44f30db5c1aa9d54208c8bc7f10b064fd117111d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 4 Jun 2019 15:19:00 +0200 Subject: [PATCH 0593/1322] Fix linking QtGui on Android Until we have some convenience in place, it is strictly necessary to set the NDK API level, otherwise the libraries from vcpkg are statically built against a newer libc headers than what we finally link against. This also means that we can remove the manual libc linkage again. Change-Id: If1f2eec4df5ed800ac6b060561edff89236891e9 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- cmake/QtBaseGlobalTargets.cmake | 4 ++-- cmake/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 2bda1eddabb..9c22df32b7c 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -11,11 +11,11 @@ target_include_directories(Platform target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS}) -# When building on android we need to link against their logging and C library +# When building on android we need to link against the logging library # in order to satisfy linker dependencies. Both of these libraries are part of # the NDK. if (ANDROID) - target_link_libraries(Platform INTERFACE log c) + target_link_libraries(Platform INTERFACE log) endif() set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}") diff --git a/cmake/README.md b/cmake/README.md index e7c7ced2271..610f7eea27c 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -133,7 +133,7 @@ Vcpkg for Android can be set up using the following steps: * Set the ``ANDROID_NDK_HOME`` environment variable to the path where you have installed the Android NDK. * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` -When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build`` +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21`` # Debugging CMake files From 22852cf6219304fd120d810c84b18e3e060e2844 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 16:14:05 +0200 Subject: [PATCH 0594/1322] cmake: Define _LARGEFILE64_SOURCE _LARGEFILE_SOURCE when largefile feature is enabled, in qmake world this came from largefile.prf Change-Id: I064da31328ad46157354c7012c7b8397c558cd1d Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6eae0481dd0..07ea8018878 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1051,6 +1051,10 @@ function(add_qt_module target) qt_autogen_tools_initial_setup(${target}) + if(FEATURE_largefile) + set(largefile_defines "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") + endif() + extend_target("${target}" SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES @@ -1075,6 +1079,7 @@ function(add_qt_module target) QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS QT_BUILDING_QT + "${largefile_defines}" QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} From fa57ca055d4e66b10da1e2490bf43eeec5f07a9e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 15:37:55 +0200 Subject: [PATCH 0595/1322] Install plugin related .cmake.in files This fixes the build when building qtsvg, qtimageformats, etc. Amends 0900298d466e819dd6d8fd39c0be333dc09af189 Change-Id: Ie732ef6faa99e2ebe7e8da6ee2aa5fc0cf59d3f3 Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 9c22df32b7c..7eaa8d3cb01 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -117,6 +117,8 @@ qt_copy_or_install(FILES cmake/QtModuleDependencies.cmake.in cmake/QtModuleToolsDependencies.cmake.in cmake/QtModuleToolsConfig.cmake.in + cmake/QtPluginConfig.cmake.in + cmake/QtPluginDependencies.cmake.in DESTINATION "${__GlobalConfig_install_dir}" ) From 8fea3ec4e77dfebe2e84e10ae0f014d03b9098b3 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 4 Jun 2019 16:19:46 +0200 Subject: [PATCH 0596/1322] pro2cmake: A couple more fixes regarding examples Changes: - Make sure the footer is passed along to callees - Make sure RESOURCES are part of add_executable(...) for AUTORCC Change-Id: I4546bacd2e41ca8acc1a9351af54d325afb715ab Reviewed-by: Alexandru Croitor Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 3b37991cba5..dc6c1fc873f 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1140,10 +1140,10 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, - indent: int = 0, footer: str = ''): + indent: int = 0, footer: str = '', extraKeys: typing.List[str]): write_source_file_list(cm_fh, scope, header, - ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'], - indent) + ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'] + extraKeys, + indent, footer=footer) def write_defines(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, @@ -1153,21 +1153,21 @@ def write_defines(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, defines = [d.replace('=\\\\\\"$$PWD/\\\\\\"', '="${CMAKE_CURRENT_SOURCE_DIR}/"') for d in defines] - write_list(cm_fh, defines, cmake_parameter, indent) + write_list(cm_fh, defines, cmake_parameter, indent, footer=footer) def write_include_paths(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, indent: int = 0, footer: str = ''): includes = [i.rstrip('/') or ('/') for i in scope.get_files('INCLUDEPATH')] - write_list(cm_fh, includes, cmake_parameter, indent) + write_list(cm_fh, includes, cmake_parameter, indent, footer=footer) def write_compile_options(cm_fh: typing.IO[str], scope: Scope, cmake_parameter: str, *, indent: int = 0, footer: str = ''): compile_options = [d for d in scope.expand('QMAKE_CXXFLAGS') if not d.startswith('-D')] - write_list(cm_fh, compile_options, cmake_parameter, indent) + write_list(cm_fh, compile_options, cmake_parameter, indent, footer=footer) def write_library_section(cm_fh: typing.IO[str], scope: Scope, *, @@ -1700,13 +1700,13 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, if gui: add_executable += ' WIN32 MACOSX_BUNDLE' - write_all_source_file_lists(cm_fh, scope, add_executable, indent=0) + write_all_source_file_lists(cm_fh, scope, add_executable, indent=0, extraKeys = ['RESOURCES']) cm_fh.write(')\n') write_include_paths(cm_fh, scope, 'target_include_directories({}'.format(binary_name), indent=0, footer=')') - write_defines(cm_fh, scope, 'target_compile_definitions({}'.format(binary_name), + write_defines(cm_fh, scope, 'target_compile_definitions({} PUBLIC'.format(binary_name), indent=0, footer=')') write_list(cm_fh, private_libs, '', indent=indent, header='target_link_libraries({} PRIVATE\n'.format(binary_name), footer=')') From 772f5dbf1c30b9b0a26ac48a8ae1e1d5cf58b130 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 4 Jun 2019 15:27:48 +0200 Subject: [PATCH 0597/1322] pro2cmake: Always add a newline after func calls Fixes the situation where we end up with e.g.: ``` target_link_libraries(... )target_link_libraries(... ) ``` Change-Id: I455563b24850db7f389746385af53cd606343274 Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index dc6c1fc873f..4b2b8dc5c70 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1125,7 +1125,7 @@ def write_list(cm_fh: typing.IO[str], entries: typing.List[str], for s in sort_sources(entries): cm_fh.write('{}{}{}\n'.format(ind, extra_indent, s)) if footer: - cm_fh.write('{}{}'.format(ind, footer)) + cm_fh.write('{}{}\n'.format(ind, footer)) def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, From 75bb0b6cd12959618f91e11a8f69b1a0af04bb41 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 4 Jun 2019 15:28:59 +0200 Subject: [PATCH 0598/1322] pro2cmake: Add PUBLIC to target_include_directories Change-Id: Ie4e882a5713022bfaec7182172be69616ff8b91c Reviewed-by: Alexandru Croitor --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 4b2b8dc5c70..072fd4a08b1 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1704,7 +1704,7 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, cm_fh.write(')\n') - write_include_paths(cm_fh, scope, 'target_include_directories({}'.format(binary_name), + write_include_paths(cm_fh, scope, 'target_include_directories({} PUBLIC'.format(binary_name), indent=0, footer=')') write_defines(cm_fh, scope, 'target_compile_definitions({} PUBLIC'.format(binary_name), indent=0, footer=')') From 8842cb5337c78b934e8da7752a9f23d36a671a1f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 14:28:14 +0200 Subject: [PATCH 0599/1322] Improve special_case_helper.py Make sure to set the author user and email for the temporary git repo, so that the commits succeed on systems that don't have a global git author. Also fix run_process_quiet to print stderr and stdout in case if the execution failed for some reason. Change-Id: I0ddb61730114b3e9c59e2d23480df0ced8d6e772 Reviewed-by: Albert Astals Cid Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- util/cmake/special_case_helper.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/util/cmake/special_case_helper.py b/util/cmake/special_case_helper.py index 8777b9c4db4..57b91b6cb1b 100644 --- a/util/cmake/special_case_helper.py +++ b/util/cmake/special_case_helper.py @@ -146,7 +146,13 @@ def run_process_quiet(args_string: str, debug=False) -> None: if debug: print('Running command: "{}\"'.format(args_string)) args_list = args_string.split() - subprocess.run(args_list, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + try: + subprocess.run(args_list, check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as e: + # git merge with conflicts returns with exit code 1, but that's not + # an error for us. + if 'git merge' not in args_string: + print('Error while running: "{}"\n{}'.format(args_string, e.stdout)) def does_file_have_conflict_markers(file_path: str, debug=False) -> bool: @@ -228,19 +234,23 @@ class SpecialCaseHandler(object): try: # Create new repo with the "clean" CMakeLists.txt file. run_process_quiet('git init .', debug=self.debug) + run_process_quiet('git config user.name fake', debug=self.debug) + run_process_quiet('git config user.email fake@fake', debug=self.debug) copyfile_log(no_special_cases_file_path, txt, debug=self.debug) run_process_quiet('git add {}'.format(txt), debug=self.debug) run_process_quiet('git commit -m no_special', debug=self.debug) + run_process_quiet('git checkout -b no_special', debug=self.debug) # Copy the original "modified" file (with the special cases) # and make a new commit. + run_process_quiet('git checkout -b original', debug=self.debug) copyfile_log(original_file_path, txt, debug=self.debug) run_process_quiet('git add {}'.format(txt), debug=self.debug) run_process_quiet('git commit -m original', debug=self.debug) # Checkout the commit with "clean" file again, and create a # new branch. - run_process_quiet('git checkout HEAD~', debug=self.debug) + run_process_quiet('git checkout no_special', debug=self.debug) run_process_quiet('git checkout -b newly_generated', debug=self.debug) # Copy the new "modified" file and make a commit. @@ -250,7 +260,7 @@ class SpecialCaseHandler(object): # Merge the "old" branch with modifications into the "new" # branch with the newly generated file. - run_process_quiet('git merge master', debug=self.debug) + run_process_quiet('git merge original', debug=self.debug) # Resolve some simple conflicts (just remove the markers) # for cases that don't need intervention. From 63f2b8c7a885a84fc8f240ec8e4ac88c3a3c6e64 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 15:48:53 +0200 Subject: [PATCH 0600/1322] Include the .prev_CMakeLists.txt files for selftests This will help with future regeneration. Amends 6d1c695b0e32b644d13a088ab3363b6aef75de68 Change-Id: I2454dc36cfc00f7aad72488fb7927d7807978fd8 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- .../testlib/selftests/.prev_CMakeLists.txt | 9 +++++++ tests/auto/testlib/selftests/CMakeLists.txt | 5 +++- .../selftests/assert/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/badxml/.prev_CMakeLists.txt | 24 +++++++++++++++++ .../benchlibcallgrind/.prev_CMakeLists.txt | 22 +++++++++++++++ .../benchlibcounting/.prev_CMakeLists.txt | 22 +++++++++++++++ .../benchlibeventcounter/.prev_CMakeLists.txt | 22 +++++++++++++++ .../benchliboptions/.prev_CMakeLists.txt | 22 +++++++++++++++ .../benchlibtickcounter/.prev_CMakeLists.txt | 24 +++++++++++++++++ .../benchlibwalltime/.prev_CMakeLists.txt | 22 +++++++++++++++ .../blacklisted/.prev_CMakeLists.txt | 24 +++++++++++++++++ .../selftests/cmptest/.prev_CMakeLists.txt | 27 +++++++++++++++++++ .../commandlinedata/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/counting/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/crashes/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/datatable/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/datetime/.prev_CMakeLists.txt | 22 +++++++++++++++ .../deleteLater/.prev_CMakeLists.txt | 16 +++++++++++ .../deleteLater_noApp/.prev_CMakeLists.txt | 16 +++++++++++ .../differentexec/.prev_CMakeLists.txt | 22 +++++++++++++++ .../exceptionthrow/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/expectfail/.prev_CMakeLists.txt | 22 +++++++++++++++ .../failcleanup/.prev_CMakeLists.txt | 22 +++++++++++++++ .../faildatatype/.prev_CMakeLists.txt | 22 +++++++++++++++ .../failfetchtype/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/failinit/.prev_CMakeLists.txt | 22 +++++++++++++++ .../failinitdata/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/fetchbogus/.prev_CMakeLists.txt | 22 +++++++++++++++ .../findtestdata/.prev_CMakeLists.txt | 27 +++++++++++++++++++ .../selftests/float/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/globaldata/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/keyboard/.prev_CMakeLists.txt | 26 ++++++++++++++++++ .../selftests/longstring/.prev_CMakeLists.txt | 22 +++++++++++++++ .../maxwarnings/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/mouse/.prev_CMakeLists.txt | 26 ++++++++++++++++++ .../selftests/multiexec/.prev_CMakeLists.txt | 22 +++++++++++++++ .../pairdiagnostics/.prev_CMakeLists.txt | 16 +++++++++++ .../printdatatags/.prev_CMakeLists.txt | 22 +++++++++++++++ .../.prev_CMakeLists.txt | 22 +++++++++++++++ .../qexecstringlist/.prev_CMakeLists.txt | 22 +++++++++++++++ .../signaldumper/.prev_CMakeLists.txt | 24 +++++++++++++++++ .../selftests/silent/.prev_CMakeLists.txt | 24 +++++++++++++++++ .../selftests/singleskip/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/skip/.prev_CMakeLists.txt | 22 +++++++++++++++ .../skipcleanup/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/skipinit/.prev_CMakeLists.txt | 22 +++++++++++++++ .../skipinitdata/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/sleep/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/strcmp/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/subtest/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/testlib/.prev_CMakeLists.txt | 22 +++++++++++++++ .../tuplediagnostics/.prev_CMakeLists.txt | 16 +++++++++++ .../selftests/verbose1/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/verbose2/.prev_CMakeLists.txt | 22 +++++++++++++++ .../.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/warnings/.prev_CMakeLists.txt | 22 +++++++++++++++ .../selftests/watchdog/.prev_CMakeLists.txt | 25 +++++++++++++++++ .../selftests/xunit/.prev_CMakeLists.txt | 22 +++++++++++++++ 58 files changed, 1252 insertions(+), 1 deletion(-) create mode 100644 tests/auto/testlib/selftests/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/assert/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/badxml/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibcallgrind/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibcounting/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibeventcounter/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchliboptions/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibtickcounter/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/benchlibwalltime/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/blacklisted/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/cmptest/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/commandlinedata/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/counting/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/crashes/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/datatable/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/datetime/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/deleteLater/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/deleteLater_noApp/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/differentexec/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/exceptionthrow/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/expectfail/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failcleanup/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/faildatatype/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failfetchtype/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failinit/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/failinitdata/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/fetchbogus/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/findtestdata/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/float/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/globaldata/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/keyboard/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/longstring/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/maxwarnings/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/mouse/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/multiexec/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/pairdiagnostics/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/printdatatags/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/printdatatagswithglobaltags/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/qexecstringlist/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/signaldumper/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/silent/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/singleskip/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skip/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skipcleanup/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skipinit/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/skipinitdata/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/sleep/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/strcmp/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/subtest/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/testlib/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/tuplediagnostics/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/verbose1/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/verbose2/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/verifyexceptionthrown/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/warnings/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/watchdog/.prev_CMakeLists.txt create mode 100644 tests/auto/testlib/selftests/xunit/.prev_CMakeLists.txt diff --git a/tests/auto/testlib/selftests/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/.prev_CMakeLists.txt new file mode 100644 index 00000000000..124d2a60a04 --- /dev/null +++ b/tests/auto/testlib/selftests/.prev_CMakeLists.txt @@ -0,0 +1,9 @@ +# Generated from selftests.pro. + +add_subdirectory(test) + +if(NOT WINRT) + + if(TARGET Qt::Gui) + endif() +endif() diff --git a/tests/auto/testlib/selftests/CMakeLists.txt b/tests/auto/testlib/selftests/CMakeLists.txt index ae710f8e525..6b7fdb0d539 100644 --- a/tests/auto/testlib/selftests/CMakeLists.txt +++ b/tests/auto/testlib/selftests/CMakeLists.txt @@ -1,4 +1,7 @@ -# special case begin - The whole file is manually generated +# Generated from selftests.pro. + +# special case begin +# The whole file is written manually. if(NOT WINRT) add_subdirectory(assert) diff --git a/tests/auto/testlib/selftests/assert/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/assert/.prev_CMakeLists.txt new file mode 100644 index 00000000000..5a102a5f1bf --- /dev/null +++ b/tests/auto/testlib/selftests/assert/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from assert.pro. + +##################################################################### +## assert Binary: +##################################################################### + +add_qt_executable(assert + GUI + SOURCES + tst_assert.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:assert.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:assert.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/badxml/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/badxml/.prev_CMakeLists.txt new file mode 100644 index 00000000000..6570862a482 --- /dev/null +++ b/tests/auto/testlib/selftests/badxml/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from badxml.pro. + +##################################################################### +## badxml Binary: +##################################################################### + +add_qt_executable(badxml + GUI + SOURCES + tst_badxml.cpp + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:badxml.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:badxml.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibcallgrind/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/benchlibcallgrind/.prev_CMakeLists.txt new file mode 100644 index 00000000000..0a0a1c38641 --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibcallgrind/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from benchlibcallgrind.pro. + +##################################################################### +## benchlibcallgrind Binary: +##################################################################### + +add_qt_executable(benchlibcallgrind + GUI + SOURCES + tst_benchlibcallgrind.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibcallgrind.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibcallgrind.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibcounting/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/benchlibcounting/.prev_CMakeLists.txt new file mode 100644 index 00000000000..0a16de054fb --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibcounting/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from benchlibcounting.pro. + +##################################################################### +## benchlibcounting Binary: +##################################################################### + +add_qt_executable(benchlibcounting + GUI + SOURCES + tst_benchlibcounting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibcounting.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibcounting.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibeventcounter/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/benchlibeventcounter/.prev_CMakeLists.txt new file mode 100644 index 00000000000..5dec354c07e --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibeventcounter/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from benchlibeventcounter.pro. + +##################################################################### +## benchlibeventcounter Binary: +##################################################################### + +add_qt_executable(benchlibeventcounter + GUI + SOURCES + tst_benchlibeventcounter.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibeventcounter.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibeventcounter.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchliboptions/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/benchliboptions/.prev_CMakeLists.txt new file mode 100644 index 00000000000..68435200f19 --- /dev/null +++ b/tests/auto/testlib/selftests/benchliboptions/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from benchliboptions.pro. + +##################################################################### +## benchliboptions Binary: +##################################################################### + +add_qt_executable(benchliboptions + GUI + SOURCES + tst_benchliboptions.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchliboptions.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchliboptions.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibtickcounter/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/benchlibtickcounter/.prev_CMakeLists.txt new file mode 100644 index 00000000000..f30cf1752f7 --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibtickcounter/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from benchlibtickcounter.pro. + +##################################################################### +## benchlibtickcounter Binary: +##################################################################### + +add_qt_executable(benchlibtickcounter + GUI + SOURCES + tst_benchlibtickcounter.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibtickcounter.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibtickcounter.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/benchlibwalltime/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/benchlibwalltime/.prev_CMakeLists.txt new file mode 100644 index 00000000000..b3306cdc7a1 --- /dev/null +++ b/tests/auto/testlib/selftests/benchlibwalltime/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from benchlibwalltime.pro. + +##################################################################### +## benchlibwalltime Binary: +##################################################################### + +add_qt_executable(benchlibwalltime + GUI + SOURCES + tst_benchlibwalltime.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:benchlibwalltime.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:benchlibwalltime.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/blacklisted/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/blacklisted/.prev_CMakeLists.txt new file mode 100644 index 00000000000..975c934252d --- /dev/null +++ b/tests/auto/testlib/selftests/blacklisted/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from blacklisted.pro. + +##################################################################### +## blacklisted Binary: +##################################################################### + +add_qt_executable(blacklisted + GUI + SOURCES + tst_blacklisted.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:blacklisted.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:blacklisted.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/cmptest/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/cmptest/.prev_CMakeLists.txt new file mode 100644 index 00000000000..a4954a4aa87 --- /dev/null +++ b/tests/auto/testlib/selftests/cmptest/.prev_CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from cmptest.pro. + +##################################################################### +## cmptest Binary: +##################################################################### + +add_qt_executable(cmptest + GUI + SOURCES + tst_cmptest.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:cmptest.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +extend_target(cmptest CONDITION TARGET Qt::Gui + PUBLIC_LIBRARIES + Qt::Gui +) + +#### Keys ignored in scope 3:.:.:cmptest.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/commandlinedata/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/commandlinedata/.prev_CMakeLists.txt new file mode 100644 index 00000000000..e46ce884534 --- /dev/null +++ b/tests/auto/testlib/selftests/commandlinedata/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from commandlinedata.pro. + +##################################################################### +## commandlinedata Binary: +##################################################################### + +add_qt_executable(commandlinedata + GUI + SOURCES + tst_commandlinedata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:commandlinedata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:commandlinedata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/counting/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/counting/.prev_CMakeLists.txt new file mode 100644 index 00000000000..3c63b1cb189 --- /dev/null +++ b/tests/auto/testlib/selftests/counting/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from counting.pro. + +##################################################################### +## counting Binary: +##################################################################### + +add_qt_executable(counting + GUI + SOURCES + tst_counting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:counting.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:counting.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/crashes/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/crashes/.prev_CMakeLists.txt new file mode 100644 index 00000000000..3d2a1babd4a --- /dev/null +++ b/tests/auto/testlib/selftests/crashes/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from crashes.pro. + +##################################################################### +## crashes Binary: +##################################################################### + +add_qt_executable(crashes + GUI + SOURCES + tst_crashes.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:crashes.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:crashes.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/datatable/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/datatable/.prev_CMakeLists.txt new file mode 100644 index 00000000000..32e38eedff5 --- /dev/null +++ b/tests/auto/testlib/selftests/datatable/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from datatable.pro. + +##################################################################### +## datatable Binary: +##################################################################### + +add_qt_executable(datatable + GUI + SOURCES + tst_datatable.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:datatable.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:datatable.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/datetime/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/datetime/.prev_CMakeLists.txt new file mode 100644 index 00000000000..86e21f3eac2 --- /dev/null +++ b/tests/auto/testlib/selftests/datetime/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from datetime.pro. + +##################################################################### +## datetime Binary: +##################################################################### + +add_qt_executable(datetime + GUI + SOURCES + tst_datetime.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:datetime.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:datetime.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/deleteLater/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/deleteLater/.prev_CMakeLists.txt new file mode 100644 index 00000000000..18c7a526a7e --- /dev/null +++ b/tests/auto/testlib/selftests/deleteLater/.prev_CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from deleteLater.pro. + +##################################################################### +## tst_deleteLater Binary: +##################################################################### + +add_qt_executable(tst_deleteLater + GUI + SOURCES + tst_deleteLater.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:deleteLater.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/deleteLater_noApp/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/deleteLater_noApp/.prev_CMakeLists.txt new file mode 100644 index 00000000000..e88da0040df --- /dev/null +++ b/tests/auto/testlib/selftests/deleteLater_noApp/.prev_CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from deleteLater_noApp.pro. + +##################################################################### +## tst_deleteLater_noApp Binary: +##################################################################### + +add_qt_executable(tst_deleteLater_noApp + GUI + SOURCES + tst_deleteLater_noApp.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:deleteLater_noApp.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/differentexec/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/differentexec/.prev_CMakeLists.txt new file mode 100644 index 00000000000..907c2329cd0 --- /dev/null +++ b/tests/auto/testlib/selftests/differentexec/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from differentexec.pro. + +##################################################################### +## differentexec Binary: +##################################################################### + +add_qt_executable(differentexec + GUI + SOURCES + tst_differentexec.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:differentexec.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:differentexec.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/exceptionthrow/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/exceptionthrow/.prev_CMakeLists.txt new file mode 100644 index 00000000000..43b56d0c3f2 --- /dev/null +++ b/tests/auto/testlib/selftests/exceptionthrow/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from exceptionthrow.pro. + +##################################################################### +## exceptionthrow Binary: +##################################################################### + +add_qt_executable(exceptionthrow + GUI + SOURCES + tst_exceptionthrow.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:exceptionthrow.pro:: +# CONFIG = "-debug_and_release_target" "exceptions" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:exceptionthrow.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/expectfail/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/expectfail/.prev_CMakeLists.txt new file mode 100644 index 00000000000..b4550d999a0 --- /dev/null +++ b/tests/auto/testlib/selftests/expectfail/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from expectfail.pro. + +##################################################################### +## expectfail Binary: +##################################################################### + +add_qt_executable(expectfail + GUI + SOURCES + tst_expectfail.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:expectfail.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:expectfail.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failcleanup/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/failcleanup/.prev_CMakeLists.txt new file mode 100644 index 00000000000..1632518ab4f --- /dev/null +++ b/tests/auto/testlib/selftests/failcleanup/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from failcleanup.pro. + +##################################################################### +## failcleanup Binary: +##################################################################### + +add_qt_executable(failcleanup + GUI + SOURCES + tst_failcleanup.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failcleanup.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failcleanup.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/faildatatype/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/faildatatype/.prev_CMakeLists.txt new file mode 100644 index 00000000000..149dea9d5bd --- /dev/null +++ b/tests/auto/testlib/selftests/faildatatype/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from faildatatype.pro. + +##################################################################### +## faildatatype Binary: +##################################################################### + +add_qt_executable(faildatatype + GUI + SOURCES + tst_faildatatype.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:faildatatype.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:faildatatype.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failfetchtype/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/failfetchtype/.prev_CMakeLists.txt new file mode 100644 index 00000000000..c13fa99bae1 --- /dev/null +++ b/tests/auto/testlib/selftests/failfetchtype/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from failfetchtype.pro. + +##################################################################### +## failfetchtype Binary: +##################################################################### + +add_qt_executable(failfetchtype + GUI + SOURCES + tst_failfetchtype.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failfetchtype.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failfetchtype.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failinit/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/failinit/.prev_CMakeLists.txt new file mode 100644 index 00000000000..ecc131d2906 --- /dev/null +++ b/tests/auto/testlib/selftests/failinit/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from failinit.pro. + +##################################################################### +## failinit Binary: +##################################################################### + +add_qt_executable(failinit + GUI + SOURCES + tst_failinit.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failinit.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failinit.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/failinitdata/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/failinitdata/.prev_CMakeLists.txt new file mode 100644 index 00000000000..baecab0501a --- /dev/null +++ b/tests/auto/testlib/selftests/failinitdata/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from failinitdata.pro. + +##################################################################### +## failinitdata Binary: +##################################################################### + +add_qt_executable(failinitdata + GUI + SOURCES + tst_failinitdata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:failinitdata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:failinitdata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/fetchbogus/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/fetchbogus/.prev_CMakeLists.txt new file mode 100644 index 00000000000..c083406c319 --- /dev/null +++ b/tests/auto/testlib/selftests/fetchbogus/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from fetchbogus.pro. + +##################################################################### +## fetchbogus Binary: +##################################################################### + +add_qt_executable(fetchbogus + GUI + SOURCES + tst_fetchbogus.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:fetchbogus.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:fetchbogus.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/findtestdata/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/findtestdata/.prev_CMakeLists.txt new file mode 100644 index 00000000000..523e40c1692 --- /dev/null +++ b/tests/auto/testlib/selftests/findtestdata/.prev_CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from findtestdata.pro. + +##################################################################### +## findtestdata Binary: +##################################################################### + +add_qt_executable(findtestdata + GUI + SOURCES + findtestdata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +# Resources: +add_qt_resource(findtestdata "findtestdata" PREFIX "/qt/etc/" FILES + qt.conf) + + +#### Keys ignored in scope 1:.:.:findtestdata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:findtestdata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/float/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/float/.prev_CMakeLists.txt new file mode 100644 index 00000000000..af8db7db723 --- /dev/null +++ b/tests/auto/testlib/selftests/float/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from float.pro. + +##################################################################### +## float Binary: +##################################################################### + +add_qt_executable(float + GUI + SOURCES + tst_float.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:float.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:float.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/globaldata/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/globaldata/.prev_CMakeLists.txt new file mode 100644 index 00000000000..eb9af97ab40 --- /dev/null +++ b/tests/auto/testlib/selftests/globaldata/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from globaldata.pro. + +##################################################################### +## globaldata Binary: +##################################################################### + +add_qt_executable(globaldata + GUI + SOURCES + tst_globaldata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:globaldata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:globaldata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/keyboard/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/keyboard/.prev_CMakeLists.txt new file mode 100644 index 00000000000..2ba2ab36681 --- /dev/null +++ b/tests/auto/testlib/selftests/keyboard/.prev_CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from keyboard.pro. + +##################################################################### +## keyboard Binary: +##################################################################### + +add_qt_executable(keyboard + GUI + SOURCES + tst_keyboard.cpp + LIBRARIES + Qt::GuiPrivate + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Gui + Qt::Test +) + +#### Keys ignored in scope 1:.:.:keyboard.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:keyboard.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/longstring/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/longstring/.prev_CMakeLists.txt new file mode 100644 index 00000000000..86b039f2e1c --- /dev/null +++ b/tests/auto/testlib/selftests/longstring/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from longstring.pro. + +##################################################################### +## longstring Binary: +##################################################################### + +add_qt_executable(longstring + GUI + SOURCES + tst_longstring.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:longstring.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:longstring.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/maxwarnings/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/maxwarnings/.prev_CMakeLists.txt new file mode 100644 index 00000000000..bab5a9f9690 --- /dev/null +++ b/tests/auto/testlib/selftests/maxwarnings/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from maxwarnings.pro. + +##################################################################### +## maxwarnings Binary: +##################################################################### + +add_qt_executable(maxwarnings + GUI + SOURCES + maxwarnings.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:maxwarnings.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:maxwarnings.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/mouse/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/mouse/.prev_CMakeLists.txt new file mode 100644 index 00000000000..03a6a56236b --- /dev/null +++ b/tests/auto/testlib/selftests/mouse/.prev_CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from mouse.pro. + +##################################################################### +## mouse Binary: +##################################################################### + +add_qt_executable(mouse + GUI + SOURCES + tst_mouse.cpp + LIBRARIES + Qt::GuiPrivate + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Gui + Qt::Test +) + +#### Keys ignored in scope 1:.:.:mouse.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:mouse.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/multiexec/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/multiexec/.prev_CMakeLists.txt new file mode 100644 index 00000000000..9b0a98dedf3 --- /dev/null +++ b/tests/auto/testlib/selftests/multiexec/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from multiexec.pro. + +##################################################################### +## multiexec Binary: +##################################################################### + +add_qt_executable(multiexec + GUI + SOURCES + tst_multiexec.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:multiexec.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:multiexec.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/pairdiagnostics/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/pairdiagnostics/.prev_CMakeLists.txt new file mode 100644 index 00000000000..4e5d563011a --- /dev/null +++ b/tests/auto/testlib/selftests/pairdiagnostics/.prev_CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from pairdiagnostics.pro. + +##################################################################### +## pairdiagnostics Binary: +##################################################################### + +add_qt_executable(pairdiagnostics + GUI + SOURCES + tst_pairdiagnostics.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:pairdiagnostics.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/printdatatags/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/printdatatags/.prev_CMakeLists.txt new file mode 100644 index 00000000000..51cc667b33e --- /dev/null +++ b/tests/auto/testlib/selftests/printdatatags/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from printdatatags.pro. + +##################################################################### +## printdatatags Binary: +##################################################################### + +add_qt_executable(printdatatags + GUI + SOURCES + tst_printdatatags.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:printdatatags.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:printdatatags.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/printdatatagswithglobaltags/.prev_CMakeLists.txt new file mode 100644 index 00000000000..60d5ee891b9 --- /dev/null +++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from printdatatagswithglobaltags.pro. + +##################################################################### +## printdatatagswithglobaltags Binary: +##################################################################### + +add_qt_executable(printdatatagswithglobaltags + GUI + SOURCES + tst_printdatatagswithglobaltags.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:printdatatagswithglobaltags.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:printdatatagswithglobaltags.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/qexecstringlist/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/qexecstringlist/.prev_CMakeLists.txt new file mode 100644 index 00000000000..f0454960cca --- /dev/null +++ b/tests/auto/testlib/selftests/qexecstringlist/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from qexecstringlist.pro. + +##################################################################### +## qexecstringlist Binary: +##################################################################### + +add_qt_executable(qexecstringlist + GUI + SOURCES + tst_qexecstringlist.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:qexecstringlist.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:qexecstringlist.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/signaldumper/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/signaldumper/.prev_CMakeLists.txt new file mode 100644 index 00000000000..f55e6889b25 --- /dev/null +++ b/tests/auto/testlib/selftests/signaldumper/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from signaldumper.pro. + +##################################################################### +## signaldumper Binary: +##################################################################### + +add_qt_executable(signaldumper + GUI + SOURCES + tst_signaldumper.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:signaldumper.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:signaldumper.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/silent/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/silent/.prev_CMakeLists.txt new file mode 100644 index 00000000000..df5215a557f --- /dev/null +++ b/tests/auto/testlib/selftests/silent/.prev_CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from silent.pro. + +##################################################################### +## silent Binary: +##################################################################### + +add_qt_executable(silent + GUI + SOURCES + tst_silent.cpp + LIBRARIES + Qt::TestPrivate + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:silent.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:silent.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/singleskip/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/singleskip/.prev_CMakeLists.txt new file mode 100644 index 00000000000..176e0be6c05 --- /dev/null +++ b/tests/auto/testlib/selftests/singleskip/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from singleskip.pro. + +##################################################################### +## singleskip Binary: +##################################################################### + +add_qt_executable(singleskip + GUI + SOURCES + tst_singleskip.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:singleskip.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:singleskip.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skip/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/skip/.prev_CMakeLists.txt new file mode 100644 index 00000000000..7fd34cfe39f --- /dev/null +++ b/tests/auto/testlib/selftests/skip/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from skip.pro. + +##################################################################### +## skip Binary: +##################################################################### + +add_qt_executable(skip + GUI + SOURCES + tst_skip.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skip.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skip.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skipcleanup/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/skipcleanup/.prev_CMakeLists.txt new file mode 100644 index 00000000000..c79684c20a1 --- /dev/null +++ b/tests/auto/testlib/selftests/skipcleanup/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from skipcleanup.pro. + +##################################################################### +## skipcleanup Binary: +##################################################################### + +add_qt_executable(skipcleanup + GUI + SOURCES + tst_skipcleanup.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skipcleanup.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skipcleanup.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skipinit/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/skipinit/.prev_CMakeLists.txt new file mode 100644 index 00000000000..a08fb6fb27e --- /dev/null +++ b/tests/auto/testlib/selftests/skipinit/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from skipinit.pro. + +##################################################################### +## skipinit Binary: +##################################################################### + +add_qt_executable(skipinit + GUI + SOURCES + tst_skipinit.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skipinit.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skipinit.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/skipinitdata/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/skipinitdata/.prev_CMakeLists.txt new file mode 100644 index 00000000000..9ee6245368c --- /dev/null +++ b/tests/auto/testlib/selftests/skipinitdata/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from skipinitdata.pro. + +##################################################################### +## skipinitdata Binary: +##################################################################### + +add_qt_executable(skipinitdata + GUI + SOURCES + tst_skipinitdata.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:skipinitdata.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:skipinitdata.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/sleep/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/sleep/.prev_CMakeLists.txt new file mode 100644 index 00000000000..fa90735255b --- /dev/null +++ b/tests/auto/testlib/selftests/sleep/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from sleep.pro. + +##################################################################### +## sleep Binary: +##################################################################### + +add_qt_executable(sleep + GUI + SOURCES + tst_sleep.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:sleep.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:sleep.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/strcmp/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/strcmp/.prev_CMakeLists.txt new file mode 100644 index 00000000000..c51789cb96e --- /dev/null +++ b/tests/auto/testlib/selftests/strcmp/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from strcmp.pro. + +##################################################################### +## strcmp Binary: +##################################################################### + +add_qt_executable(strcmp + GUI + SOURCES + tst_strcmp.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:strcmp.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:strcmp.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/subtest/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/subtest/.prev_CMakeLists.txt new file mode 100644 index 00000000000..1e321d7d990 --- /dev/null +++ b/tests/auto/testlib/selftests/subtest/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from subtest.pro. + +##################################################################### +## subtest Binary: +##################################################################### + +add_qt_executable(subtest + GUI + SOURCES + tst_subtest.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:subtest.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:subtest.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/testlib/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/testlib/.prev_CMakeLists.txt new file mode 100644 index 00000000000..e16d3eef61c --- /dev/null +++ b/tests/auto/testlib/selftests/testlib/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from testlib.pro. + +##################################################################### +## testlib Binary: +##################################################################### + +add_qt_executable(testlib + GUI + SOURCES + tst_testlib.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:testlib.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:testlib.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/tuplediagnostics/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/tuplediagnostics/.prev_CMakeLists.txt new file mode 100644 index 00000000000..5d16c68c790 --- /dev/null +++ b/tests/auto/testlib/selftests/tuplediagnostics/.prev_CMakeLists.txt @@ -0,0 +1,16 @@ +# Generated from tuplediagnostics.pro. + +##################################################################### +## tuplediagnostics Binary: +##################################################################### + +add_qt_executable(tuplediagnostics + GUI + SOURCES + tst_tuplediagnostics.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:tuplediagnostics.pro:: +# CONFIG = "-app_bundle" "-debug_and_release_target" diff --git a/tests/auto/testlib/selftests/verbose1/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/verbose1/.prev_CMakeLists.txt new file mode 100644 index 00000000000..bdaed7dc454 --- /dev/null +++ b/tests/auto/testlib/selftests/verbose1/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from verbose1.pro. + +##################################################################### +## verbose1 Binary: +##################################################################### + +add_qt_executable(verbose1 + GUI + SOURCES + ../counting/tst_counting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:verbose1.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:verbose1.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/verbose2/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/verbose2/.prev_CMakeLists.txt new file mode 100644 index 00000000000..0da6c883ec0 --- /dev/null +++ b/tests/auto/testlib/selftests/verbose2/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from verbose2.pro. + +##################################################################### +## verbose2 Binary: +##################################################################### + +add_qt_executable(verbose2 + GUI + SOURCES + ../counting/tst_counting.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:verbose2.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:verbose2.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/verifyexceptionthrown/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/verifyexceptionthrown/.prev_CMakeLists.txt new file mode 100644 index 00000000000..fb28197adc4 --- /dev/null +++ b/tests/auto/testlib/selftests/verifyexceptionthrown/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from verifyexceptionthrown.pro. + +##################################################################### +## verifyexceptionthrown Binary: +##################################################################### + +add_qt_executable(verifyexceptionthrown + GUI + SOURCES + tst_verifyexceptionthrown.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:verifyexceptionthrown.pro:: +# CONFIG = "-debug_and_release_target" "exceptions" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:verifyexceptionthrown.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/warnings/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/warnings/.prev_CMakeLists.txt new file mode 100644 index 00000000000..111ec1594d2 --- /dev/null +++ b/tests/auto/testlib/selftests/warnings/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from warnings.pro. + +##################################################################### +## warnings Binary: +##################################################################### + +add_qt_executable(warnings + GUI + SOURCES + tst_warnings.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:warnings.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:warnings.pro:APPLE_OSX: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/watchdog/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/watchdog/.prev_CMakeLists.txt new file mode 100644 index 00000000000..8852d670a41 --- /dev/null +++ b/tests/auto/testlib/selftests/watchdog/.prev_CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from watchdog.pro. + +##################################################################### +## watchdog Binary: +##################################################################### + +add_qt_executable(watchdog + GUI + SOURCES + tst_watchdog.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:watchdog.pro:: +# CONFIG = "-debug_and_release_target" +# QT_TOOL_ENV = "checkenv" +# checkenv.name = "QTEST_FUNCTION_TIMEOUT" +# checkenv.value = "100" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:watchdog.pro:APPLE: +# CONFIG = "-app_bundle" diff --git a/tests/auto/testlib/selftests/xunit/.prev_CMakeLists.txt b/tests/auto/testlib/selftests/xunit/.prev_CMakeLists.txt new file mode 100644 index 00000000000..73fbbc18df0 --- /dev/null +++ b/tests/auto/testlib/selftests/xunit/.prev_CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from xunit.pro. + +##################################################################### +## xunit Binary: +##################################################################### + +add_qt_executable(xunit + GUI + SOURCES + tst_xunit.cpp + PUBLIC_LIBRARIES + Qt::Test +) + +#### Keys ignored in scope 1:.:.:xunit.pro:: +# CONFIG = "-debug_and_release_target" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 2:.:.:xunit.pro:APPLE_OSX: +# CONFIG = "-app_bundle" From b64e8e721fd9117af585151b93a18fec1c285059 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 15:17:33 +0200 Subject: [PATCH 0601/1322] Fix special_case_handler to handle git add prev_CMakeLists.txt better When using run_pro2cmake.py, it spawns multiple instances of pro2cmake.py. If more than 1 of the instances need to git add prev_CMakeLists.txt at the same time, git add might fail due to the acquired index.lock. The cleaner solution would be to use a file lock as a mutex, but that requires an external pypi package. Use a poor man solution of retrying the git add with a time delay for a finite amount of times. Change-Id: I2031f6e29ae499526cb4f1753e4387e7f4fab0ab Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- util/cmake/special_case_helper.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/util/cmake/special_case_helper.py b/util/cmake/special_case_helper.py index 57b91b6cb1b..1cb25ac1e2d 100644 --- a/util/cmake/special_case_helper.py +++ b/util/cmake/special_case_helper.py @@ -87,6 +87,7 @@ import re import os import subprocess import filecmp +import time from shutil import copyfile from shutil import rmtree @@ -142,7 +143,7 @@ def check_if_git_in_path() -> bool: return False -def run_process_quiet(args_string: str, debug=False) -> None: +def run_process_quiet(args_string: str, debug=False) -> bool: if debug: print('Running command: "{}\"'.format(args_string)) args_list = args_string.split() @@ -153,6 +154,8 @@ def run_process_quiet(args_string: str, debug=False) -> None: # an error for us. if 'git merge' not in args_string: print('Error while running: "{}"\n{}'.format(args_string, e.stdout)) + return False + return True def does_file_have_conflict_markers(file_path: str, debug=False) -> bool: @@ -289,7 +292,28 @@ class SpecialCaseHandler(object): # merge result, save the new "clean" file for future # regenerations. copyfile_log(self.generated_file_path, self.prev_file_path, debug=self.debug) - run_process_quiet("git add {}".format(self.prev_file_path), debug=self.debug) + + # Attempt to git add until we succeed. It can fail when + # run_pro2cmake executes pro2cmake in multiple threads, and git + # has acquired the index lock. + success = False + failed_once = False + i = 0 + while not success and i < 20: + success = run_process_quiet("git add {}".format(self.prev_file_path), + debug=self.debug) + if not success: + failed_once = True + i += 1 + time.sleep(0.1) + + if failed_once and not success: + print('Retrying git add, the index.lock was probably acquired.') + if failed_once and success: + print('git add succeeded.') + elif failed_once and not success: + print('git add failed. Make sure to git add {} yourself.'.format( + self.prev_file_path)) def handle_special_cases_helper(self) -> bool: """ From 003e0bb8ff3fcb4dbc74e1e199eb3fd2454166be Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 17:09:14 +0200 Subject: [PATCH 0602/1322] cmake: tweak largefile defines so they are actually set for all the targets and that the code is a bit simpler Change-Id: I2cd253d0a3cec3f482b868f81e852edfa158d3f1 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 07ea8018878..bd18d48beb7 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1051,10 +1051,6 @@ function(add_qt_module target) qt_autogen_tools_initial_setup(${target}) - if(FEATURE_largefile) - set(largefile_defines "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") - endif() - extend_target("${target}" SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES @@ -1079,7 +1075,6 @@ function(add_qt_module target) QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS QT_BUILDING_QT - "${largefile_defines}" QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} @@ -1103,6 +1098,9 @@ function(add_qt_module target) # It's set for every module being built, but it's not propagated to user apps. target_compile_definitions("${target}" PRIVATE _USE_MATH_DEFINES) endif() + if(FEATURE_largefile) + target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") + endif() set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") @@ -1439,6 +1437,10 @@ function(add_qt_plugin target) ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) + if(FEATURE_largefile) + target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") + endif() + set(qt_libs_private "") foreach(it ${QT_KNOWN_MODULES}) @@ -1549,6 +1551,10 @@ function(add_qt_executable name) WIN32_EXECUTABLE "${arg_GUI}" MACOSX_BUNDLE "${arg_GUI}" ) + if(FEATURE_largefile) + target_compile_definitions("${name}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") + endif() + if(WIN32) # Workaround for not having ported the winmain / qtmain static library From 9231204e2ccab611af0df9a18761cd601ba20e92 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 22:40:42 +0200 Subject: [PATCH 0603/1322] Fix extra_keys in write_all_source_file_lists to be optional Initially it was added as a required argument, but not all usages of the function where adjusted, so the script failed. Make it optional. Also change the styling of the argument to be snake cased. Amends 8fea3ec4e77dfebe2e84e10ae0f014d03b9098b3. Change-Id: I568800401bb5af153b7bb5229f134c2f74b87468 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- util/cmake/pro2cmake.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 072fd4a08b1..98706d1064a 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1140,9 +1140,12 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, - indent: int = 0, footer: str = '', extraKeys: typing.List[str]): + indent: int = 0, footer: str = '', + extra_keys: typing.Union[typing.List[str], None] = None): + if extra_keys is None: + extra_keys = [] write_source_file_list(cm_fh, scope, header, - ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'] + extraKeys, + ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'] + extra_keys, indent, footer=footer) @@ -1700,7 +1703,7 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, if gui: add_executable += ' WIN32 MACOSX_BUNDLE' - write_all_source_file_lists(cm_fh, scope, add_executable, indent=0, extraKeys = ['RESOURCES']) + write_all_source_file_lists(cm_fh, scope, add_executable, indent=0, extra_keys=['RESOURCES']) cm_fh.write(')\n') From 891c897b801c86eaf4c4daea5fab3f2d510fbbe8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 22:57:36 +0200 Subject: [PATCH 0604/1322] Regenerate the main qtbase modules There were some changes done in pro2cmake, so regenerate the main qtbase modules to keep everything up to date. Some new whitespace got added. Some special cases were removed (ZLIB). Some opengl code got moved around. Some plugin types were added. And some other minor things. Change-Id: Ie8cba4a9aa6b4b163c39d6cf546ea9e0bfc05c01 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- src/concurrent/CMakeLists.txt | 1 + src/corelib/.prev_CMakeLists.txt | 2 + src/corelib/CMakeLists.txt | 2 + src/dbus/.prev_CMakeLists.txt | 1 + src/dbus/CMakeLists.txt | 1 + src/gui/.prev_CMakeLists.txt | 82 ++++++++++++---------- src/gui/CMakeLists.txt | 116 +++++++++++++++---------------- src/network/.prev_CMakeLists.txt | 3 + src/network/CMakeLists.txt | 4 +- src/opengl/.prev_CMakeLists.txt | 1 + src/opengl/CMakeLists.txt | 1 + src/printsupport/CMakeLists.txt | 2 + src/sql/CMakeLists.txt | 4 +- src/testlib/.prev_CMakeLists.txt | 1 + src/testlib/CMakeLists.txt | 1 + src/widgets/.prev_CMakeLists.txt | 2 + src/widgets/CMakeLists.txt | 2 + src/xml/CMakeLists.txt | 16 +++-- 18 files changed, 139 insertions(+), 103 deletions(-) diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index 56eb2163da0..9094cf13db5 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -45,3 +45,4 @@ extend_target(Concurrent CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i3 add_qt_docs( doc/qtconcurrent.qdocconf ) + diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt index 0b0f9632e3f..cad230bd87f 100644 --- a/src/corelib/.prev_CMakeLists.txt +++ b/src/corelib/.prev_CMakeLists.txt @@ -239,6 +239,7 @@ add_qt_simd_part(Core SIMD mips_dsp ) + #### Keys ignored in scope 1:.:.:corelib.pro:: # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" # ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" @@ -964,3 +965,4 @@ qt_create_tracepoints(Core qtcore.tracepoints) add_qt_docs( doc/qtcore.qdocconf ) + diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 5313eecfe99..5d45d2b3167 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -311,6 +311,7 @@ add_qt_simd_part(Core SIMD mips_dsp ) + #### Keys ignored in scope 1:.:.:corelib.pro:: # ANDROID_BUNDLED_JAR_DEPENDENCIES = "jar/QtAndroid.jar" # ANDROID_LIB_DEPENDENCIES = "plugins/platforms/android/libqtforandroid.so" @@ -1074,3 +1075,4 @@ qt_create_tracepoints(Core qtcore.tracepoints) add_qt_docs( doc/qtcore.qdocconf ) + diff --git a/src/dbus/.prev_CMakeLists.txt b/src/dbus/.prev_CMakeLists.txt index 852ba7b03f5..aee116ffa71 100644 --- a/src/dbus/.prev_CMakeLists.txt +++ b/src/dbus/.prev_CMakeLists.txt @@ -72,3 +72,4 @@ extend_target(DBus CONDITION WIN32 add_qt_docs( doc/qtdbus.qdocconf ) + diff --git a/src/dbus/CMakeLists.txt b/src/dbus/CMakeLists.txt index 9810167bca8..fdfbb485ab1 100644 --- a/src/dbus/CMakeLists.txt +++ b/src/dbus/CMakeLists.txt @@ -75,3 +75,4 @@ extend_target(DBus CONDITION WIN32 add_qt_docs( doc/qtdbus.qdocconf ) + diff --git a/src/gui/.prev_CMakeLists.txt b/src/gui/.prev_CMakeLists.txt index dfdf061d6ae..815a33117ad 100644 --- a/src/gui/.prev_CMakeLists.txt +++ b/src/gui/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Gui + PLUGIN_TYPES platforms platforms/darwin xcbglintegrations platformthemes platforminputcontexts generic iconengines imageformats egldeviceintegrations SOURCES image/qbitmap.cpp image/qbitmap.h image/qbmphandler.cpp image/qbmphandler_p.h @@ -205,6 +206,7 @@ add_qt_module(Gui QT_NO_USING_NAMESPACE LIBRARIES Qt::CorePrivate + ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core ) @@ -221,18 +223,21 @@ add_qt_simd_part(Gui SIMD sse2 painting/qdrawhelper_sse2.cpp ) + add_qt_simd_part(Gui SIMD ssse3 SOURCES image/qimage_ssse3.cpp painting/qdrawhelper_ssse3.cpp ) + add_qt_simd_part(Gui SIMD sse4_1 SOURCES painting/qdrawhelper_sse4.cpp painting/qimagescale_sse4.cpp ) + add_qt_simd_part(Gui SIMD neon SOURCES image/qimage_neon.cpp @@ -240,6 +245,7 @@ add_qt_simd_part(Gui SIMD neon painting/qimagescale_neon.cpp ) + add_qt_simd_part(Gui SIMD mips_dsp SOURCES painting/qdrawhelper_mips_dsp.cpp painting/qdrawhelper_mips_dsp_p.h @@ -247,6 +253,7 @@ add_qt_simd_part(Gui SIMD mips_dsp painting/qt_mips_asm_dsp_p.h ) + add_qt_simd_part(Gui SIMD mips_dspr2 SOURCES image/qimage_mips_dspr2.cpp @@ -254,12 +261,14 @@ add_qt_simd_part(Gui SIMD mips_dspr2 painting/qdrawhelper_mips_dspr2_asm.S ) + add_qt_simd_part(Gui SIMD arch_haswell SOURCES painting/qdrawhelper_avx2.cpp ) + #### Keys ignored in scope 1:.:.:gui.pro:: # CONFIG = "simd" "optimize_full" "qt_tracepoints" # MODULE_PLUGIN_TYPES = "platforms" "platforms/darwin" "xcbglintegrations" "platformthemes" "platforminputcontexts" "generic" "iconengines" "imageformats" "egldeviceintegrations" @@ -270,7 +279,41 @@ add_qt_simd_part(Gui SIMD arch_haswell ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:.:gui.pro:qtConfig(opengl._x_): +extend_target(Gui CONDITION QT_FEATURE_opengl + SOURCES + kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h + kernel/qopenglwindow.cpp kernel/qopenglwindow.h + kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h + opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h + opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h + opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h + opengl/qopenglcustomshaderstage.cpp opengl/qopenglcustomshaderstage_p.h + opengl/qopengldebug.cpp opengl/qopengldebug.h + opengl/qopenglengineshadermanager.cpp opengl/qopenglengineshadermanager_p.h + opengl/qopenglengineshadersource_p.h + opengl/qopenglextensions_p.h + opengl/qopenglextrafunctions.h + opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h + opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h + opengl/qopenglgradientcache.cpp opengl/qopenglgradientcache_p.h + opengl/qopenglpaintdevice.cpp opengl/qopenglpaintdevice.h opengl/qopenglpaintdevice_p.h + opengl/qopenglpaintengine.cpp opengl/qopenglpaintengine_p.h + opengl/qopenglpixeltransferoptions.cpp opengl/qopenglpixeltransferoptions.h + opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h + opengl/qopenglshadercache_p.h + opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h + opengl/qopengltexture.cpp opengl/qopengltexture.h opengl/qopengltexture_p.h + opengl/qopengltextureblitter.cpp opengl/qopengltextureblitter.h + opengl/qopengltexturecache.cpp opengl/qopengltexturecache_p.h + opengl/qopengltextureglyphcache.cpp opengl/qopengltextureglyphcache_p.h + opengl/qopengltexturehelper.cpp opengl/qopengltexturehelper_p.h + opengl/qopengltextureuploader.cpp opengl/qopengltextureuploader_p.h + opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h + opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h + opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h +) + +#### Keys ignored in scope 2:.:.:gui.pro:QT_FEATURE_opengl: # MODULE_CONFIG = "opengl" #### Keys ignored in scope 3:.:.:gui.pro:QT_FEATURE_angle: @@ -369,40 +412,6 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h ) -extend_target(Gui CONDITION QT_FEATURE_opengl - SOURCES - kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h - kernel/qopenglwindow.cpp kernel/qopenglwindow.h - kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h - opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h - opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h - opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h - opengl/qopenglcustomshaderstage.cpp opengl/qopenglcustomshaderstage_p.h - opengl/qopengldebug.cpp opengl/qopengldebug.h - opengl/qopenglengineshadermanager.cpp opengl/qopenglengineshadermanager_p.h - opengl/qopenglengineshadersource_p.h - opengl/qopenglextensions_p.h - opengl/qopenglextrafunctions.h - opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h - opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h - opengl/qopenglgradientcache.cpp opengl/qopenglgradientcache_p.h - opengl/qopenglpaintdevice.cpp opengl/qopenglpaintdevice.h opengl/qopenglpaintdevice_p.h - opengl/qopenglpaintengine.cpp opengl/qopenglpaintengine_p.h - opengl/qopenglpixeltransferoptions.cpp opengl/qopenglpixeltransferoptions.h - opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h - opengl/qopenglshadercache_p.h - opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h - opengl/qopengltexture.cpp opengl/qopengltexture.h opengl/qopengltexture_p.h - opengl/qopengltextureblitter.cpp opengl/qopengltextureblitter.h - opengl/qopengltexturecache.cpp opengl/qopengltexturecache_p.h - opengl/qopengltextureglyphcache.cpp opengl/qopengltextureglyphcache_p.h - opengl/qopengltexturehelper.cpp opengl/qopengltexturehelper_p.h - opengl/qopengltextureuploader.cpp opengl/qopengltextureuploader_p.h - opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h - opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h - opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h -) - extend_target(Gui CONDITION QT_FEATURE_movie SOURCES image/qmovie.cpp image/qmovie.h @@ -463,7 +472,7 @@ extend_target(Gui CONDITION QT_FEATURE_cssparser text/qcssparser.cpp text/qcssparser_p.h ) -extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 +extend_target(Gui CONDITION GCC AND (QT_COMPILER_VERSION_MAJOR STREQUAL 5) SOURCES -painting/qdrawhelper.cpp painting/qdrawhelper.cpp @@ -551,3 +560,4 @@ qt_create_tracepoints(Gui qtgui.tracepoints) add_qt_docs( doc/qtgui.qdocconf ) + diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 50e966d34dc..70ce41aaca0 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -39,16 +39,7 @@ endif() # special case end add_qt_module(Gui - PLUGIN_TYPES - platforms - platforms/darwin - xcbglintegrations - platformthemes - platforminputcontexts - generic - iconengines - imageformats - egldeviceintegrations + PLUGIN_TYPES platforms platforms/darwin xcbglintegrations platformthemes platforminputcontexts generic iconengines imageformats egldeviceintegrations FEATURE_DEPENDENCIES # special case: Qt::Network # special case: SOURCES @@ -252,7 +243,7 @@ add_qt_module(Gui QT_QPA_DEFAULT_PLATFORM_NAME="${QT_QPA_DEFAULT_PLATFORM}" # special case LIBRARIES Qt::CorePrivate - ZLIB::ZLIB # special case + ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core ) @@ -277,18 +268,21 @@ add_qt_simd_part(Gui SIMD sse2 painting/qdrawhelper_sse2.cpp ) + add_qt_simd_part(Gui SIMD ssse3 SOURCES image/qimage_ssse3.cpp painting/qdrawhelper_ssse3.cpp ) + add_qt_simd_part(Gui SIMD sse4_1 SOURCES painting/qdrawhelper_sse4.cpp painting/qimagescale_sse4.cpp ) + add_qt_simd_part(Gui SIMD neon SOURCES image/qimage_neon.cpp @@ -296,6 +290,7 @@ add_qt_simd_part(Gui SIMD neon painting/qimagescale_neon.cpp ) + add_qt_simd_part(Gui SIMD mips_dsp SOURCES painting/qdrawhelper_mips_dsp.cpp painting/qdrawhelper_mips_dsp_p.h @@ -303,6 +298,7 @@ add_qt_simd_part(Gui SIMD mips_dsp painting/qt_mips_asm_dsp_p.h ) + add_qt_simd_part(Gui SIMD mips_dspr2 SOURCES image/qimage_mips_dspr2.cpp @@ -327,6 +323,7 @@ extend_target(Gui CONDITION QT_FEATURE_standarditemmodel # special case end + #### Keys ignored in scope 1:.:.:gui.pro:: # CONFIG = "simd" "optimize_full" "qt_tracepoints" # MODULE_PLUGIN_TYPES = "platforms" "platforms/darwin" "xcbglintegrations" "platformthemes" "platforminputcontexts" "generic" "iconengines" "imageformats" "egldeviceintegrations" @@ -337,7 +334,53 @@ extend_target(Gui CONDITION QT_FEATURE_standarditemmodel ## Scopes: ##################################################################### -#### Keys ignored in scope 2:.:.:gui.pro:qtConfig(opengl._x_): +# special case begin +# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf +# acted like WrapOpenGL: direct linkage against either libGLESv2 or +# libGL, depending on the opengl _feature_. This is done by hand now +# here (where the feature is available). +# DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not +# available until the add_qt_module call. +qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) +# special case end + +extend_target(Gui CONDITION QT_FEATURE_opengl + SOURCES + kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h + kernel/qopenglwindow.cpp kernel/qopenglwindow.h + kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h + opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h + opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h + opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h + opengl/qopenglcustomshaderstage.cpp opengl/qopenglcustomshaderstage_p.h + opengl/qopengldebug.cpp opengl/qopengldebug.h + opengl/qopenglengineshadermanager.cpp opengl/qopenglengineshadermanager_p.h + opengl/qopenglengineshadersource_p.h + opengl/qopenglextensions_p.h + opengl/qopenglextrafunctions.h + opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h + opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h + opengl/qopenglgradientcache.cpp opengl/qopenglgradientcache_p.h + opengl/qopenglpaintdevice.cpp opengl/qopenglpaintdevice.h opengl/qopenglpaintdevice_p.h + opengl/qopenglpaintengine.cpp opengl/qopenglpaintengine_p.h + opengl/qopenglpixeltransferoptions.cpp opengl/qopenglpixeltransferoptions.h + opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h + opengl/qopenglshadercache_p.h + opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h + opengl/qopengltexture.cpp opengl/qopengltexture.h opengl/qopengltexture_p.h + opengl/qopengltextureblitter.cpp opengl/qopengltextureblitter.h + opengl/qopengltexturecache.cpp opengl/qopengltexturecache_p.h + opengl/qopengltextureglyphcache.cpp opengl/qopengltextureglyphcache_p.h + opengl/qopengltexturehelper.cpp opengl/qopengltexturehelper_p.h + opengl/qopengltextureuploader.cpp opengl/qopengltextureuploader_p.h + opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h + opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h + opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h + LIBRARIES # special case + WrapOpenGL # special case +) + +#### Keys ignored in scope 2:.:.:gui.pro:QT_FEATURE_opengl: # MODULE_CONFIG = "opengl" #### Keys ignored in scope 3:.:.:gui.pro:QT_FEATURE_angle: @@ -436,52 +479,6 @@ extend_target(Gui CONDITION QT_FEATURE_draganddrop kernel/qsimpledrag.cpp kernel/qsimpledrag_p.h ) -# special case begin -# With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf -# acted like WrapOpenGL: direct linkage against either libGLESv2 or -# libGL, depending on the opengl _feature_. This is done by hand now -# here (where the feature is available). -# DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not -# available until the add_qt_module call. -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) -# special case end - -extend_target(Gui CONDITION QT_FEATURE_opengl - SOURCES - kernel/qopenglcontext.cpp kernel/qopenglcontext.h kernel/qopenglcontext_p.h - kernel/qopenglwindow.cpp kernel/qopenglwindow.h - kernel/qplatformopenglcontext.cpp kernel/qplatformopenglcontext.h - opengl/qopengl.cpp opengl/qopengl.h opengl/qopengl_p.h - opengl/qopengl2pexvertexarray.cpp opengl/qopengl2pexvertexarray_p.h - opengl/qopenglbuffer.cpp opengl/qopenglbuffer.h - opengl/qopenglcustomshaderstage.cpp opengl/qopenglcustomshaderstage_p.h - opengl/qopengldebug.cpp opengl/qopengldebug.h - opengl/qopenglengineshadermanager.cpp opengl/qopenglengineshadermanager_p.h - opengl/qopenglengineshadersource_p.h - opengl/qopenglextensions_p.h - opengl/qopenglextrafunctions.h - opengl/qopenglframebufferobject.cpp opengl/qopenglframebufferobject.h opengl/qopenglframebufferobject_p.h - opengl/qopenglfunctions.cpp opengl/qopenglfunctions.h - opengl/qopenglgradientcache.cpp opengl/qopenglgradientcache_p.h - opengl/qopenglpaintdevice.cpp opengl/qopenglpaintdevice.h opengl/qopenglpaintdevice_p.h - opengl/qopenglpaintengine.cpp opengl/qopenglpaintengine_p.h - opengl/qopenglpixeltransferoptions.cpp opengl/qopenglpixeltransferoptions.h - opengl/qopenglprogrambinarycache.cpp opengl/qopenglprogrambinarycache_p.h - opengl/qopenglshadercache_p.h - opengl/qopenglshaderprogram.cpp opengl/qopenglshaderprogram.h - opengl/qopengltexture.cpp opengl/qopengltexture.h opengl/qopengltexture_p.h - opengl/qopengltextureblitter.cpp opengl/qopengltextureblitter.h - opengl/qopengltexturecache.cpp opengl/qopengltexturecache_p.h - opengl/qopengltextureglyphcache.cpp opengl/qopengltextureglyphcache_p.h - opengl/qopengltexturehelper.cpp opengl/qopengltexturehelper_p.h - opengl/qopengltextureuploader.cpp opengl/qopengltextureuploader_p.h - opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h - opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h - opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h - LIBRARIES # special case - WrapOpenGL # special case -) - extend_target(Gui CONDITION QT_FEATURE_movie SOURCES image/qmovie.cpp image/qmovie.h @@ -542,7 +539,7 @@ extend_target(Gui CONDITION QT_FEATURE_cssparser text/qcssparser.cpp text/qcssparser_p.h ) -# extend_target(Gui CONDITION GCC AND QT_GCC_MAJOR_VERSION___equals___5 ... # special case: +# extend_target(Gui CONDITION GCC AND (QT_COMPILER_VERSION_MAJOR STREQUAL 5) ... # special case: remove #### Keys ignored in scope 50:.:painting:painting/painting.pri:NOT APPLE_UIKIT AND NOT WIN32 AND QT_ARCH___contains___arm: # CONFIG = "no_clang_integrated_as" @@ -686,3 +683,4 @@ qt_create_tracepoints(Gui qtgui.tracepoints) add_qt_docs( doc/qtgui.qdocconf ) + diff --git a/src/network/.prev_CMakeLists.txt b/src/network/.prev_CMakeLists.txt index 1b901d30500..b1ba59e7be9 100644 --- a/src/network/.prev_CMakeLists.txt +++ b/src/network/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Network + PLUGIN_TYPES bearer SOURCES access/qabstractnetworkcache.cpp access/qabstractnetworkcache.h access/qabstractnetworkcache_p.h access/qhsts.cpp access/qhsts_p.h @@ -56,6 +57,7 @@ add_qt_module(Network kernel LIBRARIES Qt::CorePrivate + ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core ) @@ -427,3 +429,4 @@ extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 add_qt_docs( doc/qtnetwork.qdocconf ) + diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 4a642835b67..dc4f08e4cdf 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Network + PLUGIN_TYPES bearer SOURCES access/qabstractnetworkcache.cpp access/qabstractnetworkcache.h access/qabstractnetworkcache_p.h access/qhsts.cpp access/qhsts_p.h @@ -56,7 +57,7 @@ add_qt_module(Network kernel LIBRARIES Qt::CorePrivate - ZLIB::ZLIB # special case + ZLIB::ZLIB PUBLIC_LIBRARIES Qt::Core ) @@ -432,3 +433,4 @@ extend_target(Network CONDITION WIN32 LIBRARIES ws2_32) # special case: mkspecs/ add_qt_docs( doc/qtnetwork.qdocconf ) + diff --git a/src/opengl/.prev_CMakeLists.txt b/src/opengl/.prev_CMakeLists.txt index 759b1a70832..2844fac32d3 100644 --- a/src/opengl/.prev_CMakeLists.txt +++ b/src/opengl/.prev_CMakeLists.txt @@ -63,3 +63,4 @@ extend_target(OpenGL CONDITION QT_FEATURE_graphicseffect add_qt_docs( doc/qtopengl.qdocconf ) + diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index af77dde8a22..53a59b34347 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -64,3 +64,4 @@ extend_target(OpenGL CONDITION QT_FEATURE_graphicseffect add_qt_docs( doc/qtopengl.qdocconf ) + diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index bdb93042d51..5215961f61b 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(PrintSupport + PLUGIN_TYPES printsupport SOURCES kernel/qpaintengine_alpha.cpp kernel/qpaintengine_alpha_p.h kernel/qplatformprintdevice.cpp kernel/qplatformprintdevice.h @@ -153,3 +154,4 @@ extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewdialog add_qt_docs( doc/qtprintsupport.qdocconf ) + diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index 8f728e70792..8e9345765ff 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -5,8 +5,7 @@ ##################################################################### add_qt_module(Sql - PLUGIN_TYPES - sqldrivers + PLUGIN_TYPES sqldrivers SOURCES kernel/qsqlcachedresult.cpp kernel/qsqlcachedresult_p.h kernel/qsqldatabase.cpp kernel/qsqldatabase.h @@ -54,3 +53,4 @@ extend_target(Sql CONDITION QT_FEATURE_sqlmodel add_qt_docs( doc/qtsql.qdocconf ) + diff --git a/src/testlib/.prev_CMakeLists.txt b/src/testlib/.prev_CMakeLists.txt index aef2ceefd0b..82bc8341bbf 100644 --- a/src/testlib/.prev_CMakeLists.txt +++ b/src/testlib/.prev_CMakeLists.txt @@ -139,3 +139,4 @@ extend_target(Test CONDITION ((APPLE_OSX) AND (OFF AND NOT lessThan(QMAKE_XCODE_ add_qt_docs( doc/qttestlib.qdocconf ) + diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index 92864a9e011..9acbe76e0ff 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -122,3 +122,4 @@ extend_target(Test CONDITION APPLE_OSX add_qt_docs( doc/qttestlib.qdocconf ) + diff --git a/src/widgets/.prev_CMakeLists.txt b/src/widgets/.prev_CMakeLists.txt index 6d4691d8f89..f8ae83025c1 100644 --- a/src/widgets/.prev_CMakeLists.txt +++ b/src/widgets/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(Widgets QMAKE_MODULE_CONFIG uic + PLUGIN_TYPES styles SOURCES itemviews/qfileiconprovider.cpp itemviews/qfileiconprovider.h itemviews/qfileiconprovider_p.h kernel/qaction.cpp kernel/qaction.h kernel/qaction_p.h @@ -796,3 +797,4 @@ qt_create_tracepoints(Widgets qtwidgets.tracepoints) add_qt_docs( doc/qtwidgets.qdocconf ) + diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index 5532f7387df..a4c4ea16a36 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(Widgets QMAKE_MODULE_CONFIG uic + PLUGIN_TYPES styles SOURCES itemviews/qfileiconprovider.cpp itemviews/qfileiconprovider.h itemviews/qfileiconprovider_p.h kernel/qaction.cpp kernel/qaction.h kernel/qaction_p.h @@ -800,3 +801,4 @@ qt_create_tracepoints(Widgets qtwidgets.tracepoints) add_qt_docs( doc/qtwidgets.qdocconf ) + diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt index 7ce740476c8..6c7ad3489eb 100644 --- a/src/xml/CMakeLists.txt +++ b/src/xml/CMakeLists.txt @@ -10,20 +10,26 @@ add_qt_module(Xml qtxmlglobal.h sax/qxml.cpp sax/qxml.h sax/qxml_p.h DEFINES - QT_NO_USING_NAMESPACE QT_NO_FOREACH + QT_NO_USING_NAMESPACE LIBRARIES Qt::CorePrivate - # PRECOMPILED_HEADER = - # _LOADED = "qt_module" + PUBLIC_LIBRARIES + Qt::Core ) +#### Keys ignored in scope 1:.:.:xml.pro:: +# PRECOMPILED_HEADER = +# _LOADED = "qt_module" + ## Scopes: ##################################################################### -extend_target(Xml CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") +extend_target(Xml CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x61000000" ) +add_qt_docs( + doc/qtxml.qdocconf +) -add_qt_docs(./doc/qtxml.qdocconf) From d0eb985f7413c62c2bff26caaf84bec2e6893131 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 28 May 2019 19:11:36 +0200 Subject: [PATCH 0605/1322] Improve run_pro2cmake.py Add two new options: If you pass --only-existing, the pro2cmake script will only be executed on .pro files that already have a CMakeLists.txt next to them. This is useful if you modify pro2cmake, and only want to regenerate existing files. If you pass --only-qtbase-main-modules, the script will be executed on the main modules in qtbase/src. This is useful if you want to check if your pro2cmake modification works correctly on the more complicated projects. Change-Id: I5228411a252dbef6d77f01ca742a7b98583c5a75 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- util/cmake/run_pro2cmake.py | 141 +++++++++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 35 deletions(-) diff --git a/util/cmake/run_pro2cmake.py b/util/cmake/run_pro2cmake.py index 47bc6b661f6..bc64fb3fbb5 100755 --- a/util/cmake/run_pro2cmake.py +++ b/util/cmake/run_pro2cmake.py @@ -31,18 +31,24 @@ import glob import os import subprocess import concurrent.futures -import sys import typing - -script_path = os.path.dirname(os.path.abspath(__file__)) -base_path = os.path.dirname(script_path) -pro2cmake = os.path.join(script_path, 'pro2cmake.py') - -if len(sys.argv) > 1: - base_path = os.path.abspath(sys.argv[1]) +import argparse +from argparse import ArgumentParser -def find_all_pro_files(): +def parse_command_line(): + parser = ArgumentParser(description='Run pro2cmake on all .pro files recursively in given path.') + parser.add_argument('--only-existing', dest='only_existing', action='store_true', + help='Run pro2cmake only on .pro files that already have a CMakeLists.txt.') + parser.add_argument('--only-qtbase-main-modules', dest='only_qtbase_main_modules', action='store_true', + help='Run pro2cmake only on the main modules in qtbase.') + parser.add_argument('path', metavar='', type=str, + help='The path where to look for .pro files.') + + return parser.parse_args() + + +def find_all_pro_files(base_path: str, args: argparse.Namespace): def sorter(pro_file: str) -> str: """ Sorter that tries to prioritize main pro files in a directory. """ @@ -54,9 +60,49 @@ def find_all_pro_files(): all_files = [] previous_dir_name: str = None - for pro_file in sorted(glob.glob(os.path.join(base_path, '**/*.pro'), - recursive=True), - key=sorter): + + print('Finding .pro files.') + glob_result = glob.glob(os.path.join(base_path, '**/*.pro'), recursive=True) + + def cmake_lists_exists_filter(path): + path_dir_name = os.path.dirname(path) + if os.path.exists(os.path.join(path_dir_name, 'CMakeLists.txt')): + return True + return False + + def qtbase_main_modules_filter(path): + main_modules = [ + 'corelib', + 'network', + 'gui', + 'widgets', + 'testlib', + 'printsupport', + 'opengl', + 'sql', + 'dbus', + 'concurrent', + 'xml', + ] + path_suffixes = ['src/{}/{}.pro'.format(m, m, '.pro') for m in main_modules] + + for path_suffix in path_suffixes: + if path.endswith(path_suffix): + return True + return False + + filter_result = glob_result + filter_func = None + if args.only_existing: + filter_func = cmake_lists_exists_filter + elif args.only_qtbase_main_modules: + filter_func = qtbase_main_modules_filter + + if filter_func: + print('Filtering.') + filter_result = [p for p in filter_result if filter_func(p)] + + for pro_file in sorted(filter_result, key=sorter): dir_name = os.path.dirname(pro_file) if dir_name == previous_dir_name: print("Skipping:", pro_file) @@ -66,31 +112,56 @@ def find_all_pro_files(): return all_files -failed_files = [] -all_files = find_all_pro_files() -files_count = len(all_files) +def run(all_files: typing.List[str], pro2cmake: str, args: argparse.Namespace) -> typing.List[str]: + failed_files = [] + files_count = len(all_files) + workers = (os.cpu_count() or 1) -with concurrent.futures.ThreadPoolExecutor(initializer=os.nice, initargs=(10,)) as pool: + if args.only_qtbase_main_modules: + # qtbase main modules take longer than usual to process. + workers = 2 - def _process_a_file(data: typing.Tuple[str, int, int]) -> typing.Tuple[int, str, str]: - filename, index, total = data - result = subprocess.run((pro2cmake, os.path.basename(filename)), - cwd=os.path.dirname(filename), - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - stdout = 'Converted[{}/{}]: {}\n'.format(index, total, filename) - return result.returncode, filename, stdout + result.stdout.decode() + with concurrent.futures.ThreadPoolExecutor(max_workers=workers, initializer=os.nice, initargs=(10,)) as pool: + print('Firing up thread pool executor.') - for return_code, filename, stdout in pool.map(_process_a_file, - zip(all_files, - range(1, files_count + 1), - (files_count for _ in all_files))): - if return_code: - failed_files.append(filename) - print(stdout) + def _process_a_file(data: typing.Tuple[str, int, int]) -> typing.Tuple[int, str, str]: + filename, index, total = data + result = subprocess.run((pro2cmake, os.path.basename(filename)), + cwd=os.path.dirname(filename), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + stdout = 'Converted[{}/{}]: {}\n'.format(index, total, filename) + return result.returncode, filename, stdout + result.stdout.decode() -if failed_files: - print('The following files were not successfully ' - 'converted ({} of {}):'.format(len(failed_files), files_count)) - for f in failed_files: - print(' "{}"'.format(f)) + for return_code, filename, stdout in pool.map(_process_a_file, + zip(all_files, + range(1, files_count + 1), + (files_count for _ in all_files))): + if return_code: + failed_files.append(filename) + print(stdout) + return failed_files + + +def main() -> None: + args = parse_command_line() + + script_path = os.path.dirname(os.path.abspath(__file__)) + pro2cmake = os.path.join(script_path, 'pro2cmake.py') + base_path = args.path + + all_files = find_all_pro_files(base_path, args) + files_count = len(all_files) + failed_files = run(all_files, pro2cmake, args) + if len(all_files) == 0: + print('No files found.') + + if failed_files: + print('The following files were not successfully ' + 'converted ({} of {}):'.format(len(failed_files), files_count)) + for f in failed_files: + print(' "{}"'.format(f)) + + +if __name__ == '__main__': + main() From 35dc8f496dc324a816dc17e80b744bfe864ec261 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 17:34:27 +0200 Subject: [PATCH 0606/1322] Map module.gui to if TARGET Qt::Gui in configure.cmake Some features check for module existence. Adapt conversion script and QtBuild feature condition parser to handle that. Change-Id: I063e49a6fe9f8e9cf3aec985fd78ed4430398586 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 8 ++++++++ util/cmake/configurejson2cmake.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index c7e47647511..33b1c7a9554 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -131,6 +131,14 @@ function(qt_evaluate_config_expression resultVar) string(COMPARE EQUAL "${lhs}" "${rhs}" stringCompareResult) list(APPEND result ${stringCompareResult}) + elseif("${member}" STREQUAL "TARGET" AND memberIdx LESS ${length}) + math(EXPR rhsIndex "${memberIdx}+1") + list(GET exists_target ${rhsIndex} rhs) + if(NOT TARGET "${exists_target}") + set(result "target_does_not_exist") + break() + endif() + set(skipNext ON) else() string(FIND "${member}" "QT_FEATURE_" idx) if(idx EQUAL 0) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 890d4dfc5fe..2de2567803e 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -281,6 +281,8 @@ def map_condition(condition): elif match.group(1) == 'config': substitution = map_platform(match.group(2)) + elif match.group(1) == 'module': + substitution = 'TARGET {}'.format(map_qt_library(match.group(2))) elif match.group(1) == 'arch': if match.group(2) == 'i386': From 38b7ee3533f553f1bacd1a80ce15a5e604f82721 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 10:30:49 +0200 Subject: [PATCH 0607/1322] Revert "Map module.gui to if TARGET Qt::Gui in configure.cmake" It breaks some conditions, and then the build fails not finding some private header files in qpa, etc. This reverts commit 35dc8f496dc324a816dc17e80b744bfe864ec261. Change-Id: I1b51eac06fe9186181d3f0a7c78f22da7be534e2 Reviewed-by: Tobias Hunger --- cmake/QtFeature.cmake | 8 -------- util/cmake/configurejson2cmake.py | 2 -- 2 files changed, 10 deletions(-) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 33b1c7a9554..c7e47647511 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -131,14 +131,6 @@ function(qt_evaluate_config_expression resultVar) string(COMPARE EQUAL "${lhs}" "${rhs}" stringCompareResult) list(APPEND result ${stringCompareResult}) - elseif("${member}" STREQUAL "TARGET" AND memberIdx LESS ${length}) - math(EXPR rhsIndex "${memberIdx}+1") - list(GET exists_target ${rhsIndex} rhs) - if(NOT TARGET "${exists_target}") - set(result "target_does_not_exist") - break() - endif() - set(skipNext ON) else() string(FIND "${member}" "QT_FEATURE_" idx) if(idx EQUAL 0) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 2de2567803e..890d4dfc5fe 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -281,8 +281,6 @@ def map_condition(condition): elif match.group(1) == 'config': substitution = map_platform(match.group(2)) - elif match.group(1) == 'module': - substitution = 'TARGET {}'.format(map_qt_library(match.group(2))) elif match.group(1) == 'arch': if match.group(2) == 'i386': From 9ad193cc3d3379587c283a2b2cc21f7e6a4fb0cf Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 09:49:30 +0200 Subject: [PATCH 0608/1322] Fix write_all_source_file_lists type annotation Change-Id: I6e22d21562a0923079b90cf9b3e6d15dfe16ff29 Reviewed-by: Tobias Hunger --- util/cmake/pro2cmake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 98706d1064a..fcf9b1060c7 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1141,7 +1141,7 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, indent: int = 0, footer: str = '', - extra_keys: typing.Union[typing.List[str], None] = None): + extra_keys: typing.Optional[typing.List[str]] = None): if extra_keys is None: extra_keys = [] write_source_file_list(cm_fh, scope, header, From c220974ed8c6c972d43f535afa7b1bbcb1ccc5e2 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 4 Jun 2019 16:40:11 +0200 Subject: [PATCH 0609/1322] Fix linkage of QtWidgets on Android On Android, the OpenGL dependency is unfortunately a public dependency in QtGui. Change-Id: I50847891ba55c4646078b02e3aacf14823daf1d0 Reviewed-by: Alexandru Croitor --- src/gui/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 70ce41aaca0..7acfedf46b6 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -380,6 +380,16 @@ extend_target(Gui CONDITION QT_FEATURE_opengl WrapOpenGL # special case ) +# special case begin +# qopenglfunctions.h on Android does not use the function +# table indirection for calls but calls ::glFoo in inline functions +# directly. That means the GL library is a public dependency. +extend_target(Gui CONDITION QT_FEATURE_opengl AND ANDROID + PUBLIC_LIBRARIES + WrapOpenGL +) +# special case end + #### Keys ignored in scope 2:.:.:gui.pro:QT_FEATURE_opengl: # MODULE_CONFIG = "opengl" From fecd9d90daa22b33c40a709da21cef62bfa44a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 5 Jun 2019 10:08:44 +0200 Subject: [PATCH 0610/1322] Fix static usage requirements for XcbQpa In particular, Qt targets extended with other qt targets (eg. Qt::VulkanSupport or Qt::LinuxAccessibilitySupport) after the first add_qt_module were not taken into account when generating Depends files. Note that this patch updates the minimum required version to CMake 3.15 Change-Id: I747deedd4d59e385876bc1a834ef9bdb6078911b Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 2 +- cmake/FindATSPI2.cmake | 3 ++ cmake/FindGTK3.cmake | 4 +++ cmake/FindTslib.cmake | 4 +++ cmake/FindXKB_COMMON_X11.cmake | 7 ++++ cmake/QtBuild.cmake | 35 ++++++++++++-------- cmake/QtFeature.cmake | 2 +- cmake/QtModuleDependencies.cmake.in | 8 ++--- cmake/QtProperties.cmake | 42 +++++++++++++++++++++++- src/gui/configure.cmake | 1 - src/plugins/platforms/xcb/CMakeLists.txt | 17 +++++++--- 11 files changed, 97 insertions(+), 28 deletions(-) create mode 100644 cmake/FindXKB_COMMON_X11.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d70beff2e93..8344d22c0de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14.0) +cmake_minimum_required(VERSION 3.15.0) project(QtBase VERSION 5.14.0 diff --git a/cmake/FindATSPI2.cmake b/cmake/FindATSPI2.cmake index 4e1ade0d077..87e3838ee95 100644 --- a/cmake/FindATSPI2.cmake +++ b/cmake/FindATSPI2.cmake @@ -2,4 +2,7 @@ include(FindPkgConfig) if(NOT TARGET PkgConfig::ATSPI2) pkg_check_modules(ATSPI2 atspi-2 IMPORTED_TARGET) + if (NOT TARGET PkgConfig::ATSPI2) + set(ATSPI2_FOUND 0) + endif() endif() diff --git a/cmake/FindGTK3.cmake b/cmake/FindGTK3.cmake index f4476c167b7..9423eb4b9be 100644 --- a/cmake/FindGTK3.cmake +++ b/cmake/FindGTK3.cmake @@ -1,3 +1,7 @@ include(FindPkgConfig) pkg_check_modules(GTK3 "gtk+-3.0 >= 3.6" IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::GTK3) + set(GTK3_FOUND 0) +endif() diff --git a/cmake/FindTslib.cmake b/cmake/FindTslib.cmake index 979291a5f62..3c50116d0aa 100644 --- a/cmake/FindTslib.cmake +++ b/cmake/FindTslib.cmake @@ -1,3 +1,7 @@ find_package(PkgConfig) pkg_check_modules(Tslib tslib IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::Tslib) + set(Tslib_FOUND 0) +endif() diff --git a/cmake/FindXKB_COMMON_X11.cmake b/cmake/FindXKB_COMMON_X11.cmake new file mode 100644 index 00000000000..61b4ba82e74 --- /dev/null +++ b/cmake/FindXKB_COMMON_X11.cmake @@ -0,0 +1,7 @@ +include(FindPkgConfig) + +pkg_check_modules(XKB_COMMON_X11 "xkbcommon-x11>=0.4.1" IMPORTED_TARGET) + +if (NOT TARGET PkgConfig::XKB_COMMON_X11) + set(XKB_COMMON_X11_FOUND 0) +endif() diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index bd18d48beb7..85ee030822c 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -795,7 +795,6 @@ function(extend_target target) endif() endif() endforeach() - # Set-up the target target_sources("${target}" PRIVATE ${arg_SOURCES} ${dbus_sources}) if (arg_COMPILE_FLAGS) @@ -811,6 +810,23 @@ function(extend_target target) AUTOMOC_MOC_OPTIONS "${arg_MOC_OPTIONS}" _qt_target_deps "${target_deps}" ) + + # When a public module depends on private, also make its private depend on the other's private + set(qt_libs_private "") + foreach(it ${QT_KNOWN_MODULES}) + list(FIND arg_LIBRARIES "Qt::${it}Private" pos) + if(pos GREATER -1) + list(APPEND qt_libs_private "Qt::${it}Private") + endif() + endforeach() + + set(target_private "${target}Private") + if(TARGET "${target_private}") + target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") + endif() + qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}") + + qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS}) @@ -1045,7 +1061,8 @@ function(add_qt_module target) ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}" VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} - OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}") + OUTPUT_NAME "${INSTALL_CMAKE_NAMESPACE}${target}" + ) qt_internal_library_deprecation_level(deprecation_define) @@ -1220,16 +1237,6 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") # that belong to Qt. qt_internal_add_link_flags_no_undefined("${target}") - # When a public module depends on private, also make its private depend on the other's private - set(qt_libs_private "") - foreach(it ${QT_KNOWN_MODULES}) - list(FIND arg_LIBRARIES "Qt::${it}Private" pos) - if(pos GREATER -1) - list(APPEND qt_libs_private "Qt::${it}Private") - endif() - endforeach() - - target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") target_include_directories("${target_private}" INTERFACE $ $ @@ -1238,8 +1245,6 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") $ ) - qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}") - if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) endif() @@ -1399,6 +1404,8 @@ function(add_qt_plugin target) set_property(TARGET "${qt_module}" APPEND PROPERTY QT_PLUGINS "${target}") endif() + set_property(TARGET "${target}" APPEND PROPERTY EXPORT_PROPERTIES "QT_PLUGIN_CLASS_NAME;QT_MODULE") + extend_target("${target}" SOURCES ${arg_SOURCES} INCLUDE_DIRECTORIES diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index c7e47647511..758605c05a8 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -417,7 +417,7 @@ function(qt_feature_module_end) set(propertyPrefix "INTERFACE_") else() set(propertyPrefix "") - set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES") + set_target_properties("${target}" PROPERTIES EXPORT_PROPERTIES "QT_ENABLED_PUBLIC_FEATURES;QT_DISABLED_PUBLIC_FEATURES;QT_ENABLED_PRIVATE_FEATURES;QT_DISABLED_PRIVATE_FEATURES;MODULE_PLUGIN_TYPES;QT_PLUGINS") endif() foreach(visibility public private) string(TOUPPER "${visibility}" capitalVisibility) diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index f94ba22d9e6..5d9164bd11b 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -21,9 +21,7 @@ foreach(_target_dep ${_third_party_deps}) list(APPEND find_package_args "COMPONENTS" ${components}) endif() - if (NOT ${pkg}_FOUND) - find_dependency(${find_package_args}) - endif() + find_dependency(${find_package_args}) if (NOT ${pkg}_FOUND) set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) @@ -40,9 +38,7 @@ foreach(_target_dep ${_tool_deps}) list(GET _target_dep 0 pkg) list(GET _target_dep 1 version) - if (NOT ${pkg}_FOUND) - find_dependency(${pkg} ${version}) - endif() + find_dependency(${pkg} ${version}) if (NOT ${pkg}_FOUND) set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) diff --git a/cmake/QtProperties.cmake b/cmake/QtProperties.cmake index f2bb2c5c592..b0621e7b469 100644 --- a/cmake/QtProperties.cmake +++ b/cmake/QtProperties.cmake @@ -1,8 +1,48 @@ +define_property(TARGET + PROPERTY + QT_PLUGINS + BRIEF_DOCS + "List of Qt plug-ins associated with a given Qt module." + FULL_DOCS + "This is a property on Qt modules. + For instance, sqlite;odbc for Sql" +) + +define_property(TARGET + PROPERTY + MODULE_PLUGIN_TYPES + BRIEF_DOCS + "List of plugin categories associated to the Qt module" + FULL_DOCS + "This is a property on Qt modules. + For instance, sqldrivers for Sql." +) + define_property(TARGET PROPERTY QT_PLUGIN_CLASS_NAME BRIEF_DOCS "Class name of the Qt plug-in" FULL_DOCS - "For instance, QICOPlugin for the qico plug-in" + "This is a property on Qt plug-ins. + For instance, QICOPlugin for the qico plug-in" +) + +define_property(TARGET + PROPERTY + QT_MODULE + BRIEF_DOCS + "Qt module associated with a plug-in." + FULL_DOCS + "This is a property on Qt plug-ins. + For instance, Sql for qsqlite" +) + +define_property(GLOBAL + PROPERTY + QT_KNOWN_PLUGINS + BRIEF_DOCS + "" + FULL_DOCS + "" ) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 71c3bb15c10..58f34239e4b 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -103,7 +103,6 @@ if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(XRender PROVIDED_TARGETS PkgConfig::XRender) endif() - #### Tests # angle_d3d11_qdtd diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 2d5dbbef1dc..9f947915504 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -1,16 +1,25 @@ # Generated from xcb.pro. # begin special case: -qt_find_package(X11_XCB) -qt_find_package(X11) +qt_find_package(X11_XCB + PROVIDED_TARGETS + X11::XCB +) +qt_find_package(X11 + PROVIDED_TARGETS + X11::X11 +) qt_find_package(XCB) qt_find_package(XKB) qt_find_package(PkgConfig) qt_find_package(WrapFreetype) -qt_find_package(GLIB2) +qt_find_package(GLIB2 + PROVIDED_TARGETS + GLIB2::GLIB2 +) qt_find_package(XRender PROVIDED_TARGETS PkgConfig::XRender) +qt_find_package(XKB_COMMON_X11 PROVIDED_TARGETS PkgConfig::XKB_COMMON_X11) -pkg_check_modules(XKB_COMMON_X11 xkbcommon-x11>=0.4.1 IMPORTED_TARGET) # special case # end special case: ##################################################################### From bfa209dfa557e7c30d654add09f5c8f97cfc2492 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 15:55:41 +0200 Subject: [PATCH 0611/1322] cmake: build with exceptions disabled by default Only re-enable exceptions for the modules that do CONFIG+=exceptions in qmake Change-Id: I9f19078adbdc1b8fa3d4102fb51a099e7e35522e Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 37 +++++++++++++++++-- src/concurrent/CMakeLists.txt | 1 + src/corelib/CMakeLists.txt | 1 + src/testlib/CMakeLists.txt | 1 + .../global/qglobalstatic/CMakeLists.txt | 1 + .../selftests/exceptionthrow/CMakeLists.txt | 1 + .../verifyexceptionthrown/CMakeLists.txt | 1 + util/cmake/pro2cmake.py | 3 ++ 8 files changed, 42 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 85ee030822c..6fabf8098ac 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -982,6 +982,21 @@ function(qt_internal_add_target_aliases target) endif() endfunction() +# Sets the exceptions flags for the given target +function(qt_internal_set_no_exceptions_flags target) + target_compile_definitions("${target}" PRIVATE "QT_NO_EXCEPTIONS") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + target_compile_options("${target}" PRIVATE "/wd4530 /wd4577") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + target_compile_options("${target}" PRIVATE "-fno-exceptions") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + target_compile_options("${target}" PRIVATE "-fno-exceptions") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + target_compile_options("${target}" PRIVATE "-fno-exceptions") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + target_compile_options("${target}" PRIVATE "-fno-exceptions") + endif() +endfunction() # This is the main entry function for creating a Qt module, that typically # consists of a library, public header files, private header files and configurable @@ -998,7 +1013,7 @@ function(add_qt_module target) # Process arguments: qt_parse_all_arguments(arg "add_qt_module" - "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT" + "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};QMAKE_MODULE_CONFIG" ${ARGN}) @@ -1118,6 +1133,9 @@ function(add_qt_module target) if(FEATURE_largefile) target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") endif() + if(NOT ${arg_EXCEPTIONS}) + qt_internal_set_no_exceptions_flags("${target}") + endif() set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") @@ -1355,7 +1373,7 @@ function(add_qt_plugin target) qt_internal_set_qt_known_plugins("${QT_KNOWN_PLUGINS}" "${target}") - qt_parse_all_arguments(arg "add_qt_plugin" "STATIC" + qt_parse_all_arguments(arg "add_qt_plugin" "STATIC;EXCEPTIONS" "TYPE;CLASS_NAME;OUTPUT_DIRECTORY;INSTALL_DIRECTORY;ARCHIVE_INSTALL_DIRECTORY" "${__default_private_args};${__default_public_args}" ${ARGN}) @@ -1447,6 +1465,9 @@ function(add_qt_plugin target) if(FEATURE_largefile) target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") endif() + if(NOT ${arg_EXCEPTIONS}) + qt_internal_set_no_exceptions_flags("${target}") + endif() set(qt_libs_private "") @@ -1512,7 +1533,7 @@ endfunction() # Please consider to use a more specific version target like the one created # by add_qt_test or add_qt_tool below. function(add_qt_executable name) - qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP;NO_QT;NO_INSTALL" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_executable" "GUI;BOOTSTRAP;NO_QT;NO_INSTALL;EXCEPTIONS" "OUTPUT_DIRECTORY;INSTALL_DIRECTORY" "EXE_FLAGS;${__default_private_args}" ${ARGN}) if ("x${arg_OUTPUT_DIRECTORY}" STREQUAL "x") set(arg_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${INSTALL_BINDIR}") @@ -1561,6 +1582,9 @@ function(add_qt_executable name) if(FEATURE_largefile) target_compile_definitions("${name}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") endif() + if(NOT ${arg_EXCEPTIONS}) + qt_internal_set_no_exceptions_flags("${name}") + endif() if(WIN32) @@ -1579,10 +1603,15 @@ endfunction() # This function creates a CMake test target with the specified name for use with CTest. function(add_qt_test name) - qt_parse_all_arguments(arg "add_qt_test" "RUN_SERIAL" "" "${__default_private_args}" ${ARGN}) + qt_parse_all_arguments(arg "add_qt_test" "RUN_SERIAL;EXCEPTIONS" "" "${__default_private_args}" ${ARGN}) set(path "${CMAKE_CURRENT_BINARY_DIR}") + if (${arg_EXCEPTIONS}) + set(EXCEPTIONS_TEXT "EXCEPTIONS") + endif() + add_qt_executable("${name}" + ${EXCEPTIONS_TEXT} NO_INSTALL OUTPUT_DIRECTORY "${path}" SOURCES "${arg_SOURCES}" diff --git a/src/concurrent/CMakeLists.txt b/src/concurrent/CMakeLists.txt index 9094cf13db5..b0d90e40baa 100644 --- a/src/concurrent/CMakeLists.txt +++ b/src/concurrent/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(Concurrent + EXCEPTIONS SOURCES qtconcurrent_global.h qtconcurrentcompilertest.h diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 5d45d2b3167..a032a9117e8 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -17,6 +17,7 @@ endif() ##################################################################### add_qt_module(Core + EXCEPTIONS QMAKE_MODULE_CONFIG moc resources SOURCES # special case: remove ../3rdparty/harfbuzz diff --git a/src/testlib/CMakeLists.txt b/src/testlib/CMakeLists.txt index 9acbe76e0ff..eba682bdc24 100644 --- a/src/testlib/CMakeLists.txt +++ b/src/testlib/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(Test CONFIG_MODULE_NAME testlib # special case + EXCEPTIONS SOURCES qabstracttestlogger.cpp qabstracttestlogger_p.h qasciikey.cpp diff --git a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt index 3aa4511d6f2..fc31f1ea99f 100644 --- a/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt +++ b/tests/auto/corelib/global/qglobalstatic/CMakeLists.txt @@ -1,4 +1,5 @@ add_qt_test(tst_qglobalstatic + EXCEPTIONS SOURCES tst_qglobalstatic.cpp DEFINES diff --git a/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt b/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt index 1e67b630bd1..71d3aa1e74a 100644 --- a/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt +++ b/tests/auto/testlib/selftests/exceptionthrow/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_executable(exceptionthrow + EXCEPTIONS NO_INSTALL # special case OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case GUI diff --git a/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt b/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt index 817eddaee87..24dd224107e 100644 --- a/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt +++ b/tests/auto/testlib/selftests/verifyexceptionthrown/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_executable(verifyexceptionthrown + EXCEPTIONS NO_INSTALL # special case OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} # special case GUI diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fcf9b1060c7..bd26e5782aa 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1545,6 +1545,9 @@ def write_main_part(cm_fh: typing.IO[str], name: str, typename: str, # Evaluate total condition of all scopes: recursive_evaluate_scope(scope) + if 'exceptions' in scope.get('CONFIG'): + extra_lines.append('EXCEPTIONS') + # Get a flat list of all scopes but the main one: scopes = flatten_scopes(scope) total_scopes = len(scopes) From 2401435d89c62be48ee7cf798aa3f47fb3faf670 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 17:34:27 +0200 Subject: [PATCH 0612/1322] Map module.gui to if TARGET Qt::Gui in configure.cmake Some features check for module / target existence. Adapt conversion script to handle that. Reland after fixing it. Change-Id: If4fb942c2e0d16e76a0b9b767bf478527851b0f7 Reviewed-by: Simon Hausmann --- cmake/QtFeature.cmake | 2 ++ util/cmake/configurejson2cmake.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmake/QtFeature.cmake b/cmake/QtFeature.cmake index 758605c05a8..8d7006a4dee 100644 --- a/cmake/QtFeature.cmake +++ b/cmake/QtFeature.cmake @@ -142,6 +142,8 @@ function(qt_evaluate_config_expression resultVar) list(APPEND result ${member}) endif() endforeach() + # The 'TARGET Gui' case is handled by qt_evaluate_to_boolean, by passing those tokens verbatim + # to if(). if("${result}" STREQUAL "") set(result ON) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 890d4dfc5fe..2de2567803e 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -281,6 +281,8 @@ def map_condition(condition): elif match.group(1) == 'config': substitution = map_platform(match.group(2)) + elif match.group(1) == 'module': + substitution = 'TARGET {}'.format(map_qt_library(match.group(2))) elif match.group(1) == 'arch': if match.group(2) == 'i386': From 2eeba9f55f11a3389dd29196fc3c52e317d8967c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 5 Jun 2019 10:51:45 +0200 Subject: [PATCH 0613/1322] cmake: don't add install-time include directories when there are none Change-Id: I380218191139fe514ddac598992b1ba27ac33a41 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6fabf8098ac..e08f2a182c2 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1083,13 +1083,19 @@ function(add_qt_module target) qt_autogen_tools_initial_setup(${target}) + set(_public_includes + $ + $ + ) + if(NOT arg_NO_MODULE_HEADERS) + list(APPEND _public_includes $) + endif() + list(APPEND _public_includes ${arg_PUBLIC_INCLUDE_DIRECTORIES}) + extend_target("${target}" SOURCES ${arg_SOURCES} PUBLIC_INCLUDE_DIRECTORIES - $ - $ - $ - ${arg_PUBLIC_INCLUDE_DIRECTORIES} + ${_public_includes} INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" @@ -1259,10 +1265,15 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") $ $ $ - $ - $ ) + if(NOT arg_NO_MODULE_HEADERS) + target_include_directories("${target_private}" INTERFACE + $ + $ + ) + endif() + if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) endif() From 38cd18384f6198c5bc3ea1da9ffc0158e960a778 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 5 Jun 2019 10:46:16 +0200 Subject: [PATCH 0614/1322] Fix OpenGL vs. GLESv2 linkage, attempt number three We introduced WrapOpenGL to link against either desktop GL or GLESv2 depending on the GL feature in QtGui. This works "fine", with two caveats: (1) find_package(WrapOpenGL) must be called after find_package(Qt5Gui) in order for the feature check in FindWrapOpenGL.cmake to work. That's error prone. (2) More and more places are popping up, in particular examples, where GL linkage is required due to inline functions in Qt that forward to GL functions - such as on Android. This in particular explains the qmake behavior of making the GL linkage (desktop _or_ GLES) a public dependency of QtGui, so only Gui linkage is required. Those two aspects combined are the nail in the coffin of FindWrapOpenGL and it would seem much easier to simply make the Desktop GL vs. GLES decision once in Gui's CMakeLists.txt and let Qt5GuiDependencies.cmake propagate this well. This allows us to get rid of plenty of special cases as well. Change-Id: I3a7e8af49537ce5f215f24470e075a4ae9aeb944 Reviewed-by: Alexandru Croitor --- cmake/FindWrapOpenGL.cmake | 20 ------------- .../widgets/graphicsview/boxes/CMakeLists.txt | 2 -- src/gui/CMakeLists.txt | 28 ++++++++----------- src/opengl/CMakeLists.txt | 1 - .../glxconvenience/CMakeLists.txt | 2 -- src/plugins/platforms/cocoa/CMakeLists.txt | 3 -- src/plugins/platforms/eglfs/CMakeLists.txt | 2 -- .../platforms/minimalegl/CMakeLists.txt | 3 -- tests/CMakeLists.txt | 1 - 9 files changed, 12 insertions(+), 50 deletions(-) delete mode 100644 cmake/FindWrapOpenGL.cmake diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake deleted file mode 100644 index b3c60ba9534..00000000000 --- a/cmake/FindWrapOpenGL.cmake +++ /dev/null @@ -1,20 +0,0 @@ - -# Logic derived from mkspecs/features/unix/opengl.prf: prefer GLESv2 over GL - -if(TARGET WrapOpenGL) - set(WrapOpenGL_FOUND ON) - return() -endif() - -add_library(WrapOpenGL INTERFACE IMPORTED) - -if(QT_FEATURE_opengles2) - find_package(GLESv2) - target_link_libraries(WrapOpenGL INTERFACE GLESv2::GLESv2) -else() - find_package(OpenGL) - target_link_libraries(WrapOpenGL INTERFACE OpenGL::GL) -endif() -set(WrapOpenGL_FOUND ON) - -set_property(TARGET WrapOpenGL PROPERTY IMPORTED_GLOBAL TRUE) diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt index af2891ffb1a..11331b19067 100644 --- a/examples/widgets/graphicsview/boxes/CMakeLists.txt +++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt @@ -1,6 +1,5 @@ # Generated from boxes.pro. -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## boxes Binary: ##################################################################### @@ -22,7 +21,6 @@ add_qt_executable(boxes LIBRARIES Qt::OpenGL Qt::Widgets - WrapOpenGL ) # Resources: diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 7acfedf46b6..b662f8e092e 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -336,12 +336,20 @@ extend_target(Gui CONDITION QT_FEATURE_standarditemmodel # special case begin # With qmake, gui's opengl.pri used CONFIG += opengl, where opengl.prf -# acted like WrapOpenGL: direct linkage against either libGLESv2 or -# libGL, depending on the opengl _feature_. This is done by hand now -# here (where the feature is available). +# used direct public linkage against either libGLESv2 or libGL, depending +# on the opengl _feature_. This is done by hand now here (where the +# feature is available). # DO NOT MOVE THIS TO THE BEGINNING OF THE FILE, the feature variables are not # available until the add_qt_module call. -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) +if(QT_FEATURE_opengl) + if(QT_FEATURE_opengles2) + find_package(GLESv2) + target_link_libraries(Gui PUBLIC GLESv2::GLESv2) + else() + find_package(OpenGL) + target_link_libraries(Gui PUBLIC OpenGL::GL) + endif() +endif() # special case end extend_target(Gui CONDITION QT_FEATURE_opengl @@ -376,20 +384,8 @@ extend_target(Gui CONDITION QT_FEATURE_opengl opengl/qopenglversionfunctions.cpp opengl/qopenglversionfunctions.h opengl/qopenglversionfunctionsfactory.cpp opengl/qopenglversionfunctionsfactory_p.h opengl/qopenglvertexarrayobject.cpp opengl/qopenglvertexarrayobject.h - LIBRARIES # special case - WrapOpenGL # special case ) -# special case begin -# qopenglfunctions.h on Android does not use the function -# table indirection for calls but calls ::glFoo in inline functions -# directly. That means the GL library is a public dependency. -extend_target(Gui CONDITION QT_FEATURE_opengl AND ANDROID - PUBLIC_LIBRARIES - WrapOpenGL -) -# special case end - #### Keys ignored in scope 2:.:.:gui.pro:QT_FEATURE_opengl: # MODULE_CONFIG = "opengl" diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 53a59b34347..2844fac32d3 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -30,7 +30,6 @@ add_qt_module(OpenGL Qt::CorePrivate Qt::GuiPrivate Qt::WidgetsPrivate - WrapOpenGL # special case PUBLIC_LIBRARIES Qt::Core Qt::Gui diff --git a/src/platformsupport/glxconvenience/CMakeLists.txt b/src/platformsupport/glxconvenience/CMakeLists.txt index dc9a325b6b4..a435de85ee2 100644 --- a/src/platformsupport/glxconvenience/CMakeLists.txt +++ b/src/platformsupport/glxconvenience/CMakeLists.txt @@ -1,7 +1,6 @@ # Generated from glxconvenience.pro. qt_find_package(X11) # special case -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## GlxSupport Module: @@ -14,7 +13,6 @@ add_qt_module(GlxSupport DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES - WrapOpenGL # special case Qt::CorePrivate Qt::GuiPrivate X11::X11 # special case diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index 9a6902356ef..a715c593764 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -2,7 +2,6 @@ # special case: qt_find_package(Cups PROVIDED_TARGETS Cups::Cups) -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) ##################################################################### ## qcocoa Plugin: @@ -92,8 +91,6 @@ add_qt_resource(qcocoa "qcocoaresources" PREFIX "/qt-project.org/mac/cursors" FI extend_target(qcocoa CONDITION QT_FEATURE_opengl # special case SOURCES qcocoaglcontext.h qcocoaglcontext.mm - LIBRARIES - WrapOpenGL # special case ) extend_target(qcocoa CONDITION QT_FEATURE_vulkan diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index b69f06a499e..932d07dec21 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -1,5 +1,4 @@ qt_find_package(EGL) # special case -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case ##################################################################### ## EglFSDeviceIntegration Module: @@ -30,7 +29,6 @@ add_qt_module(EglFSDeviceIntegration Qt::ServiceSupportPrivate Qt::ThemeSupportPrivate EGL::EGL # special case - WrapOpenGL # special case ) #### Keys ignored in scope 2:.:./eglfsdeviceintegration.pro:: diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt index 6fc52355c8f..a038d07df95 100644 --- a/src/plugins/platforms/minimalegl/CMakeLists.txt +++ b/src/plugins/platforms/minimalegl/CMakeLists.txt @@ -1,7 +1,5 @@ # Generated from minimalegl.pro. -qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) # special case - ##################################################################### ## qminimalegl Plugin: ##################################################################### @@ -21,7 +19,6 @@ add_qt_plugin(qminimalegl Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate Qt::EglSupportPrivate - WrapOpenGL # CONFIG = "egl" # OTHER_FILES = "minimalegl.json" # PLUGIN_CLASS_NAME = "QMinimalEglIntegrationPlugin" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 109a165d74f..82da3e7b36b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,7 +9,6 @@ if(NOT TARGET Qt::Test) # Find a few packages that are usually found in configure.cmake, # because a few tests link directly against those libraries. qt_find_package(WrapDBus1 PROVIDED_TARGETS dbus-1) - qt_find_package(WrapOpenGL PROVIDED_TARGETS WrapOpenGL) endif() # special case end From eda342111156e828caa1f900b5b55d575881ac22 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 5 Jun 2019 11:31:55 +0200 Subject: [PATCH 0615/1322] cmake: Replace - with _ in define module names Otherwise when compiling qxcb-glx-integration we would get a warning like : warning: ISO C++11 requires whitespace after the macro name because -DQT_BUILD_QXCB-GLX-INTEGRATION_LIB is not a valid define name Change-Id: Ie8cef93a47b14d75eaad77893f7182e1514dd616 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index e08f2a182c2..1b521e9a242 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -329,7 +329,7 @@ QT.${module_lower}.bins = $$QT_MODULE_BIN_BASE QT.${module_lower}.depends = QT.${module_lower}.uses = QT.${module_lower}.module_config = v2 -QT.${module_lower}.DEFINES = QT_${module_upper}_LIB +QT.${module_lower}.DEFINES = QT_${module_define}_LIB QT.${module_lower}.enabled_features = ${enabled_features} QT.${module_lower}.disabled_features = ${disabled_features}${module_config} QT_MODULES += ${module_lower} @@ -644,15 +644,18 @@ endfunction() # * foo_upper with the value "CORE" # * foo_lower with the value "core" # * foo_include_dir with the module's include directory in the binary tree +# * foo_define same as foo_uper but with - replaced as _ function(qt_internal_module_info result target) set(module "Qt${target}") set("${result}" "${module}" PARENT_SCOPE) set("${result}_versioned" "Qt${PROJECT_VERSION_MAJOR}${target}" PARENT_SCOPE) string(TOUPPER "${target}" upper) - string(TOLOWER "${target}" lower) + string(TOLOWER "${target}" lower)# * foo_upper with the value "CORE" + string(REPLACE "-" "_" define "${upper}") set("${result}_upper" "${upper}" PARENT_SCOPE) set("${result}_lower" "${lower}" PARENT_SCOPE) set("${result}_include_dir" "${QT_BUILD_DIR}/include/${module}" PARENT_SCOPE) + set("${result}_define" "${define}" PARENT_SCOPE) endfunction() @@ -1105,7 +1108,7 @@ function(add_qt_module target) ${arg_INCLUDE_DIRECTORIES} PUBLIC_DEFINES ${arg_PUBLIC_DEFINES} - QT_${module_upper}_LIB + QT_${module_define}_LIB DEFINES ${arg_DEFINES} QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS @@ -1113,7 +1116,7 @@ function(add_qt_module target) QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS QT_BUILDING_QT - QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore + QT_BUILD_${module_define}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} LIBRARIES ${arg_LIBRARIES} @@ -1453,12 +1456,12 @@ function(add_qt_plugin target) QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS QT_BUILDING_QT - QT_BUILD_${module_upper}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore + QT_BUILD_${module_define}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" "${static_plugin_define}" QT_PLUGIN PUBLIC_DEFINES - QT_${module_upper}_LIB + QT_${module_define}_LIB ${arg_PUBLIC_DEFINES} FEATURE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} DBUS_ADAPTOR_SOURCES "${arg_DBUS_ADAPTOR_SOURCES}" From 527f3bb31ce066749741bd84145270336e4bbc7a Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 5 Jun 2019 10:48:56 +0200 Subject: [PATCH 0616/1322] CMake: Add WrapPCRE2 package The WrapPCRE2 package handles the PCRE2 packages that have targets, and reuse them. Change-Id: I24b0b51f507703cd8287f845f7e425f62dd2c3d6 Reviewed-by: Alexandru Croitor --- cmake/FindPCRE2.cmake | 13 ------------- cmake/FindWrapPCRE2.cmake | 20 ++++++++++++++++++++ src/corelib/.prev_CMakeLists.txt | 2 +- src/corelib/CMakeLists.txt | 2 +- src/corelib/configure.cmake | 4 ++-- util/cmake/helper.py | 2 +- 6 files changed, 25 insertions(+), 18 deletions(-) delete mode 100644 cmake/FindPCRE2.cmake create mode 100644 cmake/FindWrapPCRE2.cmake diff --git a/cmake/FindPCRE2.cmake b/cmake/FindPCRE2.cmake deleted file mode 100644 index 3977532124d..00000000000 --- a/cmake/FindPCRE2.cmake +++ /dev/null @@ -1,13 +0,0 @@ - -find_library(PCRE2_LIBRARIES NAMES pcre2-16) -find_path(PCRE2_INCLUDE_DIRS pcre2.h) - -if (PCRE2_LIBRARIES STREQUAL "PCRE2_LIBRARIES-NOTFOUND" OR PCRE2_INCLUDE_DIRS STREQUAL "PCRE2_INCLUDE_DIRS-NOTFOUND") - set(PCRE2_FOUND 0) -else() - add_library(PCRE2 INTERFACE IMPORTED) - target_link_libraries(PCRE2 INTERFACE ${PCRE2_LIBRARIES}) - target_include_directories(PCRE2 INTERFACE ${PCRE2_INCLUDE_DIRS}) - set(PCRE2_FOUND 1) -endif() - diff --git a/cmake/FindWrapPCRE2.cmake b/cmake/FindWrapPCRE2.cmake new file mode 100644 index 00000000000..b69c5078a58 --- /dev/null +++ b/cmake/FindWrapPCRE2.cmake @@ -0,0 +1,20 @@ +include_guard(GLOBAL) # pragma once equivalent + +find_package(PCRE2 CONFIG QUIET) + +if(PCRE2_FOUND AND TARGET PCRE2::pcre2-16) + # Hunter case. + add_library(WrapPCRE2::WrapPCRE2 INTERFACE IMPORTED) + target_link_libraries(WrapPCRE2::WrapPCRE2 INTERFACE PCRE2::pcre2-16) + set(WrapPCRE2_FOUND TRUE) +else() + find_library(PCRE2_LIBRARIES NAMES pcre2-16) + find_path(PCRE2_INCLUDE_DIRS pcre2.h) + + if (PCRE2_LIBRARIES AND PCRE2_INCLUDE_DIRS) + add_library(WrapPCRE2::WrapPCRE2 INTERFACE IMPORTED) + target_link_libraries(WrapPCRE2::WrapPCRE2 INTERFACE ${PCRE2_LIBRARIES}) + target_include_directories(WrapPCRE2::WrapPCRE2 INTERFACE ${PCRE2_INCLUDE_DIRS}) + set(WrapPCRE2_FOUND TRUE) + endif() +endif() diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt index cad230bd87f..ee4143ce968 100644 --- a/src/corelib/.prev_CMakeLists.txt +++ b/src/corelib/.prev_CMakeLists.txt @@ -641,7 +641,7 @@ extend_target(Core CONDITION QT_FEATURE_regularexpression SOURCES tools/qregularexpression.cpp tools/qregularexpression.h LIBRARIES - PCRE2 + WrapPCRE2::WrapPCRE2 ) extend_target(Core CONDITION QT_FEATURE_commandlineparser diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index a032a9117e8..66c211d292f 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -710,7 +710,7 @@ extend_target(Core CONDITION QT_FEATURE_regularexpression SOURCES tools/qregularexpression.cpp tools/qregularexpression.h LIBRARIES - PCRE2 + WrapPCRE2::WrapPCRE2 ) extend_target(Core CONDITION QT_FEATURE_commandlineparser diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index a144d6dd8fe..1a34662fbb9 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -16,8 +16,8 @@ qt_find_package(Libsystemd PROVIDED_TARGETS PkgConfig::Libsystemd) qt_find_package(Atomic PROVIDED_TARGETS Atomic) qt_find_package(WrapRt PROVIDED_TARGETS WrapRt) qt_find_package(LTTngUST PROVIDED_TARGETS LTTng::UST) -qt_find_package(PCRE2 PROVIDED_TARGETS PCRE2) -set_package_properties(PCRE2 PROPERTIES TYPE REQUIRED) +qt_find_package(WrapPCRE2 PROVIDED_TARGETS WrapPCRE2::WrapPCRE2) +set_package_properties(WrapPCRE2 PROPERTIES TYPE REQUIRED) if((QNX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(PPS PROVIDED_TARGETS PPS::PPS) endif() diff --git a/util/cmake/helper.py b/util/cmake/helper.py index 60128a8b03f..a184ce1f4d2 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -215,7 +215,7 @@ _library_map = [ LibraryMapping('opengl', 'OpenGL', 'OpenGL::GL', resultVariable='OpenGL_OpenGL'), LibraryMapping('openssl_headers', 'OpenSSL', 'OpenSSL::SSL_nolink', resultVariable='OPENSSL_INCLUDE_DIR', appendFoundSuffix=False), LibraryMapping('openssl', 'OpenSSL', 'OpenSSL::SSL'), - LibraryMapping('pcre2', 'PCRE2', 'PCRE2', extra = ['REQUIRED']), + LibraryMapping('pcre2', 'WrapPCRE2', 'WrapPCRE2::WrapPCRE2', extra = ['REQUIRED']), LibraryMapping('posix_iconv', None, None), LibraryMapping('pps', 'PPS', 'PPS::PPS'), LibraryMapping('psql', 'PostgreSQL', 'PostgreSQL::PostgreSQL'), From 3e93cc1044704c510a1ddab2457a7710c8a28cb0 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 11:41:40 +0200 Subject: [PATCH 0617/1322] Regenerate cocoa qpa plugin Change-Id: Ie8838846e758542b3ae18cbda00c0a54cb6c5f49 Reviewed-by: Simon Hausmann --- .../platforms/cocoa/.prev_CMakeLists.txt | 137 ++++++++++++++++++ src/plugins/platforms/cocoa/CMakeLists.txt | 4 +- 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 src/plugins/platforms/cocoa/.prev_CMakeLists.txt diff --git a/src/plugins/platforms/cocoa/.prev_CMakeLists.txt b/src/plugins/platforms/cocoa/.prev_CMakeLists.txt new file mode 100644 index 00000000000..a8ee50e7153 --- /dev/null +++ b/src/plugins/platforms/cocoa/.prev_CMakeLists.txt @@ -0,0 +1,137 @@ +# Generated from cocoa.pro. + +##################################################################### +## qcocoa Plugin: +##################################################################### + +add_qt_plugin(qcocoa + TYPE platforms + CLASS_NAME QCocoaIntegrationPlugin + SOURCES + main.mm + messages.cpp messages.h + qcocoaaccessibility.h qcocoaaccessibility.mm + qcocoaaccessibilityelement.h qcocoaaccessibilityelement.mm + qcocoaapplication.h qcocoaapplication.mm + qcocoaapplicationdelegate.h qcocoaapplicationdelegate.mm + qcocoabackingstore.h qcocoabackingstore.mm + qcocoaclipboard.h qcocoaclipboard.mm + qcocoacursor.h qcocoacursor.mm + qcocoadrag.h qcocoadrag.mm + qcocoaeventdispatcher.h qcocoaeventdispatcher.mm + qcocoahelpers.h qcocoahelpers.mm + qcocoainputcontext.h qcocoainputcontext.mm + qcocoaintegration.h qcocoaintegration.mm + qcocoaintrospection.h qcocoaintrospection.mm + qcocoakeymapper.h qcocoakeymapper.mm + qcocoamenu.h qcocoamenu.mm + qcocoamenubar.h qcocoamenubar.mm + qcocoamenuitem.h qcocoamenuitem.mm + qcocoamenuloader.h qcocoamenuloader.mm + qcocoamimetypes.h qcocoamimetypes.mm + qcocoanativeinterface.h qcocoanativeinterface.mm + qcocoansmenu.h qcocoansmenu.mm + qcocoascreen.h qcocoascreen.mm + qcocoaservices.h qcocoaservices.mm + qcocoasystemsettings.h qcocoasystemsettings.mm + qcocoasystemtrayicon.h qcocoasystemtrayicon.mm + qcocoatheme.h qcocoatheme.mm + qcocoawindow.h qcocoawindow.mm + qiosurfacegraphicsbuffer.h qiosurfacegraphicsbuffer.mm + qmacclipboard.h qmacclipboard.mm + qmultitouch_mac.mm qmultitouch_mac_p.h + qnsview.h qnsview.mm + qnswindow.h qnswindow.mm + qnswindowdelegate.h qnswindowdelegate.mm + LIBRARIES + Qt::AccessibilitySupportPrivate + Qt::ClipboardSupportPrivate + Qt::CorePrivate + Qt::FontDatabaseSupportPrivate + Qt::GraphicsSupportPrivate + Qt::GuiPrivate + Qt::ThemeSupportPrivate + PUBLIC_LIBRARIES + ${FWAppKit} + ${FWCarbon} + ${FWCoreServices} + ${FWCoreVideo} + ${FWIOKit} + ${FWIOSurface} + ${FWMetal} + ${FWQuartzCore} + Cups::Cups + Qt::AccessibilitySupport + Qt::ClipboardSupport + Qt::Core + Qt::FontDatabaseSupport + Qt::GraphicsSupport + Qt::Gui + Qt::ThemeSupport +) + +# Resources: +add_qt_resource(qcocoa "qcocoaresources" PREFIX "/qt-project.org/mac/cursors" FILES + images/sizeallcursor.png + images/spincursor.png + images/waitcursor.png) + + +#### Keys ignored in scope 1:.:.:cocoa.pro:: +# CONFIG = "no_app_extension_api_only" +# OTHER_FILES = "cocoa.json" +# PLUGIN_CLASS_NAME = "QCocoaIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +extend_target(qcocoa CONDITION QT_FEATURE_opengl + SOURCES + qcocoaglcontext.h qcocoaglcontext.mm +) + +extend_target(qcocoa CONDITION QT_FEATURE_vulkan + SOURCES + qcocoavulkaninstance.h qcocoavulkaninstance.mm + LIBRARIES + Qt::VulkanSupportPrivate + PUBLIC_LIBRARIES + Qt::VulkanSupport +) + +extend_target(qcocoa CONDITION TARGET Qt::Widgets + SOURCES + qcocoaprintdevice.h qcocoaprintdevice.mm + qcocoaprintersupport.h qcocoaprintersupport.mm + qpaintengine_mac.mm qpaintengine_mac_p.h + qprintengine_mac.mm qprintengine_mac_p.h + LIBRARIES + Qt::PrintSupportPrivate + Qt::WidgetsPrivate + PUBLIC_LIBRARIES + Qt::PrintSupport + Qt::Widgets +) + +#### Keys ignored in scope 5:.:.:cocoa.pro:TARGET Qt::Widgets: +# QT_FOR_CONFIG = "widgets" + +extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_colordialog) + SOURCES + qcocoacolordialoghelper.h qcocoacolordialoghelper.mm +) + +extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_filedialog) + SOURCES + qcocoafiledialoghelper.h qcocoafiledialoghelper.mm +) + +extend_target(qcocoa CONDITION (TARGET Qt::Widgets) AND (QT_FEATURE_fontdialog) + SOURCES + qcocoafontdialoghelper.h qcocoafontdialoghelper.mm +) + +#### Keys ignored in scope 9:.:.:cocoa.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt index a715c593764..61b7c367af0 100644 --- a/src/plugins/platforms/cocoa/CMakeLists.txt +++ b/src/plugins/platforms/cocoa/CMakeLists.txt @@ -9,6 +9,7 @@ qt_find_package(Cups PROVIDED_TARGETS Cups::Cups) add_qt_plugin(qcocoa TYPE platforms + CLASS_NAME QCocoaIntegrationPlugin SOURCES main.mm messages.cpp messages.h @@ -83,12 +84,13 @@ add_qt_resource(qcocoa "qcocoaresources" PREFIX "/qt-project.org/mac/cursors" FI # CONFIG = "no_app_extension_api_only" # OTHER_FILES = "cocoa.json" # PLUGIN_CLASS_NAME = "QCocoaIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: ##################################################################### -extend_target(qcocoa CONDITION QT_FEATURE_opengl # special case +extend_target(qcocoa CONDITION QT_FEATURE_opengl SOURCES qcocoaglcontext.h qcocoaglcontext.mm ) From ddd7af87ef33eb865ecce5fc38f76913405d6e6f Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 5 Jun 2019 11:47:54 +0200 Subject: [PATCH 0618/1322] Update .prev cmake files Change-Id: I440a3cb0288670424cf20c5d56e641a6741fee91 Reviewed-by: Alexandru Croitor --- src/corelib/.prev_CMakeLists.txt | 1 + src/corelib/CMakeLists.txt | 2 +- src/testlib/.prev_CMakeLists.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/.prev_CMakeLists.txt b/src/corelib/.prev_CMakeLists.txt index ee4143ce968..5aee44bfedb 100644 --- a/src/corelib/.prev_CMakeLists.txt +++ b/src/corelib/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(Core QMAKE_MODULE_CONFIG moc resources + EXCEPTIONS SOURCES ../3rdparty/harfbuzz/src/harfbuzz.h ../3rdparty/harfbuzz/src/harfbuzz-buffer.c diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 66c211d292f..0cc5cf3f10a 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -17,8 +17,8 @@ endif() ##################################################################### add_qt_module(Core - EXCEPTIONS QMAKE_MODULE_CONFIG moc resources + EXCEPTIONS SOURCES # special case: remove ../3rdparty/harfbuzz codecs/qtextcodec_p.h diff --git a/src/testlib/.prev_CMakeLists.txt b/src/testlib/.prev_CMakeLists.txt index 82bc8341bbf..f7f88ba5f0c 100644 --- a/src/testlib/.prev_CMakeLists.txt +++ b/src/testlib/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(Test QMAKE_MODULE_CONFIG console testlib_defines + EXCEPTIONS SOURCES qabstracttestlogger.cpp qabstracttestlogger_p.h qasciikey.cpp From 37467028bb07c14311ac2cf9741c274d5b44b388 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 5 Jun 2019 11:45:23 +0200 Subject: [PATCH 0619/1322] CMake: Fix qt_find_package PROVIDED_TARGETS check Change-Id: Ia551dcbca2d881f8bac36158abb0ac60b79f16f0 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 1b521e9a242..3b2079fbdff 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -2077,6 +2077,7 @@ macro(qt_find_package) # qt_find_package(SQLite3) call it is our intention to use the cmake package # in module mode. if (${ARGV0}_FOUND AND arg_PROVIDED_TARGETS) + unset(any_target_found) foreach(expected_target ${arg_PROVIDED_TARGETS}) if (TARGET ${expected_target}) set(any_target_found TRUE) @@ -2084,7 +2085,7 @@ macro(qt_find_package) endif() endforeach() if(NOT any_target_found) - set(${ARGV0}_FOUND) + unset(${ARGV0}_FOUND) endif() endif() endif() From ace549587073d387823815b02ec85a28da408844 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 14:28:31 +0200 Subject: [PATCH 0620/1322] Fix a few of the Wrap modules to protect against double creation of targets. This created issues when trying to build standalone examples. Change-Id: Iaaea2b537793ae25fbf3143cc205574446aa4ad1 Reviewed-by: Kevin Funk --- cmake/FindAtomic.cmake | 7 +++++++ cmake/FindWrapDoubleConversion.cmake | 7 +++++++ cmake/FindWrapRt.cmake | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/cmake/FindAtomic.cmake b/cmake/FindAtomic.cmake index b4580067ca5..91cee620466 100644 --- a/cmake/FindAtomic.cmake +++ b/cmake/FindAtomic.cmake @@ -1,3 +1,10 @@ +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET Atomic) + set(Atomic_FOUND ON) + return() +endif() + include(CheckCXXSourceCompiles) set (atomic_test_sources "#include diff --git a/cmake/FindWrapDoubleConversion.cmake b/cmake/FindWrapDoubleConversion.cmake index 1164f6ba445..9c804a3eecc 100644 --- a/cmake/FindWrapDoubleConversion.cmake +++ b/cmake/FindWrapDoubleConversion.cmake @@ -1,3 +1,10 @@ +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET WrapDoubleConversion::WrapDoubleConversion) + set(WrapDoubleConversion_FOUND ON) + return() +endif() + add_library(WrapDoubleConversion::WrapDoubleConversion INTERFACE IMPORTED) find_package(double-conversion) diff --git a/cmake/FindWrapRt.cmake b/cmake/FindWrapRt.cmake index ef5475c53dc..d14b922062d 100644 --- a/cmake/FindWrapRt.cmake +++ b/cmake/FindWrapRt.cmake @@ -1,3 +1,10 @@ +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET WrapRt) + set(WrapRt_FOUND ON) + return() +endif() + include(CheckCXXSourceCompiles) include(CMakePushCheckState) From 99539a289491a2a709c2a63cd91eac155a1699da Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Tue, 4 Jun 2019 17:08:47 +0200 Subject: [PATCH 0621/1322] Allow to build examples as standalone project Create CMake config files which can be used from the very same CMake project. These CMake config files simply do not create any targets, controlled via the QT_NO_CREATE_TARGETS. This patch also allows to build qtbase.git:examples as a standalone project, against an already-built Qt. Ran this: ag -s "QT " examples -l -0 | xargs -0 -n 1 .../util/cmake/pro2cmake.py --is-example Task-number: QTBUG-74713 Change-Id: I44cce5a4048618b30f890c5b789592c227a8b47d Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 6 + cmake/QtBuild.cmake | 2 +- cmake/QtConfig.cmake.in | 13 +- cmake/QtModuleConfig.cmake.in | 14 +- cmake/QtModuleToolsConfig.cmake.in | 12 +- cmake/QtPluginConfig.cmake.in | 12 +- examples/CMakeLists.txt | 69 ++++++- examples/corelib/CMakeLists.txt | 5 +- .../ipc/localfortuneclient/CMakeLists.txt | 37 ++-- .../ipc/localfortuneserver/CMakeLists.txt | 37 ++-- .../corelib/ipc/sharedmemory/CMakeLists.txt | 39 ++-- .../mimetypes/mimetypebrowser/CMakeLists.txt | 40 ++-- .../serialization/cbordump/CMakeLists.txt | 37 ++-- .../serialization/convert/CMakeLists.txt | 51 ++--- .../serialization/savegame/CMakeLists.txt | 43 +++-- .../corelib/threads/mandelbrot/CMakeLists.txt | 42 +++-- .../threads/queuedcustomtype/CMakeLists.txt | 38 ++-- .../corelib/threads/semaphores/CMakeLists.txt | 32 ++-- .../threads/waitconditions/CMakeLists.txt | 32 ++-- .../tools/contiguouscache/CMakeLists.txt | 34 ++-- .../corelib/tools/customtype/CMakeLists.txt | 34 ++-- .../tools/customtypesending/CMakeLists.txt | 36 ++-- examples/dbus/chat/CMakeLists.txt | 59 ++++-- examples/dbus/complexpingpong/CMakeLists.txt | 34 ++-- examples/dbus/listnames/CMakeLists.txt | 40 ++-- examples/dbus/pingpong/CMakeLists.txt | 54 +++--- .../remotecontrolledcar/car/CMakeLists.txt | 49 +++-- .../controller/CMakeLists.txt | 49 +++-- examples/embedded/digiflip/CMakeLists.txt | 32 ++-- examples/embedded/flickable/CMakeLists.txt | 34 ++-- examples/embedded/flightinfo/CMakeLists.txt | 48 ++--- examples/embedded/lightmaps/CMakeLists.txt | 44 +++-- examples/embedded/raycasting/CMakeLists.txt | 39 ++-- examples/embedded/styleexample/CMakeLists.txt | 49 +++-- examples/gui/analogclock/CMakeLists.txt | 43 +++-- examples/gui/openglwindow/CMakeLists.txt | 41 ++-- examples/gui/rasterwindow/CMakeLists.txt | 41 ++-- examples/network/bearermonitor/CMakeLists.txt | 57 +++--- .../blockingfortuneclient/CMakeLists.txt | 40 ++-- .../network/broadcastreceiver/CMakeLists.txt | 38 ++-- .../network/broadcastsender/CMakeLists.txt | 38 ++-- examples/network/dnslookup/CMakeLists.txt | 45 ++--- examples/network/download/CMakeLists.txt | 36 ++-- .../network/downloadmanager/CMakeLists.txt | 41 ++-- examples/network/fortuneclient/CMakeLists.txt | 38 ++-- examples/network/fortuneserver/CMakeLists.txt | 38 ++-- examples/network/googlesuggest/CMakeLists.txt | 40 ++-- examples/network/http/CMakeLists.txt | 42 +++-- examples/network/loopback/CMakeLists.txt | 38 ++-- .../network/multicastreceiver/CMakeLists.txt | 38 ++-- .../network/multicastsender/CMakeLists.txt | 38 ++-- .../network/multistreamclient/CMakeLists.txt | 46 +++-- .../network/multistreamserver/CMakeLists.txt | 47 +++-- examples/network/network-chat/CMakeLists.txt | 48 +++-- .../network/securesocketclient/CMakeLists.txt | 48 ++--- .../network/secureudpclient/CMakeLists.txt | 45 +++-- .../network/secureudpserver/CMakeLists.txt | 45 +++-- .../threadedfortuneserver/CMakeLists.txt | 42 +++-- examples/network/torrent/.prev_CMakeLists.txt | 73 ++++---- examples/network/torrent/CMakeLists.txt | 76 ++++---- examples/qpa/qrasterwindow/CMakeLists.txt | 31 ++-- examples/qpa/windows/CMakeLists.txt | 42 +++-- .../qtconcurrent/imagescaling/CMakeLists.txt | 38 ++-- .../qtconcurrent/map/.prev_CMakeLists.txt | 26 +++ examples/qtconcurrent/map/CMakeLists.txt | 39 ++-- .../progressdialog/CMakeLists.txt | 36 ++-- .../qtconcurrent/runfunction/CMakeLists.txt | 37 ++-- .../qtconcurrent/wordcount/CMakeLists.txt | 37 ++-- examples/qtestlib/tutorial1/CMakeLists.txt | 35 ++-- examples/qtestlib/tutorial2/CMakeLists.txt | 35 ++-- examples/qtestlib/tutorial3/CMakeLists.txt | 35 ++-- examples/qtestlib/tutorial4/CMakeLists.txt | 35 ++-- examples/qtestlib/tutorial5/CMakeLists.txt | 35 ++-- examples/sql/books/CMakeLists.txt | 56 +++--- examples/sql/cachedtable/CMakeLists.txt | 40 ++-- examples/sql/drilldown/CMakeLists.txt | 51 ++--- examples/sql/masterdetail/CMakeLists.txt | 54 +++--- examples/sql/querymodel/CMakeLists.txt | 42 +++-- .../sql/relationaltablemodel/CMakeLists.txt | 38 ++-- examples/sql/sqlbrowser/CMakeLists.txt | 53 +++--- examples/sql/sqlwidgetmapper/CMakeLists.txt | 38 ++-- examples/sql/tablemodel/CMakeLists.txt | 38 ++-- .../animation/animatedtiles/CMakeLists.txt | 43 ++--- .../widgets/animation/easing/CMakeLists.txt | 45 +++-- .../animation/moveblocks/CMakeLists.txt | 33 ++-- .../widgets/animation/states/CMakeLists.txt | 42 +++-- .../widgets/animation/stickman/CMakeLists.txt | 51 ++--- .../animation/sub-attaq/CMakeLists.txt | 175 ++++-------------- .../widgets/desktop/screenshot/CMakeLists.txt | 35 ++-- .../widgets/desktop/systray/CMakeLists.txt | 41 ++-- .../dialogs/classwizard/CMakeLists.txt | 44 ++--- .../widgets/dialogs/extension/CMakeLists.txt | 35 ++-- .../widgets/dialogs/findfiles/CMakeLists.txt | 35 ++-- .../dialogs/licensewizard/CMakeLists.txt | 42 +++-- .../dialogs/standarddialogs/CMakeLists.txt | 35 ++-- .../widgets/dialogs/tabdialog/CMakeLists.txt | 35 ++-- .../dialogs/trivialwizard/CMakeLists.txt | 33 ++-- .../draganddrop/draggableicons/CMakeLists.txt | 41 ++-- .../draganddrop/draggabletext/CMakeLists.txt | 39 ++-- .../draganddrop/dropsite/CMakeLists.txt | 37 ++-- .../draganddrop/fridgemagnets/CMakeLists.txt | 41 ++-- .../widgets/draganddrop/puzzle/CMakeLists.txt | 46 ++--- .../widgets/effects/blurpicker/CMakeLists.txt | 48 +++-- .../effects/fademessage/CMakeLists.txt | 38 ++-- .../gestures/imagegestures/CMakeLists.txt | 37 ++-- .../graphicsview/anchorlayout/CMakeLists.txt | 33 ++-- .../basicgraphicslayouts/CMakeLists.txt | 41 ++-- .../widgets/graphicsview/boxes/CMakeLists.txt | 80 ++++---- .../widgets/graphicsview/chip/CMakeLists.txt | 68 ++++--- .../graphicsview/collidingmice/CMakeLists.txt | 39 ++-- .../graphicsview/diagramscene/CMakeLists.txt | 60 +++--- .../graphicsview/dragdroprobot/CMakeLists.txt | 40 ++-- .../graphicsview/elasticnodes/CMakeLists.txt | 39 ++-- .../embeddeddialogs/CMakeLists.txt | 49 +++-- .../graphicsview/flowlayout/CMakeLists.txt | 38 ++-- .../padnavigator/.prev_CMakeLists.txt | 45 +++++ .../graphicsview/padnavigator/CMakeLists.txt | 72 ++++--- .../simpleanchorlayout/CMakeLists.txt | 33 ++-- .../weatheranchorlayout/CMakeLists.txt | 42 +++-- .../itemviews/addressbook/CMakeLists.txt | 43 +++-- .../basicsortfiltermodel/CMakeLists.txt | 35 ++-- .../widgets/itemviews/chart/CMakeLists.txt | 47 +++-- .../coloreditorfactory/CMakeLists.txt | 37 ++-- .../combowidgetmapper/CMakeLists.txt | 35 ++-- .../customsortfiltermodel/CMakeLists.txt | 43 +++-- .../widgets/itemviews/dirview/CMakeLists.txt | 33 ++-- .../editabletreemodel/CMakeLists.txt | 45 +++-- .../itemviews/fetchmore/CMakeLists.txt | 37 ++-- .../itemviews/flattreeview/CMakeLists.txt | 33 ++-- .../itemviews/frozencolumn/CMakeLists.txt | 39 ++-- .../itemviews/interview/CMakeLists.txt | 50 +++-- .../itemviews/pixelator/CMakeLists.txt | 55 +++--- .../widgets/itemviews/puzzle/CMakeLists.txt | 43 +++-- .../itemviews/simpledommodel/CMakeLists.txt | 42 +++-- .../itemviews/simpletreemodel/CMakeLists.txt | 41 ++-- .../simplewidgetmapper/CMakeLists.txt | 35 ++-- .../itemviews/spinboxdelegate/CMakeLists.txt | 35 ++-- .../itemviews/spreadsheet/CMakeLists.txt | 59 +++--- .../itemviews/stardelegate/CMakeLists.txt | 39 ++-- .../itemviews/storageview/CMakeLists.txt | 41 ++-- .../layouts/basiclayouts/CMakeLists.txt | 35 ++-- .../layouts/borderlayout/CMakeLists.txt | 37 ++-- .../layouts/dynamiclayouts/CMakeLists.txt | 35 ++-- .../widgets/layouts/flowlayout/CMakeLists.txt | 37 ++-- .../mac/qmaccocoaviewcontainer/CMakeLists.txt | 36 ++-- .../mac/qmacnativewidget/CMakeLists.txt | 36 ++-- .../mainwindows/application/CMakeLists.txt | 44 ++--- .../mainwindows/dockwidgets/CMakeLists.txt | 56 +++--- .../mainwindows/mainwindow/CMakeLists.txt | 54 +++--- .../widgets/mainwindows/mdi/CMakeLists.txt | 46 ++--- .../widgets/mainwindows/menus/CMakeLists.txt | 35 ++-- .../widgets/mainwindows/sdi/CMakeLists.txt | 44 ++--- .../widgets/painting/affine/CMakeLists.txt | 46 +++-- .../painting/basicdrawing/CMakeLists.txt | 42 +++-- .../painting/composition/CMakeLists.txt | 45 +++-- .../painting/concentriccircles/CMakeLists.txt | 37 ++-- .../widgets/painting/deform/CMakeLists.txt | 44 +++-- .../painting/fontsampler/CMakeLists.txt | 43 ++--- .../widgets/painting/gradients/CMakeLists.txt | 43 +++-- .../painting/imagecomposition/CMakeLists.txt | 40 ++-- .../painting/painterpaths/CMakeLists.txt | 42 +++-- .../painting/pathstroke/CMakeLists.txt | 45 +++-- .../widgets/painting/shared/CMakeLists.txt | 53 +----- .../painting/transformations/CMakeLists.txt | 37 ++-- .../widgets/richtext/calendar/CMakeLists.txt | 35 ++-- .../widgets/richtext/orderform/CMakeLists.txt | 47 +++-- .../richtext/syntaxhighlighter/CMakeLists.txt | 37 ++-- .../widgets/richtext/textedit/CMakeLists.txt | 104 +++-------- .../scroller/graphicsview/CMakeLists.txt | 34 ++-- .../eventtransitions/CMakeLists.txt | 33 ++-- .../statemachine/factorial/CMakeLists.txt | 38 ++-- .../statemachine/pingpong/CMakeLists.txt | 38 ++-- .../widgets/statemachine/rogue/CMakeLists.txt | 37 ++-- .../statemachine/trafficlight/CMakeLists.txt | 33 ++-- .../statemachine/twowaybutton/CMakeLists.txt | 33 ++-- examples/widgets/tools/CMakeLists.txt | 4 +- examples/widgets/tools/codecs/CMakeLists.txt | 46 ++--- .../widgets/tools/completer/CMakeLists.txt | 42 +++-- .../tools/customcompleter/CMakeLists.txt | 41 ++-- .../echoplugin/echowindow/CMakeLists.txt | 51 +++-- .../tools/echoplugin/plugin/CMakeLists.txt | 26 +-- examples/widgets/tools/i18n/CMakeLists.txt | 57 +++--- .../tools/plugandpaint/app/CMakeLists.txt | 52 +++--- .../plugins/basictools/CMakeLists.txt | 37 +--- .../plugins/extrafilters/CMakeLists.txt | 30 +-- examples/widgets/tools/regexp/CMakeLists.txt | 35 ++-- .../tools/regularexpression/CMakeLists.txt | 39 ++-- .../tools/settingseditor/CMakeLists.txt | 42 +++-- .../widgets/tools/styleplugin/CMakeLists.txt | 15 ++ .../tools/styleplugin/plugin/CMakeLists.txt | 35 +--- .../styleplugin/stylewindow/CMakeLists.txt | 48 +++-- .../tools/treemodelcompleter/CMakeLists.txt | 40 ++-- examples/widgets/tools/undo/CMakeLists.txt | 66 +++---- .../tools/undoframework/CMakeLists.txt | 45 +++-- examples/widgets/touch/dials/CMakeLists.txt | 37 ++-- .../widgets/touch/fingerpaint/CMakeLists.txt | 49 +++-- examples/widgets/touch/knobs/CMakeLists.txt | 35 ++-- .../widgets/touch/pinchzoom/CMakeLists.txt | 41 ++-- .../addressbook/part1/CMakeLists.txt | 36 ++-- .../addressbook/part2/CMakeLists.txt | 36 ++-- .../addressbook/part3/CMakeLists.txt | 36 ++-- .../addressbook/part4/CMakeLists.txt | 36 ++-- .../addressbook/part5/CMakeLists.txt | 38 ++-- .../addressbook/part6/CMakeLists.txt | 38 ++-- .../addressbook/part7/CMakeLists.txt | 38 ++-- .../gettingStarted/gsQt/part1/CMakeLists.txt | 33 ++-- .../gettingStarted/gsQt/part2/CMakeLists.txt | 33 ++-- .../gettingStarted/gsQt/part3/CMakeLists.txt | 33 ++-- .../gettingStarted/gsQt/part4/CMakeLists.txt | 33 ++-- .../gettingStarted/gsQt/part5/CMakeLists.txt | 33 ++-- .../modelview/1_readonly/CMakeLists.txt | 36 ++-- .../modelview/2_formatting/CMakeLists.txt | 36 ++-- .../modelview/3_changingmodel/CMakeLists.txt | 36 ++-- .../modelview/4_headers/CMakeLists.txt | 36 ++-- .../tutorials/modelview/5_edit/CMakeLists.txt | 38 ++-- .../modelview/6_treeview/CMakeLists.txt | 36 ++-- .../modelview/7_selections/CMakeLists.txt | 36 ++-- .../widgets/tutorials/notepad/CMakeLists.txt | 74 +++----- .../widgets/childwidget/CMakeLists.txt | 33 ++-- .../widgets/nestedlayouts/CMakeLists.txt | 33 ++-- .../tutorials/widgets/toplevel/CMakeLists.txt | 33 ++-- .../widgets/windowlayout/CMakeLists.txt | 33 ++-- .../widgets/analogclock/CMakeLists.txt | 36 ++-- .../widgets/widgets/calculator/CMakeLists.txt | 37 ++-- .../widgets/calendarwidget/CMakeLists.txt | 35 ++-- .../widgets/charactermap/CMakeLists.txt | 37 ++-- .../widgets/widgets/codeeditor/CMakeLists.txt | 35 ++-- .../widgets/digitalclock/CMakeLists.txt | 35 ++-- .../widgets/elidedlabel/CMakeLists.txt | 43 +++-- .../widgets/widgets/groupbox/CMakeLists.txt | 35 ++-- examples/widgets/widgets/icons/CMakeLists.txt | 48 +++-- .../widgets/imageviewer/CMakeLists.txt | 47 +++-- .../widgets/widgets/lineedits/CMakeLists.txt | 35 ++-- .../widgets/mousebuttons/CMakeLists.txt | 38 ++-- examples/widgets/widgets/movie/CMakeLists.txt | 36 ++-- .../widgets/widgets/scribble/CMakeLists.txt | 49 +++-- .../widgets/shapedclock/CMakeLists.txt | 35 ++-- .../widgets/widgets/sliders/CMakeLists.txt | 37 ++-- .../widgets/widgets/spinboxes/CMakeLists.txt | 35 ++-- .../widgets/widgets/styles/CMakeLists.txt | 42 +++-- .../widgets/widgets/stylesheet/CMakeLists.txt | 77 +++----- .../widgets/widgets/tablet/CMakeLists.txt | 46 ++--- .../widgets/widgets/tetrix/CMakeLists.txt | 39 ++-- .../widgets/widgets/tooltips/CMakeLists.txt | 43 +++-- .../widgets/widgets/validators/CMakeLists.txt | 47 ++--- .../widgets/widgets/wiggly/CMakeLists.txt | 37 ++-- .../widgets/windowflags/CMakeLists.txt | 37 ++-- .../widgets/windowcontainer/CMakeLists.txt | 40 ++-- examples/xml/CMakeLists.txt | 14 ++ examples/xml/dombookmarks/CMakeLists.txt | 29 +++ examples/xml/htmlinfo/CMakeLists.txt | 25 +++ examples/xml/rsslisting/CMakeLists.txt | 30 +++ examples/xml/saxbookmarks/CMakeLists.txt | 30 +++ examples/xml/streambookmarks/CMakeLists.txt | 30 +++ examples/xml/xmlstreamlint/CMakeLists.txt | 26 +++ src/corelib/Qt5CoreConfigExtras.cmake.in | 41 ++-- 256 files changed, 6097 insertions(+), 4292 deletions(-) create mode 100644 examples/qtconcurrent/map/.prev_CMakeLists.txt create mode 100644 examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt create mode 100644 examples/xml/CMakeLists.txt create mode 100644 examples/xml/dombookmarks/CMakeLists.txt create mode 100644 examples/xml/htmlinfo/CMakeLists.txt create mode 100644 examples/xml/rsslisting/CMakeLists.txt create mode 100644 examples/xml/saxbookmarks/CMakeLists.txt create mode 100644 examples/xml/streambookmarks/CMakeLists.txt create mode 100644 examples/xml/xmlstreamlint/CMakeLists.txt diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 7eaa8d3cb01..bd2a8a7ba35 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -121,6 +121,12 @@ qt_copy_or_install(FILES cmake/QtPluginDependencies.cmake.in DESTINATION "${__GlobalConfig_install_dir}" ) +if(QT_WILL_INSTALL) + # NOTE: QtFeature.cmake is included by the Qt module config files unconditionally + # In a prefix build, QtFeature.cmake is not copied to the build dir by default + # Thus do it explicitly in that case so we can use the module config files in the examples + file(COPY cmake/QtFeature.cmake DESTINATION "${__GlobalConfig_install_dir}") +endif() # TODO: Check whether this is the right place to install these diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3b2079fbdff..664d1765898 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1232,7 +1232,7 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") DESTINATION "${config_install_dir}" COMPONENT Devel ) - qt_non_prefix_copy(COPY ${extra_cmake_files} DESTINATION "${config_install_dir}") + file(COPY ${extra_cmake_files} DESTINATION "${config_build_dir}") set(exported_targets ${target} ${target_private}) set(export_name "${INSTALL_CMAKE_NAMESPACE}${target}Targets") diff --git a/cmake/QtConfig.cmake.in b/cmake/QtConfig.cmake.in index db9ac360b5d..0ea33214eb7 100644 --- a/cmake/QtConfig.cmake.in +++ b/cmake/QtConfig.cmake.in @@ -7,9 +7,16 @@ endif() get_filename_component(_qt_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) -include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Targets.cmake") - -include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@VersionlessTargets.cmake") +if (NOT QT_NO_CREATE_TARGETS) + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@Targets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@VersionlessTargets.cmake") +else() + # For examples using `find_package(...)` inside their CMakeLists.txt files: + # Make CMake's AUTOGEN detect this Qt version properly + set_directory_properties(PROPERTIES + QT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ + QT_VERSION_MINOR @PROJECT_VERSION_MINOR@) +endif() # if (NOT @INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS) # set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "The Qt package requires at least one component") diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 7c6c6545ded..fcf5ba4644d 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -9,14 +9,16 @@ get_filename_component(_import_prefix "${_import_prefix}" REALPATH) @extra_cmake_code@ # Extra cmake code end -# Find required dependencies, if any. -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") +if (NOT QT_NO_CREATE_TARGETS) + # Find required dependencies, if any. + if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + endif() + + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake") endif() -include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") - -include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake") foreach(extra_cmake_include @extra_cmake_includes@) include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}") endforeach() diff --git a/cmake/QtModuleToolsConfig.cmake.in b/cmake/QtModuleToolsConfig.cmake.in index afc6de5b197..6d7ff9c8fa7 100644 --- a/cmake/QtModuleToolsConfig.cmake.in +++ b/cmake/QtModuleToolsConfig.cmake.in @@ -2,11 +2,13 @@ include(CMakeFindDependencyMacro) -# Find required dependencies, if any. -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") +if (NOT QT_NO_CREATE_TARGETS) + # Find required dependencies, if any. + if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + endif() + + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") endif() -include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") - @extra_cmake_statements@ diff --git a/cmake/QtPluginConfig.cmake.in b/cmake/QtPluginConfig.cmake.in index b212d087644..43b5b4d6175 100644 --- a/cmake/QtPluginConfig.cmake.in +++ b/cmake/QtPluginConfig.cmake.in @@ -5,9 +5,11 @@ include(CMakeFindDependencyMacro) get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_import_prefix "${_import_prefix}" REALPATH) -# Find required dependencies, if any. -if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@target@Dependencies.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@target@Dependencies.cmake") -endif() +if (NOT QT_NO_CREATE_TARGETS) + # Find required dependencies, if any. + if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@target@Dependencies.cmake") + endif() -include("${CMAKE_CURRENT_LIST_DIR}/@target@Targets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@target@Targets.cmake") +endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cdbf0c411da..5f61a098bd0 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,3 +1,25 @@ +# special case begin +cmake_minimum_required(VERSION 3.14.0) + +project(QtBaseExamples LANGUAGES CXX C ASM) + +# Check whether this project is built as part of a Qt build +if (CMAKE_PROJECT_NAME STREQUAL "QtBaseExamples") + set(QT_STANDALONE_EXAMPLES_BUILD TRUE) +endif() + +if (NOT QT_STANDALONE_EXAMPLES_BUILD) + # It is part of a Qt build => Use the CMake config files from the binary dir + list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}") + # Also make sure the CMake config files do not recreate the already-existing targets + set(QT_NO_CREATE_TARGETS TRUE) +endif() + +find_package(Qt5 COMPONENTS DBus Network Test Concurrent Sql Widgets Xml Gui) +# special case end + +# Generated from examples.pro. + add_subdirectory(corelib) add_subdirectory(embedded) add_subdirectory(qpa) @@ -5,21 +27,62 @@ add_subdirectory(qpa) if(TARGET Qt::DBus) add_subdirectory(dbus) endif() + if(TARGET Qt::Network) add_subdirectory(network) endif() + if(TARGET Qt::Test) add_subdirectory(qtestlib) endif() + if(TARGET Qt::Concurrent) add_subdirectory(qtconcurrent) endif() + if(TARGET Qt::Sql) add_subdirectory(sql) endif() -if(TARGET Qt::Gui) - add_subdirectory(gui) -endif() + if(TARGET Qt::Widgets) add_subdirectory(widgets) endif() + +if(TARGET Qt::Xml) + add_subdirectory(xml) +endif() + +if(TARGET Qt::Gui) + add_subdirectory(gui) + + if(QT_FEATURE_opengl) +# add_subdirectory(opengl) # special case: removed + endif() + + if(QT_FEATURE_vulkan) +# add_subdirectory(vulkan) # special case: removed + endif() +endif() + +# special case begin +if (NOT QT_STANDALONE_EXAMPLES_BUILD) + # We use AUTOMOC/UIC/RCC in the examples. Make sure to not fail on a fresh Qt build, that e.g. the moc binary does not exist yet. + + # This function gets all targets below this directory + function(get_all_targets _result _dir) + get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES) + foreach(_subdir IN LISTS _subdirs) + get_all_targets(${_result} "${_subdir}") + endforeach() + get_property(_sub_targets DIRECTORY "${_dir}" PROPERTY BUILDSYSTEM_TARGETS) + set(${_result} ${${_result}} ${_sub_targets} PARENT_SCOPE) + endfunction() + + get_all_targets(targets "${CMAKE_CURRENT_SOURCE_DIR}") + + foreach(target ${targets}) + qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS "moc" "uic" "rcc") + endforeach() + +endif() +# special case end diff --git a/examples/corelib/CMakeLists.txt b/examples/corelib/CMakeLists.txt index 3b61d307d97..5e24def2510 100644 --- a/examples/corelib/CMakeLists.txt +++ b/examples/corelib/CMakeLists.txt @@ -3,5 +3,8 @@ add_subdirectory(ipc) add_subdirectory(mimetypes) add_subdirectory(serialization) -add_subdirectory(threads) add_subdirectory(tools) + +if(QT_FEATURE_thread) + add_subdirectory(threads) +endif() diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt index 39ef3f4e3ff..ae0492fe260 100644 --- a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from localfortuneclient.pro. -##################################################################### -## localfortuneclient Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(localfortuneclient LANGUAGES CXX) -add_qt_executable(localfortuneclient - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneclient" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneclient" - SOURCES - client.cpp client.h - main.cpp - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(localfortuneclient WIN32 MACOSX_BUNDLE + client.cpp client.h + main.cpp +) +target_link_libraries(localfortuneclient PUBLIC + Qt::Network + Qt::Widgets +) +install(TARGETS localfortuneclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt index e94028413e8..11fcf4e2977 100644 --- a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from localfortuneserver.pro. -##################################################################### -## localfortuneserver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(localfortuneserver LANGUAGES CXX) -add_qt_executable(localfortuneserver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneserver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/localfortuneserver" - SOURCES - main.cpp - server.cpp server.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(localfortuneserver WIN32 MACOSX_BUNDLE + main.cpp + server.cpp server.h +) +target_link_libraries(localfortuneserver PUBLIC + Qt::Network + Qt::Widgets +) +install(TARGETS localfortuneserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt index a9874333021..f4e37803480 100644 --- a/examples/corelib/ipc/sharedmemory/CMakeLists.txt +++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt @@ -1,21 +1,26 @@ # Generated from sharedmemory.pro. -##################################################################### -## sharedmemory Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(sharedmemory LANGUAGES CXX) -add_qt_executable(sharedmemory - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/sharedmemory" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/ipc/sharedmemory" - SOURCES - dialog.cpp dialog.h dialog.ui - main.cpp - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(sharedmemory WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h dialog.ui + main.cpp +) +target_link_libraries(sharedmemory PUBLIC + Qt::Widgets +) +install(TARGETS sharedmemory + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:.:sharedmemory.pro:: -# EXAMPLE_FILES = "*.png" diff --git a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt index 4bd2b5ca6af..05e68e6d674 100644 --- a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt +++ b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt @@ -1,21 +1,27 @@ # Generated from mimetypebrowser.pro. -##################################################################### -## mimetypebrowser Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mimetypebrowser LANGUAGES CXX) -add_qt_executable(mimetypebrowser - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/mimetypes/mimetypebrowser" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/mimetypes/mimetypebrowser" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - mimetypemodel.cpp mimetypemodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mimetypebrowser WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + mimetypemodel.cpp mimetypemodel.h +) +target_link_libraries(mimetypebrowser PUBLIC + Qt::Widgets +) +install(TARGETS mimetypebrowser + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:mimetypebrowser.pro:: -# CONFIG = "-app_bundle" "c++11" -# TEMPLATE = "app" diff --git a/examples/corelib/serialization/cbordump/CMakeLists.txt b/examples/corelib/serialization/cbordump/CMakeLists.txt index b62181a2b7e..f9f6be09d9f 100644 --- a/examples/corelib/serialization/cbordump/CMakeLists.txt +++ b/examples/corelib/serialization/cbordump/CMakeLists.txt @@ -1,19 +1,26 @@ # Generated from cbordump.pro. -##################################################################### -## cbordump Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(cbordump LANGUAGES CXX) -add_qt_executable(cbordump - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/cbordump" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/cbordump" - SOURCES - main.cpp - LIBRARIES - # Remove: gui +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(cbordump + main.cpp +) +target_link_libraries(cbordump PUBLIC + # Remove: gui + Qt::Core +) +install(TARGETS cbordump + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:cbordump.pro:: -# CONFIG = "-app_bundle" -# TEMPLATE = "app" diff --git a/examples/corelib/serialization/convert/CMakeLists.txt b/examples/corelib/serialization/convert/CMakeLists.txt index 4dffb69c5bc..f03d3aa9dc4 100644 --- a/examples/corelib/serialization/convert/CMakeLists.txt +++ b/examples/corelib/serialization/convert/CMakeLists.txt @@ -1,26 +1,33 @@ # Generated from convert.pro. -##################################################################### -## convert Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(convert LANGUAGES CXX) -add_qt_executable(convert - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/convert" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/convert" - SOURCES - cborconverter.cpp cborconverter.h - converter.h - datastreamconverter.cpp datastreamconverter.h - jsonconverter.cpp jsonconverter.h - main.cpp - nullconverter.cpp nullconverter.h - textconverter.cpp textconverter.h - xmlconverter.cpp xmlconverter.h - LIBRARIES - # Remove: gui +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(convert + cborconverter.cpp cborconverter.h + converter.h + datastreamconverter.cpp datastreamconverter.h + jsonconverter.cpp jsonconverter.h + main.cpp + nullconverter.cpp nullconverter.h + textconverter.cpp textconverter.h + xmlconverter.cpp xmlconverter.h +) +target_link_libraries(convert PUBLIC + # Remove: gui + Qt::Core +) +install(TARGETS convert + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:convert.pro:: -# CONFIG = "-app_bundle" -# TEMPLATE = "app" diff --git a/examples/corelib/serialization/savegame/CMakeLists.txt b/examples/corelib/serialization/savegame/CMakeLists.txt index 175fca270f8..637613fef88 100644 --- a/examples/corelib/serialization/savegame/CMakeLists.txt +++ b/examples/corelib/serialization/savegame/CMakeLists.txt @@ -1,22 +1,29 @@ # Generated from savegame.pro. -##################################################################### -## savegame Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(savegame LANGUAGES CXX) -add_qt_executable(savegame - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/savegame" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/serialization/savegame" - SOURCES - character.cpp character.h - game.cpp game.h - level.cpp level.h - main.cpp - LIBRARIES - # Remove: gui +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(savegame + character.cpp character.h + game.cpp game.h + level.cpp level.h + main.cpp +) +target_link_libraries(savegame PUBLIC + # Remove: gui + Qt::Core +) +install(TARGETS savegame + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:savegame.pro:: -# CONFIG = "-app_bundle" -# TEMPLATE = "app" diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt index 00f27bacd9f..9b5995b1a5f 100644 --- a/examples/corelib/threads/mandelbrot/CMakeLists.txt +++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt @@ -1,25 +1,27 @@ # Generated from mandelbrot.pro. -##################################################################### -## mandelbrot Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mandelbrot LANGUAGES CXX) -add_qt_executable(mandelbrot - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/mandelbrot" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/mandelbrot" - SOURCES - main.cpp - mandelbrotwidget.cpp mandelbrotwidget.h - renderthread.cpp renderthread.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mandelbrot WIN32 MACOSX_BUNDLE + main.cpp + mandelbrotwidget.cpp mandelbrotwidget.h + renderthread.cpp renderthread.h ) - -## Scopes: -##################################################################### - -extend_target(mandelbrot CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS - LIBRARIES - m +target_link_libraries(mandelbrot PUBLIC + Qt::Widgets +) +install(TARGETS mandelbrot + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt index b86092bf269..9fc8234e4d9 100644 --- a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt +++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt @@ -1,18 +1,28 @@ # Generated from queuedcustomtype.pro. -##################################################################### -## queuedcustomtype Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(queuedcustomtype LANGUAGES CXX) -add_qt_executable(queuedcustomtype - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/queuedcustomtype" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/queuedcustomtype" - SOURCES - block.cpp block.h - main.cpp - renderthread.cpp renderthread.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(queuedcustomtype WIN32 MACOSX_BUNDLE + block.cpp block.h + main.cpp + renderthread.cpp renderthread.h + window.cpp window.h +) +target_link_libraries(queuedcustomtype PUBLIC + Qt::Widgets +) +install(TARGETS queuedcustomtype + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/semaphores/CMakeLists.txt b/examples/corelib/threads/semaphores/CMakeLists.txt index d94f1ba5b45..51638e0ff8c 100644 --- a/examples/corelib/threads/semaphores/CMakeLists.txt +++ b/examples/corelib/threads/semaphores/CMakeLists.txt @@ -1,15 +1,25 @@ # Generated from semaphores.pro. -##################################################################### -## semaphores Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(semaphores LANGUAGES CXX) -add_qt_executable(semaphores - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/semaphores" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/semaphores" - SOURCES - semaphores.cpp +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(semaphores + semaphores.cpp +) +target_link_libraries(semaphores PUBLIC + Qt::Core +) +install(TARGETS semaphores + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:semaphores.pro:: -# CONFIG = "-app_bundle" "console" diff --git a/examples/corelib/threads/waitconditions/CMakeLists.txt b/examples/corelib/threads/waitconditions/CMakeLists.txt index 0a347c1cdd1..4d3e61050c0 100644 --- a/examples/corelib/threads/waitconditions/CMakeLists.txt +++ b/examples/corelib/threads/waitconditions/CMakeLists.txt @@ -1,15 +1,25 @@ # Generated from waitconditions.pro. -##################################################################### -## waitconditions Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(waitconditions LANGUAGES CXX) -add_qt_executable(waitconditions - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/waitconditions" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/threads/waitconditions" - SOURCES - waitconditions.cpp +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(waitconditions + waitconditions.cpp +) +target_link_libraries(waitconditions PUBLIC + Qt::Core +) +install(TARGETS waitconditions + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:waitconditions.pro:: -# CONFIG = "-moc" "-app_bundle" "console" diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt index 68afb7221de..62214a46d56 100644 --- a/examples/corelib/tools/contiguouscache/CMakeLists.txt +++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt @@ -1,16 +1,26 @@ # Generated from contiguouscache.pro. -##################################################################### -## contiguouscache Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(contiguouscache LANGUAGES CXX) -add_qt_executable(contiguouscache - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/contiguouscache" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/contiguouscache" - SOURCES - main.cpp - randomlistmodel.cpp randomlistmodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(contiguouscache WIN32 MACOSX_BUNDLE + main.cpp + randomlistmodel.cpp randomlistmodel.h +) +target_link_libraries(contiguouscache PUBLIC + Qt::Widgets +) +install(TARGETS contiguouscache + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt index e26846da824..394534f5eef 100644 --- a/examples/corelib/tools/customtype/CMakeLists.txt +++ b/examples/corelib/tools/customtype/CMakeLists.txt @@ -1,16 +1,26 @@ # Generated from customtype.pro. -##################################################################### -## customtype Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(customtype LANGUAGES CXX) -add_qt_executable(customtype - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtype" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtype" - SOURCES - main.cpp - message.cpp message.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(customtype WIN32 MACOSX_BUNDLE + main.cpp + message.cpp message.h +) +target_link_libraries(customtype PUBLIC + Qt::Widgets +) +install(TARGETS customtype + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt index a069f735072..53a39c57ce3 100644 --- a/examples/corelib/tools/customtypesending/CMakeLists.txt +++ b/examples/corelib/tools/customtypesending/CMakeLists.txt @@ -1,17 +1,27 @@ # Generated from customtypesending.pro. -##################################################################### -## customtypesending Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(customtypesending LANGUAGES CXX) -add_qt_executable(customtypesending - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtypesending" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/corelib/tools/customtypesending" - SOURCES - main.cpp - message.cpp message.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(customtypesending WIN32 MACOSX_BUNDLE + main.cpp + message.cpp message.h + window.cpp window.h +) +target_link_libraries(customtypesending PUBLIC + Qt::Widgets +) +install(TARGETS customtypesending + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt index 9f321bbce38..26388c51eb2 100644 --- a/examples/dbus/chat/CMakeLists.txt +++ b/examples/dbus/chat/CMakeLists.txt @@ -1,24 +1,43 @@ # Generated from chat.pro. -##################################################################### -## chat Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(chat LANGUAGES CXX) -add_qt_executable(chat - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/chat" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/chat" - SOURCES - chat.cpp chat.h - chatmainwindow.ui - chatsetnickname.ui - DBUS_ADAPTOR_SOURCES - org.example.chat.xml - DBUS_INTERFACE_SOURCES - org.example.chat.xml - PUBLIC_LIBRARIES - Qt::DBus - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS DBus) +find_package(Qt5 COMPONENTS Widgets) + +# special case begin +set(chat_SRCS) +qt5_add_dbus_interface(chat_SRCS + org.example.chat.xml + chat_interface +) +qt5_add_dbus_adaptor(chat_SRCS + org.example.chat.xml + qobject.h + QObject + chat_adaptor +) +# special case end +add_executable(chat WIN32 MACOSX_BUNDLE + chat.cpp chat.h + chatmainwindow.ui + chatsetnickname.ui + ${chat_SRCS} # special case +) +target_link_libraries(chat PUBLIC + Qt::DBus + Qt::Widgets +) +install(TARGETS chat + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/complexpingpong/CMakeLists.txt b/examples/dbus/complexpingpong/CMakeLists.txt index cccb9584af6..543af8491b9 100644 --- a/examples/dbus/complexpingpong/CMakeLists.txt +++ b/examples/dbus/complexpingpong/CMakeLists.txt @@ -1,16 +1,26 @@ # Generated from complexpong.pro. -##################################################################### -## complexpong Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(complexpong LANGUAGES CXX) -add_qt_executable(complexpong - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/complexpingpong" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/complexpingpong" - SOURCES - complexpong.cpp complexpong.h - LIBRARIES - # Remove: gui - Qt::DBus +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS DBus) + +add_executable(complexpong WIN32 MACOSX_BUNDLE + complexpong.cpp complexpong.h +) +target_link_libraries(complexpong PUBLIC + # Remove: gui + Qt::DBus +) +install(TARGETS complexpong + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/listnames/CMakeLists.txt b/examples/dbus/listnames/CMakeLists.txt index eb622b0ef66..5fe935f24a1 100644 --- a/examples/dbus/listnames/CMakeLists.txt +++ b/examples/dbus/listnames/CMakeLists.txt @@ -1,22 +1,26 @@ # Generated from listnames.pro. -##################################################################### -## listnames Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(listnames LANGUAGES CXX) -add_qt_executable(listnames - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/listnames" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/listnames" - SOURCES - listnames.cpp - LIBRARIES - # Remove: gui - Qt::DBus +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS DBus) + +add_executable(listnames WIN32 MACOSX_BUNDLE + listnames.cpp +) +target_link_libraries(listnames PUBLIC + # Remove: gui + Qt::DBus +) +install(TARGETS listnames + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:listnames.pro:WIN32: -# CONFIG = "console" diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt index 0979c8d4877..e82fe78c514 100644 --- a/examples/dbus/pingpong/CMakeLists.txt +++ b/examples/dbus/pingpong/CMakeLists.txt @@ -1,35 +1,27 @@ -# Generated from pingpong.pro. +# Generated from pong.pro. -##################################################################### -## ping Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(pong LANGUAGES CXX) -add_qt_executable(ping - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" - SOURCES - ping.cpp - ping-common.h - LIBRARIES - # Remove: gui - Qt::DBus +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS DBus) + +add_executable(pong WIN32 MACOSX_BUNDLE + ping-common.h + pong.cpp pong.h ) -##################################################################### -## pong Binary: -##################################################################### - -add_qt_executable(pong - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/pingpong" - SOURCES - ping-common.h - pong.cpp pong.h - LIBRARIES - # Remove: gui - Qt::DBus +target_link_libraries(pong PUBLIC + # Remove: gui + Qt::DBus +) +install(TARGETS pong + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -if(WIN32) -endif() diff --git a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt index a8aed5413ad..9532d0cceec 100644 --- a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt @@ -1,19 +1,38 @@ # Generated from car.pro. -##################################################################### -## car Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(car LANGUAGES CXX) -add_qt_executable(car - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/car" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/car" - SOURCES - car.cpp car.h - main.cpp - DBUS_ADAPTOR_SOURCES - car.xml - LIBRARIES - Qt::DBus - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS DBus) +find_package(Qt5 COMPONENTS Widgets) + +# special case begin +set(car_SRCS) +qt5_add_dbus_adaptor(car_SRCS + car.xml + car.h + Car + car_adaptor +) +# special case end +add_executable(car WIN32 MACOSX_BUNDLE + car.cpp car.h + main.cpp + ${car_SRCS} # special case +) +target_link_libraries(car PUBLIC + Qt::DBus + Qt::Widgets +) +install(TARGETS car + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt index 3f360fa51b1..00bf809392b 100644 --- a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt @@ -1,21 +1,36 @@ # Generated from controller.pro. -##################################################################### -## controller Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(controller LANGUAGES CXX) -add_qt_executable(controller - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/controller" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/dbus/remotecontrolledcar/controller" - SOURCES - controller.cpp controller.h controller.ui - main.cpp - DBUS_INTERFACE_SOURCES - car.xml - PUBLIC_LIBRARIES - Qt::DBus - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS DBus) +find_package(Qt5 COMPONENTS Widgets) + +# special case begin +set(controller_SRCS) +qt5_add_dbus_interface(controller_SRCS + car.xml + car_interface +) +# special case end +add_executable(controller WIN32 MACOSX_BUNDLE + controller.cpp controller.h controller.ui + main.cpp + ${controller_SRCS} # special case +) +target_link_libraries(controller PUBLIC + Qt::DBus + Qt::Widgets +) +install(TARGETS controller + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/digiflip/CMakeLists.txt b/examples/embedded/digiflip/CMakeLists.txt index 3786ed38a46..bc94d6809ad 100644 --- a/examples/embedded/digiflip/CMakeLists.txt +++ b/examples/embedded/digiflip/CMakeLists.txt @@ -1,15 +1,25 @@ # Generated from digiflip.pro. -##################################################################### -## digiflip Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(digiflip LANGUAGES CXX) -add_qt_executable(digiflip - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/digiflip" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/digiflip" - SOURCES - digiflip.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(digiflip WIN32 MACOSX_BUNDLE + digiflip.cpp +) +target_link_libraries(digiflip PUBLIC + Qt::Widgets +) +install(TARGETS digiflip + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/flickable/CMakeLists.txt b/examples/embedded/flickable/CMakeLists.txt index 20f8eca9f5a..8d5d9878f06 100644 --- a/examples/embedded/flickable/CMakeLists.txt +++ b/examples/embedded/flickable/CMakeLists.txt @@ -1,16 +1,26 @@ # Generated from flickable.pro. -##################################################################### -## flickable Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(flickable LANGUAGES CXX) -add_qt_executable(flickable - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flickable" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flickable" - SOURCES - flickable.cpp flickable.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(flickable WIN32 MACOSX_BUNDLE + flickable.cpp flickable.h + main.cpp +) +target_link_libraries(flickable PUBLIC + Qt::Widgets +) +install(TARGETS flickable + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/flightinfo/CMakeLists.txt b/examples/embedded/flightinfo/CMakeLists.txt index a4276bf2d86..9afc98df76a 100644 --- a/examples/embedded/flightinfo/CMakeLists.txt +++ b/examples/embedded/flightinfo/CMakeLists.txt @@ -1,27 +1,29 @@ # Generated from flightinfo.pro. -##################################################################### -## flightinfo Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(flightinfo LANGUAGES CXX) -add_qt_executable(flightinfo - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flightinfo" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/flightinfo" - SOURCES - flightinfo.cpp - form.ui - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(flightinfo WIN32 MACOSX_BUNDLE + flightinfo.cpp + form.ui + flightinfo.qrc # special case: add +) +target_link_libraries(flightinfo PUBLIC + Qt::Network + Qt::Widgets +) +install(TARGETS flightinfo + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -# Resources: -add_qt_resource(flightinfo "flightinfo" PREFIX "/" FILES - aircraft.png) - - -#### Keys ignored in scope 1:.:.:flightinfo.pro:: -# TEMPLATE = "app" diff --git a/examples/embedded/lightmaps/CMakeLists.txt b/examples/embedded/lightmaps/CMakeLists.txt index 4779d07adc4..35171451bfc 100644 --- a/examples/embedded/lightmaps/CMakeLists.txt +++ b/examples/embedded/lightmaps/CMakeLists.txt @@ -1,22 +1,30 @@ # Generated from lightmaps.pro. -##################################################################### -## lightmaps Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(lightmaps LANGUAGES CXX) -add_qt_executable(lightmaps - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/lightmaps" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/lightmaps" - SOURCES - lightmaps.cpp lightmaps.h - main.cpp - mapzoom.cpp mapzoom.h - slippymap.cpp slippymap.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(lightmaps WIN32 MACOSX_BUNDLE + lightmaps.cpp lightmaps.h + main.cpp + mapzoom.cpp mapzoom.h + slippymap.cpp slippymap.h +) +target_link_libraries(lightmaps PUBLIC + Qt::Network + Qt::Widgets +) +install(TARGETS lightmaps + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:lightmaps.pro:: -# TEMPLATE = "app" diff --git a/examples/embedded/raycasting/CMakeLists.txt b/examples/embedded/raycasting/CMakeLists.txt index 3757bb756a1..0578b6e0bd8 100644 --- a/examples/embedded/raycasting/CMakeLists.txt +++ b/examples/embedded/raycasting/CMakeLists.txt @@ -1,23 +1,26 @@ # Generated from raycasting.pro. -##################################################################### -## raycasting Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(raycasting LANGUAGES CXX) -add_qt_executable(raycasting - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/raycasting" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/raycasting" - SOURCES - raycasting.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(raycasting WIN32 MACOSX_BUNDLE + raycasting.cpp raycasting.qrc +) +target_link_libraries(raycasting PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(raycasting "raycasting" PREFIX "/" FILES - textures.png) - - -#### Keys ignored in scope 1:.:raycasting.pro:: -# TEMPLATE = "app" +install(TARGETS raycasting + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/embedded/styleexample/CMakeLists.txt b/examples/embedded/styleexample/CMakeLists.txt index d14acc8b5ae..2210d8cf9b6 100644 --- a/examples/embedded/styleexample/CMakeLists.txt +++ b/examples/embedded/styleexample/CMakeLists.txt @@ -1,30 +1,27 @@ # Generated from styleexample.pro. -##################################################################### -## styleexample Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(styleexample LANGUAGES CXX) -add_qt_executable(styleexample - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/styleexample" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/embedded/styleexample" - SOURCES - main.cpp - stylewidget.cpp stylewidget.h stylewidget.ui - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(styleexample WIN32 MACOSX_BUNDLE + main.cpp + stylewidget.cpp stylewidget.h stylewidget.ui + styleexample.qrc # special case: add +) +target_link_libraries(styleexample PUBLIC + Qt::Widgets +) +install(TARGETS styleexample + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -# Resources: -add_qt_resource(styleexample "styleexample" PREFIX "/" FILES - files/add.png - files/application.qss - files/blue.qss - files/khaki.qss - files/nature_1.jpg - files/nostyle.qss - files/remove.png - files/transparent.qss) - diff --git a/examples/gui/analogclock/CMakeLists.txt b/examples/gui/analogclock/CMakeLists.txt index 99a879c57a6..d35b5a7502f 100644 --- a/examples/gui/analogclock/CMakeLists.txt +++ b/examples/gui/analogclock/CMakeLists.txt @@ -1,21 +1,32 @@ # Generated from analogclock.pro. -##################################################################### -## analogclock Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(analogclock LANGUAGES CXX) -add_qt_executable(analogclock - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/analogclock" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/analogclock" - SOURCES - ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h - main.cpp - INCLUDE_DIRECTORIES - ../rasterwindow - LIBRARIES # special case - Qt::Gui +find_package(Qt5 COMPONENTS Widgets) # special case: add + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(gui_analogclock WIN32 MACOSX_BUNDLE # special case: renamed target + ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h + main.cpp ) +target_include_directories(gui_analogclock PUBLIC + ../rasterwindow +) +# special case begin +target_link_libraries(gui_analogclock PUBLIC + Qt::Gui +) +# special case end -#### Keys ignored in scope 1:.:analogclock.pro:: -# CONFIG = "no_batch" +install(TARGETS gui_analogclock + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/gui/openglwindow/CMakeLists.txt b/examples/gui/openglwindow/CMakeLists.txt index a59ba143467..ee62a2c43e4 100644 --- a/examples/gui/openglwindow/CMakeLists.txt +++ b/examples/gui/openglwindow/CMakeLists.txt @@ -1,18 +1,31 @@ # Generated from openglwindow.pro. -##################################################################### -## openglwindow Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(openglwindow LANGUAGES CXX) -add_qt_executable(openglwindow - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/openglwindow" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/openglwindow" - SOURCES - main.cpp - openglwindow.cpp openglwindow.h - INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_SOURCE_DIR} - LIBRARIES # special case - Qt::Gui +find_package(Qt5 COMPONENTS Widgets) # special case: add + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(openglwindow WIN32 MACOSX_BUNDLE + main.cpp + openglwindow.cpp openglwindow.h +) +target_include_directories(openglwindow PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) +# special case begin +target_link_libraries(openglwindow PUBLIC + Qt::Gui +) +# special case end +install(TARGETS openglwindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt index 61255f30389..f200899fbdf 100644 --- a/examples/gui/rasterwindow/CMakeLists.txt +++ b/examples/gui/rasterwindow/CMakeLists.txt @@ -1,18 +1,31 @@ # Generated from rasterwindow.pro. -##################################################################### -## rasterwindow Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(rasterwindow LANGUAGES CXX) -add_qt_executable(rasterwindow - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/rasterwindow" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/gui/rasterwindow" - SOURCES - main.cpp - rasterwindow.cpp rasterwindow.h - INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_SOURCE_DIR} - LIBRARIES # special case - Qt::Gui +find_package(Qt5 COMPONENTS Widgets) # special case: add + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(rasterwindow WIN32 MACOSX_BUNDLE + main.cpp + rasterwindow.cpp rasterwindow.h +) +target_include_directories(rasterwindow PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) +# special case begin +target_link_libraries(rasterwindow PUBLIC + Qt::Gui +) +# special case end +install(TARGETS rasterwindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/bearermonitor/CMakeLists.txt b/examples/network/bearermonitor/CMakeLists.txt index 83c45fb21a9..55893a7138c 100644 --- a/examples/network/bearermonitor/CMakeLists.txt +++ b/examples/network/bearermonitor/CMakeLists.txt @@ -1,33 +1,36 @@ # Generated from bearermonitor.pro. -##################################################################### -## bearermonitor Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(bearermonitor LANGUAGES CXX) -add_qt_executable(bearermonitor - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/bearermonitor" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/bearermonitor" - SOURCES - bearermonitor.cpp bearermonitor.h - bearermonitor_240_320.ui - bearermonitor_640_480.ui - main.cpp - sessionwidget.cpp sessionwidget.h sessionwidget.ui - PUBLIC_LIBRARIES - Qt::Gui - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Gui) +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(bearermonitor + bearermonitor.cpp bearermonitor.h + bearermonitor_240_320.ui + bearermonitor_640_480.ui + main.cpp + sessionwidget.cpp sessionwidget.h sessionwidget.ui +) +target_link_libraries(bearermonitor PUBLIC + Qt::Core + Qt::Gui + Qt::Network + Qt::Widgets ) -#### Keys ignored in scope 1:.:.:bearermonitor.pro:: -# CONFIG = "console" - -## Scopes: -##################################################################### - -extend_target(bearermonitor CONDITION WIN32 - PUBLIC_LIBRARIES - ws2_32 +install(TARGETS bearermonitor + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/blockingfortuneclient/CMakeLists.txt b/examples/network/blockingfortuneclient/CMakeLists.txt index bedbf2f6070..603c7d9fd2a 100644 --- a/examples/network/blockingfortuneclient/CMakeLists.txt +++ b/examples/network/blockingfortuneclient/CMakeLists.txt @@ -1,18 +1,30 @@ # Generated from blockingfortuneclient.pro. -##################################################################### -## blockingfortuneclient Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(blockingfortuneclient LANGUAGES CXX) -add_qt_executable(blockingfortuneclient - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/blockingfortuneclient" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/blockingfortuneclient" - SOURCES - blockingclient.cpp blockingclient.h - fortunethread.cpp fortunethread.h - main.cpp - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(blockingfortuneclient WIN32 MACOSX_BUNDLE + blockingclient.cpp blockingclient.h + fortunethread.cpp fortunethread.h + main.cpp +) +target_link_libraries(blockingfortuneclient PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS blockingfortuneclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/broadcastreceiver/CMakeLists.txt b/examples/network/broadcastreceiver/CMakeLists.txt index 197e56cef05..79075f35580 100644 --- a/examples/network/broadcastreceiver/CMakeLists.txt +++ b/examples/network/broadcastreceiver/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from broadcastreceiver.pro. -##################################################################### -## broadcastreceiver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(broadcastreceiver LANGUAGES CXX) -add_qt_executable(broadcastreceiver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastreceiver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastreceiver" - SOURCES - main.cpp - receiver.cpp receiver.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(broadcastreceiver WIN32 MACOSX_BUNDLE + main.cpp + receiver.cpp receiver.h +) +target_link_libraries(broadcastreceiver PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS broadcastreceiver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/broadcastsender/CMakeLists.txt b/examples/network/broadcastsender/CMakeLists.txt index 8fd49d85787..f6da1a57333 100644 --- a/examples/network/broadcastsender/CMakeLists.txt +++ b/examples/network/broadcastsender/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from broadcastsender.pro. -##################################################################### -## broadcastsender Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(broadcastsender LANGUAGES CXX) -add_qt_executable(broadcastsender - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastsender" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/broadcastsender" - SOURCES - main.cpp - sender.cpp sender.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(broadcastsender WIN32 MACOSX_BUNDLE + main.cpp + sender.cpp sender.h +) +target_link_libraries(broadcastsender PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS broadcastsender + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/dnslookup/CMakeLists.txt b/examples/network/dnslookup/CMakeLists.txt index 6ffc633a967..8aa5bea4cbb 100644 --- a/examples/network/dnslookup/CMakeLists.txt +++ b/examples/network/dnslookup/CMakeLists.txt @@ -1,27 +1,28 @@ # Generated from dnslookup.pro. -##################################################################### -## dnslookup Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dnslookup LANGUAGES CXX) -add_qt_executable(dnslookup - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/dnslookup" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/dnslookup" - SOURCES - dnslookup.cpp dnslookup.h - LIBRARIES - Qt::Network +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Network) + +add_executable(dnslookup + dnslookup.cpp dnslookup.h +) +target_link_libraries(dnslookup PUBLIC + Qt::Core + Qt::Network ) -#### Keys ignored in scope 1:.:dnslookup.pro:: -# TEMPLATE = "app" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:dnslookup.pro:APPLE_OSX: -# CONFIG = "-app_bundle" - -#### Keys ignored in scope 3:.:dnslookup.pro:WIN32: -# CONFIG = "console" +install(TARGETS dnslookup + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/download/CMakeLists.txt b/examples/network/download/CMakeLists.txt index 868685fd0a9..0ec20216b5b 100644 --- a/examples/network/download/CMakeLists.txt +++ b/examples/network/download/CMakeLists.txt @@ -1,18 +1,28 @@ # Generated from download.pro. -##################################################################### -## download Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(download LANGUAGES CXX) -add_qt_executable(download - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/download" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/download" - SOURCES - main.cpp - LIBRARIES - Qt::Network +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Network) + +add_executable(download + main.cpp +) +target_link_libraries(download PUBLIC + Qt::Core + Qt::Network ) -#### Keys ignored in scope 1:.:download.pro:: -# CONFIG = "-app_bundle" +install(TARGETS download + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/downloadmanager/CMakeLists.txt b/examples/network/downloadmanager/CMakeLists.txt index a5ccac9178f..574073c7eb1 100644 --- a/examples/network/downloadmanager/CMakeLists.txt +++ b/examples/network/downloadmanager/CMakeLists.txt @@ -1,21 +1,30 @@ # Generated from downloadmanager.pro. -##################################################################### -## downloadmanager Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(downloadmanager LANGUAGES CXX) -add_qt_executable(downloadmanager - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/downloadmanager" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/downloadmanager" - SOURCES - downloadmanager.cpp downloadmanager.h - main.cpp - textprogressbar.cpp textprogressbar.h - LIBRARIES - Qt::Network +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Network) + +add_executable(downloadmanager + downloadmanager.cpp downloadmanager.h + main.cpp + textprogressbar.cpp textprogressbar.h +) +target_link_libraries(downloadmanager PUBLIC + Qt::Core + Qt::Network ) -#### Keys ignored in scope 1:.:downloadmanager.pro:: -# CONFIG = "-app_bundle" -# OTHER_FILES = "debian/changelog" "debian/compat" "debian/control" "debian/copyright" "debian/README" "debian/rules" +install(TARGETS downloadmanager + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt index bbeecf9c642..a9e0e00c7eb 100644 --- a/examples/network/fortuneclient/CMakeLists.txt +++ b/examples/network/fortuneclient/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from fortuneclient.pro. -##################################################################### -## fortuneclient Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fortuneclient LANGUAGES CXX) -add_qt_executable(fortuneclient - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneclient" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneclient" - SOURCES - client.cpp client.h - main.cpp - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(fortuneclient WIN32 MACOSX_BUNDLE + client.cpp client.h + main.cpp +) +target_link_libraries(fortuneclient PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS fortuneclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/fortuneserver/CMakeLists.txt b/examples/network/fortuneserver/CMakeLists.txt index 299f43910f7..03604f121ec 100644 --- a/examples/network/fortuneserver/CMakeLists.txt +++ b/examples/network/fortuneserver/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from fortuneserver.pro. -##################################################################### -## fortuneserver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fortuneserver LANGUAGES CXX) -add_qt_executable(fortuneserver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneserver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/fortuneserver" - SOURCES - main.cpp - server.cpp server.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(fortuneserver WIN32 MACOSX_BUNDLE + main.cpp + server.cpp server.h +) +target_link_libraries(fortuneserver PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS fortuneserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt index ef5deedb801..d445bf646d5 100644 --- a/examples/network/googlesuggest/CMakeLists.txt +++ b/examples/network/googlesuggest/CMakeLists.txt @@ -1,18 +1,30 @@ # Generated from googlesuggest.pro. -##################################################################### -## googlesuggest Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(googlesuggest LANGUAGES CXX) -add_qt_executable(googlesuggest - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/googlesuggest" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/googlesuggest" - SOURCES - googlesuggest.cpp googlesuggest.h - main.cpp - searchbox.cpp searchbox.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(googlesuggest WIN32 MACOSX_BUNDLE + googlesuggest.cpp googlesuggest.h + main.cpp + searchbox.cpp searchbox.h +) +target_link_libraries(googlesuggest PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS googlesuggest + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt index 30f6b900e20..931c834eae3 100644 --- a/examples/network/http/CMakeLists.txt +++ b/examples/network/http/CMakeLists.txt @@ -1,20 +1,30 @@ # Generated from http.pro. -##################################################################### -## http Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(http LANGUAGES CXX) -add_qt_executable(http - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/http" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/http" - SOURCES - authenticationdialog.ui - httpwindow.cpp httpwindow.h - main.cpp - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(http WIN32 MACOSX_BUNDLE + authenticationdialog.ui + httpwindow.cpp httpwindow.h + main.cpp +) +target_link_libraries(http PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS http + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/loopback/CMakeLists.txt b/examples/network/loopback/CMakeLists.txt index 566b48a76e7..06410c7b5cd 100644 --- a/examples/network/loopback/CMakeLists.txt +++ b/examples/network/loopback/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from loopback.pro. -##################################################################### -## loopback Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(loopback LANGUAGES CXX) -add_qt_executable(loopback - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/loopback" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/loopback" - SOURCES - dialog.cpp dialog.h - main.cpp - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(loopback WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h + main.cpp +) +target_link_libraries(loopback PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS loopback + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multicastreceiver/CMakeLists.txt b/examples/network/multicastreceiver/CMakeLists.txt index 11204015f22..71bcadc2536 100644 --- a/examples/network/multicastreceiver/CMakeLists.txt +++ b/examples/network/multicastreceiver/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from multicastreceiver.pro. -##################################################################### -## multicastreceiver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(multicastreceiver LANGUAGES CXX) -add_qt_executable(multicastreceiver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastreceiver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastreceiver" - SOURCES - main.cpp - receiver.cpp receiver.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(multicastreceiver WIN32 MACOSX_BUNDLE + main.cpp + receiver.cpp receiver.h +) +target_link_libraries(multicastreceiver PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS multicastreceiver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multicastsender/CMakeLists.txt b/examples/network/multicastsender/CMakeLists.txt index e02a6b7145a..bcb23706494 100644 --- a/examples/network/multicastsender/CMakeLists.txt +++ b/examples/network/multicastsender/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from multicastsender.pro. -##################################################################### -## multicastsender Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(multicastsender LANGUAGES CXX) -add_qt_executable(multicastsender - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastsender" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multicastsender" - SOURCES - main.cpp - sender.cpp sender.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(multicastsender WIN32 MACOSX_BUNDLE + main.cpp + sender.cpp sender.h +) +target_link_libraries(multicastsender PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS multicastsender + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multistreamclient/CMakeLists.txt b/examples/network/multistreamclient/CMakeLists.txt index b9f10f3fd5e..399333fd29a 100644 --- a/examples/network/multistreamclient/CMakeLists.txt +++ b/examples/network/multistreamclient/CMakeLists.txt @@ -1,21 +1,33 @@ # Generated from multistreamclient.pro. -##################################################################### -## multistreamclient Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(multistreamclient LANGUAGES CXX) -add_qt_executable(multistreamclient - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamclient" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamclient" - SOURCES - chatconsumer.cpp chatconsumer.h - client.cpp client.h - consumer.h - main.cpp - movieconsumer.cpp movieconsumer.h - timeconsumer.cpp timeconsumer.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(multistreamclient WIN32 MACOSX_BUNDLE + chatconsumer.cpp chatconsumer.h + client.cpp client.h + consumer.h + main.cpp + movieconsumer.cpp movieconsumer.h + timeconsumer.cpp timeconsumer.h +) +target_link_libraries(multistreamclient PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS multistreamclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multistreamserver/CMakeLists.txt b/examples/network/multistreamserver/CMakeLists.txt index 34759951782..bf48042f58f 100644 --- a/examples/network/multistreamserver/CMakeLists.txt +++ b/examples/network/multistreamserver/CMakeLists.txt @@ -1,24 +1,33 @@ # Generated from multistreamserver.pro. -##################################################################### -## multistreamserver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(multistreamserver LANGUAGES CXX) -add_qt_executable(multistreamserver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamserver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/multistreamserver" - SOURCES - chatprovider.cpp chatprovider.h - main.cpp - movieprovider.cpp movieprovider.h - provider.h - server.cpp server.h - timeprovider.cpp timeprovider.h - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(multistreamserver WIN32 MACOSX_BUNDLE + chatprovider.cpp chatprovider.h + main.cpp + movieprovider.cpp movieprovider.h + provider.h + server.cpp server.h + timeprovider.cpp timeprovider.h +) +target_link_libraries(multistreamserver PUBLIC + Qt::Network + Qt::Widgets ) -#### Keys ignored in scope 1:.:multistreamserver.pro:: -# EXAMPLE_FILES = "animation.gif" +install(TARGETS multistreamserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt index d620d899d13..a4fb9503708 100644 --- a/examples/network/network-chat/CMakeLists.txt +++ b/examples/network/network-chat/CMakeLists.txt @@ -1,23 +1,33 @@ # Generated from network-chat.pro. -##################################################################### -## network-chat Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(network-chat LANGUAGES CXX) -add_qt_executable(network-chat - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/network-chat" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/network-chat" - SOURCES - chatdialog.cpp chatdialog.h chatdialog.ui - client.cpp client.h - connection.cpp connection.h - main.cpp - peermanager.cpp peermanager.h - server.cpp server.h - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(network-chat WIN32 MACOSX_BUNDLE + chatdialog.cpp chatdialog.h chatdialog.ui + client.cpp client.h + connection.cpp connection.h + main.cpp + peermanager.cpp peermanager.h + server.cpp server.h +) +target_link_libraries(network-chat PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS network-chat + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt index fd9a12e4bb4..d112af044a6 100644 --- a/examples/network/securesocketclient/CMakeLists.txt +++ b/examples/network/securesocketclient/CMakeLists.txt @@ -1,26 +1,32 @@ # Generated from securesocketclient.pro. -##################################################################### -## securesocketclient Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(securesocketclient LANGUAGES CXX) -add_qt_executable(securesocketclient - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/securesocketclient" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/securesocketclient" - SOURCES - certificateinfo.cpp certificateinfo.h certificateinfo.ui - main.cpp - sslclient.cpp sslclient.h sslclient.ui - sslerrors.ui - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(securesocketclient WIN32 MACOSX_BUNDLE + certificateinfo.cpp certificateinfo.h certificateinfo.ui + main.cpp + securesocketclient.qrc + sslclient.cpp sslclient.h sslclient.ui + sslerrors.ui +) +target_link_libraries(securesocketclient PUBLIC + Qt::Network + Qt::Widgets ) -# Resources: -add_qt_resource(securesocketclient "securesocketclient" FILES - encrypted.png) - +install(TARGETS securesocketclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt index 5516b36cc3c..531b1196a38 100644 --- a/examples/network/secureudpclient/CMakeLists.txt +++ b/examples/network/secureudpclient/CMakeLists.txt @@ -1,24 +1,31 @@ # Generated from secureudpclient.pro. -##################################################################### -## secureudpclient Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(secureudpclient LANGUAGES CXX) -add_qt_executable(secureudpclient - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpclient" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpclient" - SOURCES - addressdialog.cpp addressdialog.h addressdialog.ui - association.cpp association.h - main.cpp - mainwindow.cpp mainwindow.h mainwindow.ui - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Network) + +add_executable(secureudpclient WIN32 MACOSX_BUNDLE + addressdialog.cpp addressdialog.h addressdialog.ui + association.cpp association.h + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui +) +target_link_libraries(secureudpclient PUBLIC + Qt::Network + Qt::Widgets ) -#### Keys ignored in scope 1:.:.:secureudpclient.pro:: -# TEMPLATE = "app" +install(TARGETS secureudpclient + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt index 6d4968c9f7f..e6e60711d0c 100644 --- a/examples/network/secureudpserver/CMakeLists.txt +++ b/examples/network/secureudpserver/CMakeLists.txt @@ -1,24 +1,31 @@ # Generated from secureudpserver.pro. -##################################################################### -## secureudpserver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(secureudpserver LANGUAGES CXX) -add_qt_executable(secureudpserver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpserver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/secureudpserver" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h mainwindow.ui - nicselector.cpp nicselector.h nicselector.ui - server.cpp server.h - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Network) + +add_executable(secureudpserver WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + nicselector.cpp nicselector.h nicselector.ui + server.cpp server.h +) +target_link_libraries(secureudpserver PUBLIC + Qt::Network + Qt::Widgets ) -#### Keys ignored in scope 1:.:.:secureudpserver.pro:: -# TEMPLATE = "app" +install(TARGETS secureudpserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/threadedfortuneserver/CMakeLists.txt b/examples/network/threadedfortuneserver/CMakeLists.txt index 124ac1d1cce..43b95e60d5c 100644 --- a/examples/network/threadedfortuneserver/CMakeLists.txt +++ b/examples/network/threadedfortuneserver/CMakeLists.txt @@ -1,19 +1,31 @@ # Generated from threadedfortuneserver.pro. -##################################################################### -## threadedfortuneserver Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(threadedfortuneserver LANGUAGES CXX) -add_qt_executable(threadedfortuneserver - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/threadedfortuneserver" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/threadedfortuneserver" - SOURCES - dialog.cpp dialog.h - fortuneserver.cpp fortuneserver.h - fortunethread.cpp fortunethread.h - main.cpp - LIBRARIES - Qt::Network - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(threadedfortuneserver WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h + fortuneserver.cpp fortuneserver.h + fortunethread.cpp fortunethread.h + main.cpp +) +target_link_libraries(threadedfortuneserver PUBLIC + Qt::Network + Qt::Widgets +) + +install(TARGETS threadedfortuneserver + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/torrent/.prev_CMakeLists.txt b/examples/network/torrent/.prev_CMakeLists.txt index 5d23f5e74b0..8391a0a9db3 100644 --- a/examples/network/torrent/.prev_CMakeLists.txt +++ b/examples/network/torrent/.prev_CMakeLists.txt @@ -1,42 +1,41 @@ # Generated from torrent.pro. -##################################################################### -## torrent Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(torrent LANGUAGES CXX) -add_qt_executable(torrent - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" - SOURCES - addtorrentdialog.cpp addtorrentdialog.h - bencodeparser.cpp bencodeparser.h - connectionmanager.cpp connectionmanager.h - filemanager.cpp filemanager.h - forms/addtorrentform.ui - main.cpp - mainwindow.cpp mainwindow.h - metainfo.cpp metainfo.h - peerwireclient.cpp peerwireclient.h - ratecontroller.cpp ratecontroller.h - torrentclient.cpp torrentclient.h - torrentserver.cpp torrentserver.h - trackerclient.cpp trackerclient.h - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(torrent WIN32 MACOSX_BUNDLE + addtorrentdialog.cpp addtorrentdialog.h + bencodeparser.cpp bencodeparser.h + connectionmanager.cpp connectionmanager.h + filemanager.cpp filemanager.h + forms/addtorrentform.ui + icons.qrc + main.cpp + mainwindow.cpp mainwindow.h + metainfo.cpp metainfo.h + peerwireclient.cpp peerwireclient.h + ratecontroller.cpp ratecontroller.h + torrentclient.cpp torrentclient.h + torrentserver.cpp torrentserver.h + trackerclient.cpp trackerclient.h +) +target_link_libraries(torrent PUBLIC + Qt::Network + Qt::Widgets ) -# Resources: -add_qt_resource(torrent "icons" PREFIX "/" FILES - icons/1downarrow.png - icons/1uparrow.png - icons/bottom.png - icons/exit.png - icons/peertopeer.png - icons/player_pause.png - icons/player_play.png - icons/player_stop.png) - +install(TARGETS torrent + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt index 448335e7aa2..2a49e3800bd 100644 --- a/examples/network/torrent/CMakeLists.txt +++ b/examples/network/torrent/CMakeLists.txt @@ -1,44 +1,42 @@ # Generated from torrent.pro. -##################################################################### -## torrent Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(torrent LANGUAGES CXX) -add_qt_executable(torrent - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/network/torrent" - SOURCES - addtorrentdialog.cpp addtorrentdialog.h - bencodeparser.cpp bencodeparser.h - connectionmanager.cpp connectionmanager.h - filemanager.cpp filemanager.h - forms/addtorrentform.ui - main.cpp - mainwindow.cpp mainwindow.h - metainfo.cpp metainfo.h - peerwireclient.cpp peerwireclient.h - ratecontroller.cpp ratecontroller.h - torrentclient.cpp torrentclient.h - torrentserver.cpp torrentserver.h - trackerclient.cpp trackerclient.h - INCLUDE_DIRECTORIES # special case - forms # special case - PUBLIC_LIBRARIES - Qt::Network - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(torrent WIN32 MACOSX_BUNDLE + addtorrentdialog.cpp addtorrentdialog.h + bencodeparser.cpp bencodeparser.h + connectionmanager.cpp connectionmanager.h + filemanager.cpp filemanager.h + forms/addtorrentform.ui + icons.qrc + main.cpp + mainwindow.cpp mainwindow.h + metainfo.cpp metainfo.h + peerwireclient.cpp peerwireclient.h + ratecontroller.cpp ratecontroller.h + torrentclient.cpp torrentclient.h + torrentserver.cpp torrentserver.h + trackerclient.cpp trackerclient.h +) +target_include_directories(torrent PUBLIC forms) # special case +target_link_libraries(torrent PUBLIC + Qt::Network + Qt::Widgets ) -# Resources: -add_qt_resource(torrent "icons" PREFIX "/" FILES - icons/1downarrow.png - icons/1uparrow.png - icons/bottom.png - icons/exit.png - icons/peertopeer.png - icons/player_pause.png - icons/player_play.png - icons/player_stop.png) - +install(TARGETS torrent + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qpa/qrasterwindow/CMakeLists.txt b/examples/qpa/qrasterwindow/CMakeLists.txt index 0eae5b28afa..c74ce2974b2 100644 --- a/examples/qpa/qrasterwindow/CMakeLists.txt +++ b/examples/qpa/qrasterwindow/CMakeLists.txt @@ -1,15 +1,24 @@ # Generated from qrasterwindow.pro. -##################################################################### -## qrasterwindow Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(qrasterwindow LANGUAGES CXX) -add_qt_executable(qrasterwindow - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/qrasterwindow" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/qrasterwindow" - SOURCES - main.cpp - LIBRARIES - Qt::Gui # special case +find_package(Qt5 COMPONENTS Gui) # special case + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(qrasterwindow WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(qrasterwindow PUBLIC Qt::Gui) # special case: add + +install(TARGETS qrasterwindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qpa/windows/CMakeLists.txt b/examples/qpa/windows/CMakeLists.txt index 55135e02ffe..2bd7b6fd850 100644 --- a/examples/qpa/windows/CMakeLists.txt +++ b/examples/qpa/windows/CMakeLists.txt @@ -1,19 +1,33 @@ # Generated from windows.pro. -##################################################################### -## windows Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(windows LANGUAGES CXX) -add_qt_executable(windows - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/windows" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qpa/windows" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::GuiPrivate - Qt::CorePrivate +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Gui) +find_package(Qt5 COMPONENTS Core) + +add_executable(windows + main.cpp + window.cpp window.h +) +target_link_libraries(windows PRIVATE + Qt::CorePrivate + Qt::GuiPrivate +) +target_link_libraries(windows PUBLIC + Qt::Core + Qt::Gui ) -#### Keys ignored in scope 1:.:windows.pro:: -# CONFIG = "console" +install(TARGETS windows + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qtconcurrent/imagescaling/CMakeLists.txt b/examples/qtconcurrent/imagescaling/CMakeLists.txt index 0de3f26c5e4..a288397de7d 100644 --- a/examples/qtconcurrent/imagescaling/CMakeLists.txt +++ b/examples/qtconcurrent/imagescaling/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from imagescaling.pro. -##################################################################### -## imagescaling Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(imagescaling LANGUAGES CXX) -add_qt_executable(imagescaling - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/imagescaling" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/imagescaling" - SOURCES - imagescaling.cpp imagescaling.h - main.cpp - LIBRARIES - Qt::Concurrent - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Concurrent) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(imagescaling WIN32 MACOSX_BUNDLE + imagescaling.cpp imagescaling.h + main.cpp +) +target_link_libraries(imagescaling PUBLIC + Qt::Concurrent + Qt::Widgets +) + +install(TARGETS imagescaling + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtconcurrent/map/.prev_CMakeLists.txt b/examples/qtconcurrent/map/.prev_CMakeLists.txt new file mode 100644 index 00000000000..48a18038adf --- /dev/null +++ b/examples/qtconcurrent/map/.prev_CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from map.pro. + +cmake_minimum_required(VERSION 3.14) +project(mapdemo LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Concurrent) + +add_executable(mapdemo + main.cpp +) +target_link_libraries(mapdemo PUBLIC + Qt::Concurrent +) + +install(TARGETS mapdemo + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qtconcurrent/map/CMakeLists.txt b/examples/qtconcurrent/map/CMakeLists.txt index 147b91236b3..a5bac9a9738 100644 --- a/examples/qtconcurrent/map/CMakeLists.txt +++ b/examples/qtconcurrent/map/CMakeLists.txt @@ -1,20 +1,27 @@ # Generated from map.pro. -##################################################################### -## mapdemo Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mapdemo LANGUAGES CXX) -add_qt_executable(mapdemo - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/map" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/map" - SOURCES - main.cpp - LIBRARIES - Qt::Concurrent - Qt::Gui # special case +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Concurrent) +find_package(Qt5 COMPONENTS Gui) # special case + +add_executable(mapdemo + main.cpp +) +target_link_libraries(mapdemo PUBLIC + Qt::Concurrent + Qt::Gui # special case +) +install(TARGETS mapdemo + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:map.pro:: -# CONFIG = "-app_bundle" -# TEMPLATE = "app" diff --git a/examples/qtconcurrent/progressdialog/CMakeLists.txt b/examples/qtconcurrent/progressdialog/CMakeLists.txt index 3aae4af0847..8a61fd0e0a9 100644 --- a/examples/qtconcurrent/progressdialog/CMakeLists.txt +++ b/examples/qtconcurrent/progressdialog/CMakeLists.txt @@ -1,18 +1,28 @@ # Generated from progressdialog.pro. -##################################################################### -## progressdialog Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(progressdialog LANGUAGES CXX) -add_qt_executable(progressdialog - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/progressdialog" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/progressdialog" - SOURCES - main.cpp - LIBRARIES - Qt::Concurrent - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Concurrent) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(progressdialog + main.cpp +) +target_link_libraries(progressdialog PUBLIC + Qt::Concurrent + Qt::Widgets ) -#### Keys ignored in scope 1:.:progressdialog.pro:: -# CONFIG = "console" +install(TARGETS progressdialog + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qtconcurrent/runfunction/CMakeLists.txt b/examples/qtconcurrent/runfunction/CMakeLists.txt index c400b44cf61..f71a7894234 100644 --- a/examples/qtconcurrent/runfunction/CMakeLists.txt +++ b/examples/qtconcurrent/runfunction/CMakeLists.txt @@ -1,19 +1,28 @@ # Generated from runfunction.pro. -##################################################################### -## runfunction Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(runfunction LANGUAGES CXX) -add_qt_executable(runfunction - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction" - SOURCES - main.cpp - LIBRARIES - Qt::Concurrent - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Concurrent) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(runfunction + main.cpp +) +target_link_libraries(runfunction PUBLIC + Qt::Concurrent + Qt::Widgets ) -#### Keys ignored in scope 1:.:runfunction.pro:: -# CONFIG = "-app_bundle" +install(TARGETS runfunction + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qtconcurrent/wordcount/CMakeLists.txt b/examples/qtconcurrent/wordcount/CMakeLists.txt index 9bb2ac58d71..4c6402102d2 100644 --- a/examples/qtconcurrent/wordcount/CMakeLists.txt +++ b/examples/qtconcurrent/wordcount/CMakeLists.txt @@ -1,19 +1,28 @@ # Generated from wordcount.pro. -##################################################################### -## wordcount Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(wordcount LANGUAGES CXX) -add_qt_executable(wordcount - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/wordcount" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtconcurrent/wordcount" - SOURCES - main.cpp - LIBRARIES - Qt::Concurrent - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Concurrent) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(wordcount + main.cpp +) +target_link_libraries(wordcount PUBLIC + Qt::Concurrent + Qt::Widgets ) -#### Keys ignored in scope 1:.:wordcount.pro:: -# CONFIG = "-app_bundle" +install(TARGETS wordcount + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qtestlib/tutorial1/CMakeLists.txt b/examples/qtestlib/tutorial1/CMakeLists.txt index 6e489e329fd..b30293a3e3f 100644 --- a/examples/qtestlib/tutorial1/CMakeLists.txt +++ b/examples/qtestlib/tutorial1/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from tutorial1.pro. -##################################################################### -## tutorial1 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tutorial1 LANGUAGES CXX) -add_qt_executable(tutorial1 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial1" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial1" - SOURCES - testqstring.cpp - LIBRARIES - Qt::Widgets - Qt::Test +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Test) + +add_executable(tutorial1 WIN32 MACOSX_BUNDLE + testqstring.cpp +) +target_link_libraries(tutorial1 PUBLIC + Qt::Test + Qt::Widgets +) +install(TARGETS tutorial1 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial2/CMakeLists.txt b/examples/qtestlib/tutorial2/CMakeLists.txt index 06288ce50b6..ed7cc3f2240 100644 --- a/examples/qtestlib/tutorial2/CMakeLists.txt +++ b/examples/qtestlib/tutorial2/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from tutorial2.pro. -##################################################################### -## tutorial2 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tutorial2 LANGUAGES CXX) -add_qt_executable(tutorial2 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial2" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial2" - SOURCES - testqstring.cpp - LIBRARIES - Qt::Widgets - Qt::Test +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Test) + +add_executable(tutorial2 WIN32 MACOSX_BUNDLE + testqstring.cpp +) +target_link_libraries(tutorial2 PUBLIC + Qt::Test + Qt::Widgets +) +install(TARGETS tutorial2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial3/CMakeLists.txt b/examples/qtestlib/tutorial3/CMakeLists.txt index 79683e0cfcb..975ac4dfd66 100644 --- a/examples/qtestlib/tutorial3/CMakeLists.txt +++ b/examples/qtestlib/tutorial3/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from tutorial3.pro. -##################################################################### -## tutorial3 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tutorial3 LANGUAGES CXX) -add_qt_executable(tutorial3 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial3" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial3" - SOURCES - testgui.cpp - LIBRARIES - Qt::Widgets - Qt::Test +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Test) + +add_executable(tutorial3 WIN32 MACOSX_BUNDLE + testgui.cpp +) +target_link_libraries(tutorial3 PUBLIC + Qt::Test + Qt::Widgets +) +install(TARGETS tutorial3 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial4/CMakeLists.txt b/examples/qtestlib/tutorial4/CMakeLists.txt index 2f3d2bb88ac..069afd031e7 100644 --- a/examples/qtestlib/tutorial4/CMakeLists.txt +++ b/examples/qtestlib/tutorial4/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from tutorial4.pro. -##################################################################### -## tutorial4 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tutorial4 LANGUAGES CXX) -add_qt_executable(tutorial4 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial4" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial4" - SOURCES - testgui.cpp - LIBRARIES - Qt::Widgets - Qt::Test +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Test) + +add_executable(tutorial4 WIN32 MACOSX_BUNDLE + testgui.cpp +) +target_link_libraries(tutorial4 PUBLIC + Qt::Test + Qt::Widgets +) +install(TARGETS tutorial4 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial5/CMakeLists.txt b/examples/qtestlib/tutorial5/CMakeLists.txt index e4af9b354c5..65dba6dcb53 100644 --- a/examples/qtestlib/tutorial5/CMakeLists.txt +++ b/examples/qtestlib/tutorial5/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from tutorial5.pro. -##################################################################### -## tutorial5 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tutorial5 LANGUAGES CXX) -add_qt_executable(tutorial5 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial5" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qtestlib/tutorial5" - SOURCES - benchmarking.cpp - LIBRARIES - Qt::Widgets - Qt::Test +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Test) + +add_executable(tutorial5 WIN32 MACOSX_BUNDLE + benchmarking.cpp +) +target_link_libraries(tutorial5 PUBLIC + Qt::Test + Qt::Widgets +) +install(TARGETS tutorial5 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt index 7a25b95cde5..294a764a9be 100644 --- a/examples/sql/books/CMakeLists.txt +++ b/examples/sql/books/CMakeLists.txt @@ -1,31 +1,35 @@ # Generated from books.pro. -##################################################################### -## books Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(books LANGUAGES CXX) -add_qt_executable(books - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/books" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/books" - SOURCES - bookdelegate.cpp bookdelegate.h - bookwindow.cpp bookwindow.h bookwindow.ui - initdb.h - main.cpp - INCLUDE_DIRECTORIES - . - PUBLIC_LIBRARIES - Qt::Sql - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(books WIN32 MACOSX_BUNDLE + bookdelegate.cpp bookdelegate.h + books.qrc + bookwindow.cpp bookwindow.h bookwindow.ui + initdb.h + main.cpp +) +target_include_directories(books PUBLIC + . +) +target_link_libraries(books PUBLIC + Qt::Sql + Qt::Widgets ) -# Resources: -add_qt_resource(books "books" PREFIX "/" FILES - images/star.png) - - -#### Keys ignored in scope 1:.:.:books.pro:: -# TEMPLATE = "app" +install(TARGETS books + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt index 8e87a322111..3ccea061ff7 100644 --- a/examples/sql/cachedtable/CMakeLists.txt +++ b/examples/sql/cachedtable/CMakeLists.txt @@ -1,18 +1,30 @@ # Generated from cachedtable.pro. -##################################################################### -## cachedtable Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(cachedtable LANGUAGES CXX) -add_qt_executable(cachedtable - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/cachedtable" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/cachedtable" - SOURCES - ../connection.h - main.cpp - tableeditor.cpp tableeditor.h - LIBRARIES - Qt::Sql - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(cachedtable WIN32 MACOSX_BUNDLE + ../connection.h + main.cpp + tableeditor.cpp tableeditor.h +) +target_link_libraries(cachedtable PUBLIC + Qt::Sql + Qt::Widgets +) + +install(TARGETS cachedtable + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt index a4301d3474e..b8fab77b0c4 100644 --- a/examples/sql/drilldown/CMakeLists.txt +++ b/examples/sql/drilldown/CMakeLists.txt @@ -1,28 +1,33 @@ # Generated from drilldown.pro. -##################################################################### -## drilldown Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(drilldown LANGUAGES CXX) -add_qt_executable(drilldown - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/drilldown" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/drilldown" - SOURCES - ../connection.h - imageitem.cpp imageitem.h - informationwindow.cpp informationwindow.h - main.cpp - view.cpp view.h - LIBRARIES - Qt::Sql - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(drilldown WIN32 MACOSX_BUNDLE + ../connection.h + drilldown.qrc + imageitem.cpp imageitem.h + informationwindow.cpp informationwindow.h + main.cpp + view.cpp view.h +) +target_link_libraries(drilldown PUBLIC + Qt::Sql + Qt::Widgets ) -# Resources: -add_qt_resource(drilldown "drilldown" PREFIX "/" FILES - images/qt-creator.png - images/qt-logo.png - images/qt-project.png - images/qt-quick.png) - +install(TARGETS drilldown + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt index 8c73675e555..d1f4883da1d 100644 --- a/examples/sql/masterdetail/CMakeLists.txt +++ b/examples/sql/masterdetail/CMakeLists.txt @@ -1,30 +1,34 @@ # Generated from masterdetail.pro. -##################################################################### -## masterdetail Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(masterdetail LANGUAGES CXX) -add_qt_executable(masterdetail - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/masterdetail" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/masterdetail" - SOURCES - database.h - dialog.cpp dialog.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Sql - Qt::Widgets - Qt::Xml - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS Xml) + +add_executable(masterdetail WIN32 MACOSX_BUNDLE + database.h + dialog.cpp dialog.h + main.cpp + mainwindow.cpp mainwindow.h + masterdetail.qrc +) +target_link_libraries(masterdetail PUBLIC + Qt::Sql + Qt::Widgets + Qt::Xml ) -# Resources: -add_qt_resource(masterdetail "masterdetail" FILES - images/icon.png - images/image.png) - - -#### Keys ignored in scope 1:.:masterdetail.pro:: -# EXAMPLE_FILES = "albumdetails.xml" +install(TARGETS masterdetail + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt index 5c9d48c7f13..7f617c7c33b 100644 --- a/examples/sql/querymodel/CMakeLists.txt +++ b/examples/sql/querymodel/CMakeLists.txt @@ -1,19 +1,31 @@ # Generated from querymodel.pro. -##################################################################### -## querymodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(querymodel LANGUAGES CXX) -add_qt_executable(querymodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/querymodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/querymodel" - SOURCES - ../connection.h - customsqlmodel.cpp customsqlmodel.h - editablesqlmodel.cpp editablesqlmodel.h - main.cpp - LIBRARIES - Qt::Sql - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(querymodel WIN32 MACOSX_BUNDLE + ../connection.h + customsqlmodel.cpp customsqlmodel.h + editablesqlmodel.cpp editablesqlmodel.h + main.cpp +) +target_link_libraries(querymodel PUBLIC + Qt::Sql + Qt::Widgets +) + +install(TARGETS querymodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt index d31042cc735..de4dba49ccf 100644 --- a/examples/sql/relationaltablemodel/CMakeLists.txt +++ b/examples/sql/relationaltablemodel/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from relationaltablemodel.pro. -##################################################################### -## relationaltablemodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(relationaltablemodel LANGUAGES CXX) -add_qt_executable(relationaltablemodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/relationaltablemodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/relationaltablemodel" - SOURCES - ../connection.h - relationaltablemodel.cpp - LIBRARIES - Qt::Sql - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(relationaltablemodel WIN32 MACOSX_BUNDLE + ../connection.h + relationaltablemodel.cpp +) +target_link_libraries(relationaltablemodel PUBLIC + Qt::Sql + Qt::Widgets +) + +install(TARGETS relationaltablemodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt index a2e0ed951d9..dee4d4a58e8 100644 --- a/examples/sql/sqlbrowser/CMakeLists.txt +++ b/examples/sql/sqlbrowser/CMakeLists.txt @@ -1,31 +1,32 @@ # Generated from sqlbrowser.pro. -##################################################################### -## sqlbrowser Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(sqlbrowser LANGUAGES CXX) -add_qt_executable(sqlbrowser - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlbrowser" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlbrowser" - SOURCES - browser.cpp browser.h - browserwidget.ui - connectionwidget.cpp connectionwidget.h - main.cpp - qsqlconnectiondialog.cpp qsqlconnectiondialog.h qsqlconnectiondialog.ui - PUBLIC_LIBRARIES - Qt::Sql - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(sqlbrowser WIN32 MACOSX_BUNDLE + browser.cpp browser.h + browserwidget.ui + connectionwidget.cpp connectionwidget.h + main.cpp + qsqlconnectiondialog.cpp qsqlconnectiondialog.h qsqlconnectiondialog.ui +) +target_link_libraries(sqlbrowser PUBLIC + Qt::Sql + Qt::Widgets ) -#### Keys ignored in scope 1:.:.:sqlbrowser.pro:: -# TEMPLATE = "app" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:.:sqlbrowser.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS sqlbrowser + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt index 41d95da21e4..586592fb181 100644 --- a/examples/sql/sqlwidgetmapper/CMakeLists.txt +++ b/examples/sql/sqlwidgetmapper/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from sqlwidgetmapper.pro. -##################################################################### -## sqlwidgetmapper Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(sqlwidgetmapper LANGUAGES CXX) -add_qt_executable(sqlwidgetmapper - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlwidgetmapper" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/sqlwidgetmapper" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Sql - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(sqlwidgetmapper PUBLIC + Qt::Sql + Qt::Widgets +) + +install(TARGETS sqlwidgetmapper + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt index 68644a4b3da..99729271662 100644 --- a/examples/sql/tablemodel/CMakeLists.txt +++ b/examples/sql/tablemodel/CMakeLists.txt @@ -1,17 +1,29 @@ # Generated from tablemodel.pro. -##################################################################### -## tablemodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tablemodel LANGUAGES CXX) -add_qt_executable(tablemodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/tablemodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/sql/tablemodel" - SOURCES - ../connection.h - tablemodel.cpp - LIBRARIES - Qt::Sql - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Sql) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(tablemodel WIN32 MACOSX_BUNDLE + ../connection.h + tablemodel.cpp +) +target_link_libraries(tablemodel PUBLIC + Qt::Sql + Qt::Widgets +) + +install(TARGETS tablemodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/animatedtiles/CMakeLists.txt b/examples/widgets/animation/animatedtiles/CMakeLists.txt index 0af95adcf8a..dacde5535cc 100644 --- a/examples/widgets/animation/animatedtiles/CMakeLists.txt +++ b/examples/widgets/animation/animatedtiles/CMakeLists.txt @@ -1,26 +1,27 @@ # Generated from animatedtiles.pro. -##################################################################### -## animatedtiles Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(animatedtiles LANGUAGES CXX) -add_qt_executable(animatedtiles - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/animatedtiles" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/animatedtiles" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(animatedtiles WIN32 MACOSX_BUNDLE + animatedtiles.qrc + main.cpp +) +target_link_libraries(animatedtiles PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(animatedtiles "animatedtiles" FILES - images/Time-For-Lunch-2.jpg - images/centered.png - images/ellipse.png - images/figure8.png - images/kinetic.png - images/random.png - images/tile.png) - +install(TARGETS animatedtiles + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt index b7444412a68..1500b11f3bf 100644 --- a/examples/widgets/animation/easing/CMakeLists.txt +++ b/examples/widgets/animation/easing/CMakeLists.txt @@ -1,25 +1,30 @@ # Generated from easing.pro. -##################################################################### -## easing Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(easing LANGUAGES CXX) -add_qt_executable(easing - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/easing" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/easing" - SOURCES - animation.h - form.ui - main.cpp - window.cpp window.h - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(easing WIN32 MACOSX_BUNDLE + animation.h + easing.qrc + form.ui + main.cpp + window.cpp window.h +) +target_link_libraries(easing PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(easing "easing" FILES - images/qt-logo.png) - +install(TARGETS easing + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/animation/moveblocks/CMakeLists.txt b/examples/widgets/animation/moveblocks/CMakeLists.txt index 5cbb8f49368..cc2b70af44b 100644 --- a/examples/widgets/animation/moveblocks/CMakeLists.txt +++ b/examples/widgets/animation/moveblocks/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from moveblocks.pro. -##################################################################### -## moveblocks Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(moveblocks LANGUAGES CXX) -add_qt_executable(moveblocks - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/moveblocks" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/moveblocks" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(moveblocks WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(moveblocks PUBLIC + Qt::Widgets +) + +install(TARGETS moveblocks + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/states/CMakeLists.txt b/examples/widgets/animation/states/CMakeLists.txt index 52a93577896..a28995db997 100644 --- a/examples/widgets/animation/states/CMakeLists.txt +++ b/examples/widgets/animation/states/CMakeLists.txt @@ -1,25 +1,27 @@ # Generated from states.pro. -##################################################################### -## states Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(states LANGUAGES CXX) -add_qt_executable(states - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/states" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/states" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(states WIN32 MACOSX_BUNDLE + main.cpp + states.qrc +) +target_link_libraries(states PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(states "states" FILES - accessories-dictionary.png - akregator.png - digikam.png - help-browser.png - k3b.png - kchart.png) - +install(TARGETS states + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/animation/stickman/CMakeLists.txt b/examples/widgets/animation/stickman/CMakeLists.txt index f6045982328..5cb2e86c487 100644 --- a/examples/widgets/animation/stickman/CMakeLists.txt +++ b/examples/widgets/animation/stickman/CMakeLists.txt @@ -1,29 +1,32 @@ # Generated from stickman.pro. -##################################################################### -## stickman Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(stickman LANGUAGES CXX) -add_qt_executable(stickman - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/stickman" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/stickman" - SOURCES - animation.cpp animation.h - graphicsview.cpp graphicsview.h - lifecycle.cpp lifecycle.h - main.cpp - node.cpp node.h - rectbutton.cpp rectbutton.h - stickman.cpp stickman.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(stickman WIN32 MACOSX_BUNDLE + animation.cpp animation.h + graphicsview.cpp graphicsview.h + lifecycle.cpp lifecycle.h + main.cpp + node.cpp node.h + rectbutton.cpp rectbutton.h + stickman.cpp stickman.h stickman.qrc +) +target_link_libraries(stickman PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(stickman "stickman" FILES - animations/chilling.bin - animations/dancing.bin - animations/dead.bin - animations/jumping.bin) - +install(TARGETS stickman + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/animation/sub-attaq/CMakeLists.txt b/examples/widgets/animation/sub-attaq/CMakeLists.txt index e7cb602e190..3260a5f75d1 100644 --- a/examples/widgets/animation/sub-attaq/CMakeLists.txt +++ b/examples/widgets/animation/sub-attaq/CMakeLists.txt @@ -1,142 +1,43 @@ # Generated from sub-attaq.pro. -##################################################################### -## sub-attaq Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(sub-attaq LANGUAGES CXX) -add_qt_executable(sub-attaq - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/sub-attaq" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/animation/sub-attaq" - SOURCES - animationmanager.cpp animationmanager.h - boat.cpp boat.h boat_p.h - bomb.cpp bomb.h - graphicsscene.cpp graphicsscene.h - main.cpp - mainwindow.cpp mainwindow.h - pixmapitem.cpp pixmapitem.h - progressitem.cpp progressitem.h - qanimationstate.cpp qanimationstate.h - states.cpp states.h - submarine.cpp submarine.h submarine_p.h - textinformationitem.cpp textinformationitem.h - torpedo.cpp torpedo.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS OpenGL) # special case + +add_executable(sub-attaq WIN32 MACOSX_BUNDLE + animationmanager.cpp animationmanager.h + boat.cpp boat.h boat_p.h + bomb.cpp bomb.h + graphicsscene.cpp graphicsscene.h + main.cpp + mainwindow.cpp mainwindow.h + pixmapitem.cpp pixmapitem.h + progressitem.cpp progressitem.h + qanimationstate.cpp qanimationstate.h + states.cpp states.h + subattaq.qrc + submarine.cpp submarine.h submarine_p.h + textinformationitem.cpp textinformationitem.h + torpedo.cpp torpedo.h ) - -# Resources: -set_source_files_properties("pics/big/background.png" - PROPERTIES alias "big/background") -set_source_files_properties("pics/big/boat.png" - PROPERTIES alias "big/boat") -set_source_files_properties("pics/big/bomb.png" - PROPERTIES alias "big/bomb") -set_source_files_properties("pics/big/explosion/boat/step1.png" - PROPERTIES alias "big/explosion/boat/step1") -set_source_files_properties("pics/big/explosion/boat/step2.png" - PROPERTIES alias "big/explosion/boat/step2") -set_source_files_properties("pics/big/explosion/boat/step3.png" - PROPERTIES alias "big/explosion/boat/step3") -set_source_files_properties("pics/big/explosion/boat/step4.png" - PROPERTIES alias "big/explosion/boat/step4") -set_source_files_properties("pics/big/explosion/submarine/step1.png" - PROPERTIES alias "big/explosion/submarine/step1") -set_source_files_properties("pics/big/explosion/submarine/step2.png" - PROPERTIES alias "big/explosion/submarine/step2") -set_source_files_properties("pics/big/explosion/submarine/step3.png" - PROPERTIES alias "big/explosion/submarine/step3") -set_source_files_properties("pics/big/explosion/submarine/step4.png" - PROPERTIES alias "big/explosion/submarine/step4") -set_source_files_properties("pics/big/submarine.png" - PROPERTIES alias "big/submarine") -set_source_files_properties("pics/big/surface.png" - PROPERTIES alias "big/surface") -set_source_files_properties("pics/big/torpedo.png" - PROPERTIES alias "big/torpedo") -set_source_files_properties("pics/scalable/boat.svg" - PROPERTIES alias "boat") -set_source_files_properties("pics/scalable/sub-attaq.svg" - PROPERTIES alias "all") -set_source_files_properties("pics/scalable/submarine.svg" - PROPERTIES alias "submarine") -set_source_files_properties("pics/scalable/torpedo.svg" - PROPERTIES alias "torpedo") -set_source_files_properties("pics/small/background.png" - PROPERTIES alias "small/background") -set_source_files_properties("pics/small/boat.png" - PROPERTIES alias "small/boat") -set_source_files_properties("pics/small/bomb.png" - PROPERTIES alias "small/bomb") -set_source_files_properties("pics/small/submarine.png" - PROPERTIES alias "small/submarine") -set_source_files_properties("pics/small/surface.png" - PROPERTIES alias "small/surface") -set_source_files_properties("pics/small/torpedo.png" - PROPERTIES alias "small/torpedo") -set_source_files_properties("pics/welcome/logo-a.png" - PROPERTIES alias "logo-a") -set_source_files_properties("pics/welcome/logo-a2.png" - PROPERTIES alias "logo-a2") -set_source_files_properties("pics/welcome/logo-b.png" - PROPERTIES alias "logo-b") -set_source_files_properties("pics/welcome/logo-dash.png" - PROPERTIES alias "logo-dash") -set_source_files_properties("pics/welcome/logo-excl.png" - PROPERTIES alias "logo-excl") -set_source_files_properties("pics/welcome/logo-q.png" - PROPERTIES alias "logo-q") -set_source_files_properties("pics/welcome/logo-s.png" - PROPERTIES alias "logo-s") -set_source_files_properties("pics/welcome/logo-t.png" - PROPERTIES alias "logo-t") -set_source_files_properties("pics/welcome/logo-t2.png" - PROPERTIES alias "logo-t2") -set_source_files_properties("pics/welcome/logo-u.png" - PROPERTIES alias "logo-u") -add_qt_resource(sub-attaq "subattaq" PREFIX "/" FILES - data.xml - pics/big/background.png - pics/big/boat.png - pics/big/bomb.png - pics/big/explosion/boat/step1.png - pics/big/explosion/boat/step2.png - pics/big/explosion/boat/step3.png - pics/big/explosion/boat/step4.png - pics/big/explosion/submarine/step1.png - pics/big/explosion/submarine/step2.png - pics/big/explosion/submarine/step3.png - pics/big/explosion/submarine/step4.png - pics/big/submarine.png - pics/big/surface.png - pics/big/torpedo.png - pics/scalable/boat.svg - pics/scalable/sub-attaq.svg - pics/scalable/submarine.svg - pics/scalable/torpedo.svg - pics/small/background.png - pics/small/boat.png - pics/small/bomb.png - pics/small/submarine.png - pics/small/surface.png - pics/small/torpedo.png - pics/welcome/logo-a.png - pics/welcome/logo-a2.png - pics/welcome/logo-b.png - pics/welcome/logo-dash.png - pics/welcome/logo-excl.png - pics/welcome/logo-q.png - pics/welcome/logo-s.png - pics/welcome/logo-t.png - pics/welcome/logo-t2.png - pics/welcome/logo-u.png) - - -## Scopes: -##################################################################### - -extend_target(sub-attaq CONDITION TARGET Qt::OpenGL - LIBRARIES - Qt::OpenGL +target_link_libraries(sub-attaq PUBLIC + Qt::Widgets +) +if (TARGET Qt::OpenGL) + target_link_libraries(sub-attaq PUBLIC Qt::OpenGL) +endif() + +install(TARGETS sub-attaq + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt index 1956e3800e0..e4533298d07 100644 --- a/examples/widgets/desktop/screenshot/CMakeLists.txt +++ b/examples/widgets/desktop/screenshot/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from screenshot.pro. -##################################################################### -## screenshot Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(screenshot LANGUAGES CXX) -add_qt_executable(screenshot - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/screenshot" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/screenshot" - SOURCES - main.cpp - screenshot.cpp screenshot.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(screenshot WIN32 MACOSX_BUNDLE + main.cpp + screenshot.cpp screenshot.h +) +target_link_libraries(screenshot PUBLIC + Qt::Widgets +) + +install(TARGETS screenshot + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt index 9f5d05e7516..2e89c2a8f9d 100644 --- a/examples/widgets/desktop/systray/CMakeLists.txt +++ b/examples/widgets/desktop/systray/CMakeLists.txt @@ -1,23 +1,28 @@ # Generated from systray.pro. -##################################################################### -## systray Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(systray LANGUAGES CXX) -add_qt_executable(systray - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/systray" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/desktop/systray" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(systray WIN32 MACOSX_BUNDLE + main.cpp + systray.qrc + window.cpp window.h +) +target_link_libraries(systray PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(systray "systray" PREFIX "/" FILES - images/bad.png - images/heart.png - images/trash.png) - +install(TARGETS systray + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/dialogs/classwizard/CMakeLists.txt b/examples/widgets/dialogs/classwizard/CMakeLists.txt index 6d1cf9bab8c..1c9ecebcee8 100644 --- a/examples/widgets/dialogs/classwizard/CMakeLists.txt +++ b/examples/widgets/dialogs/classwizard/CMakeLists.txt @@ -1,27 +1,27 @@ # Generated from classwizard.pro. -##################################################################### -## classwizard Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(classwizard LANGUAGES CXX) -add_qt_executable(classwizard - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/classwizard" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/classwizard" - SOURCES - classwizard.cpp classwizard.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(classwizard WIN32 MACOSX_BUNDLE + classwizard.cpp classwizard.h classwizard.qrc + main.cpp +) +target_link_libraries(classwizard PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(classwizard "classwizard" FILES - images/background.png - images/banner.png - images/logo1.png - images/logo2.png - images/logo3.png - images/watermark1.png - images/watermark2.png) - +install(TARGETS classwizard + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/dialogs/extension/CMakeLists.txt b/examples/widgets/dialogs/extension/CMakeLists.txt index 400cf239894..8037d670d93 100644 --- a/examples/widgets/dialogs/extension/CMakeLists.txt +++ b/examples/widgets/dialogs/extension/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from extension.pro. -##################################################################### -## extension Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(extension LANGUAGES CXX) -add_qt_executable(extension - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/extension" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/extension" - SOURCES - finddialog.cpp finddialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(extension WIN32 MACOSX_BUNDLE + finddialog.cpp finddialog.h + main.cpp +) +target_link_libraries(extension PUBLIC + Qt::Widgets +) + +install(TARGETS extension + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/findfiles/CMakeLists.txt b/examples/widgets/dialogs/findfiles/CMakeLists.txt index 26442a71b1f..11e971b7f21 100644 --- a/examples/widgets/dialogs/findfiles/CMakeLists.txt +++ b/examples/widgets/dialogs/findfiles/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from findfiles.pro. -##################################################################### -## findfiles Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(findfiles LANGUAGES CXX) -add_qt_executable(findfiles - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/findfiles" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/findfiles" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(findfiles WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(findfiles PUBLIC + Qt::Widgets +) + +install(TARGETS findfiles + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt index 78b8cb7f51d..eef8e33ca15 100644 --- a/examples/widgets/dialogs/licensewizard/CMakeLists.txt +++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt @@ -1,23 +1,29 @@ # Generated from licensewizard.pro. -##################################################################### -## licensewizard Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(licensewizard LANGUAGES CXX) -add_qt_executable(licensewizard - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/licensewizard" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/licensewizard" - SOURCES - licensewizard.cpp licensewizard.h - main.cpp - LIBRARIES - Qt::Widgets - Qt::PrintSupport +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) + +add_executable(licensewizard WIN32 MACOSX_BUNDLE + licensewizard.cpp licensewizard.h licensewizard.qrc + main.cpp +) +target_link_libraries(licensewizard PUBLIC + Qt::PrintSupport + Qt::Widgets ) -# Resources: -add_qt_resource(licensewizard "licensewizard" FILES - images/logo.png - images/watermark.png) - +install(TARGETS licensewizard + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt index 3c0ddc0199b..2aa96fba067 100644 --- a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt +++ b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from standarddialogs.pro. -##################################################################### -## standarddialogs Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(standarddialogs LANGUAGES CXX) -add_qt_executable(standarddialogs - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/standarddialogs" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/standarddialogs" - SOURCES - dialog.cpp dialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(standarddialogs WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h + main.cpp +) +target_link_libraries(standarddialogs PUBLIC + Qt::Widgets +) + +install(TARGETS standarddialogs + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/tabdialog/CMakeLists.txt b/examples/widgets/dialogs/tabdialog/CMakeLists.txt index a8cbbb4b4e7..da05a322f31 100644 --- a/examples/widgets/dialogs/tabdialog/CMakeLists.txt +++ b/examples/widgets/dialogs/tabdialog/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from tabdialog.pro. -##################################################################### -## tabdialog Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tabdialog LANGUAGES CXX) -add_qt_executable(tabdialog - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/tabdialog" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/tabdialog" - SOURCES - main.cpp - tabdialog.cpp tabdialog.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(tabdialog WIN32 MACOSX_BUNDLE + main.cpp + tabdialog.cpp tabdialog.h +) +target_link_libraries(tabdialog PUBLIC + Qt::Widgets +) + +install(TARGETS tabdialog + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt index 2deae77c0d7..307945b2c2c 100644 --- a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt +++ b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from trivialwizard.pro. -##################################################################### -## trivialwizard Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(trivialwizard LANGUAGES CXX) -add_qt_executable(trivialwizard - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/trivialwizard" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/dialogs/trivialwizard" - SOURCES - trivialwizard.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(trivialwizard WIN32 MACOSX_BUNDLE + trivialwizard.cpp +) +target_link_libraries(trivialwizard PUBLIC + Qt::Widgets +) + +install(TARGETS trivialwizard + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt index 62a7be0cef8..ced583e1dbb 100644 --- a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt +++ b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt @@ -1,23 +1,28 @@ # Generated from draggableicons.pro. -##################################################################### -## draggableicons Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(draggableicons LANGUAGES CXX) -add_qt_executable(draggableicons - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggableicons" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggableicons" - SOURCES - dragwidget.cpp dragwidget.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(draggableicons WIN32 MACOSX_BUNDLE + draggableicons.qrc + dragwidget.cpp dragwidget.h + main.cpp +) +target_link_libraries(draggableicons PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(draggableicons "draggableicons" FILES - images/boat.png - images/car.png - images/house.png) - +install(TARGETS draggableicons + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt index 96ec5feff6a..aa6656ed0bc 100644 --- a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt +++ b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt @@ -1,21 +1,28 @@ # Generated from draggabletext.pro. -##################################################################### -## draggabletext Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(draggabletext LANGUAGES CXX) -add_qt_executable(draggabletext - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggabletext" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/draggabletext" - SOURCES - dragwidget.cpp dragwidget.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(draggabletext WIN32 MACOSX_BUNDLE + draggabletext.qrc + dragwidget.cpp dragwidget.h + main.cpp +) +target_link_libraries(draggabletext PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(draggabletext "draggabletext" PREFIX "/dictionary" FILES - words.txt) - +install(TARGETS draggabletext + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/draganddrop/dropsite/CMakeLists.txt b/examples/widgets/draganddrop/dropsite/CMakeLists.txt index 0d541337509..abb850c0b63 100644 --- a/examples/widgets/draganddrop/dropsite/CMakeLists.txt +++ b/examples/widgets/draganddrop/dropsite/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from dropsite.pro. -##################################################################### -## dropsite Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dropsite LANGUAGES CXX) -add_qt_executable(dropsite - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/dropsite" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/dropsite" - SOURCES - droparea.cpp droparea.h - dropsitewindow.cpp dropsitewindow.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(dropsite WIN32 MACOSX_BUNDLE + droparea.cpp droparea.h + dropsitewindow.cpp dropsitewindow.h + main.cpp +) +target_link_libraries(dropsite PUBLIC + Qt::Widgets +) + +install(TARGETS dropsite + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt index fcd7f3da15b..e0ab3d36c51 100644 --- a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt +++ b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt @@ -1,22 +1,29 @@ # Generated from fridgemagnets.pro. -##################################################################### -## fridgemagnets Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fridgemagnets LANGUAGES CXX) -add_qt_executable(fridgemagnets - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/fridgemagnets" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/fridgemagnets" - SOURCES - draglabel.cpp draglabel.h - dragwidget.cpp dragwidget.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(fridgemagnets WIN32 MACOSX_BUNDLE + draglabel.cpp draglabel.h + dragwidget.cpp dragwidget.h + fridgemagnets.qrc + main.cpp +) +target_link_libraries(fridgemagnets PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(fridgemagnets "fridgemagnets" PREFIX "/dictionary" FILES - words.txt) - +install(TARGETS fridgemagnets + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/draganddrop/puzzle/CMakeLists.txt b/examples/widgets/draganddrop/puzzle/CMakeLists.txt index 2622dd068e3..b95d7b2cf44 100644 --- a/examples/widgets/draganddrop/puzzle/CMakeLists.txt +++ b/examples/widgets/draganddrop/puzzle/CMakeLists.txt @@ -1,26 +1,30 @@ # Generated from puzzle.pro. -##################################################################### -## puzzle Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(puzzle LANGUAGES CXX) -add_qt_executable(puzzle - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/puzzle" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/draganddrop/puzzle" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - pieceslist.cpp pieceslist.h - puzzlewidget.cpp puzzlewidget.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(draganddrop_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle + main.cpp + mainwindow.cpp mainwindow.h + pieceslist.cpp pieceslist.h + puzzle.qrc + puzzlewidget.cpp puzzlewidget.h +) +target_link_libraries(draganddrop_puzzle PUBLIC # special case: renamed puzzle + Qt::Widgets ) -# Resources: -add_qt_resource(puzzle "puzzle" PREFIX "/images" FILES - example.jpg) - - -#### Keys ignored in scope 1:.:puzzle.pro:: -# QMAKE_PROJECT_NAME = "dndpuzzle" +install(TARGETS draganddrop_puzzle # special case: renamed puzzle + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/effects/blurpicker/CMakeLists.txt b/examples/widgets/effects/blurpicker/CMakeLists.txt index f534c47102f..c99beb310f0 100644 --- a/examples/widgets/effects/blurpicker/CMakeLists.txt +++ b/examples/widgets/effects/blurpicker/CMakeLists.txt @@ -1,30 +1,28 @@ # Generated from blurpicker.pro. -##################################################################### -## blurpicker Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(blurpicker LANGUAGES CXX) -add_qt_executable(blurpicker - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/blurpicker" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/blurpicker" - SOURCES - blureffect.cpp blureffect.h - blurpicker.cpp blurpicker.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(blurpicker WIN32 MACOSX_BUNDLE + blureffect.cpp blureffect.h + blurpicker.cpp blurpicker.h blurpicker.qrc + main.cpp +) +target_link_libraries(blurpicker PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(blurpicker "blurpicker" PREFIX "/" FILES - images/accessories-calculator.png - images/accessories-text-editor.png - images/background.jpg - images/help-browser.png - images/internet-group-chat.png - images/internet-mail.png - images/internet-web-browser.png - images/office-calendar.png - images/system-users.png) - +install(TARGETS blurpicker + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/effects/fademessage/CMakeLists.txt b/examples/widgets/effects/fademessage/CMakeLists.txt index 838a10022ed..689b0593eaf 100644 --- a/examples/widgets/effects/fademessage/CMakeLists.txt +++ b/examples/widgets/effects/fademessage/CMakeLists.txt @@ -1,21 +1,27 @@ # Generated from fademessage.pro. -##################################################################### -## fademessage Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fademessage LANGUAGES CXX) -add_qt_executable(fademessage - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/fademessage" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/effects/fademessage" - SOURCES - fademessage.cpp fademessage.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(fademessage WIN32 MACOSX_BUNDLE + fademessage.cpp fademessage.h fademessage.qrc + main.cpp +) +target_link_libraries(fademessage PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(fademessage "fademessage" PREFIX "/" FILES - background.jpg) - +install(TARGETS fademessage + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/gestures/imagegestures/CMakeLists.txt b/examples/widgets/gestures/imagegestures/CMakeLists.txt index 4862654314a..1efaa427742 100644 --- a/examples/widgets/gestures/imagegestures/CMakeLists.txt +++ b/examples/widgets/gestures/imagegestures/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from imagegestures.pro. -##################################################################### -## imagegestures Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(imagegestures LANGUAGES CXX) -add_qt_executable(imagegestures - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/gestures/imagegestures" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/gestures/imagegestures" - SOURCES - imagewidget.cpp imagewidget.h - main.cpp - mainwidget.cpp mainwidget.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(imagegestures WIN32 MACOSX_BUNDLE + imagewidget.cpp imagewidget.h + main.cpp + mainwidget.cpp mainwidget.h +) +target_link_libraries(imagegestures PUBLIC + Qt::Widgets +) + +install(TARGETS imagegestures + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt index 8149f967840..1488f394c6a 100644 --- a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from anchorlayout.pro. -##################################################################### -## anchorlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(anchorlayout LANGUAGES CXX) -add_qt_executable(anchorlayout - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/anchorlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/anchorlayout" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(anchorlayout WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(anchorlayout PUBLIC + Qt::Widgets +) + +install(TARGETS anchorlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt index d285a35ecc8..0ce632e6b6a 100644 --- a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt +++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt @@ -1,22 +1,29 @@ # Generated from basicgraphicslayouts.pro. -##################################################################### -## basicgraphicslayouts Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(basicgraphicslayouts LANGUAGES CXX) -add_qt_executable(basicgraphicslayouts - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/basicgraphicslayouts" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/basicgraphicslayouts" - SOURCES - layoutitem.cpp layoutitem.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(basicgraphicslayouts WIN32 MACOSX_BUNDLE + basicgraphicslayouts.qrc + layoutitem.cpp layoutitem.h + main.cpp + window.cpp window.h +) +target_link_libraries(basicgraphicslayouts PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(basicgraphicslayouts "basicgraphicslayouts" FILES - images/block.png) - +install(TARGETS basicgraphicslayouts + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt index 11331b19067..4e1d105a3af 100644 --- a/examples/widgets/graphicsview/boxes/CMakeLists.txt +++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt @@ -1,52 +1,38 @@ # Generated from boxes.pro. -##################################################################### -## boxes Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(boxes LANGUAGES CXX) -add_qt_executable(boxes - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/boxes" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/boxes" - SOURCES - 3rdparty/fbm.c 3rdparty/fbm.h - glbuffers.cpp glbuffers.h - glextensions.cpp glextensions.h - gltrianglemesh.h - main.cpp - qtbox.cpp qtbox.h - roundedbox.cpp roundedbox.h - scene.cpp scene.h - trackball.cpp trackball.h - LIBRARIES - Qt::OpenGL - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS OpenGL) +find_package(Qt5 COMPONENTS Widgets) + + +add_executable(boxes WIN32 MACOSX_BUNDLE + 3rdparty/fbm.c 3rdparty/fbm.h + boxes.qrc + glbuffers.cpp glbuffers.h + glextensions.cpp glextensions.h + gltrianglemesh.h + main.cpp + qtbox.cpp qtbox.h + roundedbox.cpp roundedbox.h + scene.cpp scene.h + trackball.cpp trackball.h +) +target_link_libraries(boxes PUBLIC + Qt::OpenGL + Qt::Widgets ) -# Resources: -add_qt_resource(boxes "boxes" PREFIX "/res/boxes" FILES - basic.fsh - basic.vsh - cubemap_negx.jpg - cubemap_negy.jpg - cubemap_negz.jpg - cubemap_posx.jpg - cubemap_posy.jpg - cubemap_posz.jpg - dotted.fsh - fresnel.fsh - glass.fsh - granite.fsh - marble.fsh - parameters.par - qt-logo.jpg - qt-logo.png - reflection.fsh - refraction.fsh - smiley.png - square.jpg - wood.fsh) - - -## Scopes: -##################################################################### +install(TARGETS boxes + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt index 566a8aae02c..81f290be995 100644 --- a/examples/widgets/graphicsview/chip/CMakeLists.txt +++ b/examples/widgets/graphicsview/chip/CMakeLists.txt @@ -1,44 +1,38 @@ # Generated from chip.pro. -##################################################################### -## chip Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(chip LANGUAGES CXX) -add_qt_executable(chip - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/chip" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/chip" - SOURCES - chip.cpp chip.h - main.cpp - mainwindow.cpp mainwindow.h - view.cpp view.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS OpenGL) # special case +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(chip WIN32 MACOSX_BUNDLE + chip.cpp chip.h + images.qrc + main.cpp + mainwindow.cpp mainwindow.h + view.cpp view.h ) - -# Resources: -add_qt_resource(chip "images" FILES - fileprint.png - qt4logo.png - rotateleft.png - rotateright.png - zoomin.png - zoomout.png) - - -## Scopes: -##################################################################### - -extend_target(chip CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(chip PUBLIC + Qt::Widgets ) +if (TARGET Qt::OpenGL) + target_link_libraries(chip PUBLIC Qt::OpenGL) +endif() +if (TARGET Qt::PrintSupport) + target_link_libraries(chip PUBLIC Qt::PrintSupport) +endif() -extend_target(chip CONDITION TARGET Qt::OpenGL - LIBRARIES - Qt::OpenGL +install(TARGETS chip + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 4:.:chip.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt index 5455bec89e4..36b1fb85c17 100644 --- a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt +++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt @@ -1,21 +1,28 @@ # Generated from collidingmice.pro. -##################################################################### -## collidingmice Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(collidingmice LANGUAGES CXX) -add_qt_executable(collidingmice - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/collidingmice" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/collidingmice" - SOURCES - main.cpp - mouse.cpp mouse.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(collidingmice WIN32 MACOSX_BUNDLE + main.cpp + mice.qrc + mouse.cpp mouse.h +) +target_link_libraries(collidingmice PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(collidingmice "mice" PREFIX "/" FILES - images/cheese.jpg) - +install(TARGETS collidingmice + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt index fb3ff6c712e..76f60aabaad 100644 --- a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt +++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt @@ -1,39 +1,31 @@ # Generated from diagramscene.pro. -##################################################################### -## diagramscene Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(diagramscene LANGUAGES CXX) -add_qt_executable(diagramscene - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/diagramscene" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/diagramscene" - SOURCES - arrow.cpp arrow.h - diagramitem.cpp diagramitem.h - diagramscene.cpp diagramscene.h - diagramtextitem.cpp diagramtextitem.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(diagramscene WIN32 MACOSX_BUNDLE + arrow.cpp arrow.h + diagramitem.cpp diagramitem.h + diagramscene.cpp diagramscene.h diagramscene.qrc + diagramtextitem.cpp diagramtextitem.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(diagramscene PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(diagramscene "diagramscene" FILES - images/background1.png - images/background2.png - images/background3.png - images/background4.png - images/bold.png - images/bringtofront.png - images/delete.png - images/floodfill.png - images/italic.png - images/linecolor.png - images/linepointer.png - images/pointer.png - images/sendtoback.png - images/textpointer.png - images/underline.png) - +install(TARGETS diagramscene + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt index 76932368e81..2adcff3ae5b 100644 --- a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt +++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt @@ -1,22 +1,28 @@ # Generated from dragdroprobot.pro. -##################################################################### -## dragdroprobot Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dragdroprobot LANGUAGES CXX) -add_qt_executable(dragdroprobot - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/dragdroprobot" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/dragdroprobot" - SOURCES - coloritem.cpp coloritem.h - main.cpp - robot.cpp robot.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(dragdroprobot WIN32 MACOSX_BUNDLE + coloritem.cpp coloritem.h + main.cpp + robot.cpp robot.h robot.qrc +) +target_link_libraries(dragdroprobot PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(dragdroprobot "robot" PREFIX "/" FILES - images/head.png) - +install(TARGETS dragdroprobot + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt index d1c10327b08..42fd71fa5f9 100644 --- a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt +++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt @@ -1,18 +1,29 @@ # Generated from elasticnodes.pro. -##################################################################### -## elasticnodes Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(elasticnodes LANGUAGES CXX) -add_qt_executable(elasticnodes - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/elasticnodes" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/elasticnodes" - SOURCES - edge.cpp edge.h - graphwidget.cpp graphwidget.h - main.cpp - node.cpp node.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(elasticnodes WIN32 MACOSX_BUNDLE + edge.cpp edge.h + graphwidget.cpp graphwidget.h + main.cpp + node.cpp node.h +) +target_link_libraries(elasticnodes PUBLIC + Qt::Widgets +) + +install(TARGETS elasticnodes + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt index dda61e0f684..2652b985dfa 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt +++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt @@ -1,30 +1,29 @@ # Generated from embeddeddialogs.pro. -##################################################################### -## embeddeddialogs Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(embeddeddialogs LANGUAGES CXX) -add_qt_executable(embeddeddialogs - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/embeddeddialogs" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/embeddeddialogs" - SOURCES - customproxy.cpp customproxy.h - embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui - main.cpp - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(embeddeddialogs WIN32 MACOSX_BUNDLE + customproxy.cpp customproxy.h + embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui + embeddeddialogs.qrc + main.cpp +) +target_link_libraries(embeddeddialogs PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(embeddeddialogs "embeddeddialogs" FILES - No-Ones-Laughing-3.jpg) - - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:.:embeddeddialogs.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS embeddeddialogs + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt index 2d313ff700e..96b82b79557 100644 --- a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt @@ -1,20 +1,28 @@ # Generated from flowlayout.pro. -##################################################################### -## flowlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(flowlayout LANGUAGES CXX) -add_qt_executable(flowlayout - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/flowlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/flowlayout" - SOURCES - flowlayout.cpp flowlayout.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(graphicsview_flowlayout WIN32 MACOSX_BUNDLE # special case: renamed flowlayout + flowlayout.cpp flowlayout.h + main.cpp + window.cpp window.h +) +target_link_libraries(graphicsview_flowlayout PUBLIC # special case: renamed flowlayout + Qt::Widgets ) -#### Keys ignored in scope 1:.:flowlayout.pro:: -# QMAKE_PROJECT_NAME = "flowlayout_graphicsview" +install(TARGETS graphicsview_flowlayout # special case: renamed flowlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt new file mode 100644 index 00000000000..9c4282391e6 --- /dev/null +++ b/examples/widgets/graphicsview/padnavigator/.prev_CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from padnavigator.pro. + +##################################################################### +## padnavigator Binary: +##################################################################### + +add_qt_executable(padnavigator + OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/padnavigator" + INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/padnavigator" + SOURCES + flippablepad.cpp flippablepad.h + form.ui + main.cpp + padnavigator.cpp padnavigator.h + roundrectitem.cpp roundrectitem.h + splashitem.cpp splashitem.h + PUBLIC_LIBRARIES + Qt::Widgets + ENABLE_AUTOGEN_TOOLS + uic +) + +# Resources: +add_qt_resource(padnavigator "padnavigator" FILES + images/artsfftscope.png + images/blue_angle_swirl.jpg + images/kontact_contacts.png + images/kontact_journal.png + images/kontact_mail.png + images/kontact_notes.png + images/kopeteavailable.png + images/metacontact_online.png + images/minitools.png) + + +#### Keys ignored in scope 1:.:.:padnavigator.pro:: +# CONFIG = "console" + +## Scopes: +##################################################################### + +extend_target(padnavigator CONDITION TARGET Qt::OpenGL + PUBLIC_LIBRARIES + Qt::OpenGL +) diff --git a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt index 9c4282391e6..e995f2a16e9 100644 --- a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt +++ b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt @@ -1,45 +1,37 @@ # Generated from padnavigator.pro. -##################################################################### -## padnavigator Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(padnavigator LANGUAGES CXX) -add_qt_executable(padnavigator - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/padnavigator" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/padnavigator" - SOURCES - flippablepad.cpp flippablepad.h - form.ui - main.cpp - padnavigator.cpp padnavigator.h - roundrectitem.cpp roundrectitem.h - splashitem.cpp splashitem.h - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS OpenGL) # special case + +add_executable(padnavigator + flippablepad.cpp flippablepad.h + form.ui + main.cpp + padnavigator.cpp padnavigator.h padnavigator.qrc + roundrectitem.cpp roundrectitem.h + splashitem.cpp splashitem.h ) - -# Resources: -add_qt_resource(padnavigator "padnavigator" FILES - images/artsfftscope.png - images/blue_angle_swirl.jpg - images/kontact_contacts.png - images/kontact_journal.png - images/kontact_mail.png - images/kontact_notes.png - images/kopeteavailable.png - images/metacontact_online.png - images/minitools.png) - - -#### Keys ignored in scope 1:.:.:padnavigator.pro:: -# CONFIG = "console" - -## Scopes: -##################################################################### - -extend_target(padnavigator CONDITION TARGET Qt::OpenGL - PUBLIC_LIBRARIES - Qt::OpenGL +target_link_libraries(padnavigator PUBLIC + Qt::Widgets +) +# special case begin +if (TARGET Qt::OpenGL) + target_link_libraries(padnavigator PUBLIC Qt::OpenGL) +endif() +# special case end + +install(TARGETS padnavigator + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt index 87e4742b44c..afb35675d80 100644 --- a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from simpleanchorlayout.pro. -##################################################################### -## simpleanchorlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(simpleanchorlayout LANGUAGES CXX) -add_qt_executable(simpleanchorlayout - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/simpleanchorlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/simpleanchorlayout" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(simpleanchorlayout WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(simpleanchorlayout PUBLIC + Qt::Widgets +) + +install(TARGETS simpleanchorlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt index 5a20bbdb2e5..750352e3251 100644 --- a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt @@ -1,25 +1,27 @@ # Generated from weatheranchorlayout.pro. -##################################################################### -## weatheranchorlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(weatheranchorlayout LANGUAGES CXX) -add_qt_executable(weatheranchorlayout - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/weatheranchorlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/graphicsview/weatheranchorlayout" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(weatheranchorlayout WIN32 MACOSX_BUNDLE + main.cpp + weatheranchorlayout.qrc +) +target_link_libraries(weatheranchorlayout PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(weatheranchorlayout "weatheranchorlayout" FILES - images/5days.jpg - images/details.jpg - images/place.jpg - images/tabbar.jpg - images/title.jpg - images/weather-few-clouds.png) - +install(TARGETS weatheranchorlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt index cee0ef70e24..026c2406a4b 100644 --- a/examples/widgets/itemviews/addressbook/CMakeLists.txt +++ b/examples/widgets/itemviews/addressbook/CMakeLists.txt @@ -1,20 +1,31 @@ # Generated from addressbook.pro. -##################################################################### -## addressbook Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(addressbook LANGUAGES CXX) -add_qt_executable(addressbook - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/addressbook" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/addressbook" - SOURCES - adddialog.cpp adddialog.h - addresswidget.cpp addresswidget.h - main.cpp - mainwindow.cpp mainwindow.h - newaddresstab.cpp newaddresstab.h - tablemodel.cpp tablemodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(addressbook WIN32 MACOSX_BUNDLE + adddialog.cpp adddialog.h + addresswidget.cpp addresswidget.h + main.cpp + mainwindow.cpp mainwindow.h + newaddresstab.cpp newaddresstab.h + tablemodel.cpp tablemodel.h +) +target_link_libraries(addressbook PUBLIC + Qt::Widgets +) + +install(TARGETS addressbook + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt index 6da9a73867d..2efba58b105 100644 --- a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt +++ b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from basicsortfiltermodel.pro. -##################################################################### -## basicsortfiltermodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(basicsortfiltermodel LANGUAGES CXX) -add_qt_executable(basicsortfiltermodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/basicsortfiltermodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/basicsortfiltermodel" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(basicsortfiltermodel WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(basicsortfiltermodel PUBLIC + Qt::Widgets +) + +install(TARGETS basicsortfiltermodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt index 9d707d1ec60..79c489b03e1 100644 --- a/examples/widgets/itemviews/chart/CMakeLists.txt +++ b/examples/widgets/itemviews/chart/CMakeLists.txt @@ -1,30 +1,29 @@ # Generated from chart.pro. -##################################################################### -## chart Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(chart LANGUAGES CXX) -add_qt_executable(chart - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/chart" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/chart" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - pieview.cpp pieview.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(chart WIN32 MACOSX_BUNDLE + chart.qrc + main.cpp + mainwindow.cpp mainwindow.h + pieview.cpp pieview.h +) +target_link_libraries(chart PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(chart "chart" PREFIX "/Charts" FILES - qtdata.cht) - - -## Scopes: -##################################################################### - -extend_target(chart CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS - LIBRARIES - m +install(TARGETS chart + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt index 317489e6e26..c33cc611182 100644 --- a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt +++ b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from coloreditorfactory.pro. -##################################################################### -## coloreditorfactory Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(coloreditorfactory LANGUAGES CXX) -add_qt_executable(coloreditorfactory - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/coloreditorfactory" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/coloreditorfactory" - SOURCES - colorlisteditor.cpp colorlisteditor.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(coloreditorfactory WIN32 MACOSX_BUNDLE + colorlisteditor.cpp colorlisteditor.h + main.cpp + window.cpp window.h +) +target_link_libraries(coloreditorfactory PUBLIC + Qt::Widgets +) + +install(TARGETS coloreditorfactory + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt index 326df33ba29..7cce164bc6d 100644 --- a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt +++ b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from combowidgetmapper.pro. -##################################################################### -## combowidgetmapper Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(combowidgetmapper LANGUAGES CXX) -add_qt_executable(combowidgetmapper - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/combowidgetmapper" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/combowidgetmapper" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(combowidgetmapper WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(combowidgetmapper PUBLIC + Qt::Widgets +) + +install(TARGETS combowidgetmapper + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt index 6cbfa84ae1e..0aa34c46d88 100644 --- a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt +++ b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt @@ -1,23 +1,30 @@ # Generated from customsortfiltermodel.pro. -##################################################################### -## customsortfiltermodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(customsortfiltermodel LANGUAGES CXX) -add_qt_executable(customsortfiltermodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/customsortfiltermodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/customsortfiltermodel" - SOURCES - filterwidget.cpp filterwidget.h - main.cpp - mysortfilterproxymodel.cpp mysortfilterproxymodel.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(customsortfiltermodel WIN32 MACOSX_BUNDLE + customsortfiltermodel.qrc + filterwidget.cpp filterwidget.h + main.cpp + mysortfilterproxymodel.cpp mysortfilterproxymodel.h + window.cpp window.h +) +target_link_libraries(customsortfiltermodel PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(customsortfiltermodel "customsortfiltermodel" PREFIX "/" FILES - images/find.png) - +install(TARGETS customsortfiltermodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt index 5ad3455249f..3e6e7c9ac7b 100644 --- a/examples/widgets/itemviews/dirview/CMakeLists.txt +++ b/examples/widgets/itemviews/dirview/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from dirview.pro. -##################################################################### -## dirview Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dirview LANGUAGES CXX) -add_qt_executable(dirview - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/dirview" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/dirview" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(dirview WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(dirview PUBLIC + Qt::Widgets +) + +install(TARGETS dirview + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt index 9cb49e0a25e..c86c0d7272d 100644 --- a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt +++ b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt @@ -1,25 +1,30 @@ # Generated from editabletreemodel.pro. -##################################################################### -## editabletreemodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(editabletreemodel LANGUAGES CXX) -add_qt_executable(editabletreemodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/editabletreemodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/editabletreemodel" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h mainwindow.ui - treeitem.cpp treeitem.h - treemodel.cpp treemodel.h - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(editabletreemodel WIN32 MACOSX_BUNDLE + editabletreemodel.qrc + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + treeitem.cpp treeitem.h + treemodel.cpp treemodel.h +) +target_link_libraries(editabletreemodel PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(editabletreemodel "editabletreemodel" PREFIX "/" FILES - default.txt) - +install(TARGETS editabletreemodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt index d3f25783027..5013d5bab2c 100644 --- a/examples/widgets/itemviews/fetchmore/CMakeLists.txt +++ b/examples/widgets/itemviews/fetchmore/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from fetchmore.pro. -##################################################################### -## fetchmore Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fetchmore LANGUAGES CXX) -add_qt_executable(fetchmore - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/fetchmore" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/fetchmore" - SOURCES - filelistmodel.cpp filelistmodel.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(fetchmore WIN32 MACOSX_BUNDLE + filelistmodel.cpp filelistmodel.h + main.cpp + window.cpp window.h +) +target_link_libraries(fetchmore PUBLIC + Qt::Widgets +) + +install(TARGETS fetchmore + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt index c8bffce9708..afcb66a6b29 100644 --- a/examples/widgets/itemviews/flattreeview/CMakeLists.txt +++ b/examples/widgets/itemviews/flattreeview/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from flattreeview.pro. -##################################################################### -## flattreeview Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(flattreeview LANGUAGES CXX) -add_qt_executable(flattreeview - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/flattreeview" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/flattreeview" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(flattreeview WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(flattreeview PUBLIC + Qt::Widgets +) + +install(TARGETS flattreeview + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt index 11e8a1e471b..a17ffef5fcc 100644 --- a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt +++ b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt @@ -1,21 +1,28 @@ # Generated from frozencolumn.pro. -##################################################################### -## frozencolumn Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(frozencolumn LANGUAGES CXX) -add_qt_executable(frozencolumn - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/frozencolumn" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/frozencolumn" - SOURCES - freezetablewidget.cpp freezetablewidget.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(frozencolumn WIN32 MACOSX_BUNDLE + freezetablewidget.cpp freezetablewidget.h + grades.qrc + main.cpp +) +target_link_libraries(frozencolumn PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(frozencolumn "grades" PREFIX "/" FILES - grades.txt) - +install(TARGETS frozencolumn + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt index d970348bc6a..f14bded157b 100644 --- a/examples/widgets/itemviews/interview/CMakeLists.txt +++ b/examples/widgets/itemviews/interview/CMakeLists.txt @@ -1,32 +1,28 @@ # Generated from interview.pro. -##################################################################### -## interview Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(interview LANGUAGES CXX) -add_qt_executable(interview - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/interview" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/interview" - SOURCES - main.cpp - model.cpp model.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(interview WIN32 MACOSX_BUNDLE + interview.qrc + main.cpp + model.cpp model.h +) +target_link_libraries(interview PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(interview "interview" PREFIX "/" FILES - images/folder.png - images/interview.png - images/services.png) - - -#### Keys ignored in scope 1:.:interview.pro:: -# TEMPLATE = "app" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:interview.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS interview + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt index fc29cde3b1f..e9a04a0807b 100644 --- a/examples/widgets/itemviews/pixelator/CMakeLists.txt +++ b/examples/widgets/itemviews/pixelator/CMakeLists.txt @@ -1,31 +1,36 @@ # Generated from pixelator.pro. -##################################################################### -## pixelator Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(pixelator LANGUAGES CXX) -add_qt_executable(pixelator - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/pixelator" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/pixelator" - SOURCES - imagemodel.cpp imagemodel.h - main.cpp - mainwindow.cpp mainwindow.h - pixeldelegate.cpp pixeldelegate.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(pixelator WIN32 MACOSX_BUNDLE + imagemodel.cpp imagemodel.h + images.qrc + main.cpp + mainwindow.cpp mainwindow.h + pixeldelegate.cpp pixeldelegate.h ) - -# Resources: -add_qt_resource(pixelator "images" FILES - images/qt.png) - - -## Scopes: -##################################################################### - -extend_target(pixelator CONDITION TARGET Qt::PrintSupport - LIBRARIES +target_link_libraries(pixelator PUBLIC + Qt::Widgets +) +if (TARGET Qt::PrintSupport) + target_link_libraries(pixelator PUBLIC Qt::PrintSupport + ) +endif() + +install(TARGETS pixelator + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt index a105278418e..cffbdbb1b01 100644 --- a/examples/widgets/itemviews/puzzle/CMakeLists.txt +++ b/examples/widgets/itemviews/puzzle/CMakeLists.txt @@ -1,23 +1,30 @@ # Generated from puzzle.pro. -##################################################################### -## puzzle Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(puzzle LANGUAGES CXX) -add_qt_executable(puzzle_itemview # special case - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/puzzle" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - piecesmodel.cpp piecesmodel.h - puzzlewidget.cpp puzzlewidget.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(itemviews_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle + main.cpp + mainwindow.cpp mainwindow.h + piecesmodel.cpp piecesmodel.h + puzzle.qrc + puzzlewidget.cpp puzzlewidget.h +) +target_link_libraries(itemviews_puzzle PUBLIC # special case: renamed puzzle + Qt::Widgets ) -# Resources: -add_qt_resource(puzzle_itemview "puzzle" PREFIX "/images" FILES # special case - example.jpg) - +install(TARGETS itemviews_puzzle # special case: renamed puzzle + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt index 25142870495..4a1812d96d5 100644 --- a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt +++ b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt @@ -1,19 +1,31 @@ # Generated from simpledommodel.pro. -##################################################################### -## simpledommodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(simpledommodel LANGUAGES CXX) -add_qt_executable(simpledommodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpledommodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpledommodel" - SOURCES - domitem.cpp domitem.h - dommodel.cpp dommodel.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Xml - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Xml) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(simpledommodel WIN32 MACOSX_BUNDLE + domitem.cpp domitem.h + dommodel.cpp dommodel.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(simpledommodel PUBLIC + Qt::Widgets + Qt::Xml +) + +install(TARGETS simpledommodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt index 1b50a3508c2..3fb889229d0 100644 --- a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt +++ b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt @@ -1,22 +1,29 @@ # Generated from simpletreemodel.pro. -##################################################################### -## simpletreemodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(simpletreemodel LANGUAGES CXX) -add_qt_executable(simpletreemodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpletreemodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simpletreemodel" - SOURCES - main.cpp - treeitem.cpp treeitem.h - treemodel.cpp treemodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(simpletreemodel WIN32 MACOSX_BUNDLE + main.cpp + simpletreemodel.qrc + treeitem.cpp treeitem.h + treemodel.cpp treemodel.h +) +target_link_libraries(simpletreemodel PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(simpletreemodel "simpletreemodel" FILES - default.txt) - +install(TARGETS simpletreemodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt index 849f7e29695..d25d4915443 100644 --- a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt +++ b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from simplewidgetmapper.pro. -##################################################################### -## simplewidgetmapper Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(simplewidgetmapper LANGUAGES CXX) -add_qt_executable(simplewidgetmapper - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simplewidgetmapper" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/simplewidgetmapper" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(simplewidgetmapper WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(simplewidgetmapper PUBLIC + Qt::Widgets +) + +install(TARGETS simplewidgetmapper + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt index b8c24f591c7..809c1cd0d0e 100644 --- a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt +++ b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from spinboxdelegate.pro. -##################################################################### -## spinboxdelegate Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(spinboxdelegate LANGUAGES CXX) -add_qt_executable(spinboxdelegate - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spinboxdelegate" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spinboxdelegate" - SOURCES - delegate.cpp delegate.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(spinboxdelegate WIN32 MACOSX_BUNDLE + delegate.cpp delegate.h + main.cpp +) +target_link_libraries(spinboxdelegate PUBLIC + Qt::Widgets +) + +install(TARGETS spinboxdelegate + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt index 498164c1cd9..811caec6a69 100644 --- a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt +++ b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt @@ -1,35 +1,36 @@ # Generated from spreadsheet.pro. -##################################################################### -## spreadsheet Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(spreadsheet LANGUAGES CXX) -add_qt_executable(spreadsheet - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spreadsheet" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/spreadsheet" - SOURCES - main.cpp - printview.cpp printview.h - spreadsheet.cpp spreadsheet.h - spreadsheetdelegate.cpp spreadsheetdelegate.h - spreadsheetitem.cpp spreadsheetitem.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(spreadsheet WIN32 MACOSX_BUNDLE + main.cpp + printview.cpp printview.h + spreadsheet.cpp spreadsheet.h spreadsheet.qrc + spreadsheetdelegate.cpp spreadsheetdelegate.h + spreadsheetitem.cpp spreadsheetitem.h ) - -# Resources: -add_qt_resource(spreadsheet "spreadsheet" PREFIX "/" FILES - images/interview.png) - - -## Scopes: -##################################################################### - -extend_target(spreadsheet CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(spreadsheet PUBLIC + Qt::Widgets ) +# special case begin +if (TARGET Qt::PrintSupport) + target_link_libraries(spreadsheet PUBLIC Qt::PrintSupport) +endif() +# special case end -#### Keys ignored in scope 3:.:spreadsheet.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS spreadsheet + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt index 0b94a12fb67..8cfb9911438 100644 --- a/examples/widgets/itemviews/stardelegate/CMakeLists.txt +++ b/examples/widgets/itemviews/stardelegate/CMakeLists.txt @@ -1,18 +1,29 @@ # Generated from stardelegate.pro. -##################################################################### -## stardelegate Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(stardelegate LANGUAGES CXX) -add_qt_executable(stardelegate - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/stardelegate" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/stardelegate" - SOURCES - main.cpp - stardelegate.cpp stardelegate.h - stareditor.cpp stareditor.h - starrating.cpp starrating.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(stardelegate WIN32 MACOSX_BUNDLE + main.cpp + stardelegate.cpp stardelegate.h + stareditor.cpp stareditor.h + starrating.cpp starrating.h +) +target_link_libraries(stardelegate PUBLIC + Qt::Widgets +) + +install(TARGETS stardelegate + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt index efad83e1a11..d25d839347c 100644 --- a/examples/widgets/itemviews/storageview/CMakeLists.txt +++ b/examples/widgets/itemviews/storageview/CMakeLists.txt @@ -1,20 +1,31 @@ # Generated from storageview.pro. -##################################################################### -## storageview Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(storageview LANGUAGES CXX) -add_qt_executable(storageview - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/storageview" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/itemviews/storageview" - SOURCES - main.cpp - storagemodel.cpp storagemodel.h - LIBRARIES - Qt::Gui - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Gui) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(storageview WIN32 MACOSX_BUNDLE + main.cpp + storagemodel.cpp storagemodel.h +) +target_link_libraries(storageview PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets ) -#### Keys ignored in scope 1:.:storageview.pro:: -# TEMPLATE = "app" +install(TARGETS storageview + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt index 28ac6a48b20..83c4833b9d7 100644 --- a/examples/widgets/layouts/basiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from basiclayouts.pro. -##################################################################### -## basiclayouts Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(basiclayouts LANGUAGES CXX) -add_qt_executable(basiclayouts - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/basiclayouts" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/basiclayouts" - SOURCES - dialog.cpp dialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(basiclayouts WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h + main.cpp +) +target_link_libraries(basiclayouts PUBLIC + Qt::Widgets +) + +install(TARGETS basiclayouts + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt index 72cf6002a25..cfe34ad68f1 100644 --- a/examples/widgets/layouts/borderlayout/CMakeLists.txt +++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from borderlayout.pro. -##################################################################### -## borderlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(borderlayout LANGUAGES CXX) -add_qt_executable(borderlayout - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/borderlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/borderlayout" - SOURCES - borderlayout.cpp borderlayout.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(borderlayout WIN32 MACOSX_BUNDLE + borderlayout.cpp borderlayout.h + main.cpp + window.cpp window.h +) +target_link_libraries(borderlayout PUBLIC + Qt::Widgets +) + +install(TARGETS borderlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt index 47f935bf688..1989672b9c9 100644 --- a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from dynamiclayouts.pro. -##################################################################### -## dynamiclayouts Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dynamiclayouts LANGUAGES CXX) -add_qt_executable(dynamiclayouts - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/dynamiclayouts" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/dynamiclayouts" - SOURCES - dialog.cpp dialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(dynamiclayouts WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h + main.cpp +) +target_link_libraries(dynamiclayouts PUBLIC + Qt::Widgets +) + +install(TARGETS dynamiclayouts + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt index a887abb93e8..6a7ad689cab 100644 --- a/examples/widgets/layouts/flowlayout/CMakeLists.txt +++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from flowlayout.pro. -##################################################################### -## flowlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(flowlayout LANGUAGES CXX) -add_qt_executable(flowlayout_layout # special case - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/flowlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/layouts/flowlayout" - SOURCES - flowlayout.cpp flowlayout.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(flowlayout WIN32 MACOSX_BUNDLE + flowlayout.cpp flowlayout.h + main.cpp + window.cpp window.h +) +target_link_libraries(flowlayout PUBLIC + Qt::Widgets +) + +install(TARGETS flowlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt index 52d1db1d9e7..d442ccacd09 100644 --- a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt +++ b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from qmaccocoaviewcontainer.pro. -##################################################################### -## qmaccocoaviewcontainer Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(qmaccocoaviewcontainer LANGUAGES CXX) -add_qt_executable(qmaccocoaviewcontainer - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmaccocoaviewcontainer" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmaccocoaviewcontainer" - SOURCES - main.mm - LIBRARIES - Qt::Widgets - ${FWAppKit} +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(qmaccocoaviewcontainer WIN32 MACOSX_BUNDLE + main.mm +) +target_link_libraries(qmaccocoaviewcontainer PUBLIC + ${FWAppKit} + Qt::Widgets ) -#### Keys ignored in scope 1:.:qmaccocoaviewcontainer.pro:: -# TEMPLATE = "app" +install(TARGETS qmaccocoaviewcontainer + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt index 9708fae762a..267b49361f6 100644 --- a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt +++ b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from qmacnativewidget.pro. -##################################################################### -## qmacnativewidget Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(qmacnativewidget LANGUAGES CXX) -add_qt_executable(qmacnativewidget - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmacnativewidget" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mac/qmacnativewidget" - SOURCES - main.mm - LIBRARIES - Qt::Widgets - ${FWAppKit} +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(qmacnativewidget WIN32 MACOSX_BUNDLE + main.mm +) +target_link_libraries(qmacnativewidget PUBLIC + ${FWAppKit} + Qt::Widgets ) -#### Keys ignored in scope 1:.:qmacnativewidget.pro:: -# TEMPLATE = "app" +install(TARGETS qmacnativewidget + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt index 8a9bdea2c20..67ac4637ffa 100644 --- a/examples/widgets/mainwindows/application/CMakeLists.txt +++ b/examples/widgets/mainwindows/application/CMakeLists.txt @@ -1,26 +1,28 @@ # Generated from application.pro. -##################################################################### -## application Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(application LANGUAGES CXX) -add_qt_executable(application - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/application" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/application" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(application WIN32 MACOSX_BUNDLE + application.qrc + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(application PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(application "application" FILES - images/copy.png - images/cut.png - images/new.png - images/open.png - images/paste.png - images/save.png) - +install(TARGETS application + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt index e8fd580fd86..ceacc184dab 100644 --- a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt +++ b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt @@ -1,32 +1,34 @@ # Generated from dockwidgets.pro. -##################################################################### -## dockwidgets Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dockwidgets LANGUAGES CXX) -add_qt_executable(dockwidgets - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/dockwidgets" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/dockwidgets" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(dockwidgets WIN32 MACOSX_BUNDLE + dockwidgets.qrc + main.cpp + mainwindow.cpp mainwindow.h ) - -# Resources: -add_qt_resource(dockwidgets "dockwidgets" FILES - images/new.png - images/print.png - images/save.png - images/undo.png) - - -## Scopes: -##################################################################### - -extend_target(dockwidgets CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(dockwidgets PUBLIC + Qt::Widgets +) +# special case begin +if (TARGET Qt::PrintSupport) + target_link_libraries(dockwidgets PUBLIC Qt::PrintSupport) +endif() +# special case end + +install(TARGETS dockwidgets + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt index df1d9b63556..5af2a7ffe94 100644 --- a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt +++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt @@ -1,35 +1,29 @@ # Generated from mainwindow.pro. -##################################################################### -## mainwindow Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mainwindow LANGUAGES CXX) -add_qt_executable(mainwindow - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mainwindow" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mainwindow" - SOURCES - colorswatch.cpp colorswatch.h - main.cpp - mainwindow.cpp mainwindow.h - toolbar.cpp toolbar.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mainwindow WIN32 MACOSX_BUNDLE + colorswatch.cpp colorswatch.h + main.cpp + mainwindow.cpp mainwindow.h mainwindow.qrc + toolbar.cpp toolbar.h +) +target_link_libraries(mainwindow PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(mainwindow "mainwindow" PREFIX "/res" FILES - qt.png - titlebarCenter.png - titlebarLeft.png - titlebarRight.png) - - -#### Keys ignored in scope 1:.:mainwindow.pro:: -# TEMPLATE = "app" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:mainwindow.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS mainwindow + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt index c20acbdfca5..481e2477c13 100644 --- a/examples/widgets/mainwindows/mdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt @@ -1,27 +1,29 @@ # Generated from mdi.pro. -##################################################################### -## mdi Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mdi LANGUAGES CXX) -add_qt_executable(mdi - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mdi" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/mdi" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - mdichild.cpp mdichild.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mdi WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + mdi.qrc + mdichild.cpp mdichild.h +) +target_link_libraries(mdi PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(mdi "mdi" FILES - images/copy.png - images/cut.png - images/new.png - images/open.png - images/paste.png - images/save.png) - +install(TARGETS mdi + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt index 6d7e471a8c5..a10ef9090e6 100644 --- a/examples/widgets/mainwindows/menus/CMakeLists.txt +++ b/examples/widgets/mainwindows/menus/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from menus.pro. -##################################################################### -## menus Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(menus LANGUAGES CXX) -add_qt_executable(menus - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/menus" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/menus" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(menus WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(menus PUBLIC + Qt::Widgets +) + +install(TARGETS menus + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt index 8391aa0cbc8..81cb80f7a38 100644 --- a/examples/widgets/mainwindows/sdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt @@ -1,26 +1,28 @@ # Generated from sdi.pro. -##################################################################### -## sdi Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(sdi LANGUAGES CXX) -add_qt_executable(sdi - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/sdi" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/mainwindows/sdi" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(sdi WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + sdi.qrc +) +target_link_libraries(sdi PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(sdi "sdi" FILES - images/copy.png - images/cut.png - images/new.png - images/open.png - images/paste.png - images/save.png) - +install(TARGETS sdi + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt index cda43296dd1..a3dc7861fa3 100644 --- a/examples/widgets/painting/affine/CMakeLists.txt +++ b/examples/widgets/painting/affine/CMakeLists.txt @@ -1,23 +1,33 @@ # Generated from affine.pro. -##################################################################### -## affine Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(affine LANGUAGES CXX) -add_qt_executable(affine - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/affine" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/affine" - SOURCES - main.cpp - xform.cpp xform.h - # INCLUDE_DIRECTORIES ../shared # special case - LIBRARIES # special case - painting_shared +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(affine WIN32 MACOSX_BUNDLE + # special case: remove files from ../shared + affine.qrc + main.cpp + xform.cpp xform.h +) +target_include_directories(affine PUBLIC + ../shared +) +target_link_libraries(affine PUBLIC + Qt::Widgets + painting_shared # special case ) -# Resources: -add_qt_resource(affine "affine" PREFIX "/res/affine" FILES - bg1.jpg - xform.cpp - xform.html) +install(TARGETS affine + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt index 176149dad54..d0a0ac749d8 100644 --- a/examples/widgets/painting/basicdrawing/CMakeLists.txt +++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt @@ -1,23 +1,29 @@ # Generated from basicdrawing.pro. -##################################################################### -## basicdrawing Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(basicdrawing LANGUAGES CXX) -add_qt_executable(basicdrawing - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/basicdrawing" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/basicdrawing" - SOURCES - main.cpp - renderarea.cpp renderarea.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(basicdrawing WIN32 MACOSX_BUNDLE + basicdrawing.qrc + main.cpp + renderarea.cpp renderarea.h + window.cpp window.h +) +target_link_libraries(basicdrawing PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(basicdrawing "basicdrawing" FILES - images/brick.png - images/qt-logo.png) - +install(TARGETS basicdrawing + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt index 1e83bc48147..d083cf00dde 100644 --- a/examples/widgets/painting/composition/CMakeLists.txt +++ b/examples/widgets/painting/composition/CMakeLists.txt @@ -1,23 +1,32 @@ # Generated from composition.pro. -##################################################################### -## composition Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(composition LANGUAGES CXX) -add_qt_executable(composition - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/composition" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/composition" - SOURCES - composition.cpp composition.h - main.cpp - LIBRARIES # special case - painting_shared +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(composition WIN32 MACOSX_BUNDLE + # special case: remove files from ../shared + composition.cpp composition.h composition.qrc + main.cpp +) +target_include_directories(composition PUBLIC + ../shared +) +target_link_libraries(composition PUBLIC + Qt::Widgets + painting_shared # special case ) -# Resources: -add_qt_resource(composition "composition" PREFIX "/res/composition" FILES - composition.cpp - composition.html - flower.jpg - flower_alpha.jpg) +install(TARGETS composition + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt index a2305782a55..edbfea218d8 100644 --- a/examples/widgets/painting/concentriccircles/CMakeLists.txt +++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from concentriccircles.pro. -##################################################################### -## concentriccircles Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(concentriccircles LANGUAGES CXX) -add_qt_executable(concentriccircles - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/concentriccircles" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/concentriccircles" - SOURCES - circlewidget.cpp circlewidget.h - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(concentriccircles WIN32 MACOSX_BUNDLE + circlewidget.cpp circlewidget.h + main.cpp + window.cpp window.h +) +target_link_libraries(concentriccircles PUBLIC + Qt::Widgets +) + +install(TARGETS concentriccircles + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt index 67622da25d7..591bc552eae 100644 --- a/examples/widgets/painting/deform/CMakeLists.txt +++ b/examples/widgets/painting/deform/CMakeLists.txt @@ -1,21 +1,33 @@ # Generated from deform.pro. -##################################################################### -## deform Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(deform LANGUAGES CXX) -add_qt_executable(deform - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/deform" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/deform" - SOURCES - main.cpp - pathdeform.cpp pathdeform.h - LIBRARIES # special case - painting_shared +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(deform WIN32 MACOSX_BUNDLE + # special case: remove files from ../shared + deform.qrc + main.cpp + pathdeform.cpp pathdeform.h +) +target_include_directories(deform PUBLIC + ../shared +) +target_link_libraries(deform PUBLIC + Qt::Widgets + painting_shared # special case ) -# Resources: -add_qt_resource(deform "deform" PREFIX "/res/deform" FILES - pathdeform.cpp - pathdeform.html) +install(TARGETS deform + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt index 38bb59eb6cb..e533cdb63a3 100644 --- a/examples/widgets/painting/fontsampler/CMakeLists.txt +++ b/examples/widgets/painting/fontsampler/CMakeLists.txt @@ -1,27 +1,28 @@ # Generated from fontsampler.pro. -##################################################################### -## fontsampler Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fontsampler LANGUAGES CXX) -add_qt_executable(fontsampler - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/fontsampler" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/fontsampler" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - mainwindowbase.ui - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(fontsampler WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + mainwindowbase.ui +) +target_link_libraries(fontsampler PUBLIC + Qt::Widgets ) -## Scopes: -##################################################################### - -extend_target(fontsampler CONDITION TARGET Qt::PrintSupport - PUBLIC_LIBRARIES - Qt::PrintSupport +install(TARGETS fontsampler + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt index 0d5553b986c..b25739e919e 100644 --- a/examples/widgets/painting/gradients/CMakeLists.txt +++ b/examples/widgets/painting/gradients/CMakeLists.txt @@ -1,21 +1,32 @@ # Generated from gradients.pro. -##################################################################### -## gradients Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(gradients LANGUAGES CXX) -add_qt_executable(gradients - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/gradients" - SOURCES - gradients.cpp gradients.h - main.cpp - LIBRARIES # special case - painting_shared +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(gradients WIN32 MACOSX_BUNDLE + # special case: remove files from ../shared + gradients.cpp gradients.h gradients.qrc + main.cpp +) +target_include_directories(gradients PUBLIC + ../shared +) +target_link_libraries(gradients PUBLIC + Qt::Widgets + painting_shared # special case ) -# Resources: -add_qt_resource(gradients "gradients" PREFIX "/res/gradients" FILES - gradients.cpp - gradients.html) +install(TARGETS gradients + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt index eed2bede43e..506a3d8510b 100644 --- a/examples/widgets/painting/imagecomposition/CMakeLists.txt +++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt @@ -1,22 +1,28 @@ # Generated from imagecomposition.pro. -##################################################################### -## imagecomposition Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(imagecomposition LANGUAGES CXX) -add_qt_executable(imagecomposition - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/imagecomposition" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/imagecomposition" - SOURCES - imagecomposer.cpp imagecomposer.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(imagecomposition WIN32 MACOSX_BUNDLE + imagecomposer.cpp imagecomposer.h + imagecomposition.qrc + main.cpp +) +target_link_libraries(imagecomposition PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(imagecomposition "imagecomposition" FILES - images/butterfly.png - images/checker.png) - +install(TARGETS imagecomposition + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt index 13dd321a529..423d7d98ed9 100644 --- a/examples/widgets/painting/painterpaths/CMakeLists.txt +++ b/examples/widgets/painting/painterpaths/CMakeLists.txt @@ -1,26 +1,28 @@ # Generated from painterpaths.pro. -##################################################################### -## painterpaths Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(painterpaths LANGUAGES CXX) -add_qt_executable(painterpaths - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/painterpaths" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/painterpaths" - SOURCES - main.cpp - renderarea.cpp renderarea.h - window.cpp window.h - LIBRARIES - Qt::Widgets - painting_shared # special case +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(painterpaths WIN32 MACOSX_BUNDLE + main.cpp + renderarea.cpp renderarea.h + window.cpp window.h +) +target_link_libraries(painterpaths PUBLIC + Qt::Widgets ) -## Scopes: -##################################################################### - -extend_target(painterpaths CONDITION UNIX AND NOT APPLE_OSX AND NOT HAIKU AND NOT INTEGRITY AND NOT VXWORKS - LIBRARIES - m +install(TARGETS painterpaths + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt index 150a1baa834..ce32f385499 100644 --- a/examples/widgets/painting/pathstroke/CMakeLists.txt +++ b/examples/widgets/painting/pathstroke/CMakeLists.txt @@ -1,21 +1,34 @@ # Generated from pathstroke.pro. -##################################################################### -## pathstroke Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(pathstroke LANGUAGES CXX) -add_qt_executable(pathstroke - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/pathstroke" - SOURCES - main.cpp - pathstroke.cpp pathstroke.h - LIBRARIES # special case - painting_shared +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(pathstroke WIN32 MACOSX_BUNDLE + ../shared/arthurstyle.cpp ../shared/arthurstyle.h + ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h + ../shared/hoverpoints.cpp ../shared/hoverpoints.h + ../shared/shared.qrc + main.cpp + pathstroke.cpp pathstroke.h pathstroke.qrc +) +target_include_directories(pathstroke PUBLIC + ../shared +) +target_link_libraries(pathstroke PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(pathstroke "pathstroke" PREFIX "/res/pathstroke" FILES - pathstroke.cpp - pathstroke.html) +install(TARGETS pathstroke + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/painting/shared/CMakeLists.txt b/examples/widgets/painting/shared/CMakeLists.txt index a7bec2789b6..c94a586425a 100644 --- a/examples/widgets/painting/shared/CMakeLists.txt +++ b/examples/widgets/painting/shared/CMakeLists.txt @@ -2,7 +2,7 @@ # special case: add_library(painting_shared OBJECT) -qt_manual_moc(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/ +qt5_wrap_cpp(moc_files arthurwidgets.h hoverpoints.h) # no automoc for OBJECT libs:-/ target_sources(painting_shared PRIVATE arthurstyle.cpp arthurstyle.h arthurwidgets.cpp arthurwidgets.h @@ -12,53 +12,16 @@ target_sources(painting_shared PRIVATE target_link_libraries(painting_shared PUBLIC Qt::Widgets) target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") - -# Resources: -add_qt_resource(painting_shared "shared" PREFIX "/res" FILES - images/button_normal_cap_left.png - images/button_normal_cap_right.png - images/button_normal_stretch.png - images/button_pressed_cap_left.png - images/button_pressed_cap_right.png - images/button_pressed_stretch.png - images/frame_bottom.png - images/frame_bottomleft.png - images/frame_bottomright.png - images/frame_left.png - images/frame_right.png - images/frame_top.png - images/frame_topleft.png - images/frame_topright.png - images/groupframe_bottom_left.png - images/groupframe_bottom_right.png - images/groupframe_bottom_stretch.png - images/groupframe_left_stretch.png - images/groupframe_right_stretch.png - images/groupframe_top_stretch.png - images/groupframe_topleft.png - images/groupframe_topright.png - images/line_dash_dot.png - images/line_dash_dot_dot.png - images/line_dashed.png - images/line_dotted.png - images/line_solid.png - images/radiobutton-on.png - images/radiobutton_off.png - images/radiobutton_on.png - images/slider_bar.png - images/slider_thumb_on.png - images/title_cap_left.png - images/title_cap_right.png - images/title_stretch.png) - +qt5_add_resources(res_files shared.qrc) +target_sources(painting_shared PRIVATE ${res_files}) ## Scopes: ##################################################################### -extend_target(painting_shared CONDITION TARGET Qt::OpenGL OR QT_FEATURE_opengles2 - DEFINES - QT_OPENGL_SUPPORT - LIBRARIES +if (TARGET Qt::OpenGL OR QT_FEATURE_opengles2) + target_compile_definitions(painting_shared PRIVATE QT_OPENGL_SUPPORT) + target_link_libraries(painting_shared PRIVATE Qt::OpenGL Qt::Widgets -) + ) +endif() diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt index a3c3130c323..5837f90f9d9 100644 --- a/examples/widgets/painting/transformations/CMakeLists.txt +++ b/examples/widgets/painting/transformations/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from transformations.pro. -##################################################################### -## transformations Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(transformations LANGUAGES CXX) -add_qt_executable(transformations - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/transformations" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/painting/transformations" - SOURCES - main.cpp - renderarea.cpp renderarea.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(transformations WIN32 MACOSX_BUNDLE + main.cpp + renderarea.cpp renderarea.h + window.cpp window.h +) +target_link_libraries(transformations PUBLIC + Qt::Widgets +) + +install(TARGETS transformations + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt index 8d26479929a..099991172d6 100644 --- a/examples/widgets/richtext/calendar/CMakeLists.txt +++ b/examples/widgets/richtext/calendar/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from calendar.pro. -##################################################################### -## calendar Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(calendar LANGUAGES CXX) -add_qt_executable(calendar - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/calendar" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/calendar" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(calendar WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(calendar PUBLIC + Qt::Widgets +) + +install(TARGETS calendar + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/orderform/CMakeLists.txt b/examples/widgets/richtext/orderform/CMakeLists.txt index 5f12e98cdfe..9dd715c752a 100644 --- a/examples/widgets/richtext/orderform/CMakeLists.txt +++ b/examples/widgets/richtext/orderform/CMakeLists.txt @@ -1,25 +1,32 @@ # Generated from orderform.pro. -##################################################################### -## orderform Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(orderform LANGUAGES CXX) -add_qt_executable(orderform - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/orderform" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/orderform" - SOURCES - detailsdialog.cpp detailsdialog.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) + +add_executable(orderform WIN32 MACOSX_BUNDLE + detailsdialog.cpp detailsdialog.h + main.cpp + mainwindow.cpp mainwindow.h ) - -## Scopes: -##################################################################### - -extend_target(orderform CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(orderform PUBLIC + Qt::Widgets +) +if (TARGET Qt::PrintSupport) + target_link_libraries(orderform PUBLIC Qt::PrintSupport) +endif() + +install(TARGETS orderform + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt index afffcc639b1..918843e1bd6 100644 --- a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt +++ b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from syntaxhighlighter.pro. -##################################################################### -## syntaxhighlighter Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(syntaxhighlighter LANGUAGES CXX) -add_qt_executable(syntaxhighlighter - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/syntaxhighlighter" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/syntaxhighlighter" - SOURCES - highlighter.cpp highlighter.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(syntaxhighlighter WIN32 MACOSX_BUNDLE + highlighter.cpp highlighter.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(syntaxhighlighter PUBLIC + Qt::Widgets +) + +install(TARGETS syntaxhighlighter + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/textedit/CMakeLists.txt b/examples/widgets/richtext/textedit/CMakeLists.txt index 487f708b343..54689bae5b5 100644 --- a/examples/widgets/richtext/textedit/CMakeLists.txt +++ b/examples/widgets/richtext/textedit/CMakeLists.txt @@ -1,83 +1,33 @@ # Generated from textedit.pro. -##################################################################### -## textedit Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(textedit LANGUAGES CXX) -add_qt_executable(textedit - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/textedit" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/richtext/textedit" - SOURCES - main.cpp - textedit.cpp textedit.h - PUBLIC_LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(textedit WIN32 MACOSX_BUNDLE + main.cpp + textedit.cpp textedit.h textedit.qrc ) - -# Resources: -add_qt_resource(textedit "textedit" PREFIX "/" FILES - example.html - images/logo32.png - images/mac/checkbox-checked.png - images/mac/checkbox.png - images/mac/editcopy.png - images/mac/editcut.png - images/mac/editpaste.png - images/mac/editredo.png - images/mac/editundo.png - images/mac/exportpdf.png - images/mac/filenew.png - images/mac/fileopen.png - images/mac/fileprint.png - images/mac/filesave.png - images/mac/format-indent-less.png - images/mac/format-indent-more.png - images/mac/textbold.png - images/mac/textcenter.png - images/mac/textitalic.png - images/mac/textjustify.png - images/mac/textleft.png - images/mac/textright.png - images/mac/textunder.png - images/mac/zoomin.png - images/mac/zoomout.png - images/win/checkbox-checked.png - images/win/checkbox.png - images/win/editcopy.png - images/win/editcut.png - images/win/editpaste.png - images/win/editredo.png - images/win/editundo.png - images/win/exportpdf.png - images/win/filenew.png - images/win/fileopen.png - images/win/fileprint.png - images/win/filesave.png - images/win/format-indent-less.png - images/win/format-indent-more.png - images/win/textbold.png - images/win/textcenter.png - images/win/textitalic.png - images/win/textjustify.png - images/win/textleft.png - images/win/textright.png - images/win/textunder.png - images/win/zoomin.png - images/win/zoomout.png) - - -#### Keys ignored in scope 1:.:.:textedit.pro:: -# EXAMPLE_FILES = "textedit.qdoc" -# TEMPLATE = "app" - -## Scopes: -##################################################################### - -extend_target(textedit CONDITION TARGET Qt::PrintSupport - PUBLIC_LIBRARIES - Qt::PrintSupport +target_link_libraries(textedit PUBLIC + Qt::Widgets ) +# special case begin +if (TARGET Qt::PrintSupport) + target_link_libraries(textedit PUBLIC Qt::PrintSupport) +endif() +# special case end -#### Keys ignored in scope 3:.:.:textedit.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS textedit + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/scroller/graphicsview/CMakeLists.txt b/examples/widgets/scroller/graphicsview/CMakeLists.txt index 0f25d6b71cb..5b36cfc9aed 100644 --- a/examples/widgets/scroller/graphicsview/CMakeLists.txt +++ b/examples/widgets/scroller/graphicsview/CMakeLists.txt @@ -1,18 +1,26 @@ # Generated from graphicsview.pro. -##################################################################### -## graphicsview Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(graphicsview LANGUAGES CXX) -add_qt_executable(graphicsview - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/scroller/graphicsview" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/scroller/graphicsview" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(graphicsview WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(graphicsview PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:graphicsview.pro:: -# TEMPLATE = "app" +install(TARGETS graphicsview + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt index 0fc20f59ae5..758265686b9 100644 --- a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt +++ b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from eventtransitions.pro. -##################################################################### -## eventtransitions Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(eventtransitions LANGUAGES CXX) -add_qt_executable(eventtransitions - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/eventtransitions" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/eventtransitions" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(eventtransitions WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(eventtransitions PUBLIC + Qt::Widgets +) + +install(TARGETS eventtransitions + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/factorial/CMakeLists.txt b/examples/widgets/statemachine/factorial/CMakeLists.txt index e38995220e5..e3832257058 100644 --- a/examples/widgets/statemachine/factorial/CMakeLists.txt +++ b/examples/widgets/statemachine/factorial/CMakeLists.txt @@ -1,22 +1,26 @@ # Generated from factorial.pro. -##################################################################### -## factorial Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(factorial LANGUAGES CXX) -add_qt_executable(factorial - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/factorial" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/factorial" - SOURCES - main.cpp +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(factorial + main.cpp +) +target_link_libraries(factorial PUBLIC + Qt::Core ) -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:factorial.pro:WIN32: -# CONFIG = "console" - -#### Keys ignored in scope 3:.:factorial.pro:APPLE_OSX: -# CONFIG = "-app_bundle" +install(TARGETS factorial + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/statemachine/pingpong/CMakeLists.txt b/examples/widgets/statemachine/pingpong/CMakeLists.txt index b911bd727f9..e3745a280da 100644 --- a/examples/widgets/statemachine/pingpong/CMakeLists.txt +++ b/examples/widgets/statemachine/pingpong/CMakeLists.txt @@ -1,22 +1,26 @@ # Generated from pingpong.pro. -##################################################################### -## pingpong Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(pingpong LANGUAGES CXX) -add_qt_executable(pingpong - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/pingpong" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/pingpong" - SOURCES - main.cpp +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) + +add_executable(pingpong + main.cpp +) +target_link_libraries(pingpong PUBLIC + Qt::Core ) -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:pingpong.pro:WIN32: -# CONFIG = "console" - -#### Keys ignored in scope 3:.:pingpong.pro:APPLE_OSX: -# CONFIG = "-app_bundle" +install(TARGETS pingpong + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/statemachine/rogue/CMakeLists.txt b/examples/widgets/statemachine/rogue/CMakeLists.txt index a6a1a473e1d..7ce3c5c9660 100644 --- a/examples/widgets/statemachine/rogue/CMakeLists.txt +++ b/examples/widgets/statemachine/rogue/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from rogue.pro. -##################################################################### -## rogue Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(rogue LANGUAGES CXX) -add_qt_executable(rogue - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/rogue" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/rogue" - SOURCES - main.cpp - movementtransition.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(rogue WIN32 MACOSX_BUNDLE + main.cpp + movementtransition.h + window.cpp window.h +) +target_link_libraries(rogue PUBLIC + Qt::Widgets +) + +install(TARGETS rogue + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/trafficlight/CMakeLists.txt b/examples/widgets/statemachine/trafficlight/CMakeLists.txt index 52f9fb3c6cf..3325c5fe465 100644 --- a/examples/widgets/statemachine/trafficlight/CMakeLists.txt +++ b/examples/widgets/statemachine/trafficlight/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from trafficlight.pro. -##################################################################### -## trafficlight Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(trafficlight LANGUAGES CXX) -add_qt_executable(trafficlight - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/trafficlight" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/trafficlight" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(trafficlight WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(trafficlight PUBLIC + Qt::Widgets +) + +install(TARGETS trafficlight + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt index c5f14b75143..3ea05f9595a 100644 --- a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt +++ b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from twowaybutton.pro. -##################################################################### -## twowaybutton Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(twowaybutton LANGUAGES CXX) -add_qt_executable(twowaybutton - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/twowaybutton" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/statemachine/twowaybutton" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(twowaybutton WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(twowaybutton PUBLIC + Qt::Widgets +) + +install(TARGETS twowaybutton + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/CMakeLists.txt b/examples/widgets/tools/CMakeLists.txt index 90ac6fe86f7..042f751b0f7 100644 --- a/examples/widgets/tools/CMakeLists.txt +++ b/examples/widgets/tools/CMakeLists.txt @@ -16,5 +16,7 @@ add_subdirectory(undoframework) if(QT_FEATURE_library) # special case add_subdirectory(echoplugin) - add_subdirectory(plugandpaint) + # FIXME: Currently broken # special case + # Fails to link (ld: error: undefined symbol: qt_static_plugin_BasicToolsPlugin()) # special case + #add_subdirectory(plugandpaint) # special case endif() diff --git a/examples/widgets/tools/codecs/CMakeLists.txt b/examples/widgets/tools/codecs/CMakeLists.txt index 703aa3fb477..99040e807ea 100644 --- a/examples/widgets/tools/codecs/CMakeLists.txt +++ b/examples/widgets/tools/codecs/CMakeLists.txt @@ -1,26 +1,30 @@ # Generated from codecs.pro. -##################################################################### -## codecs Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(codecs LANGUAGES CXX) -add_qt_executable(codecs - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/codecs" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/codecs" - SOURCES - encodingdialog.cpp encodingdialog.h - main.cpp - mainwindow.cpp mainwindow.h - previewform.cpp previewform.h - PUBLIC_LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(codecs WIN32 MACOSX_BUNDLE + codecs.qrc + encodingdialog.cpp encodingdialog.h + main.cpp + mainwindow.cpp mainwindow.h + previewform.cpp previewform.h +) +target_link_libraries(codecs PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(codecs "codecs" PREFIX "/" FILES - images/editcopy.png) - - -#### Keys ignored in scope 1:.:.:codecs.pro:: -# EXAMPLE_FILES = "encodedfiles" +install(TARGETS codecs + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt index b39b4f262dc..9db2d089d93 100644 --- a/examples/widgets/tools/completer/CMakeLists.txt +++ b/examples/widgets/tools/completer/CMakeLists.txt @@ -1,23 +1,29 @@ # Generated from completer.pro. -##################################################################### -## completer Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(completer LANGUAGES CXX) -add_qt_executable(completer - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/completer" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/completer" - SOURCES - fsmodel.cpp fsmodel.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(completer WIN32 MACOSX_BUNDLE + completer.qrc + fsmodel.cpp fsmodel.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(completer PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(completer "completer" PREFIX "/" FILES - resources/countries.txt - resources/wordlist.txt) - +install(TARGETS completer + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt index 04f8035ff33..7c1db10befe 100644 --- a/examples/widgets/tools/customcompleter/CMakeLists.txt +++ b/examples/widgets/tools/customcompleter/CMakeLists.txt @@ -1,22 +1,29 @@ # Generated from customcompleter.pro. -##################################################################### -## customcompleter Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(customcompleter LANGUAGES CXX) -add_qt_executable(customcompleter - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/customcompleter" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/customcompleter" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - textedit.cpp textedit.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(customcompleter WIN32 MACOSX_BUNDLE + customcompleter.qrc + main.cpp + mainwindow.cpp mainwindow.h + textedit.cpp textedit.h +) +target_link_libraries(customcompleter PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(customcompleter "customcompleter" PREFIX "/" FILES - resources/wordlist.txt) - +install(TARGETS customcompleter + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt index 3c9082db07a..941007505d6 100644 --- a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt +++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt @@ -1,33 +1,28 @@ # Generated from echowindow.pro. -##################################################################### -## echoplugin Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(echoplugin LANGUAGES CXX) -add_qt_executable(echoplugin - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/echoplugin" - SOURCES - echointerface.h - echowindow.cpp echowindow.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(echopluginwindow WIN32 MACOSX_BUNDLE # special case: renamed target + echointerface.h + echowindow.cpp echowindow.h + main.cpp +) +target_link_libraries(echopluginwindow PUBLIC # special case: renamed target + Qt::Widgets ) -#### Keys ignored in scope 1:.:echowindow.pro:: -# CONFIG = "install_ok" -# QMAKE_PROJECT_NAME = "echopluginwindow" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:echowindow.pro:CONFIG(debug,release OR debug): -# DESTDIR = "../debug/" - -#### Keys ignored in scope 4:.:echowindow.pro:CONFIG(release,release OR debug): -# DESTDIR = "../release/" - -#### Keys ignored in scope 5:.:echowindow.pro:else: -# DESTDIR = "../" +install(TARGETS echopluginwindow # special case: renamed target + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt index 7250a7e0a6a..78f5dcbe705 100644 --- a/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt +++ b/examples/widgets/tools/echoplugin/plugin/CMakeLists.txt @@ -1,22 +1,10 @@ -# Generated from plugin.pro. +# special case begin -##################################################################### -## qtLibraryTargetechoplugin Module: -##################################################################### - -add_qt_plugin(echoplugin_plugin TYPE plugin # special case - SOURCES - echoplugin.cpp echoplugin.h - INCLUDE_DIRECTORIES - ../echowindow - LIBRARIES - Qt::Widgets +add_library(echoplugin MODULE + echoplugin.cpp echoplugin.h ) -#### Keys ignored in scope 1:.:plugin.pro:: -# CONFIG = "plugin" "install_ok" -# DESTDIR = "../plugins" -# EXAMPLE_FILES = "echoplugin.json" -# INSTALLS = "target" -# TEMPLATE = "lib" -# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/echoplugin/plugins" +target_include_directories(echoplugin PUBLIC ../echowindow) +target_link_libraries(echoplugin PUBLIC Qt::Widgets) + +# special case end diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt index 033362bb4c0..3835cc27ea6 100644 --- a/examples/widgets/tools/i18n/CMakeLists.txt +++ b/examples/widgets/tools/i18n/CMakeLists.txt @@ -1,38 +1,29 @@ # Generated from i18n.pro. -##################################################################### -## i18n Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(i18n LANGUAGES CXX) -add_qt_executable(i18n - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/i18n" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/i18n" - SOURCES - languagechooser.cpp languagechooser.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(i18n WIN32 MACOSX_BUNDLE + i18n.qrc + languagechooser.cpp languagechooser.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(i18n PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(i18n "i18n" FILES - translations/i18n_ar.qm - translations/i18n_cs.qm - translations/i18n_de.qm - translations/i18n_el.qm - translations/i18n_en.qm - translations/i18n_eo.qm - translations/i18n_fr.qm - translations/i18n_it.qm - translations/i18n_jp.qm - translations/i18n_ko.qm - translations/i18n_no.qm - translations/i18n_ru.qm - translations/i18n_sv.qm - translations/i18n_zh.qm) - - -#### Keys ignored in scope 1:.:i18n.pro:: -# TRANSLATIONS = "translations/i18n_ar.ts" "translations/i18n_cs.ts" "translations/i18n_de.ts" "translations/i18n_el.ts" "translations/i18n_en.ts" "translations/i18n_eo.ts" "translations/i18n_fr.ts" "translations/i18n_it.ts" "translations/i18n_jp.ts" "translations/i18n_ko.ts" "translations/i18n_no.ts" "translations/i18n_ru.ts" "translations/i18n_sv.ts" "translations/i18n_zh.ts" +install(TARGETS i18n + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt index e5bbbacec29..2e730791cc4 100644 --- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt @@ -1,29 +1,33 @@ # Generated from app.pro. -##################################################################### -## plugandpaint Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(plugandpaint LANGUAGES CXX) -add_qt_executable(plugandpaint - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/plugandpaint" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/plugandpaint" - SOURCES - interfaces.h - main.cpp - mainwindow.cpp mainwindow.h - paintarea.cpp paintarea.h - plugindialog.cpp plugindialog.h - LIBRARIES - Qt::Widgets - pnp_basictools # special case +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(plugandpaint WIN32 MACOSX_BUNDLE + interfaces.h + main.cpp + mainwindow.cpp mainwindow.h + paintarea.cpp paintarea.h + plugindialog.cpp plugindialog.h ) +target_link_libraries(plugandpaint PUBLIC + # Remove: L../plugins + Qt::Widgets + pnp_basictools # special case +) +target_link_libraries(plugandpaint PUBLIC pnp_basictools) # special case -#### Keys ignored in scope 1:.:app.pro:: -# CONFIG = "install_ok" -# DESTDIR = ".." - -## Scopes: -##################################################################### - -# special case: Remove the rest +install(TARGETS plugandpaint + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt index a059d0deab1..64d239b054d 100644 --- a/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/plugins/basictools/CMakeLists.txt @@ -1,30 +1,13 @@ -# Generated from basictools.pro. +# special case begin -##################################################################### -## qtLibraryTargetpnp_basictools Module: -##################################################################### - -add_qt_plugin(pnp_basictools # special case - STATIC # special case - OUTPUT_DIRECTORY ../../plugins # special case - INSTALL_DIRECTORY ../../plugins # special case - ARCHIVE_INSTALL_DIRECTORY ../../plugins # special case - SOURCES - basictoolsplugin.cpp basictoolsplugin.h - INCLUDE_DIRECTORIES - ../../app - LIBRARIES - Qt::Widgets +add_library(pnp_basictools MODULE STATIC + basictoolsplugin.cpp basictoolsplugin.h ) +set_target_properties(pnp_basictools PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "../../plugins" + RUNTIME_OUTPUT_DIRECTORY "../../plugins" +) +target_include_directories(pnp_basictools PUBLIC ../../app) +target_link_libraries(pnp_basictools PUBLIC Qt::Widgets) -# CONFIG = "plugin" "static" "install_ok" -# DESTDIR = "../../plugins" -# INSTALLS = "target" -# TEMPLATE = "lib" -# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:basictools.pro:APPLE_UIKIT: -# CONFIG = "debug_and_release" +# special case end diff --git a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt index a0447c833ed..31d6f5ef659 100644 --- a/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/plugins/extrafilters/CMakeLists.txt @@ -1,27 +1,9 @@ -# Generated from extrafilters.pro. +# special case begin -##################################################################### -## qtLibraryTargetpnp_extrafilters Module: -##################################################################### - -add_qt_plugin(pnp_extrafilters_plugin TYPE plugin # special case - SOURCES - extrafiltersplugin.cpp extrafiltersplugin.h - INCLUDE_DIRECTORIES - ../../app - LIBRARIES - Qt::Widgets +add_library(pnp_extrafilters_plugin MODULE + extrafiltersplugin.cpp extrafiltersplugin.h ) +target_include_directories(pnp_extrafilters_plugin PRIVATE ../../app) +target_link_libraries(pnp_extrafilters_plugin PRIVATE Qt::Widgets) -#### Keys ignored in scope 1:.:extrafilters.pro:: -# CONFIG = "plugin" "install_ok" -# DESTDIR = "../../plugins" -# INSTALLS = "target" -# TEMPLATE = "lib" -# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/plugandpaint/plugins" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:extrafilters.pro:APPLE_UIKIT: -# CONFIG = "debug_and_release" +# special case end diff --git a/examples/widgets/tools/regexp/CMakeLists.txt b/examples/widgets/tools/regexp/CMakeLists.txt index da729f5f5b3..026e72673a3 100644 --- a/examples/widgets/tools/regexp/CMakeLists.txt +++ b/examples/widgets/tools/regexp/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from regexp.pro. -##################################################################### -## regexp Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(regexp LANGUAGES CXX) -add_qt_executable(regexp - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regexp" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regexp" - SOURCES - main.cpp - regexpdialog.cpp regexpdialog.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(regexp WIN32 MACOSX_BUNDLE + main.cpp + regexpdialog.cpp regexpdialog.h +) +target_link_libraries(regexp PUBLIC + Qt::Widgets +) + +install(TARGETS regexp + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt index e9dcb977a2f..ba7274b007e 100644 --- a/examples/widgets/tools/regularexpression/CMakeLists.txt +++ b/examples/widgets/tools/regularexpression/CMakeLists.txt @@ -1,21 +1,28 @@ # Generated from regularexpression.pro. -##################################################################### -## regularexpression Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(regularexpression LANGUAGES CXX) -add_qt_executable(regularexpression - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regularexpression" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/regularexpression" - SOURCES - main.cpp - regularexpressiondialog.cpp regularexpressiondialog.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(regularexpression WIN32 MACOSX_BUNDLE + main.cpp + regularexpression.qrc + regularexpressiondialog.cpp regularexpressiondialog.h +) +target_link_libraries(regularexpression PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(regularexpression "regularexpression" FILES - images/copy.png) - +install(TARGETS regularexpression + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt index ce260da3589..7bfa75cade5 100644 --- a/examples/widgets/tools/settingseditor/CMakeLists.txt +++ b/examples/widgets/tools/settingseditor/CMakeLists.txt @@ -1,22 +1,30 @@ # Generated from settingseditor.pro. -##################################################################### -## settingseditor Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(settingseditor LANGUAGES CXX) -add_qt_executable(settingseditor - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/settingseditor" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/settingseditor" - SOURCES - locationdialog.cpp locationdialog.h - main.cpp - mainwindow.cpp mainwindow.h - settingstree.cpp settingstree.h - variantdelegate.cpp variantdelegate.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(settingseditor WIN32 MACOSX_BUNDLE + locationdialog.cpp locationdialog.h + main.cpp + mainwindow.cpp mainwindow.h + settingstree.cpp settingstree.h + variantdelegate.cpp variantdelegate.h +) +target_link_libraries(settingseditor PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:settingseditor.pro:: -# EXAMPLE_FILES = "inifiles" +install(TARGETS settingseditor + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/styleplugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/CMakeLists.txt index 630c3703f82..8ee575f8a67 100644 --- a/examples/widgets/tools/styleplugin/CMakeLists.txt +++ b/examples/widgets/tools/styleplugin/CMakeLists.txt @@ -1,4 +1,19 @@ # Generated from styleplugin.pro. +# special case begin +cmake_minimum_required(VERSION 3.14) +project(styleplugin LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +# special case end + add_subdirectory(stylewindow) add_subdirectory(plugin) diff --git a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt index c311799d302..28c6ec07aba 100644 --- a/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt +++ b/examples/widgets/tools/styleplugin/plugin/CMakeLists.txt @@ -1,32 +1,9 @@ -# Generated from plugin.pro. +# special case begin -##################################################################### -## mplestyleplugin Module: -##################################################################### - -add_qt_plugin(simplestyleplugin TYPE style # special case - SOURCES - simplestyle.cpp simplestyle.h - simplestyleplugin.cpp simplestyleplugin.h - LIBRARIES - Qt::Widgets +add_library(simplestyleplugin MODULE + simplestyle.cpp simplestyle.h + simplestyleplugin.cpp simplestyleplugin.h ) +target_link_libraries(simplestyleplugin PUBLIC Qt::Widgets) -#### Keys ignored in scope 1:.:plugin.pro:: -# CONFIG = "plugin" "install_ok" -# EXAMPLE_FILES = "simplestyle.json" -# INSTALLS = "target" -# TEMPLATE = "lib" -# target.path = "$$[QT_INSTALL_EXAMPLES]/widgets/tools/styleplugin/styles" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:plugin.pro:CONFIG(debug,release OR debug): -# DESTDIR = "../debug/styles/" - -#### Keys ignored in scope 4:.:plugin.pro:CONFIG(release,release OR debug): -# DESTDIR = "../release/styles/" - -#### Keys ignored in scope 5:.:plugin.pro:else: -# DESTDIR = "../styles/" +# special case end diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt index a6d6a56874e..3e3893ad03c 100644 --- a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt +++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt @@ -1,31 +1,27 @@ # Generated from stylewindow.pro. -##################################################################### -## styleplugin Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(styleplugin LANGUAGES CXX) -add_qt_executable(styleplugin - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/styleplugin" - SOURCES - main.cpp - stylewindow.cpp stylewindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(styleplugin WIN32 MACOSX_BUNDLE + main.cpp + stylewindow.cpp stylewindow.h +) +target_link_libraries(styleplugin PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:stylewindow.pro:: -# CONFIG = "install_ok" - -## Scopes: -##################################################################### - -#### Keys ignored in scope 3:.:stylewindow.pro:debug: -# DESTDIR = "../debug/" - -#### Keys ignored in scope 4:.:stylewindow.pro:release: -# DESTDIR = "../release/" - -#### Keys ignored in scope 5:.:stylewindow.pro:else: -# DESTDIR = "../" +install(TARGETS styleplugin + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt index ab4d60f290b..a6bd7177f10 100644 --- a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt +++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt @@ -1,22 +1,28 @@ # Generated from treemodelcompleter.pro. -##################################################################### -## treemodelcompleter Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(treemodelcompleter LANGUAGES CXX) -add_qt_executable(treemodelcompleter - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/treemodelcompleter" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/treemodelcompleter" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - treemodelcompleter.cpp treemodelcompleter.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(treemodelcompleter WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + treemodelcompleter.cpp treemodelcompleter.h treemodelcompleter.qrc +) +target_link_libraries(treemodelcompleter PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(treemodelcompleter "treemodelcompleter" PREFIX "/" FILES - resources/treemodel.txt) - +install(TARGETS treemodelcompleter + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt index f3f1a5a4366..5cd91dda0a2 100644 --- a/examples/widgets/tools/undo/CMakeLists.txt +++ b/examples/widgets/tools/undo/CMakeLists.txt @@ -1,46 +1,30 @@ # Generated from undo.pro. -##################################################################### -## undo Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(undo LANGUAGES CXX) -add_qt_executable(undo - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undo" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undo" - SOURCES - commands.cpp commands.h - document.cpp document.h - main.cpp - mainwindow.cpp mainwindow.h mainwindow.ui - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(undo WIN32 MACOSX_BUNDLE + commands.cpp commands.h + document.cpp document.h + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + undo.qrc +) +target_link_libraries(undo PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(undo "undo" PREFIX "/" FILES - icons/background.png - icons/blue.png - icons/circle.png - icons/exit.png - icons/fileclose.png - icons/filenew.png - icons/fileopen.png - icons/filesave.png - icons/green.png - icons/ok.png - icons/rectangle.png - icons/red.png - icons/redo.png - icons/remove.png - icons/triangle.png - icons/undo.png) - - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:.:undo.pro:build_all AND NOT build_pass: -# CONFIG = "-build_all" "release" +install(TARGETS undo + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt index 0689d0df085..a1a6c2c624f 100644 --- a/examples/widgets/tools/undoframework/CMakeLists.txt +++ b/examples/widgets/tools/undoframework/CMakeLists.txt @@ -1,24 +1,31 @@ # Generated from undoframework.pro. -##################################################################### -## undoframework Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(undoframework LANGUAGES CXX) -add_qt_executable(undoframework - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undoframework" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tools/undoframework" - SOURCES - commands.cpp commands.h - diagramitem.cpp diagramitem.h - diagramscene.cpp diagramscene.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(undoframework WIN32 MACOSX_BUNDLE + commands.cpp commands.h + diagramitem.cpp diagramitem.h + diagramscene.cpp diagramscene.h + main.cpp + mainwindow.cpp mainwindow.h + undoframework.qrc +) +target_link_libraries(undoframework PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(undoframework "undoframework" FILES - images/cross.png) - +install(TARGETS undoframework + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt index 76920b0f3ca..0589e555f3e 100644 --- a/examples/widgets/touch/dials/CMakeLists.txt +++ b/examples/widgets/touch/dials/CMakeLists.txt @@ -1,18 +1,27 @@ # Generated from dials.pro. -##################################################################### -## dials Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(dials LANGUAGES CXX) -add_qt_executable(dials - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/dials" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/dials" - SOURCES - dials.ui - main.cpp - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(dials WIN32 MACOSX_BUNDLE + dials.ui + main.cpp +) +target_link_libraries(dials PUBLIC + Qt::Widgets +) + +install(TARGETS dials + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt index 82ec8cd91e7..a419a614be8 100644 --- a/examples/widgets/touch/fingerpaint/CMakeLists.txt +++ b/examples/widgets/touch/fingerpaint/CMakeLists.txt @@ -1,25 +1,34 @@ # Generated from fingerpaint.pro. -##################################################################### -## fingerpaint Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(fingerpaint LANGUAGES CXX) -add_qt_executable(fingerpaint - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/fingerpaint" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/fingerpaint" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - scribblearea.cpp scribblearea.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(fingerpaint WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + scribblearea.cpp scribblearea.h ) - -## Scopes: -##################################################################### - -extend_target(fingerpaint CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(fingerpaint PUBLIC + Qt::Widgets +) +# special case begin +if (TARGET Qt::PrintSupport) + target_link_libraries(fingerpaint PUBLIC Qt::PrintSupport) +endif() +# special case end + +install(TARGETS fingerpaint + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt index e8976db270b..4a8f55820a9 100644 --- a/examples/widgets/touch/knobs/CMakeLists.txt +++ b/examples/widgets/touch/knobs/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from knobs.pro. -##################################################################### -## knobs Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(knobs LANGUAGES CXX) -add_qt_executable(knobs - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/knobs" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/knobs" - SOURCES - knob.cpp knob.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(knobs WIN32 MACOSX_BUNDLE + knob.cpp knob.h + main.cpp +) +target_link_libraries(knobs PUBLIC + Qt::Widgets +) + +install(TARGETS knobs + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt index 92d7b4c3b31..379dde1e9f3 100644 --- a/examples/widgets/touch/pinchzoom/CMakeLists.txt +++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt @@ -1,22 +1,29 @@ # Generated from pinchzoom.pro. -##################################################################### -## pinchzoom Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(pinchzoom LANGUAGES CXX) -add_qt_executable(pinchzoom - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/pinchzoom" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/touch/pinchzoom" - SOURCES - graphicsview.cpp graphicsview.h - main.cpp - mouse.cpp mouse.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(pinchzoom WIN32 MACOSX_BUNDLE + graphicsview.cpp graphicsview.h + main.cpp + mice.qrc + mouse.cpp mouse.h +) +target_link_libraries(pinchzoom PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(pinchzoom "mice" PREFIX "/" FILES - images/cheese.jpg) - +install(TARGETS pinchzoom + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt index dcfc424a24a..14533cb8dce 100644 --- a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from part1.pro. -##################################################################### -## part1 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part1 LANGUAGES CXX) -add_qt_executable(part1 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part1" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part1" - SOURCES - addressbook.cpp addressbook.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part1 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + main.cpp +) +target_link_libraries(part1 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part1.pro:: -# QMAKE_PROJECT_NAME = "ab_part1" +install(TARGETS part1 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt index b9fe9307ee5..aace9f86af8 100644 --- a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from part2.pro. -##################################################################### -## part2 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part2 LANGUAGES CXX) -add_qt_executable(part2 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part2" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part2" - SOURCES - addressbook.cpp addressbook.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part2 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + main.cpp +) +target_link_libraries(part2 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part2.pro:: -# QMAKE_PROJECT_NAME = "ab_part2" +install(TARGETS part2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt index f83a8c5379a..b9fadf57d04 100644 --- a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from part3.pro. -##################################################################### -## part3 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part3 LANGUAGES CXX) -add_qt_executable(part3 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part3" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part3" - SOURCES - addressbook.cpp addressbook.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part3 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + main.cpp +) +target_link_libraries(part3 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part3.pro:: -# QMAKE_PROJECT_NAME = "ab_part3" +install(TARGETS part3 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt index 0dee5fab9ab..af8dfd49046 100644 --- a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from part4.pro. -##################################################################### -## part4 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part4 LANGUAGES CXX) -add_qt_executable(part4 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part4" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part4" - SOURCES - addressbook.cpp addressbook.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part4 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + main.cpp +) +target_link_libraries(part4 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part4.pro:: -# QMAKE_PROJECT_NAME = "ab_part4" +install(TARGETS part4 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt index 564f044ba88..eec0af2bac6 100644 --- a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt @@ -1,20 +1,28 @@ # Generated from part5.pro. -##################################################################### -## part5 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part5 LANGUAGES CXX) -add_qt_executable(part5 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part5" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part5" - SOURCES - addressbook.cpp addressbook.h - finddialog.cpp finddialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part5 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + finddialog.cpp finddialog.h + main.cpp +) +target_link_libraries(part5 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part5.pro:: -# QMAKE_PROJECT_NAME = "ab_part5" +install(TARGETS part5 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt index 375f1f0612f..294f16a26d5 100644 --- a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt @@ -1,20 +1,28 @@ # Generated from part6.pro. -##################################################################### -## part6 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part6 LANGUAGES CXX) -add_qt_executable(part6 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part6" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part6" - SOURCES - addressbook.cpp addressbook.h - finddialog.cpp finddialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part6 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + finddialog.cpp finddialog.h + main.cpp +) +target_link_libraries(part6 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part6.pro:: -# QMAKE_PROJECT_NAME = "ab_part6" +install(TARGETS part6 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt index 1ccd87fff54..3d50ebcc6ca 100644 --- a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt @@ -1,20 +1,28 @@ # Generated from part7.pro. -##################################################################### -## part7 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part7 LANGUAGES CXX) -add_qt_executable(part7 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part7" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/addressbook/part7" - SOURCES - addressbook.cpp addressbook.h - finddialog.cpp finddialog.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part7 WIN32 MACOSX_BUNDLE + addressbook.cpp addressbook.h + finddialog.cpp finddialog.h + main.cpp +) +target_link_libraries(part7 PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:part7.pro:: -# QMAKE_PROJECT_NAME = "ab_part7" +install(TARGETS part7 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt index c39133d235e..50f6e31364d 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from part1.pro. -##################################################################### -## part1 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part1 LANGUAGES CXX) -add_qt_executable(part1 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part1" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part1" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part1 WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(part1 PUBLIC + Qt::Widgets +) + +install(TARGETS part1 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt index ff9ddd6584d..9df643de4aa 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from part2.pro. -##################################################################### -## part2 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part2 LANGUAGES CXX) -add_qt_executable(part2 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part2" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part2" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part2 WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(part2 PUBLIC + Qt::Widgets +) + +install(TARGETS part2 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt index 2564472be6e..048d2d60abc 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from part3.pro. -##################################################################### -## part3 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part3 LANGUAGES CXX) -add_qt_executable(part3 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part3" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part3" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part3 WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(part3 PUBLIC + Qt::Widgets +) + +install(TARGETS part3 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt index 473b803044e..c752b44d04f 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from part4.pro. -##################################################################### -## part4 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part4 LANGUAGES CXX) -add_qt_executable(part4 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part4" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part4" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part4 WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(part4 PUBLIC + Qt::Widgets +) + +install(TARGETS part4 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt index 93d2ea4175a..fc4fd05b6e0 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from part5.pro. -##################################################################### -## part5 Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(part5 LANGUAGES CXX) -add_qt_executable(part5 - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part5" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/gettingStarted/gsQt/part5" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(part5 WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(part5 PUBLIC + Qt::Widgets +) + +install(TARGETS part5 + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt index 1edda802f9d..82e1b4dbab6 100644 --- a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from 1_readonly.pro. -##################################################################### -## mv_readonly Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_readonly LANGUAGES CXX) -add_qt_executable(mv_readonly - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/1_readonly" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/1_readonly" - SOURCES - main.cpp - mymodel.cpp mymodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_readonly WIN32 MACOSX_BUNDLE + main.cpp + mymodel.cpp mymodel.h +) +target_link_libraries(mv_readonly PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:1_readonly.pro:: -# TEMPLATE = "app" +install(TARGETS mv_readonly + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt index 3235275d6aa..898df9bfbfb 100644 --- a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from 2_formatting.pro. -##################################################################### -## mv_formatting Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_formatting LANGUAGES CXX) -add_qt_executable(mv_formatting - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/2_formatting" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/2_formatting" - SOURCES - main.cpp - mymodel.cpp mymodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_formatting WIN32 MACOSX_BUNDLE + main.cpp + mymodel.cpp mymodel.h +) +target_link_libraries(mv_formatting PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:2_formatting.pro:: -# TEMPLATE = "app" +install(TARGETS mv_formatting + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt index 746bafc19a9..b460b7b2816 100644 --- a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from 3_changingmodel.pro. -##################################################################### -## mv_changingmodel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_changingmodel LANGUAGES CXX) -add_qt_executable(mv_changingmodel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/3_changingmodel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/3_changingmodel" - SOURCES - main.cpp - mymodel.cpp mymodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_changingmodel WIN32 MACOSX_BUNDLE + main.cpp + mymodel.cpp mymodel.h +) +target_link_libraries(mv_changingmodel PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:3_changingmodel.pro:: -# TEMPLATE = "app" +install(TARGETS mv_changingmodel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt index ef7e0a501be..e76299ee0c8 100644 --- a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from 4_headers.pro. -##################################################################### -## mv_headers Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_headers LANGUAGES CXX) -add_qt_executable(mv_headers - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/4_headers" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/4_headers" - SOURCES - main.cpp - mymodel.cpp mymodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_headers WIN32 MACOSX_BUNDLE + main.cpp + mymodel.cpp mymodel.h +) +target_link_libraries(mv_headers PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:4_headers.pro:: -# TEMPLATE = "app" +install(TARGETS mv_headers + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt index 2ce884a7fef..ceb2ef0ed52 100644 --- a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt @@ -1,20 +1,28 @@ # Generated from 5_edit.pro. -##################################################################### -## mv_edit Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_edit LANGUAGES CXX) -add_qt_executable(mv_edit - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/5_edit" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/5_edit" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - mymodel.cpp mymodel.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_edit WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + mymodel.cpp mymodel.h +) +target_link_libraries(mv_edit PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:5_edit.pro:: -# TEMPLATE = "app" +install(TARGETS mv_edit + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt index 1d5a9425e5a..f6409036fd9 100644 --- a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from 6_treeview.pro. -##################################################################### -## mv_tree Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_tree LANGUAGES CXX) -add_qt_executable(mv_tree - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/6_treeview" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/6_treeview" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_tree WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(mv_tree PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:6_treeview.pro:: -# TEMPLATE = "app" +install(TARGETS mv_tree + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt index 0560dc7a604..f328863a1f7 100644 --- a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from 7_selections.pro. -##################################################################### -## mv_selections Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mv_selections LANGUAGES CXX) -add_qt_executable(mv_selections - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/7_selections" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/modelview/7_selections" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mv_selections WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(mv_selections PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:7_selections.pro:: -# TEMPLATE = "app" +install(TARGETS mv_selections + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt index d34d3ca846e..fee3e14285a 100644 --- a/examples/widgets/tutorials/notepad/CMakeLists.txt +++ b/examples/widgets/tutorials/notepad/CMakeLists.txt @@ -1,51 +1,35 @@ # Generated from notepad.pro. -##################################################################### -## notepad Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(notepad LANGUAGES CXX) -add_qt_executable(notepad - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/notepad" - SOURCES - main.cpp - notepad.cpp notepad.h notepad.ui - ENABLE_AUTOGEN_TOOLS - uic - LIBRARIES # special case - Qt::Widgets # special case +find_package(Qt5 COMPONENTS Widgets) # special case: add +find_package(Qt5 COMPONENTS PrintSupport) # special case: add + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(notepad WIN32 MACOSX_BUNDLE + main.cpp + notepad.cpp notepad.h notepad.qrc notepad.ui ) - -# Resources: -add_qt_resource(notepad "notepad" PREFIX "/" FILES - images/bold.png - images/copy.png - images/create.png - images/cut.png - images/edit_redo.png - images/edit_undo.png - images/exit.png - images/font.png - images/info.png - images/italic.png - images/new.png - images/open.png - images/paste.png - images/pencil.png - images/print.png - images/save.png - images/save_as.png - images/underline.png) - - -#### Keys ignored in scope 1:.:.:notepad.pro:: -# TEMPLATE = "app" - -## Scopes: -##################################################################### - -extend_target(notepad CONDITION TARGET Qt::PrintSupport - PUBLIC_LIBRARIES +# special case begin +target_link_libraries(notepad PUBLIC + Qt::Widgets +) +if (TARGET Qt::PrintSupport) + target_link_libraries(notepad PUBLIC Qt::PrintSupport + ) +endif() +# special case end + +install(TARGETS notepad + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt index 823098c9fc4..6725ad69f50 100644 --- a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from childwidget.pro. -##################################################################### -## childwidget Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(childwidget LANGUAGES CXX) -add_qt_executable(childwidget - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/childwidget" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/childwidget" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(childwidget WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(childwidget PUBLIC + Qt::Widgets +) + +install(TARGETS childwidget + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt index 7f88c89d80e..32ca867208b 100644 --- a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from nestedlayouts.pro. -##################################################################### -## nestedlayouts Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(nestedlayouts LANGUAGES CXX) -add_qt_executable(nestedlayouts - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/nestedlayouts" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/nestedlayouts" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(nestedlayouts WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(nestedlayouts PUBLIC + Qt::Widgets +) + +install(TARGETS nestedlayouts + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt index 2ef630033b6..b18e09a2782 100644 --- a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from toplevel.pro. -##################################################################### -## toplevel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(toplevel LANGUAGES CXX) -add_qt_executable(toplevel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/toplevel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/toplevel" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(toplevel WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(toplevel PUBLIC + Qt::Widgets +) + +install(TARGETS toplevel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt index 157865b68c2..4d8899227aa 100644 --- a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt @@ -1,15 +1,26 @@ # Generated from windowlayout.pro. -##################################################################### -## windowlayout Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(windowlayout LANGUAGES CXX) -add_qt_executable(windowlayout - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/windowlayout" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/tutorials/widgets/windowlayout" - SOURCES - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(windowlayout WIN32 MACOSX_BUNDLE + main.cpp +) +target_link_libraries(windowlayout PUBLIC + Qt::Widgets +) + +install(TARGETS windowlayout + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/analogclock/CMakeLists.txt b/examples/widgets/widgets/analogclock/CMakeLists.txt index 890a3002945..064b9f23e86 100644 --- a/examples/widgets/widgets/analogclock/CMakeLists.txt +++ b/examples/widgets/widgets/analogclock/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from analogclock.pro. -##################################################################### -## analogclock Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(analogclock LANGUAGES CXX) -add_qt_executable(analogclock_widgets # special case - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/analogclock" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/analogclock" - SOURCES - analogclock.cpp analogclock.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(analogclock WIN32 MACOSX_BUNDLE + analogclock.cpp analogclock.h + main.cpp +) +target_link_libraries(analogclock PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:analogclock.pro:: -# QMAKE_PROJECT_NAME = "widgets_analogclock" +install(TARGETS analogclock + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/calculator/CMakeLists.txt b/examples/widgets/widgets/calculator/CMakeLists.txt index b4f58b4f39a..779272f31a9 100644 --- a/examples/widgets/widgets/calculator/CMakeLists.txt +++ b/examples/widgets/widgets/calculator/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from calculator.pro. -##################################################################### -## calculator Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(calculator LANGUAGES CXX) -add_qt_executable(calculator - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calculator" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calculator" - SOURCES - button.cpp button.h - calculator.cpp calculator.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(calculator WIN32 MACOSX_BUNDLE + button.cpp button.h + calculator.cpp calculator.h + main.cpp +) +target_link_libraries(calculator PUBLIC + Qt::Widgets +) + +install(TARGETS calculator + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/calendarwidget/CMakeLists.txt b/examples/widgets/widgets/calendarwidget/CMakeLists.txt index 463fce38495..ed496bdad7d 100644 --- a/examples/widgets/widgets/calendarwidget/CMakeLists.txt +++ b/examples/widgets/widgets/calendarwidget/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from calendarwidget.pro. -##################################################################### -## calendarwidget Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(calendarwidget LANGUAGES CXX) -add_qt_executable(calendarwidget - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calendarwidget" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/calendarwidget" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(calendarwidget WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(calendarwidget PUBLIC + Qt::Widgets +) + +install(TARGETS calendarwidget + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/charactermap/CMakeLists.txt b/examples/widgets/widgets/charactermap/CMakeLists.txt index a09b63a4f72..f397822c592 100644 --- a/examples/widgets/widgets/charactermap/CMakeLists.txt +++ b/examples/widgets/widgets/charactermap/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from charactermap.pro. -##################################################################### -## charactermap Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(charactermap LANGUAGES CXX) -add_qt_executable(charactermap - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/charactermap" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/charactermap" - SOURCES - characterwidget.cpp characterwidget.h - main.cpp - mainwindow.cpp mainwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(charactermap WIN32 MACOSX_BUNDLE + characterwidget.cpp characterwidget.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_link_libraries(charactermap PUBLIC + Qt::Widgets +) + +install(TARGETS charactermap + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/codeeditor/CMakeLists.txt b/examples/widgets/widgets/codeeditor/CMakeLists.txt index 7c29d383ffb..f352b060cb5 100644 --- a/examples/widgets/widgets/codeeditor/CMakeLists.txt +++ b/examples/widgets/widgets/codeeditor/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from codeeditor.pro. -##################################################################### -## codeeditor Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(codeeditor LANGUAGES CXX) -add_qt_executable(codeeditor - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/codeeditor" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/codeeditor" - SOURCES - codeeditor.cpp codeeditor.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(codeeditor WIN32 MACOSX_BUNDLE + codeeditor.cpp codeeditor.h + main.cpp +) +target_link_libraries(codeeditor PUBLIC + Qt::Widgets +) + +install(TARGETS codeeditor + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/digitalclock/CMakeLists.txt b/examples/widgets/widgets/digitalclock/CMakeLists.txt index b85528a1e82..505e6a67b62 100644 --- a/examples/widgets/widgets/digitalclock/CMakeLists.txt +++ b/examples/widgets/widgets/digitalclock/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from digitalclock.pro. -##################################################################### -## digitalclock Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(digitalclock LANGUAGES CXX) -add_qt_executable(digitalclock - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/digitalclock" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/digitalclock" - SOURCES - digitalclock.cpp digitalclock.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(digitalclock WIN32 MACOSX_BUNDLE + digitalclock.cpp digitalclock.h + main.cpp +) +target_link_libraries(digitalclock PUBLIC + Qt::Widgets +) + +install(TARGETS digitalclock + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/elidedlabel/CMakeLists.txt b/examples/widgets/widgets/elidedlabel/CMakeLists.txt index b894e186926..1efb7a1bb3c 100644 --- a/examples/widgets/widgets/elidedlabel/CMakeLists.txt +++ b/examples/widgets/widgets/elidedlabel/CMakeLists.txt @@ -1,21 +1,32 @@ # Generated from elidedlabel.pro. -##################################################################### -## elidedlabel Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(elidedlabel LANGUAGES CXX) -add_qt_executable(elidedlabel - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/elidedlabel" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/elidedlabel" - SOURCES - elidedlabel.cpp elidedlabel.h - main.cpp - testwidget.cpp testwidget.h - LIBRARIES - Qt::Gui - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Gui) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(elidedlabel WIN32 MACOSX_BUNDLE + elidedlabel.cpp elidedlabel.h + main.cpp + testwidget.cpp testwidget.h +) +target_link_libraries(elidedlabel PUBLIC + Qt::Core + Qt::Gui + Qt::Widgets ) -#### Keys ignored in scope 1:.:elidedlabel.pro:: -# TEMPLATE = "app" +install(TARGETS elidedlabel + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/groupbox/CMakeLists.txt b/examples/widgets/widgets/groupbox/CMakeLists.txt index 1d77ab37dce..0b13e4587d2 100644 --- a/examples/widgets/widgets/groupbox/CMakeLists.txt +++ b/examples/widgets/widgets/groupbox/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from groupbox.pro. -##################################################################### -## groupbox Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(groupbox LANGUAGES CXX) -add_qt_executable(groupbox - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/groupbox" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/groupbox" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(groupbox WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(groupbox PUBLIC + Qt::Widgets +) + +install(TARGETS groupbox + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/icons/CMakeLists.txt b/examples/widgets/widgets/icons/CMakeLists.txt index 34d9bcec94c..ef20d8d2b09 100644 --- a/examples/widgets/widgets/icons/CMakeLists.txt +++ b/examples/widgets/widgets/icons/CMakeLists.txt @@ -1,24 +1,32 @@ # Generated from icons.pro. -##################################################################### -## icons Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(icons LANGUAGES CXX) -add_qt_executable(icons - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/icons" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/icons" - SOURCES - iconpreviewarea.cpp iconpreviewarea.h - iconsizespinbox.cpp iconsizespinbox.h - imagedelegate.cpp imagedelegate.h - main.cpp - mainwindow.cpp mainwindow.h - DEFINES - SRCDIR=\\\"/\\\" - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(icons WIN32 MACOSX_BUNDLE + iconpreviewarea.cpp iconpreviewarea.h + iconsizespinbox.cpp iconsizespinbox.h + imagedelegate.cpp imagedelegate.h + main.cpp + mainwindow.cpp mainwindow.h +) +target_compile_definitions(icons PUBLIC + SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}" +) +target_link_libraries(icons PUBLIC + Qt::Widgets +) +install(TARGETS icons + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) - -#### Keys ignored in scope 1:.:icons.pro:: -# EXAMPLE_FILES = "images/*" diff --git a/examples/widgets/widgets/imageviewer/CMakeLists.txt b/examples/widgets/widgets/imageviewer/CMakeLists.txt index 4684653e645..49695865c76 100644 --- a/examples/widgets/widgets/imageviewer/CMakeLists.txt +++ b/examples/widgets/widgets/imageviewer/CMakeLists.txt @@ -1,24 +1,33 @@ # Generated from imageviewer.pro. -##################################################################### -## imageviewer Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(imageviewer LANGUAGES CXX) -add_qt_executable(imageviewer - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/imageviewer" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/imageviewer" - SOURCES - imageviewer.cpp imageviewer.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(imageviewer WIN32 MACOSX_BUNDLE + imageviewer.cpp imageviewer.h + main.cpp ) - -## Scopes: -##################################################################### - -extend_target(imageviewer CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(imageviewer PUBLIC + Qt::Widgets +) +# special case begin +if (TARGET Qt::PrintSupport) + target_link_libraries(imageviewer PUBLIC Qt::PrintSupport) +endif() +# special case end + +install(TARGETS imageviewer + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/lineedits/CMakeLists.txt b/examples/widgets/widgets/lineedits/CMakeLists.txt index 59406a703d7..eb8f210f6cb 100644 --- a/examples/widgets/widgets/lineedits/CMakeLists.txt +++ b/examples/widgets/widgets/lineedits/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from lineedits.pro. -##################################################################### -## lineedits Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(lineedits LANGUAGES CXX) -add_qt_executable(lineedits - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/lineedits" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/lineedits" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(lineedits WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(lineedits PUBLIC + Qt::Widgets +) + +install(TARGETS lineedits + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/mousebuttons/CMakeLists.txt b/examples/widgets/widgets/mousebuttons/CMakeLists.txt index 6ec817458cc..2746ca670a4 100644 --- a/examples/widgets/widgets/mousebuttons/CMakeLists.txt +++ b/examples/widgets/widgets/mousebuttons/CMakeLists.txt @@ -1,19 +1,29 @@ # Generated from mousebuttons.pro. -##################################################################### -## mousebuttons Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(mousebuttons LANGUAGES CXX) -add_qt_executable(mousebuttons - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/mousebuttons" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/mousebuttons" - SOURCES - buttontester.cpp buttontester.h - main.cpp - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Core) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(mousebuttons WIN32 MACOSX_BUNDLE + buttontester.cpp buttontester.h + main.cpp +) +target_link_libraries(mousebuttons PUBLIC + Qt::Core + Qt::Widgets ) -#### Keys ignored in scope 1:.:mousebuttons.pro:: -# TEMPLATE = "app" +install(TARGETS mousebuttons + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/movie/CMakeLists.txt b/examples/widgets/widgets/movie/CMakeLists.txt index 0df3465feab..b96cce628e1 100644 --- a/examples/widgets/widgets/movie/CMakeLists.txt +++ b/examples/widgets/widgets/movie/CMakeLists.txt @@ -1,19 +1,27 @@ # Generated from movie.pro. -##################################################################### -## movie Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(movie LANGUAGES CXX) -add_qt_executable(movie - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/movie" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/movie" - SOURCES - main.cpp - movieplayer.cpp movieplayer.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(movie WIN32 MACOSX_BUNDLE + main.cpp + movieplayer.cpp movieplayer.h +) +target_link_libraries(movie PUBLIC + Qt::Widgets ) -#### Keys ignored in scope 1:.:movie.pro:: -# EXAMPLE_FILES = "animation.gif" +install(TARGETS movie + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/scribble/CMakeLists.txt b/examples/widgets/widgets/scribble/CMakeLists.txt index d9b22923369..51db261f223 100644 --- a/examples/widgets/widgets/scribble/CMakeLists.txt +++ b/examples/widgets/widgets/scribble/CMakeLists.txt @@ -1,25 +1,34 @@ # Generated from scribble.pro. -##################################################################### -## scribble Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(scribble LANGUAGES CXX) -add_qt_executable(scribble - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/scribble" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/scribble" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - scribblearea.cpp scribblearea.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) +find_package(Qt5 COMPONENTS PrintSupport) # special case + +add_executable(scribble WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + scribblearea.cpp scribblearea.h ) - -## Scopes: -##################################################################### - -extend_target(scribble CONDITION TARGET Qt::PrintSupport - LIBRARIES - Qt::PrintSupport +target_link_libraries(scribble PUBLIC + Qt::Widgets +) +# special case begin +if (TARGET Qt::PrintSupport) + target_link_libraries(scribble PUBLIC Qt::PrintSupport) +endif() +# special case end + +install(TARGETS scribble + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/shapedclock/CMakeLists.txt b/examples/widgets/widgets/shapedclock/CMakeLists.txt index ab199d69817..144d3006c54 100644 --- a/examples/widgets/widgets/shapedclock/CMakeLists.txt +++ b/examples/widgets/widgets/shapedclock/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from shapedclock.pro. -##################################################################### -## shapedclock Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(shapedclock LANGUAGES CXX) -add_qt_executable(shapedclock - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/shapedclock" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/shapedclock" - SOURCES - main.cpp - shapedclock.cpp shapedclock.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(shapedclock WIN32 MACOSX_BUNDLE + main.cpp + shapedclock.cpp shapedclock.h +) +target_link_libraries(shapedclock PUBLIC + Qt::Widgets +) + +install(TARGETS shapedclock + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/sliders/CMakeLists.txt b/examples/widgets/widgets/sliders/CMakeLists.txt index a064ad5a4aa..bfdd22a7cc4 100644 --- a/examples/widgets/widgets/sliders/CMakeLists.txt +++ b/examples/widgets/widgets/sliders/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from sliders.pro. -##################################################################### -## sliders Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(sliders LANGUAGES CXX) -add_qt_executable(sliders - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/sliders" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/sliders" - SOURCES - main.cpp - slidersgroup.cpp slidersgroup.h - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(sliders WIN32 MACOSX_BUNDLE + main.cpp + slidersgroup.cpp slidersgroup.h + window.cpp window.h +) +target_link_libraries(sliders PUBLIC + Qt::Widgets +) + +install(TARGETS sliders + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/spinboxes/CMakeLists.txt b/examples/widgets/widgets/spinboxes/CMakeLists.txt index 8635f06a8e7..680ecad2a81 100644 --- a/examples/widgets/widgets/spinboxes/CMakeLists.txt +++ b/examples/widgets/widgets/spinboxes/CMakeLists.txt @@ -1,16 +1,27 @@ # Generated from spinboxes.pro. -##################################################################### -## spinboxes Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(spinboxes LANGUAGES CXX) -add_qt_executable(spinboxes - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/spinboxes" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/spinboxes" - SOURCES - main.cpp - window.cpp window.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(spinboxes WIN32 MACOSX_BUNDLE + main.cpp + window.cpp window.h +) +target_link_libraries(spinboxes PUBLIC + Qt::Widgets +) + +install(TARGETS spinboxes + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/styles/CMakeLists.txt b/examples/widgets/widgets/styles/CMakeLists.txt index d33d90a5bc6..e0db35653ca 100644 --- a/examples/widgets/widgets/styles/CMakeLists.txt +++ b/examples/widgets/widgets/styles/CMakeLists.txt @@ -1,23 +1,29 @@ # Generated from styles.pro. -##################################################################### -## styles Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(styles LANGUAGES CXX) -add_qt_executable(styles - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/styles" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/styles" - SOURCES - main.cpp - norwegianwoodstyle.cpp norwegianwoodstyle.h - widgetgallery.cpp widgetgallery.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(styles WIN32 MACOSX_BUNDLE + main.cpp + norwegianwoodstyle.cpp norwegianwoodstyle.h + styles.qrc + widgetgallery.cpp widgetgallery.h +) +target_link_libraries(styles PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(styles "styles" FILES - images/woodbackground.png - images/woodbutton.png) - +install(TARGETS styles + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt index 227eb13b68c..7e99a396952 100644 --- a/examples/widgets/widgets/stylesheet/CMakeLists.txt +++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt @@ -1,58 +1,29 @@ # Generated from stylesheet.pro. -##################################################################### -## stylesheet Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(stylesheet LANGUAGES CXX) -add_qt_executable(stylesheet - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/stylesheet" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/stylesheet" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h mainwindow.ui - stylesheeteditor.cpp stylesheeteditor.h stylesheeteditor.ui - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(stylesheet WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui + stylesheet.qrc + stylesheeteditor.cpp stylesheeteditor.h stylesheeteditor.ui +) +target_link_libraries(stylesheet PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(stylesheet "stylesheet" PREFIX "/" FILES - images/checkbox_checked.png - images/checkbox_checked_hover.png - images/checkbox_checked_pressed.png - images/checkbox_unchecked.png - images/checkbox_unchecked_hover.png - images/checkbox_unchecked_pressed.png - images/down_arrow.png - images/down_arrow_disabled.png - images/frame.png - images/pagefold.png - images/pushbutton.png - images/pushbutton_hover.png - images/pushbutton_pressed.png - images/radiobutton_checked.png - images/radiobutton_checked_hover.png - images/radiobutton_checked_pressed.png - images/radiobutton_unchecked.png - images/radiobutton_unchecked_hover.png - images/radiobutton_unchecked_pressed.png - images/sizegrip.png - images/spindown.png - images/spindown_hover.png - images/spindown_off.png - images/spindown_pressed.png - images/spinup.png - images/spinup_hover.png - images/spinup_off.png - images/spinup_pressed.png - images/up_arrow.png - images/up_arrow_disabled.png - layouts/default.ui - layouts/pagefold.ui - qss/coffee.qss - qss/default.qss - qss/pagefold.qss) - +install(TARGETS stylesheet + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/tablet/CMakeLists.txt b/examples/widgets/widgets/tablet/CMakeLists.txt index f23fe7ec718..febec2afd0c 100644 --- a/examples/widgets/widgets/tablet/CMakeLists.txt +++ b/examples/widgets/widgets/tablet/CMakeLists.txt @@ -1,26 +1,30 @@ # Generated from tablet.pro. -##################################################################### -## qttablet Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(qttablet LANGUAGES CXX) -add_qt_executable(qttablet - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tablet" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tablet" - SOURCES - main.cpp - mainwindow.cpp mainwindow.h - tabletapplication.cpp tabletapplication.h - tabletcanvas.cpp tabletcanvas.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(qttablet WIN32 MACOSX_BUNDLE + images.qrc + main.cpp + mainwindow.cpp mainwindow.h + tabletapplication.cpp tabletapplication.h + tabletcanvas.cpp tabletcanvas.h +) +target_link_libraries(qttablet PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(qttablet "images" FILES - images/cursor-airbrush.png - images/cursor-eraser.png - images/cursor-felt-marker.png - images/cursor-pencil.png) - +install(TARGETS qttablet + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/tetrix/CMakeLists.txt b/examples/widgets/widgets/tetrix/CMakeLists.txt index 002667a6b93..ec795779289 100644 --- a/examples/widgets/widgets/tetrix/CMakeLists.txt +++ b/examples/widgets/widgets/tetrix/CMakeLists.txt @@ -1,18 +1,29 @@ # Generated from tetrix.pro. -##################################################################### -## tetrix Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tetrix LANGUAGES CXX) -add_qt_executable(tetrix - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tetrix" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tetrix" - SOURCES - main.cpp - tetrixboard.cpp tetrixboard.h - tetrixpiece.cpp tetrixpiece.h - tetrixwindow.cpp tetrixwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(tetrix WIN32 MACOSX_BUNDLE + main.cpp + tetrixboard.cpp tetrixboard.h + tetrixpiece.cpp tetrixpiece.h + tetrixwindow.cpp tetrixwindow.h +) +target_link_libraries(tetrix PUBLIC + Qt::Widgets +) + +install(TARGETS tetrix + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/tooltips/CMakeLists.txt b/examples/widgets/widgets/tooltips/CMakeLists.txt index 02d773858a3..90601659f64 100644 --- a/examples/widgets/widgets/tooltips/CMakeLists.txt +++ b/examples/widgets/widgets/tooltips/CMakeLists.txt @@ -1,24 +1,29 @@ # Generated from tooltips.pro. -##################################################################### -## tooltips Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(tooltips LANGUAGES CXX) -add_qt_executable(tooltips - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tooltips" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/tooltips" - SOURCES - main.cpp - shapeitem.cpp shapeitem.h - sortingbox.cpp sortingbox.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(tooltips WIN32 MACOSX_BUNDLE + main.cpp + shapeitem.cpp shapeitem.h + sortingbox.cpp sortingbox.h + tooltips.qrc +) +target_link_libraries(tooltips PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(tooltips "tooltips" FILES - images/circle.png - images/square.png - images/triangle.png) - +install(TARGETS tooltips + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt index ef981d9eb70..b09d10dd9aa 100644 --- a/examples/widgets/widgets/validators/CMakeLists.txt +++ b/examples/widgets/widgets/validators/CMakeLists.txt @@ -1,27 +1,30 @@ # Generated from validators.pro. -##################################################################### -## validators Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(validators LANGUAGES CXX) -add_qt_executable(validators - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/validators" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/validators" - SOURCES - ledwidget.cpp ledwidget.h - localeselector.cpp localeselector.h - main.cpp - validators.ui - validatorwidget.cpp validatorwidget.h - PUBLIC_LIBRARIES - Qt::Widgets - ENABLE_AUTOGEN_TOOLS - uic +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(validators WIN32 MACOSX_BUNDLE + ledwidget.cpp ledwidget.h + localeselector.cpp localeselector.h + main.cpp + validators.qrc validators.ui + validatorwidget.cpp validatorwidget.h +) +target_link_libraries(validators PUBLIC + Qt::Widgets ) -# Resources: -add_qt_resource(validators "validators" PREFIX "/" FILES - ledoff.png - ledon.png) - +install(TARGETS validators + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/widgets/widgets/wiggly/CMakeLists.txt b/examples/widgets/widgets/wiggly/CMakeLists.txt index cc8c0befbf4..2fabcafb0e7 100644 --- a/examples/widgets/widgets/wiggly/CMakeLists.txt +++ b/examples/widgets/widgets/wiggly/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from wiggly.pro. -##################################################################### -## wiggly Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(wiggly LANGUAGES CXX) -add_qt_executable(wiggly - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/wiggly" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/wiggly" - SOURCES - dialog.cpp dialog.h - main.cpp - wigglywidget.cpp wigglywidget.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(wiggly WIN32 MACOSX_BUNDLE + dialog.cpp dialog.h + main.cpp + wigglywidget.cpp wigglywidget.h +) +target_link_libraries(wiggly PUBLIC + Qt::Widgets +) + +install(TARGETS wiggly + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/windowflags/CMakeLists.txt b/examples/widgets/widgets/windowflags/CMakeLists.txt index aa2eff00888..0eab6f64524 100644 --- a/examples/widgets/widgets/windowflags/CMakeLists.txt +++ b/examples/widgets/widgets/windowflags/CMakeLists.txt @@ -1,17 +1,28 @@ # Generated from windowflags.pro. -##################################################################### -## windowflags Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(windowflags LANGUAGES CXX) -add_qt_executable(windowflags - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/windowflags" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/widgets/windowflags" - SOURCES - controllerwindow.cpp controllerwindow.h - main.cpp - previewwindow.cpp previewwindow.h - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(windowflags WIN32 MACOSX_BUNDLE + controllerwindow.cpp controllerwindow.h + main.cpp + previewwindow.cpp previewwindow.h +) +target_link_libraries(windowflags PUBLIC + Qt::Widgets +) + +install(TARGETS windowflags + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt index 88dc37ea5e7..f67a6515bde 100644 --- a/examples/widgets/windowcontainer/CMakeLists.txt +++ b/examples/widgets/windowcontainer/CMakeLists.txt @@ -1,18 +1,30 @@ # Generated from windowcontainer.pro. -##################################################################### -## windowcontainer Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(windowcontainer LANGUAGES CXX) -add_qt_executable(windowcontainer - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/windowcontainer" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/widgets/windowcontainer" - SOURCES - ../../gui/openglwindow/openglwindow.cpp ../../gui/openglwindow/openglwindow.h - windowcontainer.cpp - INCLUDE_DIRECTORIES - ../../gui/openglwindow - LIBRARIES - Qt::Widgets +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Widgets) + +add_executable(windowcontainer WIN32 MACOSX_BUNDLE + ../../gui/openglwindow/openglwindow.cpp ../../gui/openglwindow/openglwindow.h + windowcontainer.cpp +) +target_include_directories(windowcontainer PUBLIC + ../../gui/openglwindow +) +target_link_libraries(windowcontainer PUBLIC + Qt::Widgets +) + +install(TARGETS windowcontainer + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/CMakeLists.txt b/examples/xml/CMakeLists.txt new file mode 100644 index 00000000000..af7f096d19e --- /dev/null +++ b/examples/xml/CMakeLists.txt @@ -0,0 +1,14 @@ +# Generated from xml.pro. + +add_subdirectory(htmlinfo) +add_subdirectory(xmlstreamlint) + +if(TARGET Qt::Widgets) + add_subdirectory(dombookmarks) + add_subdirectory(saxbookmarks) + add_subdirectory(streambookmarks) + + if(TARGET Qt::Network) + add_subdirectory(rsslisting) + endif() +endif() diff --git a/examples/xml/dombookmarks/CMakeLists.txt b/examples/xml/dombookmarks/CMakeLists.txt new file mode 100644 index 00000000000..e7d5577b0e9 --- /dev/null +++ b/examples/xml/dombookmarks/CMakeLists.txt @@ -0,0 +1,29 @@ +# Generated from dombookmarks.pro. + +cmake_minimum_required(VERSION 3.14) +project(dombookmarks LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Xml) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(dombookmarks WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + xbeltree.cpp xbeltree.h +) +target_link_libraries(dombookmarks PUBLIC + Qt::Widgets + Qt::Xml +) +install(TARGETS dombookmarks + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/xml/htmlinfo/CMakeLists.txt b/examples/xml/htmlinfo/CMakeLists.txt new file mode 100644 index 00000000000..00ecced0c56 --- /dev/null +++ b/examples/xml/htmlinfo/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from htmlinfo.pro. + +cmake_minimum_required(VERSION 3.14) +project(htmlinfo LANGUAGES CXX) + +find_package(Qt5 COMPONENTS Core) # special case: add + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(htmlinfo + main.cpp +) +target_link_libraries(htmlinfo PUBLIC + Qt::Core +) +install(TARGETS htmlinfo + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/xml/rsslisting/CMakeLists.txt b/examples/xml/rsslisting/CMakeLists.txt new file mode 100644 index 00000000000..f8c3a67c7fb --- /dev/null +++ b/examples/xml/rsslisting/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from rsslisting.pro. + +cmake_minimum_required(VERSION 3.14) +project(rsslisting LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Network) +find_package(Qt5 COMPONENTS Xml) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(rsslisting WIN32 MACOSX_BUNDLE + main.cpp + rsslisting.cpp rsslisting.h +) +target_link_libraries(rsslisting PUBLIC + Qt::Network + Qt::Widgets + Qt::Xml +) +install(TARGETS rsslisting + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/xml/saxbookmarks/CMakeLists.txt b/examples/xml/saxbookmarks/CMakeLists.txt new file mode 100644 index 00000000000..8d003a95a53 --- /dev/null +++ b/examples/xml/saxbookmarks/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from saxbookmarks.pro. + +cmake_minimum_required(VERSION 3.14) +project(saxbookmarks LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Xml) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(saxbookmarks WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + xbelgenerator.cpp xbelgenerator.h + xbelhandler.cpp xbelhandler.h +) +target_link_libraries(saxbookmarks PUBLIC + Qt::Widgets + Qt::Xml +) +install(TARGETS saxbookmarks + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/xml/streambookmarks/CMakeLists.txt b/examples/xml/streambookmarks/CMakeLists.txt new file mode 100644 index 00000000000..442e46ffd1a --- /dev/null +++ b/examples/xml/streambookmarks/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from streambookmarks.pro. + +cmake_minimum_required(VERSION 3.14) +project(streambookmarks LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt5 COMPONENTS Xml) +find_package(Qt5 COMPONENTS Widgets) + +add_executable(streambookmarks WIN32 MACOSX_BUNDLE + main.cpp + mainwindow.cpp mainwindow.h + xbelreader.cpp xbelreader.h + xbelwriter.cpp xbelwriter.h +) +target_link_libraries(streambookmarks PUBLIC + Qt::Widgets + Qt::Xml +) +install(TARGETS streambookmarks + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/xml/xmlstreamlint/CMakeLists.txt b/examples/xml/xmlstreamlint/CMakeLists.txt new file mode 100644 index 00000000000..a3677a2c814 --- /dev/null +++ b/examples/xml/xmlstreamlint/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from xmlstreamlint.pro. + +cmake_minimum_required(VERSION 3.14) +project(xmlstreamlint LANGUAGES CXX) + +find_package(Qt5 COMPONENTS Core Xml) # special case: add + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +add_executable(xmlstreamlint + main.cpp +) +target_link_libraries(xmlstreamlint PUBLIC + Qt::Core + Qt::Xml # special case: add +) +install(TARGETS xmlstreamlint + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 3775fc64b9b..81d89ccd683 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -1,8 +1,3 @@ -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_MAJOR_VERSION @PROJECT_MAJOR_VERSION@) -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE -) # include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigExtrasMkspecDir.cmake\") # @@ -14,19 +9,27 @@ set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY # set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5_corelib_extra_includes}) # set(_qt5_corelib_extra_includes) -# On x86 and x86-64 systems with ELF binaries (especially Linux), due to -# a new optimization in GCC 5.x in combination with a recent version of -# GNU binutils, compiling Qt applications with -fPIE is no longer -# enough. -# Applications now need to be compiled with the -fPIC option if the Qt option -# \"reduce relocations\" is active. For backward compatibility only, Qt accepts -# the use of -fPIE for GCC 4.x versions. -if (CMAKE_CXX_COMPILER MATCHES "icc.*$" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "-fPIC") -endif() +if (NOT QT_NO_CREATE_TARGETS) + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_MAJOR_VERSION @PROJECT_MAJOR_VERSION@) + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY + COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE + ) -if (NOT "@QT_NAMESPACE@" STREQUAL "") - set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=@QT_NAMESPACE@) + # On x86 and x86-64 systems with ELF binaries (especially Linux), due to + # a new optimization in GCC 5.x in combination with a recent version of + # GNU binutils, compiling Qt applications with -fPIE is no longer + # enough. + # Applications now need to be compiled with the -fPIC option if the Qt option + # \"reduce relocations\" is active. For backward compatibility only, Qt accepts + # the use of -fPIE for GCC 4.x versions. + if (CMAKE_CXX_COMPILER MATCHES "icc.*$" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "-fPIC") + endif() + + if (NOT "@QT_NAMESPACE@" STREQUAL "") + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS QT_NAMESPACE=@QT_NAMESPACE@) + endif() + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype) endif() -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) -set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype) From 019dac8f9d1ca314f40dccf413d8f0cdb88a915b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2019 11:26:39 +0200 Subject: [PATCH 0622/1322] Set QT_DEPRECATED_WARNINGS_SINCE also for CMake This was added to the qmake build system in 220028d37c3 Change-Id: Ieee8b4d47b8f9716c14c85cf3038f1074ee8c46a Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 664d1765898..842333485cf 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -851,6 +851,7 @@ function(qt_internal_library_deprecation_level result) # On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API set("${result}" "QT_DISABLE_DEPRECATED_BEFORE=0x050000" PARENT_SCOPE) endif() + set("${result}" "QT_DEPRECATED_WARNINGS_SINCE=0x060000" PARENT_SCOPE) endfunction() From e5d66406928c9baa190cd2e57783849d8ad67fd5 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2019 11:50:55 +0200 Subject: [PATCH 0623/1322] Cmake: Disable warnings when building Qt plugins This mirrors what happens for qmake. qt_plugin.prf does not define these, but qt_module.prf does. Change-Id: I742d3c766f6f4bd129fa6ccf85b5a67c6758e819 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 842333485cf..acc36276bb5 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1452,12 +1452,7 @@ function(add_qt_plugin target) PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} DEFINES ${arg_DEFINES} - QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS - QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code - QT_USE_QSTRINGBUILDER QT_DEPRECATED_WARNINGS - QT_BUILDING_QT - QT_BUILD_${module_define}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" "${static_plugin_define}" QT_PLUGIN From 5fea9f8f52810dc50e45f7462a5df9d8ab0a1f37 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 4 Jun 2019 15:14:42 +0200 Subject: [PATCH 0624/1322] cmake: Add warnings_are_errors option for modules, plugins and tools only (i.e. no tests nor examples) this mimics the qmake behavior default value is developer_build Comes with some fixes in qmake since it seems in the qmake built it was not having Werror, now does because we built it with add_qt_tool Change-Id: I6f3237f25a6fedefa958644929e90f13837a12df Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 3 ++ cmake/QtBuild.cmake | 63 ++++++++++++++++++++++++++ qmake/generators/mac/pbuilder_pbx.cpp | 2 - qmake/generators/makefile.cpp | 1 + qmake/generators/projectgenerator.h | 2 +- qmake/generators/win32/winmakefile.cpp | 2 +- src/gui/CMakeLists.txt | 7 +++ 7 files changed, 76 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8344d22c0de..6be7a6edcbb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,9 @@ include(QtBaseGlobalTargets) option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON) set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) +## Should this Qt be built with Werror? +option(WARNINGS_ARE_ERRORS "Build Qt with warnings as errors" ${FEATURE_developer_build}) + ## Decide whether tools will be built. qt_check_if_tools_will_be_built() diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index acc36276bb5..08b04e42ea1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1002,6 +1002,60 @@ function(qt_internal_set_no_exceptions_flags target) endif() endfunction() +function(qt_internal_set_warnings_are_errors_flags target) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Regular clang 3.0+ + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "3.0.0") + target_compile_options("${target}" PRIVATE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + # using AppleClang + # Apple clang 4.0+ + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0") + target_compile_options("${target}" PRIVATE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC + target_compile_options("${target}" PRIVATE -Werror -Wno-error=cpp -Wno-error=deprecated-declarations) + + # GCC prints this bogus warning, after it has inlined a lot of code + # error: assuming signed overflow does not occur when assuming that (X + c) < X is always false + target_compile_options("${target}" PRIVATE -Wno-error=strict-overflow) + + # GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs. + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0") + target_compile_options("${target}" PRIVATE -Wno-error=implicit-fallthrough) + endif() + + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0.0") + # GCC 9 introduced these but we are not clean for it. + target_compile_options("${target}" PRIVATE -Wno-error=deprecated-copy -Wno-error=redundant-move -Wno-error=init-list-lifetime) + endif() + + # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135 + if (ANDROID) + target_compile_options("${target}" PRIVATE -Wno-error=literal-suffix) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + # Intel CC 13.0 +, on Linux only + if (LINUX) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0.0") + # 177: function "entity" was declared but never referenced + # (too aggressive; ICC reports even for functions created due to template instantiation) + # 1224: #warning directive + # 1478: function "entity" (declared at line N) was declared deprecated + # 1786: function "entity" (declared at line N of "file") was declared deprecated ("message") + # 1881: argument must be a constant null pointer value + # (NULL in C++ is usually a literal 0) + target_compile_options("${target}" PRIVATE -Werror -ww177,1224,1478,1786,1881) + endif() + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # using Visual Studio C++ + target_compile_options("${target}" PRIVATE /WX) + endif() +endfunction() + # This is the main entry function for creating a Qt module, that typically # consists of a library, public header files, private header files and configurable # features. @@ -1146,6 +1200,9 @@ function(add_qt_module target) if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${target}") endif() + if(WARNINGS_ARE_ERRORS) + qt_internal_set_warnings_are_errors_flags("${target}") + endif() set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") @@ -1478,6 +1535,9 @@ function(add_qt_plugin target) if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${target}") endif() + if(WARNINGS_ARE_ERRORS) + qt_internal_set_warnings_are_errors_flags("${target}") + endif() set(qt_libs_private "") @@ -1777,6 +1837,9 @@ function(add_qt_tool name) DISABLE_AUTOGEN_TOOLS ${disable_autogen_tools} ) qt_internal_add_target_aliases("${name}") + if(WARNINGS_ARE_ERRORS) + qt_internal_set_warnings_are_errors_flags("${name}") + endif() if(NOT arg_NO_INSTALL AND arg_TOOLS_TARGET) # Assign a tool to an export set, and mark the module to which the tool belongs. diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index b3c6ba4869e..59a4008a3b6 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -513,7 +513,6 @@ bool ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) { ProStringList tmp; - bool did_preprocess = false; //HEADER const int pbVersion = pbuilderVersion(); @@ -731,7 +730,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QFile mkf(mkfile); if(mkf.open(QIODevice::WriteOnly | QIODevice::Text)) { writingUnixMakefileGenerator = true; - did_preprocess = true; debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData()); QTextStream mkt(&mkf); writeHeader(mkt); diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index f3ca192ab22..411bb374371 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -895,6 +895,7 @@ bool MakefileGenerator::processPrlFileBase(QString &origFile, const QStringRef &origName, const QStringRef &fixedBase, int slashOff) { + Q_UNUSED(slashOff) return processPrlFileCore(origFile, origName, fixedBase + Option::prl_ext); } diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h index e9b050cc748..ef6a76f0d05 100644 --- a/qmake/generators/projectgenerator.h +++ b/qmake/generators/projectgenerator.h @@ -43,7 +43,7 @@ protected: void init() override; bool writeMakefile(QTextStream &) override; - QString escapeFilePath(const QString &path) const override { Q_ASSERT(false); return QString(); } + QString escapeFilePath(const QString &path) const override { Q_UNUSED(path); Q_ASSERT(false); return QString(); } public: bool supportsMetaBuild() override { return false; } diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 8e0c62e13f3..b79fd8f250d 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -645,7 +645,7 @@ void Win32MakefileGenerator::writeObjectsPart(QTextStream &t) t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl; } -void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &t) +void Win32MakefileGenerator::writeImplicitRulesPart(QTextStream &) { } diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b662f8e092e..fe37e4daa51 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -36,6 +36,13 @@ if (QT_FEATURE_gui) set(QT_QPA_DEFAULT_PLATFORM "${_default_platform}" CACHE STRING "QPA default platform") endif() + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set_source_files_properties(../3rdparty/md4c/md4c.c PROPERTIES COMPILE_FLAGS "-Wno-error=unused-parameter -Wno-error=sign-compare -Wno-error=missing-field-initializers") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set_source_files_properties(../3rdparty/md4c/md4c.c PROPERTIES COMPILE_FLAGS "-Wno-error=unused-parameter -Wno-error=sign-compare -Wno-error=missing-field-initializers -Wno-error=missing-braces") +endif() + # special case end add_qt_module(Gui From 81fee7732d1096e3456de8b49cea592544f8ec85 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 15:15:32 +0200 Subject: [PATCH 0625/1322] Add AppleClang as exception for warnings as errors for md4c library Change-Id: Ia7dd9bfb622b80b18fa7323de5188dc50e4fca78 Reviewed-by: Simon Hausmann --- src/gui/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index fe37e4daa51..745e4b45f77 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -39,7 +39,7 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set_source_files_properties(../3rdparty/md4c/md4c.c PROPERTIES COMPILE_FLAGS "-Wno-error=unused-parameter -Wno-error=sign-compare -Wno-error=missing-field-initializers") -elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") set_source_files_properties(../3rdparty/md4c/md4c.c PROPERTIES COMPILE_FLAGS "-Wno-error=unused-parameter -Wno-error=sign-compare -Wno-error=missing-field-initializers -Wno-error=missing-braces") endif() From 4e62517b9e72e7cb84e166134f90e06a83fdcf32 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2019 14:49:09 +0200 Subject: [PATCH 0626/1322] CMake: Disable autotests for non-developer builds Mimic the behavior in the qmake build system, and by default build tests for developer-build, and not build it for a normal build. To do this, we define BUILD_TESTING with the right default before including CTest, which does otherwise define the option itself. Change-Id: Ifa1b1156477919abc1e916ccd9e1e0a74e969ee6 Reviewed-by: Alexandru Croitor --- cmake/QtSetup.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 769e17dfb85..e7ec66b322e 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -41,6 +41,7 @@ if(FEATURE_developer_build) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) endif() set(QT_WILL_INSTALL OFF) + set(QT_BUILD_TESTING ON) # Handle non-prefix builds by setting the cmake install prefix to the project binary dir. if(PROJECT_NAME STREQUAL "QtBase") set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR} CACHE PATH @@ -51,9 +52,11 @@ if(FEATURE_developer_build) endif() else() set(QT_WILL_INSTALL ON) + set(QT_BUILD_TESTING OFF) endif() -## Enable testing: +## Set up testing +option(BUILD_TESTING "Build the testing tree." ${QT_BUILD_TESTING}) include(CTest) enable_testing() From 6e0f48a99390a0e0573f697e4a0bbb0c86376e62 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Jun 2019 15:19:08 +0200 Subject: [PATCH 0627/1322] CMake: Also bump to CMake 3.15 in README Amends fecd9d90daa Change-Id: I5373844515c83d218f840b3277ac2c49f318620e Reviewed-by: Alexandru Croitor --- cmake/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/README.md b/cmake/README.md index 610f7eea27c..fc73defaa14 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -4,7 +4,7 @@ Initial port is on-going. Some modules of QtBase are ported, incl. some of the p Basic functionality is there (moc, uic, etc.), but documentation, translations, etc. are missing. -NOTE: YOU NEED CMAKE 3.14 or later. +NOTE: YOU NEED CMAKE 3.15 or later. # Intro From 016351d267d60d737cc472dad51e96797a10f692 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 5 Jun 2019 15:23:05 +0200 Subject: [PATCH 0628/1322] Fix typo: PROJECT_MAJOR_VERSION does not exist Change-Id: I0e0783d615aa2f875f4dbe492e67f1e4366b7371 Reviewed-by: Volker Krause --- src/corelib/Qt5CoreConfigExtras.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 81d89ccd683..5fe0fd5252a 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -10,7 +10,7 @@ # set(_qt5_corelib_extra_includes) if (NOT QT_NO_CREATE_TARGETS) - set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_MAJOR_VERSION @PROJECT_MAJOR_VERSION@) + set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_MAJOR_VERSION @PROJECT_VERSION_MAJOR@) set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE From 9298033ed6e6e67cce89243f44b7ce77018d0e62 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 5 Jun 2019 15:20:21 +0200 Subject: [PATCH 0629/1322] CMake: Add WinMain support Change-Id: I85c56555bc47dcf348daeb3435c621529aa2d381 Fixes: QTBUG-75195 Reviewed-by: Cristian Adam Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 6 ---- src/CMakeLists.txt | 2 ++ src/winmain/.prev_CMakeLists.txt | 48 ++++++++++++++++++++++++++++++++ src/winmain/CMakeLists.txt | 28 +++++++++++++++++++ 4 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 src/winmain/.prev_CMakeLists.txt create mode 100644 src/winmain/CMakeLists.txt diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 08b04e42ea1..854a5f3a45a 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1657,12 +1657,6 @@ function(add_qt_executable name) endif() - if(WIN32) - # Workaround for not having ported the winmain / qtmain static library - # which is always linked in by qmake. - set_target_properties("${name}" PROPERTIES WIN32_EXECUTABLE 0) - endif() - if(NOT arg_NO_INSTALL) qt_install(TARGETS "${name}" RUNTIME DESTINATION "${arg_INSTALL_DIRECTORY}" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1bc66bee9d2..3a3e358c730 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -54,3 +54,5 @@ if(QT_FEATURE_gui AND QT_FEATURE_widgets) add_subdirectory(printsupport) endif() add_subdirectory(plugins) + +add_subdirectory(winmain) diff --git a/src/winmain/.prev_CMakeLists.txt b/src/winmain/.prev_CMakeLists.txt new file mode 100644 index 00000000000..a6077dd467c --- /dev/null +++ b/src/winmain/.prev_CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from winmain.pro. + +##################################################################### +## qtLibraryTarget$$TARGET$$QT_LIBINFIX Module: +##################################################################### + +add_qt_module(qtLibraryTarget$$TARGET$$QT_LIBINFIX + STATIC + DEFINES + QT_NO_FOREACH + PUBLIC_LIBRARIES + Qt::Core +) + +#### Keys ignored in scope 1:.:.:winmain.pro:: +# CONFIG = "static" +# DESTDIR = "$$QT.core.libs" +# TEMPLATE = "lib" +# _LOADED = "qt_installs" "qt_targets" "qt_build_paths" "qt_common" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 3:.:.:winmain.pro:QT_FEATURE_debug_and_release: +# CONFIG = "build_all" + +#### Keys ignored in scope 4:.:.:winmain.pro:MSVC: +# QMAKE_CFLAGS_DEBUG = "--Zi" "-Z7" + +extend_target(qtLibraryTarget$$TARGET$$QT_LIBINFIX CONDITION mingw + DEFINES + QT_NEEDS_QMAIN +) + +extend_target(qtLibraryTarget$$TARGET$$QT_LIBINFIX CONDITION WINRT + SOURCES + qtmain_winrt.cpp +) + +extend_target(qtLibraryTarget$$TARGET$$QT_LIBINFIX CONDITION NOT WINRT + SOURCES + qtmain_win.cpp + LIBRARIES + shell32 +) + +#### Keys ignored in scope 10:.:.:winmain.pro:else: +# CONFIG = "-qt" diff --git a/src/winmain/CMakeLists.txt b/src/winmain/CMakeLists.txt new file mode 100644 index 00000000000..10c3252f432 --- /dev/null +++ b/src/winmain/CMakeLists.txt @@ -0,0 +1,28 @@ +# special case begin +if (NOT WIN32) + return() +endif() + +add_qt_module(WinMain + STATIC + NO_MODULE_HEADERS + DEFINES + QT_NO_FOREACH + INCLUDE_DIRECTORIES + $ +) + +extend_target(WinMain CONDITION WINRT + SOURCES qtmain_winrt.cpp +) + +extend_target(WinMain CONDITION NOT WINRT + SOURCES qtmain_win.cpp +) + +extend_target(WinMain CONDITION MINGW + DEFINES QT_NEEDS_QMAIN +) + +extend_target(Core LIBRARIES WinMain) +# special case end From bc9409d85748c7167a9e8e7eec82fa6c9420ea3d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 5 Jun 2019 13:48:02 +0200 Subject: [PATCH 0630/1322] Re-generate the CMakeLists.txt and add the prev files Change-Id: I93ea196bdd5807bccebf81e72332966288a35a4f Reviewed-by: Alexandru Croitor --- .../eglconvenience/.prev_CMakeLists.txt | 53 ++++ .../eventdispatchers/.prev_CMakeLists.txt | 45 +++ .../input/.prev_CMakeLists.txt | 142 ++++++++++ .../input/xkbcommon/CMakeLists.txt | 2 +- .../kmsconvenience/.prev_CMakeLists.txt | 25 ++ .../linuxaccessibility/.prev_CMakeLists.txt | 45 +++ .../platforms/eglfs/.prev_CMakeLists.txt | 144 ++++++++++ src/plugins/platforms/eglfs/CMakeLists.txt | 17 +- .../eglfs_emu/CMakeLists.txt | 20 +- .../eglfs_kms/CMakeLists.txt | 29 +- .../eglfs_kms_egldevice/CMakeLists.txt | 26 +- .../eglfs_kms_support/CMakeLists.txt | 20 +- .../eglfs_x11/CMakeLists.txt | 25 +- src/plugins/platforms/linuxfb/CMakeLists.txt | 34 ++- src/plugins/platforms/minimal/CMakeLists.txt | 13 +- .../platforms/minimalegl/CMakeLists.txt | 29 +- .../platforms/offscreen/CMakeLists.txt | 4 +- src/plugins/platforms/vnc/CMakeLists.txt | 35 ++- .../platforms/windows/.prev_CMakeLists.txt | 4 +- src/plugins/platforms/windows/CMakeLists.txt | 4 +- .../platforms/xcb/.prev_CMakeLists.txt | 263 ++++++++++++++++++ src/plugins/platforms/xcb/CMakeLists.txt | 12 +- .../gl_integrations/xcb_egl/CMakeLists.txt | 4 +- .../gl_integrations/xcb_glx/CMakeLists.txt | 6 +- 24 files changed, 908 insertions(+), 93 deletions(-) create mode 100644 src/platformsupport/eglconvenience/.prev_CMakeLists.txt create mode 100644 src/platformsupport/eventdispatchers/.prev_CMakeLists.txt create mode 100644 src/platformsupport/input/.prev_CMakeLists.txt create mode 100644 src/platformsupport/kmsconvenience/.prev_CMakeLists.txt create mode 100644 src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt create mode 100644 src/plugins/platforms/eglfs/.prev_CMakeLists.txt create mode 100644 src/plugins/platforms/xcb/.prev_CMakeLists.txt diff --git a/src/platformsupport/eglconvenience/.prev_CMakeLists.txt b/src/platformsupport/eglconvenience/.prev_CMakeLists.txt new file mode 100644 index 00000000000..48648f39003 --- /dev/null +++ b/src/platformsupport/eglconvenience/.prev_CMakeLists.txt @@ -0,0 +1,53 @@ +# Generated from eglconvenience.pro. + +##################################################################### +## EglSupport Module: +##################################################################### + +add_qt_module(EglSupport + STATIC + SOURCES + qeglconvenience.cpp qeglconvenience_p.h + qeglstreamconvenience.cpp qeglstreamconvenience_p.h + qt_egl_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:eglconvenience.pro:: +# CONFIG = "static" "internal_module" "egl" +# MODULE = "egl_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(EglSupport CONDITION QT_FEATURE_opengl + SOURCES + qeglpbuffer.cpp qeglpbuffer_p.h + qeglplatformcontext.cpp qeglplatformcontext_p.h +) + +extend_target(EglSupport CONDITION QT_FEATURE_egl_x11 + SOURCES + qxlibeglintegration.cpp qxlibeglintegration_p.h + LIBRARIES + X11::XCB +) + +extend_target(EglSupport CONDITION NOT QT_FEATURE_egl_x11 + DEFINES + QT_EGL_NO_X11 +) + +extend_target(EglSupport CONDITION QT_FEATURE_dlopen + PUBLIC_LIBRARIES + ${CMAKE_DL_LIBS} +) diff --git a/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt b/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt new file mode 100644 index 00000000000..3e2215da819 --- /dev/null +++ b/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from eventdispatchers.pro. + +##################################################################### +## EventDispatcherSupport Module: +##################################################################### + +add_qt_module(EventDispatcherSupport + STATIC + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:eventdispatchers.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "eventdispatcher_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(EventDispatcherSupport CONDITION UNIX + SOURCES + qgenericunixeventdispatcher.cpp qgenericunixeventdispatcher_p.h + qunixeventdispatcher.cpp + qunixeventdispatcher_qpa_p.h +) + +extend_target(EventDispatcherSupport CONDITION WIN32 + SOURCES + qwindowsguieventdispatcher.cpp qwindowsguieventdispatcher_p.h +) + +extend_target(EventDispatcherSupport CONDITION QT_FEATURE_glib + SOURCES + qeventdispatcher_glib.cpp qeventdispatcher_glib_p.h + LIBRARIES + GLIB2::GLIB2 +) diff --git a/src/platformsupport/input/.prev_CMakeLists.txt b/src/platformsupport/input/.prev_CMakeLists.txt new file mode 100644 index 00000000000..df330e7c8a5 --- /dev/null +++ b/src/platformsupport/input/.prev_CMakeLists.txt @@ -0,0 +1,142 @@ +# Generated from input.pro. + +##################################################################### +## InputSupport Module: +##################################################################### + +add_qt_module(InputSupport + STATIC + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::DeviceDiscoverySupportPrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::DeviceDiscoverySupport + Qt::Gui +) + +#### Keys ignored in scope 3:.:.:input-support.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "input_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(InputSupport CONDITION QT_FEATURE_evdev + SOURCES + evdevkeyboard/qevdevkeyboard_defaultmap_p.h + evdevkeyboard/qevdevkeyboardhandler.cpp evdevkeyboard/qevdevkeyboardhandler_p.h + evdevkeyboard/qevdevkeyboardmanager.cpp evdevkeyboard/qevdevkeyboardmanager_p.h + evdevmouse/qevdevmousehandler.cpp evdevmouse/qevdevmousehandler_p.h + evdevmouse/qevdevmousemanager.cpp evdevmouse/qevdevmousemanager_p.h + evdevtouch/qevdevtouchhandler.cpp evdevtouch/qevdevtouchhandler_p.h + evdevtouch/qevdevtouchmanager.cpp evdevtouch/qevdevtouchmanager_p.h + INCLUDE_DIRECTORIES + evdevtouch/../shared +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_tabletevent + SOURCES + evdevtablet/qevdevtablethandler.cpp evdevtablet/qevdevtablethandler_p.h + evdevtablet/qevdevtabletmanager.cpp evdevtablet/qevdevtabletmanager_p.h +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_libudev AND QT_FEATURE_tabletevent + LIBRARIES + PkgConfig::Libudev +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_libudev + LIBRARIES + PkgConfig::Libudev +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev AND QT_FEATURE_mtdev + LIBRARIES + PkgConfig::Mtdev +) + +extend_target(InputSupport CONDITION QT_FEATURE_tslib + SOURCES + tslib/qtslib.cpp tslib/qtslib_p.h + PUBLIC_LIBRARIES + PkgConfig::Tslib +) + +extend_target(InputSupport CONDITION QT_FEATURE_libinput + SOURCES + libinput/qlibinputhandler.cpp libinput/qlibinputhandler_p.h + libinput/qlibinputkeyboard.cpp libinput/qlibinputkeyboard_p.h + libinput/qlibinputpointer.cpp libinput/qlibinputpointer_p.h + libinput/qlibinputtouch.cpp libinput/qlibinputtouch_p.h + INCLUDE_DIRECTORIES + libinput/../shared + LIBRARIES + Libinput::Libinput + PkgConfig::Libudev +) + +extend_target(InputSupport CONDITION QT_FEATURE_libinput AND QT_FEATURE_xkbcommon + LIBRARIES + Qt::XkbCommonSupportPrivate + XKB::XKB + PUBLIC_LIBRARIES + Qt::XkbCommonSupport +) + +extend_target(InputSupport CONDITION QT_FEATURE_evdev OR QT_FEATURE_libinput + SOURCES + shared/qtouchoutputmapping.cpp shared/qtouchoutputmapping_p.h +) + +extend_target(InputSupport CONDITION QT_FEATURE_integrityhid + SOURCES + integrityhid/qintegrityhidmanager.cpp integrityhid/qintegrityhidmanager.h + LIBRARIES + integrityhid +) + +if(QT_FEATURE_xkbcommon) + add_subdirectory(xkbcommon) +endif() + + if(QT_FEATURE_evdev) + + if(QT_FEATURE_tabletevent) + + if(QT_FEATURE_libudev) + endif() + endif() + + if(QT_FEATURE_libudev) + endif() + + if(QT_FEATURE_libudev) + endif() + + if(QT_FEATURE_libudev) + endif() + + if(QT_FEATURE_mtdev) + endif() + endif() + + if(QT_FEATURE_tslib) + endif() + + if(QT_FEATURE_libinput) + + if(QT_FEATURE_xkbcommon) + endif() + endif() + + if(QT_FEATURE_evdev OR QT_FEATURE_libinput) + endif() + + if(QT_FEATURE_integrityhid) + endif() diff --git a/src/platformsupport/input/xkbcommon/CMakeLists.txt b/src/platformsupport/input/xkbcommon/CMakeLists.txt index 2797966fc43..5f4eca9fc84 100644 --- a/src/platformsupport/input/xkbcommon/CMakeLists.txt +++ b/src/platformsupport/input/xkbcommon/CMakeLists.txt @@ -31,5 +31,5 @@ add_qt_module(XkbCommonSupport extend_target(XkbCommonSupport CONDITION CLANG AND NOT ICC COMPILE_OPTIONS - "-ftemplate-depth=1024" + -ftemplate-depth=1024 ) diff --git a/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt b/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt new file mode 100644 index 00000000000..a6e206d5cd9 --- /dev/null +++ b/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from kmsconvenience.pro. + +##################################################################### +## KmsSupport Module: +##################################################################### + +add_qt_module(KmsSupport + STATIC + SOURCES + qkmsdevice.cpp qkmsdevice_p.h + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Libdrm::Libdrm + Qt::Core + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:kmsconvenience.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "kms_support" +# _LOADED = "qt_module" diff --git a/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt b/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt new file mode 100644 index 00000000000..f18b0597ce1 --- /dev/null +++ b/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt @@ -0,0 +1,45 @@ +# Generated from linuxaccessibility.pro. + +##################################################################### +## LinuxAccessibilitySupport Module: +##################################################################### + +add_qt_module(LinuxAccessibilitySupport + STATIC + SOURCES + application.cpp application_p.h + atspiadaptor.cpp atspiadaptor_p.h + bridge.cpp bridge_p.h + cache.cpp cache_p.h + constant_mappings.cpp constant_mappings_p.h + dbusconnection.cpp dbusconnection_p.h + struct_marshallers.cpp struct_marshallers_p.h + DBUS_ADAPTOR_SOURCES + dbusxml/Cache.xml + dbusxml/DeviceEventController.xml + DBUS_ADAPTOR_FLAGS + "-i" "struct_marshallers_p.h" + DBUS_INTERFACE_SOURCES + dbusxml/Bus.xml + dbusxml/Socket.xml + DBUS_INTERFACE_FLAGS + "-i" "struct_marshallers_p.h" + DEFINES + QT_NO_CAST_FROM_ASCII + LIBRARIES + Qt::AccessibilitySupportPrivate + Qt::CorePrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + PkgConfig::ATSPI2_nolink + Qt::AccessibilitySupport + Qt::Core + Qt::DBus + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:linuxaccessibility.pro:: +# CONFIG = "static" "internal_module" +# MODULE = "linuxaccessibility_support" +# PRECOMPILED_HEADER = "../../corelib/global/qt_pch.h" +# _LOADED = "qt_module" diff --git a/src/plugins/platforms/eglfs/.prev_CMakeLists.txt b/src/plugins/platforms/eglfs/.prev_CMakeLists.txt new file mode 100644 index 00000000000..4af52dd0fee --- /dev/null +++ b/src/plugins/platforms/eglfs/.prev_CMakeLists.txt @@ -0,0 +1,144 @@ +# Generated from eglfs.pro. + +##################################################################### +## EglFSDeviceIntegration Module: +##################################################################### + +add_qt_module(EglFSDeviceIntegration + SOURCES + api/qeglfsdeviceintegration.cpp api/qeglfsdeviceintegration_p.h + api/qeglfsglobal_p.h + api/qeglfshooks.cpp api/qeglfshooks_p.h + api/qeglfsintegration.cpp api/qeglfsintegration_p.h + api/qeglfsoffscreenwindow.cpp api/qeglfsoffscreenwindow_p.h + api/qeglfsscreen.cpp api/qeglfsscreen_p.h + api/qeglfswindow.cpp api/qeglfswindow_p.h + DEFINES + QT_BUILD_EGL_DEVICE_LIB + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + api + LIBRARIES + Qt::CorePrivate + Qt::DeviceDiscoverySupportPrivate + Qt::EglSupportPrivate + Qt::EventDispatcherSupportPrivate + Qt::FbSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::GuiPrivate + Qt::ServiceSupportPrivate + Qt::ThemeSupportPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::DeviceDiscoverySupport + Qt::EglSupport + Qt::EventDispatcherSupport + Qt::FbSupport + Qt::FontDatabaseSupport + Qt::Gui + Qt::ServiceSupport + Qt::ThemeSupport +) + +#### Keys ignored in scope 2:.:.:eglfsdeviceintegration.pro:: +# CONFIG = "internal_module" "egl" +# MODULE = "eglfsdeviceintegration" +# _LOADED = "qt_module" + +## Scopes: +##################################################################### + +extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::InputSupportPrivate + LIBRARIES + Qt::InputSupportPrivate + PUBLIC_LIBRARIES + Qt::InputSupport +) + +extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::PlatformCompositorSupportPrivate + LIBRARIES + Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupport +) + +extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_PLATFORM_HOOKS_SOURCES_ISEMPTY + DEFINES + EGLFS_PLATFORM_HOOKS +) + +extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_DEVICE_INTEGRATION_ISEMPTY + DEFINES + EGLFS_PREFERRED_PLUGIN= +) + +#### Keys ignored in scope 7:.:.:eglfsdeviceintegration.pro:use_gold_linker: +# CONFIG = "no_linker_version_script" + +# Resources: +add_qt_resource(EglFSDeviceIntegration "cursor" FILES + cursor-atlas.png + cursor.json) + + +extend_target(EglFSDeviceIntegration CONDITION QT_FEATURE_opengl + SOURCES + api/qeglfscontext.cpp api/qeglfscontext_p.h + api/qeglfscursor.cpp api/qeglfscursor_p.h +) +##################################################################### +## qeglfs Plugin: +##################################################################### + +add_qt_plugin(qeglfs + TYPE platforms + CLASS_NAME QEglFSIntegrationPlugin + SOURCES + qeglfsmain.cpp + DEFINES + QT_EGL_NO_X11 + INCLUDE_DIRECTORIES + api + LIBRARIES + Qt::EglFSDeviceIntegrationPrivate + PUBLIC_LIBRARIES + Qt::EglFSDeviceIntegration +) + +#### Keys ignored in scope 11:.:.:eglfs-plugin.pro:: +# CONFIG = "egl" +# OTHER_FILES = "$$PWD/eglfs.json" +# PLUGIN_CLASS_NAME = "QEglFSIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 12:.:.:eglfs-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" +add_subdirectory(deviceintegration) + + if(TARGET Qt::InputSupportPrivate) + endif() + + if(TARGET Qt::PlatformCompositorSupportPrivate) + endif() + + if(NOT EGLFS_PLATFORM_HOOKS_SOURCES_ISEMPTY) + endif() + + if(NOT EGLFS_DEVICE_INTEGRATION_ISEMPTY) + endif() + + if(use_gold_linker) + endif() + + if(NOT DEFINES___contains___QT_NO_CURSOR) + endif() + + if(QT_FEATURE_opengl) + endif() + + if(NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN) + endif() diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index 932d07dec21..47b5f3cf64b 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -1,3 +1,4 @@ +# Generated from eglfs.pro. qt_find_package(EGL) # special case ##################################################################### @@ -14,8 +15,8 @@ add_qt_module(EglFSDeviceIntegration api/qeglfsscreen.cpp api/qeglfsscreen_p.h api/qeglfswindow.cpp api/qeglfswindow_p.h DEFINES - QT_EGL_NO_X11 QT_BUILD_EGL_DEVICE_LIB + QT_EGL_NO_X11 INCLUDE_DIRECTORIES api LIBRARIES @@ -31,7 +32,7 @@ add_qt_module(EglFSDeviceIntegration EGL::EGL # special case ) -#### Keys ignored in scope 2:.:./eglfsdeviceintegration.pro:: +#### Keys ignored in scope 2:.:.:eglfsdeviceintegration.pro:: # CONFIG = "internal_module" "egl" # MODULE = "eglfsdeviceintegration" # _LOADED = "qt_module" @@ -42,18 +43,22 @@ add_qt_module(EglFSDeviceIntegration extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::InputSupportPrivate LIBRARIES Qt::InputSupportPrivate + PUBLIC_LIBRARIES + Qt::InputSupport ) extend_target(EglFSDeviceIntegration CONDITION TARGET Qt::PlatformCompositorSupportPrivate LIBRARIES Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES + Qt::PlatformCompositorSupport ) # special case: # extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_PLATFORM_HOOKS_SOURCES_ISEMPTY ... # extend_target(EglFSDeviceIntegration CONDITION NOT EGLFS_DEVICE_INTEGRATION_ISEMPTY ... -#### Keys ignored in scope 7:.:./eglfsdeviceintegration.pro:use_gold_linker: +#### Keys ignored in scope 7:.:.:eglfsdeviceintegration.pro:use_gold_linker: # CONFIG = "no_linker_version_script" # Resources: @@ -73,6 +78,7 @@ extend_target(EglFSDeviceIntegration CONDITION QT_FEATURE_opengl add_qt_plugin(qeglfs TYPE platforms + CLASS_NAME QEglFSIntegrationPlugin SOURCES qeglfsmain.cpp DEFINES @@ -85,16 +91,17 @@ add_qt_plugin(qeglfs EGL::EGL # special case ) -#### Keys ignored in scope 11:.:./eglfs-plugin.pro:: +#### Keys ignored in scope 11:.:.:eglfs-plugin.pro:: # CONFIG = "egl" # OTHER_FILES = "$$PWD/eglfs.json" # PLUGIN_CLASS_NAME = "QEglFSIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: ##################################################################### -#### Keys ignored in scope 12:.:./eglfs-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 12:.:.:eglfs-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" add_subdirectory(deviceintegration) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt index 64dd4d8548f..a9ab601dade 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qeglfs-emu-integration TYPE egldeviceintegrations + CLASS_NAME QEglFSEmulatorIntegrationPlugin SOURCES qeglfsemulatorintegration.cpp qeglfsemulatorintegration.h qeglfsemulatorscreen.cpp qeglfsemulatorscreen.h @@ -16,11 +17,18 @@ add_qt_plugin(qeglfs-emu-integration ../../api LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::EglFSDeviceIntegrationPrivate - # CONFIG = "egl" - # DISTFILES = "eglfs_emu.json" - # OTHER_FILES = "$$PWD/eglfs_emu.json" - # PLUGIN_CLASS_NAME = "QEglFSEmulatorIntegrationPlugin" - # _LOADED = "qt_plugin" + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::EglFSDeviceIntegration + Qt::Gui ) + +#### Keys ignored in scope 1:.:.:eglfs_emu.pro:: +# CONFIG = "egl" +# DISTFILES = "eglfs_emu.json" +# OTHER_FILES = "$$PWD/eglfs_emu.json" +# PLUGIN_CLASS_NAME = "QEglFSEmulatorIntegrationPlugin" +# PLUGIN_TYPE = "egldeviceintegrations" +# _LOADED = "qt_plugin" diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt index 214b13be2e9..579220dd471 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/CMakeLists.txt @@ -1,14 +1,12 @@ # Generated from eglfs_kms.pro. -qt_find_package(gbm) -qt_find_package(Libdrm) - ##################################################################### ## qeglfs-kms-integration Plugin: ##################################################################### add_qt_plugin(qeglfs-kms-integration TYPE egldeviceintegrations + CLASS_NAME QEglFSKmsGbmIntegrationPlugin SOURCES qeglfskmsgbmcursor.cpp qeglfskmsgbmcursor.h qeglfskmsgbmdevice.cpp qeglfskmsgbmdevice.h @@ -23,16 +21,25 @@ add_qt_plugin(qeglfs-kms-integration ../eglfs_kms_support LIBRARIES Qt::CorePrivate - Qt::GuiPrivate + Qt::EdidSupportPrivate Qt::EglFSDeviceIntegrationPrivate Qt::EglFsKmsSupportPrivate + Qt::GuiPrivate Qt::KmsSupportPrivate - Qt::EdidSupportPrivate - Qt::PlatformCompositorSupportPrivate - gbm::gbm + PUBLIC_LIBRARIES Libdrm::Libdrm - # CONFIG = "egl" - # OTHER_FILES = "$$PWD/eglfs_kms.json" - # PLUGIN_CLASS_NAME = "QEglFSKmsGbmIntegrationPlugin" - # _LOADED = "qt_plugin" + Qt::Core + Qt::EdidSupport + Qt::EglFSDeviceIntegration + Qt::EglFsKmsSupport + Qt::Gui + Qt::KmsSupport + gbm::gbm ) + +#### Keys ignored in scope 1:.:.:eglfs_kms.pro:: +# CONFIG = "egl" +# OTHER_FILES = "$$PWD/eglfs_kms.json" +# PLUGIN_CLASS_NAME = "QEglFSKmsGbmIntegrationPlugin" +# PLUGIN_TYPE = "egldeviceintegrations" +# _LOADED = "qt_plugin" diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt index 526c75a882f..cdaca72ac4c 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/CMakeLists.txt @@ -1,13 +1,12 @@ # Generated from eglfs_kms_egldevice.pro. -qt_find_package(Libdrm) - ##################################################################### ## qeglfs-kms-egldevice-integration Plugin: ##################################################################### add_qt_plugin(qeglfs-kms-egldevice-integration TYPE egldeviceintegrations + CLASS_NAME QEglFSKmsEglDeviceIntegrationPlugin SOURCES qeglfskmsegldevice.cpp qeglfskmsegldevice.h qeglfskmsegldeviceintegration.cpp qeglfskmsegldeviceintegration.h @@ -20,15 +19,24 @@ add_qt_plugin(qeglfs-kms-egldevice-integration ../eglfs_kms_support LIBRARIES Qt::CorePrivate - Qt::GuiPrivate + Qt::EdidSupportPrivate Qt::EglFSDeviceIntegrationPrivate Qt::EglFsKmsSupportPrivate + Qt::GuiPrivate Qt::KmsSupportPrivate - Qt::EdidSupportPrivate - Qt::PlatformCompositorSupportPrivate + PUBLIC_LIBRARIES Libdrm::Libdrm - # CONFIG = "egl" - # OTHER_FILES = "$$PWD/eglfs_kms_egldevice.json" - # PLUGIN_CLASS_NAME = "QEglFSKmsEglDeviceIntegrationPlugin" - # _LOADED = "qt_plugin" + Qt::Core + Qt::EdidSupport + Qt::EglFSDeviceIntegration + Qt::EglFsKmsSupport + Qt::Gui + Qt::KmsSupport ) + +#### Keys ignored in scope 1:.:.:eglfs_kms_egldevice.pro:: +# CONFIG = "egl" +# OTHER_FILES = "$$PWD/eglfs_kms_egldevice.json" +# PLUGIN_CLASS_NAME = "QEglFSKmsEglDeviceIntegrationPlugin" +# PLUGIN_TYPE = "egldeviceintegrations" +# _LOADED = "qt_plugin" diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt index 96cabe9f1e0..fd7ba3cefb6 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt @@ -1,7 +1,5 @@ # Generated from eglfs_kms_support.pro. -qt_find_package(Libdrm) - ##################################################################### ## EglFsKmsSupport Module: ##################################################################### @@ -19,11 +17,19 @@ add_qt_module(EglFsKmsSupport ../../api LIBRARIES Qt::CorePrivate - Qt::GuiPrivate - Qt::EglFSDeviceIntegrationPrivate - Qt::KmsSupportPrivate Qt::EdidSupportPrivate + Qt::EglFSDeviceIntegrationPrivate + Qt::GuiPrivate + Qt::KmsSupportPrivate + PUBLIC_LIBRARIES Libdrm::Libdrm - # CONFIG = "no_module_headers" "internal_module" "egl" - # _LOADED = "qt_module" + Qt::Core + Qt::EdidSupport + Qt::EglFSDeviceIntegration + Qt::Gui + Qt::KmsSupport ) + +#### Keys ignored in scope 1:.:.:eglfs_kms_support.pro:: +# CONFIG = "no_module_headers" "internal_module" "egl" +# _LOADED = "qt_module" diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt index f4487a77476..14a7d59227d 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt @@ -1,15 +1,12 @@ # Generated from eglfs_x11.pro. -qt_find_package(XCB) -qt_find_package(X11) -qt_find_package(X11_XCB) - ##################################################################### ## qeglfs-x11-integration Plugin: ##################################################################### add_qt_plugin(qeglfs-x11-integration TYPE egldeviceintegrations + CLASS_NAME QEglFSX11IntegrationPlugin SOURCES qeglfsx11integration.cpp qeglfsx11integration.h qeglfsx11main.cpp @@ -19,13 +16,19 @@ add_qt_plugin(qeglfs-x11-integration ../../api LIBRARIES Qt::CorePrivate - Qt::GuiPrivate Qt::EglFSDeviceIntegrationPrivate - XCB::XCB - X11::X11 + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::EglFSDeviceIntegration + Qt::Gui X11::XCB - # CONFIG = "egl" - # OTHER_FILES = "$$PWD/eglfs_x11.json" - # PLUGIN_CLASS_NAME = "QEglFSX11IntegrationPlugin" - # _LOADED = "qt_plugin" + XCB::XCB ) + +#### Keys ignored in scope 1:.:.:eglfs_x11.pro:: +# CONFIG = "egl" +# OTHER_FILES = "$$PWD/eglfs_x11.json" +# PLUGIN_CLASS_NAME = "QEglFSX11IntegrationPlugin" +# PLUGIN_TYPE = "egldeviceintegrations" +# _LOADED = "qt_plugin" diff --git a/src/plugins/platforms/linuxfb/CMakeLists.txt b/src/plugins/platforms/linuxfb/CMakeLists.txt index 6c800835038..623a5296c99 100644 --- a/src/plugins/platforms/linuxfb/CMakeLists.txt +++ b/src/plugins/platforms/linuxfb/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qlinuxfb TYPE platforms + CLASS_NAME QLinuxFbIntegrationPlugin SOURCES main.cpp qlinuxfbintegration.cpp qlinuxfbintegration.h @@ -14,22 +15,34 @@ add_qt_plugin(qlinuxfb QT_NO_FOREACH LIBRARIES Qt::CorePrivate + Qt::EventDispatcherSupportPrivate + Qt::FbSupportPrivate + Qt::FontDatabaseSupportPrivate Qt::GuiPrivate Qt::ServiceSupportPrivate - Qt::EventDispatcherSupportPrivate - Qt::FontDatabaseSupportPrivate - Qt::FbSupportPrivate - # OTHER_FILES = "linuxfb.json" - # PLUGIN_CLASS_NAME = "QLinuxFbIntegrationPlugin" - # _LOADED = "qt_plugin" + PUBLIC_LIBRARIES + Qt::Core + Qt::EventDispatcherSupport + Qt::FbSupport + Qt::FontDatabaseSupport + Qt::Gui + Qt::ServiceSupport ) +#### Keys ignored in scope 1:.:.:linuxfb.pro:: +# OTHER_FILES = "linuxfb.json" +# PLUGIN_CLASS_NAME = "QLinuxFbIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### extend_target(qlinuxfb CONDITION TARGET Qt::InputSupportPrivate LIBRARIES Qt::InputSupportPrivate + PUBLIC_LIBRARIES + Qt::InputSupport ) extend_target(qlinuxfb CONDITION TARGET Qt::KmsSupportPrivate @@ -37,8 +50,9 @@ extend_target(qlinuxfb CONDITION TARGET Qt::KmsSupportPrivate qlinuxfbdrmscreen.cpp qlinuxfbdrmscreen.h LIBRARIES Qt::KmsSupportPrivate + PUBLIC_LIBRARIES + Qt::KmsSupport ) -# -#extend_target(qlinuxfb CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) + +#### Keys ignored in scope 4:.:.:linuxfb.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt index 58cd506e963..7f5ff13b275 100644 --- a/src/plugins/platforms/minimal/CMakeLists.txt +++ b/src/plugins/platforms/minimal/CMakeLists.txt @@ -1,4 +1,4 @@ -qt_find_package(WrapFreetype) # special case +# Generated from minimal.pro. ##################################################################### ## qminimal Plugin: @@ -6,6 +6,7 @@ qt_find_package(WrapFreetype) # special case add_qt_plugin(qminimal TYPE platforms + CLASS_NAME QMinimalIntegrationPlugin SOURCES main.cpp qminimalbackingstore.cpp qminimalbackingstore.h @@ -17,11 +18,17 @@ add_qt_plugin(qminimal Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::EventDispatcherSupport + Qt::FontDatabaseSupport + Qt::Gui ) -#### Keys ignored in scope 1:.:minimal.pro:: +#### Keys ignored in scope 1:.:.:minimal.pro:: # OTHER_FILES = "minimal.json" # PLUGIN_CLASS_NAME = "QMinimalIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: @@ -32,5 +39,5 @@ extend_target(qminimal CONDITION QT_FEATURE_freetype WrapFreetype::WrapFreetype ) -#### Keys ignored in scope 3:.:minimal.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +#### Keys ignored in scope 3:.:.:minimal.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: # PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt index a038d07df95..8118bef4c5a 100644 --- a/src/plugins/platforms/minimalegl/CMakeLists.txt +++ b/src/plugins/platforms/minimalegl/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qminimalegl TYPE platforms + CLASS_NAME QMinimalEglIntegrationPlugin SOURCES main.cpp qminimaleglintegration.cpp qminimaleglintegration.h @@ -15,16 +16,25 @@ add_qt_plugin(qminimalegl QT_EGL_NO_X11 LIBRARIES Qt::CorePrivate - Qt::GuiPrivate + Qt::EglSupportPrivate Qt::EventDispatcherSupportPrivate Qt::FontDatabaseSupportPrivate - Qt::EglSupportPrivate - # CONFIG = "egl" - # OTHER_FILES = "minimalegl.json" - # PLUGIN_CLASS_NAME = "QMinimalEglIntegrationPlugin" - # _LOADED = "qt_plugin" + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::EglSupport + Qt::EventDispatcherSupport + Qt::FontDatabaseSupport + Qt::Gui ) +#### Keys ignored in scope 1:.:.:minimalegl.pro:: +# CONFIG = "egl" +# OTHER_FILES = "minimalegl.json" +# PLUGIN_CLASS_NAME = "QMinimalEglIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### @@ -32,7 +42,6 @@ extend_target(qminimalegl CONDITION QT_FEATURE_opengl SOURCES qminimaleglbackingstore.cpp qminimaleglbackingstore.h ) -# -#extend_target(qminimalegl CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) + +#### Keys ignored in scope 3:.:.:minimalegl.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt index e81134bbfb3..a81b3b434f7 100644 --- a/src/plugins/platforms/offscreen/CMakeLists.txt +++ b/src/plugins/platforms/offscreen/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qoffscreen TYPE platforms + CLASS_NAME QOffscreenIntegrationPlugin SOURCES main.cpp qoffscreencommon.cpp qoffscreencommon.h @@ -25,9 +26,10 @@ add_qt_plugin(qoffscreen Qt::Gui ) -#### Keys ignored in scope 1:.:.:./offscreen.pro:: +#### Keys ignored in scope 1:.:.:offscreen.pro:: # OTHER_FILES = "offscreen.json" # PLUGIN_CLASS_NAME = "QOffscreenIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: diff --git a/src/plugins/platforms/vnc/CMakeLists.txt b/src/plugins/platforms/vnc/CMakeLists.txt index ced972391dc..8a294a09fb2 100644 --- a/src/plugins/platforms/vnc/CMakeLists.txt +++ b/src/plugins/platforms/vnc/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qvnc TYPE platforms + CLASS_NAME QVncIntegrationPlugin SOURCES main.cpp qvnc.cpp qvnc_p.h @@ -16,26 +17,38 @@ add_qt_plugin(qvnc QT_NO_FOREACH LIBRARIES Qt::CorePrivate - Qt::Network + Qt::EventDispatcherSupportPrivate + Qt::FbSupportPrivate + Qt::FontDatabaseSupportPrivate Qt::GuiPrivate Qt::ServiceSupportPrivate Qt::ThemeSupportPrivate - Qt::FbSupportPrivate - Qt::EventDispatcherSupportPrivate - Qt::FontDatabaseSupportPrivate - # OTHER_FILES = "vnc.json" - # PLUGIN_CLASS_NAME = "QVncIntegrationPlugin" - # _LOADED = "qt_plugin" + PUBLIC_LIBRARIES + Qt::Core + Qt::EventDispatcherSupport + Qt::FbSupport + Qt::FontDatabaseSupport + Qt::Gui + Qt::Network + Qt::ServiceSupport + Qt::ThemeSupport ) +#### Keys ignored in scope 1:.:.:vnc.pro:: +# OTHER_FILES = "vnc.json" +# PLUGIN_CLASS_NAME = "QVncIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + ## Scopes: ##################################################################### extend_target(qvnc CONDITION TARGET Qt::InputSupportPrivate LIBRARIES Qt::InputSupportPrivate + PUBLIC_LIBRARIES + Qt::InputSupport ) -# -#extend_target(qvnc CONDITION NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN -# # PLUGIN_EXTENDS = "-" -#) + +#### Keys ignored in scope 3:.:.:vnc.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" diff --git a/src/plugins/platforms/windows/.prev_CMakeLists.txt b/src/plugins/platforms/windows/.prev_CMakeLists.txt index b53fed4b465..315b3cf7b33 100644 --- a/src/plugins/platforms/windows/.prev_CMakeLists.txt +++ b/src/plugins/platforms/windows/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qwindows TYPE platforms + CLASS_NAME QWindowsIntegrationPlugin SOURCES main.cpp qtwindowsglobal.h @@ -38,7 +39,7 @@ add_qt_plugin(qwindows QT_NO_CAST_FROM_ASCII QT_NO_FOREACH INCLUDE_DIRECTORIES - . + ${CMAKE_CURRENT_SOURCE_DIR} LIBRARIES Qt::CorePrivate Qt::EventDispatcherSupportPrivate @@ -76,6 +77,7 @@ add_qt_resource(qwindows "openglblacklists" PREFIX "/qt-project.org/windows/open #### Keys ignored in scope 1:.:.:windows.pro:: # OTHER_FILES = "windows.json" # PLUGIN_CLASS_NAME = "QWindowsIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index 8b7ba7e9be0..44a16989947 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qwindows TYPE platforms + CLASS_NAME QWindowsIntegrationPlugin SOURCES main.cpp qtwindowsglobal.h @@ -38,7 +39,7 @@ add_qt_plugin(qwindows QT_NO_CAST_FROM_ASCII QT_NO_FOREACH INCLUDE_DIRECTORIES - . + ${CMAKE_CURRENT_SOURCE_DIR} LIBRARIES Qt::CorePrivate Qt::EventDispatcherSupportPrivate @@ -76,6 +77,7 @@ add_qt_resource(qwindows "openglblacklists" PREFIX "/qt-project.org/windows/open #### Keys ignored in scope 1:.:.:windows.pro:: # OTHER_FILES = "windows.json" # PLUGIN_CLASS_NAME = "QWindowsIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: diff --git a/src/plugins/platforms/xcb/.prev_CMakeLists.txt b/src/plugins/platforms/xcb/.prev_CMakeLists.txt new file mode 100644 index 00000000000..c3d469f0c62 --- /dev/null +++ b/src/plugins/platforms/xcb/.prev_CMakeLists.txt @@ -0,0 +1,263 @@ +# Generated from xcb.pro. + +##################################################################### +## XcbQpa Module: +##################################################################### + +add_qt_module(XcbQpa + NO_MODULE_HEADERS + SOURCES + gl_integrations/qxcbglintegration.cpp gl_integrations/qxcbglintegration.h + gl_integrations/qxcbglintegrationfactory.cpp gl_integrations/qxcbglintegrationfactory.h + gl_integrations/qxcbglintegrationplugin.h + gl_integrations/qxcbnativeinterfacehandler.cpp gl_integrations/qxcbnativeinterfacehandler.h + qxcbatom.cpp qxcbatom.h + qxcbbackingstore.cpp qxcbbackingstore.h + qxcbclipboard.cpp qxcbclipboard.h + qxcbconnection.cpp qxcbconnection.h + qxcbconnection_basic.cpp qxcbconnection_basic.h + qxcbconnection_screens.cpp + qxcbcursor.cpp qxcbcursor.h + qxcbeventdispatcher.cpp qxcbeventdispatcher.h + qxcbeventqueue.cpp qxcbeventqueue.h + qxcbimage.cpp qxcbimage.h + qxcbintegration.cpp qxcbintegration.h + qxcbkeyboard.cpp qxcbkeyboard.h + qxcbmime.cpp qxcbmime.h + qxcbnativeinterface.cpp qxcbnativeinterface.h + qxcbobject.h + qxcbscreen.cpp qxcbscreen.h + qxcbsystemtraytracker.cpp qxcbsystemtraytracker.h + qxcbwindow.cpp qxcbwindow.h + qxcbwmsupport.cpp qxcbwmsupport.h + qxcbxsettings.cpp qxcbxsettings.h + DEFINES + QT_BUILD_XCB_PLUGIN + QT_NO_FOREACH + INCLUDE_DIRECTORIES + gl_integrations + LIBRARIES + Qt::CorePrivate + Qt::EdidSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::GuiPrivate + Qt::ServiceSupportPrivate + Qt::ThemeSupportPrivate + Qt::XkbCommonSupportPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::EdidSupport + Qt::FontDatabaseSupport + Qt::Gui + Qt::ServiceSupport + Qt::ThemeSupport + Qt::XkbCommonSupport + XCB::ICCCM + XCB::IMAGE + XCB::KEYSYMS + XCB::RANDR + XCB::RENDER + XCB::RENDERUTIL + XCB::SHAPE + XCB::SHM + XCB::SYNC + XCB::XCB + XCB::XFIXES + XCB::XINERAMA + XKB::XKB +) + +#### Keys ignored in scope 3:.:.:xcb_qpa_lib.pro:: +# CONFIG = "no_module_headers" "internal_module" +# _LOADED = "qt_build_paths" "qt_module" + +## Scopes: +##################################################################### + +extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate + LIBRARIES + Qt::LinuxAccessibilitySupportPrivate + PUBLIC_LIBRARIES + Qt::LinuxAccessibilitySupport +) + +extend_target(XcbQpa CONDITION QT_FEATURE_vulkan + SOURCES + qxcbvulkaninstance.cpp qxcbvulkaninstance.h + qxcbvulkanwindow.cpp qxcbvulkanwindow.h + LIBRARIES + Qt::VulkanSupportPrivate + PUBLIC_LIBRARIES + Qt::VulkanSupport +) + +extend_target(XcbQpa CONDITION QT_FEATURE_glib + LIBRARIES + GLIB2::GLIB2 +) + +extend_target(XcbQpa CONDITION QT_FEATURE_draganddrop + SOURCES + qxcbdrag.cpp qxcbdrag.h +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xlib + PUBLIC_LIBRARIES + X11::XCB +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xinput + SOURCES + qxcbconnection_xi2.cpp + PUBLIC_LIBRARIES + XCB::XINPUT +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_sm + SOURCES + qxcbsessionmanager.cpp qxcbsessionmanager.h + PUBLIC_LIBRARIES + ${X11_SM_LIB} ${X11_ICE_LIB} +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xkb + PUBLIC_LIBRARIES + XCB::XKB + XKB::XKB +) + +extend_target(XcbQpa CONDITION QT_FEATURE_dlopen + PUBLIC_LIBRARIES + ${CMAKE_DL_LIBS} +) + +extend_target(XcbQpa CONDITION CLANG AND NOT ICC + COMPILE_OPTIONS + -ftemplate-depth=1024 +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting + SOURCES + nativepainting/qbackingstore_x11.cpp nativepainting/qbackingstore_x11_p.h + nativepainting/qcolormap_x11.cpp nativepainting/qcolormap_x11_p.h + nativepainting/qpaintengine_x11.cpp nativepainting/qpaintengine_x11_p.h + nativepainting/qpixmap_x11.cpp nativepainting/qpixmap_x11_p.h + nativepainting/qt_x11_p.h + nativepainting/qtessellator.cpp nativepainting/qtessellator_p.h + nativepainting/qxcbnativepainting.cpp nativepainting/qxcbnativepainting.h + INCLUDE_DIRECTORIES + nativepainting +) + +extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender + PUBLIC_LIBRARIES + PkgConfig::XRender +) + +extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_painting + LIBRARIES + WrapFreetype::WrapFreetype +) +##################################################################### +## qxcb Plugin: +##################################################################### + +add_qt_plugin(qxcb + TYPE platforms + CLASS_NAME QXcbIntegrationPlugin + SOURCES + qxcbmain.cpp + DEFINES + QT_NO_FOREACH + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::XcbQpaPrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::XcbQpa +) + +#### Keys ignored in scope 24:.:.:xcb-plugin.pro:: +# OTHER_FILES = "xcb.json" "README" +# PLUGIN_CLASS_NAME = "QXcbIntegrationPlugin" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +#### Keys ignored in scope 25:.:.:xcb-plugin.pro:APPLE_OSX: +# CONFIG = "no_app_extension_api_only" + +#### Keys ignored in scope 26:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN: +# PLUGIN_EXTENDS = "-" +add_subdirectory(gl_integrations) + +if(NOT ON) + add_subdirectory(xcb-static) +endif() + + if(TARGET Qt::LinuxAccessibilitySupportPrivate) + endif() + + if(QT_FEATURE_vulkan) + endif() + + if(QT_FEATURE_glib) + endif() + + if(QT_FEATURE_draganddrop) + endif() + + if(QT_FEATURE_xcb_xlib) + endif() + + if(QT_FEATURE_xcb_xinput) + endif() + + if(QT_FEATURE_xcb_sm) + endif() + + if(QT_FEATURE_vulkan) + endif() + + if(NOT ON) + endif() + + else() + + if(QT_FEATURE_xcb_xinput) + endif() + endif() + + if(QT_FEATURE_xkb) + + if(ON) + endif() + endif() + + if(QT_FEATURE_dlopen) + endif() + + if(CLANG AND NOT ICC) + endif() + + if(QT_FEATURE_xcb_native_painting) + + if(QT_FEATURE_xrender) + endif() + + if(QT_FEATURE_fontconfig) + endif() + endif() + + if(QT_FEATURE_xcb_xinput) + endif() + + if(APPLE_OSX) + endif() + + if(NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN) + endif() diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 9f947915504..aa2c0732f26 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -54,8 +54,8 @@ add_qt_module(XcbQpa qxcbwmsupport.cpp qxcbwmsupport.h qxcbxsettings.cpp qxcbxsettings.h DEFINES - QT_NO_FOREACH QT_BUILD_XCB_PLUGIN + QT_NO_FOREACH INCLUDE_DIRECTORIES gl_integrations LIBRARIES @@ -68,7 +68,6 @@ add_qt_module(XcbQpa Qt::XkbCommonSupportPrivate PkgConfig::XKB_COMMON_X11 # special case PUBLIC_LIBRARIES - ${CMAKE_DL_LIBS} Qt::Core Qt::EdidSupport Qt::FontDatabaseSupport @@ -151,9 +150,14 @@ extend_target(XcbQpa CONDITION QT_FEATURE_xkb XKB::XKB ) +extend_target(XcbQpa CONDITION QT_FEATURE_dlopen + PUBLIC_LIBRARIES + ${CMAKE_DL_LIBS} +) + extend_target(XcbQpa CONDITION CLANG AND NOT ICC COMPILE_OPTIONS - "-ftemplate-depth=1024" + -ftemplate-depth=1024 ) extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting @@ -184,6 +188,7 @@ extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_p add_qt_plugin(qxcb TYPE platforms + CLASS_NAME QXcbIntegrationPlugin SOURCES qxcbmain.cpp DEFINES @@ -201,6 +206,7 @@ add_qt_plugin(qxcb #### Keys ignored in scope 24:.:.:xcb-plugin.pro:: # OTHER_FILES = "xcb.json" "README" # PLUGIN_CLASS_NAME = "QXcbIntegrationPlugin" +# PLUGIN_TYPE = "platforms" # _LOADED = "qt_plugin" ## Scopes: diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt index 6692ece7dc7..e54a6dd306a 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qxcb-egl-integration TYPE xcbglintegrations + CLASS_NAME QXcbEglIntegrationPlugin SOURCES qxcbeglcontext.h qxcbeglintegration.cpp qxcbeglintegration.h @@ -29,7 +30,8 @@ add_qt_plugin(qxcb-egl-integration Qt::XcbQpa ) -#### Keys ignored in scope 1:.:.:./xcb_egl.pro:: +#### Keys ignored in scope 1:.:.:xcb_egl.pro:: # CONFIG = "egl" # PLUGIN_CLASS_NAME = "QXcbEglIntegrationPlugin" +# PLUGIN_TYPE = "xcbglintegrations" # _LOADED = "qt_plugin" "qt_build_paths" diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt index c8212daae6f..d6bf4097be0 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_plugin(qxcb-glx-integration TYPE xcbglintegrations + CLASS_NAME QXcbGlxIntegrationPlugin SOURCES qglxintegration.cpp qglxintegration.h qxcbglxintegration.cpp qxcbglxintegration.h @@ -29,8 +30,9 @@ add_qt_plugin(qxcb-glx-integration Qt::XcbQpa ) -#### Keys ignored in scope 1:.:.:./xcb_glx.pro:: +#### Keys ignored in scope 1:.:.:xcb_glx.pro:: # PLUGIN_CLASS_NAME = "QXcbGlxIntegrationPlugin" +# PLUGIN_TYPE = "xcbglintegrations" # _LOADED = "qt_plugin" "qt_build_paths" ## Scopes: @@ -41,7 +43,7 @@ extend_target(qxcb-glx-integration CONDITION QT_FEATURE_xcb_glx XCB::GLX ) -extend_target(qxcb-glx-integration CONDITION NOT static +extend_target(qxcb-glx-integration CONDITION QT_FEATURE_dlopen AND NOT static PUBLIC_LIBRARIES ${CMAKE_DL_LIBS} ) From 04da0df56851565fe93f69be72efbba2b492d5db Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Wed, 5 Jun 2019 12:07:42 +0200 Subject: [PATCH 0631/1322] Android: SDK Support Enable building androiddeployqt when performing host builds only. Added QtPlatformAndroid.cmake to locate Java and the setup the android SDK platform when building on android. Install the androiddeployqt support files when performing a host build. Added ANDROID_SDK_ROOT configuration variable for specifying the android sdk directory. Generating the deployment-settings.json will be done in another change. Change-Id: I1bf15315af4ed904d2fb1d22b0e8e834df32d6ed Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 1 + cmake/QtPlatformAndroid.cmake | 44 ++++++++++++++++++++++++ cmake/QtPlatformSupport.cmake | 4 +++ cmake/README.md | 3 +- src/CMakeLists.txt | 2 ++ src/android/CMakeLists.txt | 12 +++++++ src/android/jar/CMakeLists.txt | 32 +++++++++++++++++ src/android/java/CMakeLists.txt | 11 ++++++ src/android/templates/CMakeLists.txt | 18 ++++++++++ src/tools/CMakeLists.txt | 5 +++ src/tools/androiddeployqt/CMakeLists.txt | 27 +++++++++++++++ 11 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 cmake/QtPlatformAndroid.cmake create mode 100644 src/android/CMakeLists.txt create mode 100644 src/android/jar/CMakeLists.txt create mode 100644 src/android/java/CMakeLists.txt create mode 100644 src/android/templates/CMakeLists.txt create mode 100644 src/tools/androiddeployqt/CMakeLists.txt diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index bd2a8a7ba35..160d7141d56 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -111,6 +111,7 @@ qt_copy_or_install(FILES cmake/QtCompilerOptimization.cmake cmake/QtFeature.cmake cmake/QtPlatformSupport.cmake + cmake/QtPlatformAndroid.cmake cmake/QtPostProcess.cmake cmake/QtSetup.cmake cmake/QtModuleConfig.cmake.in diff --git a/cmake/QtPlatformAndroid.cmake b/cmake/QtPlatformAndroid.cmake new file mode 100644 index 00000000000..46a8fe06a4a --- /dev/null +++ b/cmake/QtPlatformAndroid.cmake @@ -0,0 +1,44 @@ +# +# Platform Settings for Android +# + +if (NOT DEFINED ANDROID_SDK_ROOT) + message(FATAL_ERROR "ANDROID_SDK_ROOT is not defined") +endif() + +if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}") + message(FATAL_ERROR "Could not find ANDROID_SDK_ROOT or path is not a directory: ${ANDROID_SDK_ROOT}") +endif() + +# Minimum recommend android SDK api version +set(qt_android_api_version "android-21") + +# Locate android.jar +set(android_jar "${ANDROID_SDK_ROOT}/platforms/${qt_android_api_version}/android.jar") +if(NOT EXISTS "${android_jar}") + # Locate the highest available platform + file(GLOB android_platforms + LIST_DIRECTORIES true + RELATIVE "${ANDROID_SDK_ROOT}/platforms" + "${ANDROID_SDK_ROOT}/platforms/*") + # If list is not empty + if(android_platforms) + list(SORT android_platforms) + list(REVERSE android_platforms) + list(GET android_platforms 0 android_platform_latest) + set(qt_android_api_version ${android_platform_latest}) + set(android_jar "${ANDROID_SDK_ROOT}/platforms/${qt_android_api_version}/android.jar") + endif() +endif() + +if(NOT EXISTS "${android_jar}") + message(FATAL_ERROR "No suitable Android SDK platform found. Minimum version is ${qt_android_api_version}") +endif() + +message(STATUS "Using Android SDK API ${qt_android_api_version} from ${ANDROID_SDK_ROOT}/platforms") + +# Locate Java +include(UseJava) + +# Find JDK 8.0 +find_package(Java 1.8 COMPONENTS Development REQUIRED) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index ac9973905af..9a3befc4200 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -79,3 +79,7 @@ endfunction() if(CMAKE_CXX_COMPILER_VERSION) qt_parse_version_string("${CMAKE_CXX_COMPILER_VERSION}" "QT_COMPILER_VERSION") endif() + +if(ANDROID) + include(QtPlatformAndroid) +endif() diff --git a/cmake/README.md b/cmake/README.md index fc73defaa14..88d4b0aa31a 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -131,9 +131,10 @@ Vcpkg for Android can be set up using the following steps: * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``arm-android`` * Set the ``ANDROID_NDK_HOME`` environment variable to the path where you have installed the Android NDK. + * Set the ``ANDROID_SDK_HOME`` environment variable to the path where you have installed the Android SDK. * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` -When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21`` +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME`` # Debugging CMake files diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a3e358c730..682f70ebd21 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,3 +56,5 @@ endif() add_subdirectory(plugins) add_subdirectory(winmain) + +add_subdirectory(android) diff --git a/src/android/CMakeLists.txt b/src/android/CMakeLists.txt new file mode 100644 index 00000000000..7b0b0cd930e --- /dev/null +++ b/src/android/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from android.pro. + +# special case begin +# Only build jars during android build? +if (ANDROID) + add_subdirectory(jar) +endif() +# special case end + +# Templates need to be installed during host build +add_subdirectory(java) +add_subdirectory(templates) diff --git a/src/android/jar/CMakeLists.txt b/src/android/jar/CMakeLists.txt new file mode 100644 index 00000000000..31afb3fdf4d --- /dev/null +++ b/src/android/jar/CMakeLists.txt @@ -0,0 +1,32 @@ +# QtAndroid Jar + +# special case begin +set(path_prefix ${CMAKE_CURRENT_SOURCE_DIR}/src/org/qtproject/qt5/android/) + +set(java_sources + ${path_prefix}/accessibility/QtAccessibilityDelegate.java + ${path_prefix}/accessibility/QtNativeAccessibility.java + ${path_prefix}/CursorHandle.java + ${path_prefix}/EditContextView.java + ${path_prefix}/EditPopupMenu.java + ${path_prefix}/ExtractStyle.java + ${path_prefix}/QtActivityDelegate.java + ${path_prefix}/QtEditText.java + ${path_prefix}/QtInputConnection.java + ${path_prefix}/QtLayout.java + ${path_prefix}/QtMessageDialogHelper.java + ${path_prefix}/QtNative.java + ${path_prefix}/QtNativeLibrariesDir.java + ${path_prefix}/QtServiceDelegate.java + ${path_prefix}/QtSurface.java + ${path_prefix}/QtThread.java) + +add_jar(QtAndroid + INCLUDE_JARS ${android_jar} + SOURCES ${java_sources} + ) + +install_jar(QtAndroid + DESTINATION jar + COMPONENT Devel) +# special case end diff --git a/src/android/java/CMakeLists.txt b/src/android/java/CMakeLists.txt new file mode 100644 index 00000000000..d2c0c3df249 --- /dev/null +++ b/src/android/java/CMakeLists.txt @@ -0,0 +1,11 @@ +# Android Java Resource files + +# special case begin +set(resource_directories + res + src) + +qt_install(DIRECTORY ${resource_directories} + DESTINATION src/android/java + COMPONENT Devel) +# special case end diff --git a/src/android/templates/CMakeLists.txt b/src/android/templates/CMakeLists.txt new file mode 100644 index 00000000000..b330840cc71 --- /dev/null +++ b/src/android/templates/CMakeLists.txt @@ -0,0 +1,18 @@ +# Android template files + +# special case begin +set(template_files + AndroidManifest.xml + build.gradle) + +set(template_directories + res) + +qt_install(FILES ${template_files} + DESTINATION src/android/templates + COMPONENT Devel) + +qt_install(DIRECTORY ${template_directories} + DESTINATION src/android/templates + COMPONENT Devel) +# special case end diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 77942a9c7e8..f1f0a8ce93c 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -5,3 +5,8 @@ if (QT_FEATURE_dbus) endif() add_subdirectory(qlalr) add_subdirectory(qvkgen) + +# Only include the following tools when performing a host build +if(NOT CMAKE_CROSSCOMPILING) + add_subdirectory(androiddeployqt) +endif() diff --git a/src/tools/androiddeployqt/CMakeLists.txt b/src/tools/androiddeployqt/CMakeLists.txt new file mode 100644 index 00000000000..75c7115e85e --- /dev/null +++ b/src/tools/androiddeployqt/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from androiddeployqt.pro. + +##################################################################### +## androiddeployqt Binary: +##################################################################### + +add_qt_executable(androiddeployqt + SOURCES + main.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + QT_NO_FOREACH +) + +#### Keys ignored in scope 1:.:.:androiddeployqt.pro:: +# CONFIG = "console" +# _LOADED = "qt_app" +# _OPTION = "host_build" + +## Scopes: +##################################################################### + +extend_target(androiddeployqt CONDITION windows + COMPILE_OPTIONS + -U__STRICT_ANSI__ +) From 2fb7cca6ba566e28f4fdad5259dc420fa84759f2 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 5 Jun 2019 16:18:07 +0200 Subject: [PATCH 0632/1322] CMake: Compile fix for MinGW 8.1.0 Change-Id: I4e484619421812ae83da1382938c527ad67382e9 Reviewed-by: Simon Hausmann --- src/gui/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 745e4b45f77..635af4faf4a 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -509,6 +509,15 @@ extend_target(Gui CONDITION QT_FEATURE_png PNG::PNG ) +# special case begin +if (MINGW AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.1.0) + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86048 + set_source_files_properties(image/qpnghandler.cpp + PROPERTIES COMPILE_OPTIONS -fno-reorder-blocks-and-partition + ) +endif() +# special case end + extend_target(Gui CONDITION QT_FEATURE_harfbuzz SOURCES text/qharfbuzzng.cpp text/qharfbuzzng_p.h From a6c11d3e09f8ebc923eb043e6c090997d21f2ac9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 5 Jun 2019 13:49:08 +0200 Subject: [PATCH 0633/1322] Add support for private module .pri files Generate a pri file for public and private interfaces, but map CONFIG += internal_module to a cmake option and skip the former if set. Task-number: QTBUG-75666 Change-Id: I3f4baf1277094f4c22149a9e8769734baf9a235f Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 61 +++++++++++++++---- .../accessibility/CMakeLists.txt | 1 + src/platformsupport/clipboard/CMakeLists.txt | 1 + .../devicediscovery/CMakeLists.txt | 1 + src/platformsupport/edid/CMakeLists.txt | 1 + .../eglconvenience/.prev_CMakeLists.txt | 1 + .../eglconvenience/CMakeLists.txt | 1 + .../eventdispatchers/.prev_CMakeLists.txt | 1 + .../eventdispatchers/CMakeLists.txt | 1 + .../fbconvenience/CMakeLists.txt | 1 + .../fontdatabases/.prev_CMakeLists.txt | 1 + .../fontdatabases/CMakeLists.txt | 1 + .../glxconvenience/.prev_CMakeLists.txt | 1 + .../glxconvenience/CMakeLists.txt | 1 + src/platformsupport/graphics/CMakeLists.txt | 1 + .../input/.prev_CMakeLists.txt | 1 + src/platformsupport/input/CMakeLists.txt | 1 + .../input/xkbcommon/CMakeLists.txt | 1 + .../kmsconvenience/.prev_CMakeLists.txt | 1 + .../kmsconvenience/CMakeLists.txt | 1 + .../linuxaccessibility/.prev_CMakeLists.txt | 1 + .../linuxaccessibility/CMakeLists.txt | 1 + .../platformcompositor/CMakeLists.txt | 1 + src/platformsupport/services/CMakeLists.txt | 1 + src/platformsupport/themes/CMakeLists.txt | 1 + .../vkconvenience/.prev_CMakeLists.txt | 1 + .../vkconvenience/CMakeLists.txt | 1 + .../windowsuiautomation/CMakeLists.txt | 1 + .../platforms/eglfs/.prev_CMakeLists.txt | 1 + src/plugins/platforms/eglfs/CMakeLists.txt | 1 + .../eglfs_kms_support/CMakeLists.txt | 1 + .../platforms/xcb/.prev_CMakeLists.txt | 1 + src/plugins/platforms/xcb/CMakeLists.txt | 1 + util/cmake/pro2cmake.py | 2 + 34 files changed, 84 insertions(+), 11 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 854a5f3a45a..afd50c55acd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -294,20 +294,28 @@ function(qt_set_up_developer_build) endfunction() # Generates module .pri files for consumption by qmake -function(qt_generate_module_pri_file target target_path pri_file_name_var) - set(flags) +function(qt_generate_module_pri_file target target_path pri_files_var) + set(flags INTERNAL_MODULE) set(options) set(multiopts QMAKE_MODULE_CONFIG) cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) qt_internal_module_info(module "${target}") qt_path_join(pri_file_name "${target_path}" "qt_lib_${module_lower}.pri") - set("${pri_file_name_var}" "${pri_file_name}" PARENT_SCOPE) + set(pri_files "${pri_file_name}") get_target_property(enabled_features "${target}" QT_ENABLED_PUBLIC_FEATURES) get_target_property(disabled_features "${target}" QT_DISABLED_PUBLIC_FEATURES) - string (REPLACE ";" " " enabled_features "${enabled_features}") - string (REPLACE ";" " " disabled_features "${disabled_features}") + get_target_property(enabled_private_features "${target}" QT_ENABLED_PRIVATE_FEATURES) + get_target_property(disabled_private_features "${target}" QT_DISABLED_PRIVATE_FEATURES) + + foreach(var enabled_features disabled_features enabled_private_features disabled_private_features) + if(${var} STREQUAL "${var}-NOTFOUND") + set(${var} "") + else() + string (REPLACE ";" " " ${var} "${${var}}") + endif() + endforeach() if(arg_QMAKE_MODULE_CONFIG) string(REPLACE ";" " " module_config "${arg_QMAKE_MODULE_CONFIG}") @@ -316,9 +324,10 @@ function(qt_generate_module_pri_file target target_path pri_file_name_var) set(module_config "") endif() - file(GENERATE - OUTPUT "${pri_file_name}" - CONTENT + if (NOT ${arg_INTERNAL_MODULE}) + file(GENERATE + OUTPUT "${pri_file_name}" + CONTENT "QT.${module_lower}.VERSION = ${PROJECT_VERSION} QT.${module_lower}.name = ${module} QT.${module_lower}.module = ${module_versioned} @@ -333,8 +342,31 @@ QT.${module_lower}.DEFINES = QT_${module_define}_LIB QT.${module_lower}.enabled_features = ${enabled_features} QT.${module_lower}.disabled_features = ${disabled_features}${module_config} QT_MODULES += ${module_lower} +" + ) + endif() + + qt_path_join(private_pri_file "${target_path}" "qt_lib_${module_lower}_private.pri") + list(APPEND pri_files "${private_pri_file}") + + file(GENERATE + OUTPUT "${private_pri_file}" + CONTENT + "QT.${module_lower}_private.VERSION = ${PROJECT_VERSION} +QT.${module_lower}_private.name = ${module} +QT.${module_lower}_private.module = +QT.${module_lower}_private.libs = $$QT_MODULE_LIB_BASE +QT.${module_lower}_private.includes = $$QT_MODULE_INCLUDE_BASE/${module}/${PROJECT_VERSION} $$QT_MODULE_INCLUDE_BASE/${module}/${PROJECT_VERSION}/${module} +QT.${module_lower}_private.frameworks = +QT.${module_lower}_private.depends = ${module_lower} +QT.${module_lower}_private.uses = +QT.${module_lower}_private.module_config = v2 +QT.${module_lower}_private.enabled_features = ${enabled_private_features} +QT.${module_lower}_private.disabled_features = ${disabled_private_features} " ) + + set("${pri_files_var}" "${pri_files}" PARENT_SCOPE) endfunction() function(qt_generate_global_config_pri_file) @@ -1071,7 +1103,7 @@ function(add_qt_module target) # Process arguments: qt_parse_all_arguments(arg "add_qt_module" - "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS" + "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};QMAKE_MODULE_CONFIG" ${ARGN}) @@ -1311,12 +1343,19 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target} CONFIG_INSTALL_DIR "${config_install_dir}") + if (${arg_INTERNAL_MODULE}) + set(arg_INTERNAL_MODULE "INTERNAL_MODULE") + else() + unset(arg_INTERNAL_MODULE) + endif() + qt_path_join(pri_target_path ${PROJECT_BINARY_DIR} mkspecs/modules) - qt_generate_module_pri_file("${target}" "${pri_target_path}" module_pri_file_name + qt_generate_module_pri_file("${target}" "${pri_target_path}" module_pri_files + ${arg_INTERNAL_MODULE} QMAKE_MODULE_CONFIG ${arg_QMAKE_MODULE_CONFIG} ) - qt_install(FILES "${module_pri_file_name}" DESTINATION mkspecs/modules) + qt_install(FILES "${module_pri_files}" DESTINATION mkspecs/modules) ### fixme: cmake is missing a built-in variable for this. We want to apply it only to modules and plugins # that belong to Qt. diff --git a/src/platformsupport/accessibility/CMakeLists.txt b/src/platformsupport/accessibility/CMakeLists.txt index 2a6588764a4..3475b62c3ee 100644 --- a/src/platformsupport/accessibility/CMakeLists.txt +++ b/src/platformsupport/accessibility/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(AccessibilitySupport STATIC + INTERNAL_MODULE SOURCES qaccessiblebridgeutils.cpp qaccessiblebridgeutils_p.h DEFINES diff --git a/src/platformsupport/clipboard/CMakeLists.txt b/src/platformsupport/clipboard/CMakeLists.txt index 4a93b240cdf..2d7734ebdfb 100644 --- a/src/platformsupport/clipboard/CMakeLists.txt +++ b/src/platformsupport/clipboard/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(ClipboardSupport STATIC + INTERNAL_MODULE SOURCES qmacmime.mm qmacmime_p.h DEFINES diff --git a/src/platformsupport/devicediscovery/CMakeLists.txt b/src/platformsupport/devicediscovery/CMakeLists.txt index a704fc3ba2a..a0b5192d740 100644 --- a/src/platformsupport/devicediscovery/CMakeLists.txt +++ b/src/platformsupport/devicediscovery/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(DeviceDiscoverySupport STATIC + INTERNAL_MODULE SOURCES qdevicediscovery_p.h DEFINES diff --git a/src/platformsupport/edid/CMakeLists.txt b/src/platformsupport/edid/CMakeLists.txt index fd4a53239f5..948cb7e0911 100644 --- a/src/platformsupport/edid/CMakeLists.txt +++ b/src/platformsupport/edid/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(EdidSupport STATIC + INTERNAL_MODULE SOURCES qedidparser.cpp qedidparser_p.h DEFINES diff --git a/src/platformsupport/eglconvenience/.prev_CMakeLists.txt b/src/platformsupport/eglconvenience/.prev_CMakeLists.txt index 48648f39003..d286ff76ad8 100644 --- a/src/platformsupport/eglconvenience/.prev_CMakeLists.txt +++ b/src/platformsupport/eglconvenience/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(EglSupport STATIC + INTERNAL_MODULE SOURCES qeglconvenience.cpp qeglconvenience_p.h qeglstreamconvenience.cpp qeglstreamconvenience_p.h diff --git a/src/platformsupport/eglconvenience/CMakeLists.txt b/src/platformsupport/eglconvenience/CMakeLists.txt index f2db6c746eb..a6a6633d034 100644 --- a/src/platformsupport/eglconvenience/CMakeLists.txt +++ b/src/platformsupport/eglconvenience/CMakeLists.txt @@ -6,6 +6,7 @@ qt_find_package(EGL) # special case add_qt_module(EglSupport STATIC + INTERNAL_MODULE SOURCES qeglconvenience.cpp qeglconvenience_p.h qeglstreamconvenience.cpp qeglstreamconvenience_p.h diff --git a/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt b/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt index 3e2215da819..85d9c967e3e 100644 --- a/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(EventDispatcherSupport STATIC + INTERNAL_MODULE DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES diff --git a/src/platformsupport/eventdispatchers/CMakeLists.txt b/src/platformsupport/eventdispatchers/CMakeLists.txt index 9f5b4a06698..5e884500232 100644 --- a/src/platformsupport/eventdispatchers/CMakeLists.txt +++ b/src/platformsupport/eventdispatchers/CMakeLists.txt @@ -8,6 +8,7 @@ qt_find_package(GLIB2) # special case add_qt_module(EventDispatcherSupport STATIC + INTERNAL_MODULE DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES diff --git a/src/platformsupport/fbconvenience/CMakeLists.txt b/src/platformsupport/fbconvenience/CMakeLists.txt index d4b1d469b09..05ee44b9675 100644 --- a/src/platformsupport/fbconvenience/CMakeLists.txt +++ b/src/platformsupport/fbconvenience/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(FbSupport STATIC + INTERNAL_MODULE SOURCES qfbbackingstore.cpp qfbbackingstore_p.h qfbcursor.cpp qfbcursor_p.h diff --git a/src/platformsupport/fontdatabases/.prev_CMakeLists.txt b/src/platformsupport/fontdatabases/.prev_CMakeLists.txt index 7d3e5957ccb..66c4b5314b9 100644 --- a/src/platformsupport/fontdatabases/.prev_CMakeLists.txt +++ b/src/platformsupport/fontdatabases/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(FontDatabaseSupport STATIC + INTERNAL_MODULE DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES diff --git a/src/platformsupport/fontdatabases/CMakeLists.txt b/src/platformsupport/fontdatabases/CMakeLists.txt index e93ec382376..2e42a71cb23 100644 --- a/src/platformsupport/fontdatabases/CMakeLists.txt +++ b/src/platformsupport/fontdatabases/CMakeLists.txt @@ -9,6 +9,7 @@ qt_find_package(Fontconfig) # special case add_qt_module(FontDatabaseSupport STATIC + INTERNAL_MODULE DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES diff --git a/src/platformsupport/glxconvenience/.prev_CMakeLists.txt b/src/platformsupport/glxconvenience/.prev_CMakeLists.txt index 8abf9530d81..5a407885cff 100644 --- a/src/platformsupport/glxconvenience/.prev_CMakeLists.txt +++ b/src/platformsupport/glxconvenience/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(GlxSupport STATIC + INTERNAL_MODULE SOURCES qglxconvenience.cpp qglxconvenience_p.h DEFINES diff --git a/src/platformsupport/glxconvenience/CMakeLists.txt b/src/platformsupport/glxconvenience/CMakeLists.txt index a435de85ee2..484fabf2348 100644 --- a/src/platformsupport/glxconvenience/CMakeLists.txt +++ b/src/platformsupport/glxconvenience/CMakeLists.txt @@ -8,6 +8,7 @@ qt_find_package(X11) # special case add_qt_module(GlxSupport STATIC + INTERNAL_MODULE SOURCES qglxconvenience.cpp qglxconvenience_p.h DEFINES diff --git a/src/platformsupport/graphics/CMakeLists.txt b/src/platformsupport/graphics/CMakeLists.txt index f6a429fa3a5..4dd6db7ebd6 100644 --- a/src/platformsupport/graphics/CMakeLists.txt +++ b/src/platformsupport/graphics/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(GraphicsSupport STATIC + INTERNAL_MODULE SOURCES qrasterbackingstore.cpp qrasterbackingstore_p.h DEFINES diff --git a/src/platformsupport/input/.prev_CMakeLists.txt b/src/platformsupport/input/.prev_CMakeLists.txt index df330e7c8a5..902e61f4a56 100644 --- a/src/platformsupport/input/.prev_CMakeLists.txt +++ b/src/platformsupport/input/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(InputSupport STATIC + INTERNAL_MODULE DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES diff --git a/src/platformsupport/input/CMakeLists.txt b/src/platformsupport/input/CMakeLists.txt index 5ecbbbbe307..f3d1b66a95f 100644 --- a/src/platformsupport/input/CMakeLists.txt +++ b/src/platformsupport/input/CMakeLists.txt @@ -11,6 +11,7 @@ qt_find_package(Mtdev) # special case add_qt_module(InputSupport STATIC + INTERNAL_MODULE DEFINES QT_NO_CAST_FROM_ASCII LIBRARIES diff --git a/src/platformsupport/input/xkbcommon/CMakeLists.txt b/src/platformsupport/input/xkbcommon/CMakeLists.txt index 5f4eca9fc84..1a96d5eafed 100644 --- a/src/platformsupport/input/xkbcommon/CMakeLists.txt +++ b/src/platformsupport/input/xkbcommon/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(XkbCommonSupport STATIC + INTERNAL_MODULE SOURCES qxkbcommon.cpp qxkbcommon_p.h qxkbcommon_3rdparty.cpp diff --git a/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt b/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt index a6e206d5cd9..ec29be7f4e2 100644 --- a/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt +++ b/src/platformsupport/kmsconvenience/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(KmsSupport STATIC + INTERNAL_MODULE SOURCES qkmsdevice.cpp qkmsdevice_p.h DEFINES diff --git a/src/platformsupport/kmsconvenience/CMakeLists.txt b/src/platformsupport/kmsconvenience/CMakeLists.txt index 3300c2d98de..a2ad5ecc9fe 100644 --- a/src/platformsupport/kmsconvenience/CMakeLists.txt +++ b/src/platformsupport/kmsconvenience/CMakeLists.txt @@ -8,6 +8,7 @@ qt_find_package(Libdrm) # special case add_qt_module(KmsSupport STATIC + INTERNAL_MODULE SOURCES qkmsdevice.cpp qkmsdevice_p.h DEFINES diff --git a/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt b/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt index f18b0597ce1..a5ad155a7a6 100644 --- a/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(LinuxAccessibilitySupport STATIC + INTERNAL_MODULE SOURCES application.cpp application_p.h atspiadaptor.cpp atspiadaptor_p.h diff --git a/src/platformsupport/linuxaccessibility/CMakeLists.txt b/src/platformsupport/linuxaccessibility/CMakeLists.txt index 41c86236d26..af48f9d57d7 100644 --- a/src/platformsupport/linuxaccessibility/CMakeLists.txt +++ b/src/platformsupport/linuxaccessibility/CMakeLists.txt @@ -8,6 +8,7 @@ qt_find_package(ATSPI2) # special case add_qt_module(LinuxAccessibilitySupport STATIC + INTERNAL_MODULE SOURCES application.cpp application_p.h atspiadaptor.cpp atspiadaptor_p.h diff --git a/src/platformsupport/platformcompositor/CMakeLists.txt b/src/platformsupport/platformcompositor/CMakeLists.txt index 1cb4752ead9..c37ba600b38 100644 --- a/src/platformsupport/platformcompositor/CMakeLists.txt +++ b/src/platformsupport/platformcompositor/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(PlatformCompositorSupport STATIC + INTERNAL_MODULE SOURCES qopenglcompositor.cpp qopenglcompositor_p.h qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h diff --git a/src/platformsupport/services/CMakeLists.txt b/src/platformsupport/services/CMakeLists.txt index 23e1d5e4cdc..b926030e128 100644 --- a/src/platformsupport/services/CMakeLists.txt +++ b/src/platformsupport/services/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(ServiceSupport STATIC + INTERNAL_MODULE SOURCES genericunix/qgenericunixservices.cpp genericunix/qgenericunixservices_p.h DEFINES diff --git a/src/platformsupport/themes/CMakeLists.txt b/src/platformsupport/themes/CMakeLists.txt index 9dca636b920..d5bb3e12790 100644 --- a/src/platformsupport/themes/CMakeLists.txt +++ b/src/platformsupport/themes/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(ThemeSupport STATIC + INTERNAL_MODULE SOURCES qabstractfileiconengine.cpp qabstractfileiconengine_p.h DEFINES diff --git a/src/platformsupport/vkconvenience/.prev_CMakeLists.txt b/src/platformsupport/vkconvenience/.prev_CMakeLists.txt index 92f672b8f3e..e48ce7f9ad1 100644 --- a/src/platformsupport/vkconvenience/.prev_CMakeLists.txt +++ b/src/platformsupport/vkconvenience/.prev_CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(VulkanSupport STATIC + INTERNAL_MODULE SOURCES qbasicvulkanplatforminstance.cpp qbasicvulkanplatforminstance_p.h qvkconvenience.cpp qvkconvenience_p.h diff --git a/src/platformsupport/vkconvenience/CMakeLists.txt b/src/platformsupport/vkconvenience/CMakeLists.txt index cc97c4041be..325da3f8f8a 100644 --- a/src/platformsupport/vkconvenience/CMakeLists.txt +++ b/src/platformsupport/vkconvenience/CMakeLists.txt @@ -8,6 +8,7 @@ qt_find_package(Vulkan) # special case add_qt_module(VulkanSupport STATIC + INTERNAL_MODULE SOURCES qbasicvulkanplatforminstance.cpp qbasicvulkanplatforminstance_p.h qvkconvenience.cpp qvkconvenience_p.h diff --git a/src/platformsupport/windowsuiautomation/CMakeLists.txt b/src/platformsupport/windowsuiautomation/CMakeLists.txt index e4e0eed64a3..1f0b545c83c 100644 --- a/src/platformsupport/windowsuiautomation/CMakeLists.txt +++ b/src/platformsupport/windowsuiautomation/CMakeLists.txt @@ -6,6 +6,7 @@ add_qt_module(WindowsUIAutomationSupport STATIC + INTERNAL_MODULE SOURCES qwindowsuiawrapper.cpp qwindowsuiawrapper_p.h uiaattributeids_p.h diff --git a/src/plugins/platforms/eglfs/.prev_CMakeLists.txt b/src/plugins/platforms/eglfs/.prev_CMakeLists.txt index 4af52dd0fee..e747e1d3c1e 100644 --- a/src/plugins/platforms/eglfs/.prev_CMakeLists.txt +++ b/src/plugins/platforms/eglfs/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(EglFSDeviceIntegration + INTERNAL_MODULE SOURCES api/qeglfsdeviceintegration.cpp api/qeglfsdeviceintegration_p.h api/qeglfsglobal_p.h diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt index 47b5f3cf64b..d7ca11acb67 100644 --- a/src/plugins/platforms/eglfs/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/CMakeLists.txt @@ -6,6 +6,7 @@ qt_find_package(EGL) # special case ##################################################################### add_qt_module(EglFSDeviceIntegration + INTERNAL_MODULE SOURCES api/qeglfsdeviceintegration.cpp api/qeglfsdeviceintegration_p.h api/qeglfsglobal_p.h diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt index fd7ba3cefb6..be26d40f4d2 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_support/CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(EglFsKmsSupport + INTERNAL_MODULE NO_MODULE_HEADERS SOURCES qeglfskmsdevice.cpp qeglfskmsdevice.h diff --git a/src/plugins/platforms/xcb/.prev_CMakeLists.txt b/src/plugins/platforms/xcb/.prev_CMakeLists.txt index c3d469f0c62..d7ce4e4489b 100644 --- a/src/plugins/platforms/xcb/.prev_CMakeLists.txt +++ b/src/plugins/platforms/xcb/.prev_CMakeLists.txt @@ -5,6 +5,7 @@ ##################################################################### add_qt_module(XcbQpa + INTERNAL_MODULE NO_MODULE_HEADERS SOURCES gl_integrations/qxcbglintegration.cpp gl_integrations/qxcbglintegration.h diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index aa2c0732f26..6849c75e2e9 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -27,6 +27,7 @@ qt_find_package(XKB_COMMON_X11 PROVIDED_TARGETS PkgConfig::XKB_COMMON_X11) ##################################################################### add_qt_module(XcbQpa + INTERNAL_MODULE NO_MODULE_HEADERS SOURCES gl_integrations/qxcbglintegration.cpp gl_integrations/qxcbglintegration.h diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index bd26e5782aa..bfd791a196d 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1605,6 +1605,8 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, extra = [] if 'static' in scope.get('CONFIG'): extra.append('STATIC') + if 'internal_module' in scope.get('CONFIG'): + extra.append('INTERNAL_MODULE') if 'no_module_headers' in scope.get('CONFIG'): extra.append('NO_MODULE_HEADERS') From e99f4a5c8929898167221518ea7a983046a64041 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 5 Jun 2019 16:26:42 +0200 Subject: [PATCH 0634/1322] cmake/ does not necessarily exist in a module E.g. qtsvg does not have a cmake/ folder Change-Id: I216776a4997709222064aa76195a32e7bdb6b080 Reviewed-by: Simon Hausmann --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 91e1efa23a6..79186ac046f 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -46,10 +46,12 @@ macro(qt_build_repo_end) qt_path_join(__qt_repo_install_dir ${QT_CONFIG_INSTALL_DIR} ${INSTALL_CMAKE_NAMESPACE}) if(NOT PROJECT_NAME STREQUAL "QtBase") - qt_copy_or_install(DIRECTORY cmake/ - DESTINATION "${__qt_repo_install_dir}" - FILES_MATCHING PATTERN "Find*.cmake" - ) + if (EXISTS cmake) + qt_copy_or_install(DIRECTORY cmake/ + DESTINATION "${__qt_repo_install_dir}" + FILES_MATCHING PATTERN "Find*.cmake" + ) + endif() endif() # Print a feature summary: From 1143b07948340449158bddd3ec123cf2755b42e2 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 5 Jun 2019 16:44:34 +0200 Subject: [PATCH 0635/1322] CMake: MinGW build fix Change-Id: Ica47189fd8f1811ce9e726fa0416e6ea8ae7af63 Reviewed-by: Simon Hausmann --- src/network/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index dc4f08e4cdf..7a6bf8f9e9d 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -428,7 +428,7 @@ extend_target(Network CONDITION QT_FEATURE_openssl AND QT_FEATURE_ssl AND WIN32 crypt32 ) -extend_target(Network CONDITION WIN32 LIBRARIES ws2_32) # special case: mkspecs/common/msvc-desktop.conf +extend_target(Network CONDITION WIN32 PUBLIC_LIBRARIES ws2_32) # special case: mkspecs/common/msvc-desktop.conf add_qt_docs( doc/qtnetwork.qdocconf From 64f17cca0449c4bcd2ba3590e0e9c481be46ac4c Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 5 Jun 2019 15:29:20 +0200 Subject: [PATCH 0636/1322] Export installation locations compatible with qmake -query Change-Id: I634bd1036ce197602d4acaf4535ab43227d120a8 Reviewed-by: Alexandru Croitor --- src/corelib/CMakeLists.txt | 10 ++++++++++ src/corelib/Qt5CoreConfigExtras.cmake.in | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 0cc5cf3f10a..1932af8b6d3 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -10,6 +10,16 @@ if (NOT WrapDoubleConversion_FOUND) sscanf_l/snprintf_l _snprintf_l/_sscanf_l. \ You need to use libdouble-conversion for double/string conversion.") endif() + +# compute the reverse relative path from QtCoreConfigExtras to the install prefix +# this is used in QtCoreConfigExtras to make its install paths relocatable +if(QT_WILL_INSTALL) + get_filename_component(_clean_prefix "${CMAKE_INSTALL_PREFIX}/${QT_CONFIG_INSTALL_DIR}" ABSOLUTE) +else() + get_filename_component(_clean_prefix "${QT_CONFIG_BUILD_DIR}" ABSOLUTE) +endif() +file(RELATIVE_PATH QT_INVERSE_CONFIG_INSTALL_DIR ${_clean_prefix} ${CMAKE_INSTALL_PREFIX}) + # special case end ##################################################################### diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 5fe0fd5252a..298dbe7e042 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -33,3 +33,20 @@ if (NOT QT_NO_CREATE_TARGETS) set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG>) set_property(TARGET @QT_CMAKE_EXPORT_NAMESPACE@::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype) endif() + +# install layout information, following what qmake -query provides +get_filename_component(QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../@QT_INVERSE_CONFIG_INSTALL_DIR@ ABSOLUTE) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_ARCHDATA ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_ARCHDATADIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_BINS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_BINDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_CONFIGURATION ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_SYSCONFDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_DATA ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_DATADIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_DOCS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_DOCDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_EXAMPLES ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_EXAMPLESDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_HEADERS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_INCLUDEDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_IMPORTS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_IMPORTDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_LIBS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_LIBDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_LIBEXECS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_LIBEXECDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_PLUGINS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_PLUGINSDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_QML ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_QMLDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_TESTS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_TESTSDIR@) +set(QT@PROJECT_VERSION_MAJOR@_INSTALL_TRANSLATIONS ${QT@PROJECT_VERSION_MAJOR@_INSTALL_PREFIX}/@INSTALL_TRANSLATIONSDIR@) From 143981b570df906b036165c243da155daee3b599 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 5 Jun 2019 16:54:52 +0200 Subject: [PATCH 0637/1322] Add the Android QPA plugin to the CMake build Had to apply on unused-variable -Werror fix on top. Change-Id: I4e8decf1e0a1bd56d4168bc2c7153ef3f5e31e13 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- src/plugins/platforms/CMakeLists.txt | 2 +- src/plugins/platforms/android/CMakeLists.txt | 92 +++++++++++++++++++ .../android/qandroidplatformwindow.h | 4 +- 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 src/plugins/platforms/android/CMakeLists.txt diff --git a/src/plugins/platforms/CMakeLists.txt b/src/plugins/platforms/CMakeLists.txt index 5d187ffc335..fc743c955f1 100644 --- a/src/plugins/platforms/CMakeLists.txt +++ b/src/plugins/platforms/CMakeLists.txt @@ -1,5 +1,5 @@ if(ANDROID) # AND NOT android-embedded -# TODO add_subdirectory(android) + add_subdirectory(android) endif() if(NOT ANDROID) diff --git a/src/plugins/platforms/android/CMakeLists.txt b/src/plugins/platforms/android/CMakeLists.txt new file mode 100644 index 00000000000..b60712a7188 --- /dev/null +++ b/src/plugins/platforms/android/CMakeLists.txt @@ -0,0 +1,92 @@ +# Generated from android.pro. + +##################################################################### +## qtforandroid Plugin: +##################################################################### + +add_qt_plugin(qtforandroid + TYPE platforms + SOURCES + androidcontentfileengine.cpp androidcontentfileengine.h + androiddeadlockprotector.cpp androiddeadlockprotector.h + androidjniaccessibility.cpp androidjniaccessibility.h + androidjniclipboard.cpp androidjniclipboard.h + androidjniinput.cpp androidjniinput.h + androidjnimain.cpp androidjnimain.h + androidjnimenu.cpp androidjnimenu.h + androidplatformplugin.cpp + androidsurfaceclient.h + qandroidassetsfileenginehandler.cpp qandroidassetsfileenginehandler.h + qandroideventdispatcher.cpp qandroideventdispatcher.h + qandroidinputcontext.cpp qandroidinputcontext.h + qandroidplatformaccessibility.cpp qandroidplatformaccessibility.h + qandroidplatformbackingstore.cpp qandroidplatformbackingstore.h + qandroidplatformclipboard.cpp qandroidplatformclipboard.h + qandroidplatformdialoghelpers.cpp qandroidplatformdialoghelpers.h + qandroidplatformfiledialoghelper.cpp qandroidplatformfiledialoghelper.h + qandroidplatformfontdatabase.cpp qandroidplatformfontdatabase.h + qandroidplatformforeignwindow.cpp qandroidplatformforeignwindow.h + qandroidplatformintegration.cpp qandroidplatformintegration.h + qandroidplatformmenu.cpp qandroidplatformmenu.h + qandroidplatformmenubar.cpp qandroidplatformmenubar.h + qandroidplatformmenuitem.cpp qandroidplatformmenuitem.h + qandroidplatformoffscreensurface.cpp qandroidplatformoffscreensurface.h + qandroidplatformopenglcontext.cpp qandroidplatformopenglcontext.h + qandroidplatformopenglwindow.cpp qandroidplatformopenglwindow.h + qandroidplatformscreen.cpp qandroidplatformscreen.h + qandroidplatformservices.cpp qandroidplatformservices.h + qandroidplatformtheme.cpp qandroidplatformtheme.h + qandroidplatformwindow.cpp qandroidplatformwindow.h + qandroidsystemlocale.cpp qandroidsystemlocale.h + DEFINES + QT_STATICPLUGIN + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/src/3rdparty/android + LIBRARIES + Qt::AccessibilitySupportPrivate + Qt::CorePrivate + Qt::EglSupportPrivate + Qt::EventDispatcherSupportPrivate + Qt::FontDatabaseSupportPrivate + Qt::GuiPrivate + PUBLIC_LIBRARIES + Qt::AccessibilitySupport + Qt::Core + Qt::EglSupport + Qt::EventDispatcherSupport + Qt::FontDatabaseSupport + Qt::Gui + android + jnigraphics +) + +#### Keys ignored in scope 1:.:.:android.pro:: +# DESTDIR = "$$DESTDIR/android" +# OTHER_FILES = "$$PWD/android.json" +# PLUGIN_TYPE = "platforms" +# _LOADED = "qt_plugin" +# target.path = "$${target.path}/android" + +## Scopes: +##################################################################### + +extend_target(qtforandroid CONDITION QT_FEATURE_vulkan + SOURCES + qandroidplatformvulkaninstance.cpp qandroidplatformvulkaninstance.h + qandroidplatformvulkanwindow.cpp qandroidplatformvulkanwindow.h + LIBRARIES + Qt::VulkanSupportPrivate + PUBLIC_LIBRARIES + Qt::VulkanSupport +) + +extend_target(qtforandroid CONDITION QT_FEATURE_android_style_assets + SOURCES + extract.cpp +) + +extend_target(qtforandroid CONDITION NOT QT_FEATURE_android_style_assets + SOURCES + extract-dummy.cpp +) diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h index 5edd2747595..d8eb6b7b7f2 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.h +++ b/src/plugins/platforms/android/qandroidplatformwindow.h @@ -65,8 +65,8 @@ public: void setParent(const QPlatformWindow *window) override; WId winId() const override { return m_windowId; } - bool setMouseGrabEnabled(bool grab) override { return false; } - bool setKeyboardGrabEnabled(bool grab) override { return false; } + bool setMouseGrabEnabled(bool grab) override { Q_UNUSED(grab); return false; } + bool setKeyboardGrabEnabled(bool grab) override { Q_UNUSED(grab); return false; } QAndroidPlatformScreen *platformScreen() const; From aa548e09c78ee926231f68868f95e13737539e2f Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 5 Jun 2019 16:23:53 +0200 Subject: [PATCH 0638/1322] cmake: Ensure syncqt.pl from source is found ... in superbuilds. PROJECT_SOURCE_DIR points to the wrong directory in that case. Change-Id: Ic0cba254734c4693b418dd8a0d8e77063914a9de Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index afd50c55acd..e22a56f717b 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -561,12 +561,13 @@ function(qt_ensure_sync_qt) endif() # When building qtbase, use the source syncqt, otherwise use the installed one. - if(EXISTS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl") - set(QT_SYNCQT "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" CACHE FILEPATH "syncqt script") + set(SYNCQT_FROM_SOURCE "${QtBase_SOURCE_DIR}/bin/syncqt.pl") + if(EXISTS "${SYNCQT_FROM_SOURCE}") + set(QT_SYNCQT "${SYNCQT_FROM_SOURCE}" CACHE FILEPATH "syncqt script") message(STATUS "Using source syncqt found at: ${QT_SYNCQT}") qt_path_join(syncqt_install_dir ${QT_INSTALL_DIR} ${INSTALL_LIBEXECDIR}) - qt_copy_or_install(PROGRAMS "${PROJECT_SOURCE_DIR}/bin/syncqt.pl" + qt_copy_or_install(PROGRAMS "${SYNCQT_FROM_SOURCE}" DESTINATION "${syncqt_install_dir}") else() get_filename_component(syncqt_absolute_path From af074c2c0dc73db5e7e6f167965fad80e1549427 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Wed, 5 Jun 2019 17:15:20 +0200 Subject: [PATCH 0639/1322] cmake: Generate QtBuildInternalsExtra at conftime ... using configure_file. Change-Id: Ibe3522c33e20a86c454b23919547775624f84755 Reviewed-by: Alexandru Croitor --- cmake/QtBuildInternalsExtra.cmake.in | 17 ++++++++++++++ cmake/QtPostProcess.cmake | 33 +++++----------------------- 2 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 cmake/QtBuildInternalsExtra.cmake.in diff --git a/cmake/QtBuildInternalsExtra.cmake.in b/cmake/QtBuildInternalsExtra.cmake.in new file mode 100644 index 00000000000..028cfe27178 --- /dev/null +++ b/cmake/QtBuildInternalsExtra.cmake.in @@ -0,0 +1,17 @@ +# Propagate common variables via BuildInternals package. +set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@) +option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" @BUILD_SHARED_LIBS@) +set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@) +set(INSTALL_CMAKE_NAMESPACE @INSTALL_CMAKE_NAMESPACE@) +set(CMAKE_BUILD_TYPE @CMAKE_BUILD_TYPE@) +set(QT_BUILD_INTERNALS_PATH "${CMAKE_CURRENT_LIST_DIR}") + +# Propagate the original install prefix, so that a developer building a child module can +# specify CMAKE_PREFIX_PATH for finding the Qt modules instead of CMAKE_INSTALL_PREFIX. +set(CMAKE_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@ CACHE PATH + "Install path prefix, prepended onto install directories." FORCE) + +# Propagate developer builds to other modules via BuildInternals package. +if(@FEATURE_developer_build@) + set(FEATURE_developer_build ON CACHE BOOL "Developer build." FORCE) +endif() diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index d619aebdadb..24f0621fc4d 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -258,37 +258,14 @@ endfunction() function(qt_generate_build_internals_extra_cmake_code) if(PROJECT_NAME STREQUAL "QtBase") - # Propagate common variables via BuildInternals package. - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE - "set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})") - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -option(BUILD_SHARED_LIBS \"Build Qt statically or dynamically\" ${BUILD_SHARED_LIBS})") - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -set(INSTALL_CMAKE_NAMESPACE ${INSTALL_CMAKE_NAMESPACE})") - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE})") - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -set(QT_BUILD_INTERNALS_PATH \"\${CMAKE_CURRENT_LIST_DIR}\")") - - # Propagate the original install prefix, so that a developer building a child module can - # specify CMAKE_PREFIX_PATH for finding the Qt modules instead of CMAKE_INSTALL_PREFIX. - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -set(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH -\"Install path prefix, prepended onto install directories.\" FORCE)") - - # Propagate developer builds to other modules via BuildInternals package. - if(FEATURE_developer_build) - string(APPEND QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE " -set(FEATURE_developer_build ON CACHE BOOL \"Developer build.\" FORCE)") - endif() - qt_path_join(extra_file_path ${QT_CONFIG_BUILD_DIR} ${INSTALL_CMAKE_NAMESPACE}BuildInternals/QtBuildInternalsExtra.cmake) - file(GENERATE OUTPUT "${extra_file_path}" - CONTENT "${QT_BUILD_INTERNALS_EXTRA_CMAKE_CODE}") + configure_file( + "${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake.in" + "${extra_file_path}" + @ONLY + ) endif() endfunction() From f5a494f3c12451e0ea1a9ad82ad694a652be04e2 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 5 Jun 2019 16:05:50 +0200 Subject: [PATCH 0640/1322] Introduce Platform*Internal targets Link to them from add_qt_module/plugin/tool This way we set the warnings_are_errors flags just once and also non-qtbase modules get them Change-Id: I2b65a81694aaebdd7c886249f217c11f79492bad Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 5 ++- cmake/QtBuild.cmake | 69 ++------------------------------- cmake/QtInternalTargets.cmake | 69 +++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 67 deletions(-) create mode 100644 cmake/QtInternalTargets.cmake diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 160d7141d56..0b4bfa093c4 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -92,7 +92,10 @@ target_include_directories(GlobalConfigPrivate INTERFACE ) add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) -set(__export_targets Platform GlobalConfig GlobalConfigPrivate) +# defines PlatformModuleInternal PlatformPluginInternal PlatformToolInternal +include(QtInternalTargets) + +set(__export_targets Platform GlobalConfig GlobalConfigPrivate PlatformModuleInternal PlatformPluginInternal PlatformToolInternal) set(__export_name "${INSTALL_CMAKE_NAMESPACE}Targets") qt_install(TARGETS ${__export_targets} EXPORT "${__export_name}") qt_install(EXPORT ${__export_name} diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index e22a56f717b..c3eb321ad45 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1035,60 +1035,6 @@ function(qt_internal_set_no_exceptions_flags target) endif() endfunction() -function(qt_internal_set_warnings_are_errors_flags target) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - # Regular clang 3.0+ - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "3.0.0") - target_compile_options("${target}" PRIVATE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) - endif() - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") - # using AppleClang - # Apple clang 4.0+ - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0") - target_compile_options("${target}" PRIVATE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) - endif() - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - # using GCC - target_compile_options("${target}" PRIVATE -Werror -Wno-error=cpp -Wno-error=deprecated-declarations) - - # GCC prints this bogus warning, after it has inlined a lot of code - # error: assuming signed overflow does not occur when assuming that (X + c) < X is always false - target_compile_options("${target}" PRIVATE -Wno-error=strict-overflow) - - # GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs. - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0") - target_compile_options("${target}" PRIVATE -Wno-error=implicit-fallthrough) - endif() - - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0.0") - # GCC 9 introduced these but we are not clean for it. - target_compile_options("${target}" PRIVATE -Wno-error=deprecated-copy -Wno-error=redundant-move -Wno-error=init-list-lifetime) - endif() - - # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135 - if (ANDROID) - target_compile_options("${target}" PRIVATE -Wno-error=literal-suffix) - endif() - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") - # Intel CC 13.0 +, on Linux only - if (LINUX) - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0.0") - # 177: function "entity" was declared but never referenced - # (too aggressive; ICC reports even for functions created due to template instantiation) - # 1224: #warning directive - # 1478: function "entity" (declared at line N) was declared deprecated - # 1786: function "entity" (declared at line N of "file") was declared deprecated ("message") - # 1881: argument must be a constant null pointer value - # (NULL in C++ is usually a literal 0) - target_compile_options("${target}" PRIVATE -Werror -ww177,1224,1478,1786,1881) - endif() - endif() - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - # using Visual Studio C++ - target_compile_options("${target}" PRIVATE /WX) - endif() -endfunction() - # This is the main entry function for creating a Qt module, that typically # consists of a library, public header files, private header files and configurable # features. @@ -1207,7 +1153,7 @@ function(add_qt_module target) QT_BUILD_${module_define}_LIB ### FIXME: use QT_BUILD_ADDON for Add-ons or remove if we don't have add-ons anymore "${deprecation_define}" PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} - LIBRARIES ${arg_LIBRARIES} + LIBRARIES ${arg_LIBRARIES} Qt::PlatformModuleInternal FEATURE_DEPENDENCIES ${arg_FEATURE_DEPENDENCIES} DBUS_ADAPTOR_SOURCES ${arg_DBUS_ADAPTOR_SOURCES} DBUS_ADAPTOR_FLAGS ${arg_DBUS_ADAPTOR_FLAGS} @@ -1233,9 +1179,6 @@ function(add_qt_module target) if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${target}") endif() - if(WARNINGS_ARE_ERRORS) - qt_internal_set_warnings_are_errors_flags("${target}") - endif() set(configureFile "${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake") if(EXISTS "${configureFile}") @@ -1545,7 +1488,7 @@ function(add_qt_plugin target) $ ${arg_INCLUDE_DIRECTORIES} PUBLIC_INCLUDE_DIRECTORIES ${arg_PUBLIC_INCLUDE_DIRECTORIES} - LIBRARIES ${arg_LIBRARIES} + LIBRARIES ${arg_LIBRARIES} Qt::PlatformPluginInternal PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} DEFINES ${arg_DEFINES} @@ -1575,9 +1518,6 @@ function(add_qt_plugin target) if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${target}") endif() - if(WARNINGS_ARE_ERRORS) - qt_internal_set_warnings_are_errors_flags("${target}") - endif() set(qt_libs_private "") @@ -1864,16 +1804,13 @@ function(add_qt_tool name) ${arg_INCLUDE_DIRECTORIES} DEFINES ${arg_DEFINES} PUBLIC_LIBRARIES ${corelib} - LIBRARIES ${arg_LIBRARIES} + LIBRARIES ${arg_LIBRARIES} Qt::PlatformToolInternal COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} LINK_OPTIONS ${arg_LINK_OPTIONS} MOC_OPTIONS ${arg_MOC_OPTIONS} DISABLE_AUTOGEN_TOOLS ${disable_autogen_tools} ) qt_internal_add_target_aliases("${name}") - if(WARNINGS_ARE_ERRORS) - qt_internal_set_warnings_are_errors_flags("${name}") - endif() if(NOT arg_NO_INSTALL AND arg_TOOLS_TARGET) # Assign a tool to an export set, and mark the module to which the tool belongs. diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake new file mode 100644 index 00000000000..832e5d21b49 --- /dev/null +++ b/cmake/QtInternalTargets.cmake @@ -0,0 +1,69 @@ + +function(qt_internal_set_warnings_are_errors_flags target) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # Regular clang 3.0+ + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "3.0.0") + target_compile_options("${target}" INTERFACE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + # using AppleClang + # Apple clang 4.0+ + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0") + target_compile_options("${target}" INTERFACE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # using GCC + target_compile_options("${target}" INTERFACE -Werror -Wno-error=cpp -Wno-error=deprecated-declarations) + + # GCC prints this bogus warning, after it has inlined a lot of code + # error: assuming signed overflow does not occur when assuming that (X + c) < X is always false + target_compile_options("${target}" INTERFACE -Wno-error=strict-overflow) + + # GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs. + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0") + target_compile_options("${target}" INTERFACE -Wno-error=implicit-fallthrough) + endif() + + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0.0") + # GCC 9 introduced these but we are not clean for it. + target_compile_options("${target}" INTERFACE -Wno-error=deprecated-copy -Wno-error=redundant-move -Wno-error=init-list-lifetime) + endif() + + # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135 + if (ANDROID) + target_compile_options("${target}" INTERFACE -Wno-error=literal-suffix) + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + # Intel CC 13.0 +, on Linux only + if (LINUX) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0.0") + # 177: function "entity" was declared but never referenced + # (too aggressive; ICC reports even for functions created due to template instantiation) + # 1224: #warning directive + # 1478: function "entity" (declared at line N) was declared deprecated + # 1786: function "entity" (declared at line N of "file") was declared deprecated ("message") + # 1881: argument must be a constant null pointer value + # (NULL in C++ is usually a literal 0) + target_compile_options("${target}" INTERFACE -Werror -ww177,1224,1478,1786,1881) + endif() + endif() + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # using Visual Studio C++ + target_compile_options("${target}" INTERFACE /WX) + endif() +endfunction() + +add_library(PlatformModuleInternal INTERFACE) +add_library(Qt::PlatformModuleInternal ALIAS PlatformModuleInternal) + +add_library(PlatformPluginInternal INTERFACE) +add_library(Qt::PlatformPluginInternal ALIAS PlatformPluginInternal) + +add_library(PlatformToolInternal INTERFACE) +add_library(Qt::PlatformToolInternal ALIAS PlatformToolInternal) + +if(WARNINGS_ARE_ERRORS) + qt_internal_set_warnings_are_errors_flags(PlatformModuleInternal) + qt_internal_set_warnings_are_errors_flags(PlatformPluginInternal) + qt_internal_set_warnings_are_errors_flags(PlatformToolInternal) +endif() From 82941a3f1bab6c385376761d53456c838b6cbaad Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 22:41:38 +0200 Subject: [PATCH 0641/1322] Fix some configure.json conditions for qtimageformats The auto-generated add_subdirectory conditions in qtimageformats use QT_FEATURE_foo and not QT_FEATURE_system_foo. But the non-system ones don't actually check if the respective qt_find_package(TIFF) got found. Fix the conditions of the non system features to be the same as the system ones. Change-Id: I96f889cf7061721b829d562707c42aa0e29720df Reviewed-by: Simon Hausmann --- util/cmake/configurejson2cmake.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 2de2567803e..f929ac142d1 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -716,9 +716,15 @@ def parseFeature(ctx, feature, data, cm_fh): 'system-sqlite': None, 'system-xcb': None, 'system-zlib': None, + 'tiff': { + 'condition': 'QT_FEATURE_imageformatplugin AND TIFF_FOUND' + }, 'use_gold_linker': None, 'verifyspec': None, # qmake specific... 'warnings_are_errors': None, # FIXME: Do we need these? + 'webp': { + 'condition': 'QT_FEATURE_imageformatplugin AND WrapWebP_FOUND' + }, 'xkbcommon-system': None, # another system library, just named a bit different from the rest } From 37cdd44982466546376375328712b9c05fa8a529 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 6 Jun 2019 10:11:15 +0200 Subject: [PATCH 0642/1322] Fix "make install" Don't try to report an installable public module .pri file for internal modules. Change-Id: Ide6a50420e0b5448b141c842df4c891baca4a9d9 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- cmake/QtBuild.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c3eb321ad45..166bb3b6c4f 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -301,8 +301,7 @@ function(qt_generate_module_pri_file target target_path pri_files_var) cmake_parse_arguments(arg "${flags}" "${options}" "${multiopts}" ${ARGN}) qt_internal_module_info(module "${target}") - qt_path_join(pri_file_name "${target_path}" "qt_lib_${module_lower}.pri") - set(pri_files "${pri_file_name}") + set(pri_files) get_target_property(enabled_features "${target}" QT_ENABLED_PUBLIC_FEATURES) get_target_property(disabled_features "${target}" QT_DISABLED_PUBLIC_FEATURES) @@ -325,6 +324,9 @@ function(qt_generate_module_pri_file target target_path pri_files_var) endif() if (NOT ${arg_INTERNAL_MODULE}) + qt_path_join(pri_file_name "${target_path}" "qt_lib_${module_lower}.pri") + list(APPEND pri_files "${pri_file_name}") + file(GENERATE OUTPUT "${pri_file_name}" CONTENT From 89b7f7671924f810c34637ee1f91de33a720521a Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 6 Jun 2019 10:31:55 +0200 Subject: [PATCH 0643/1322] Android: Move Platform Include Move the include of the platform from QtPlatformSupport to QtSetup. This no longer causes compile tests to fail since they expect explicit include paths instead of using CMAKE_MODULE_PATH. Change-Id: I9d3bed7845104d84422afb5a976ec14b111d259d Reviewed-by: Simon Hausmann --- cmake/QtPlatformSupport.cmake | 4 ---- cmake/QtSetup.cmake | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index 9a3befc4200..ac9973905af 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -79,7 +79,3 @@ endfunction() if(CMAKE_CXX_COMPILER_VERSION) qt_parse_version_string("${CMAKE_CXX_COMPILER_VERSION}" "QT_COMPILER_VERSION") endif() - -if(ANDROID) - include(QtPlatformAndroid) -endif() diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index e7ec66b322e..62d4b0decea 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -63,6 +63,11 @@ enable_testing() ## Define some constants to check for certain platforms, etc: include(QtPlatformSupport) +## Android platform settings +if(ANDROID) + include(QtPlatformAndroid) +endif() + ## add_qt_module and co.: include(QtBuild) From 4e907f1f62e2dc5676aeb48b99494709b7bf9d50 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 6 Jun 2019 10:31:03 +0200 Subject: [PATCH 0644/1322] Fix comment fixup in pro2cmake Comments should be removed before line continuations, otherwise the semantics of an assignment change. Found this during reconversion of qtimageformats. Adjust test to specifically test for all the expected values. Amends 76f5b784ce54730ed8d6ad4bb9c39c9a05c5d81d. Change-Id: Iaa46bbc9cbd7b2390fe9b5f0078ac33d225a9258 Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 2 +- util/cmake/tests/test_parsing.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index bfd791a196d..2eda9b69d3e 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -870,8 +870,8 @@ class QmakeParser: contents = file_fd.read() old_contents = contents - contents = fixup_linecontinuation(contents) contents = fixup_comments(contents) + contents = fixup_linecontinuation(contents) if old_contents != contents: print('Warning: Fixed line continuation in .pro-file!\n' diff --git a/util/cmake/tests/test_parsing.py b/util/cmake/tests/test_parsing.py index 11d1ed093f9..f924b139133 100755 --- a/util/cmake/tests/test_parsing.py +++ b/util/cmake/tests/test_parsing.py @@ -308,6 +308,25 @@ def test_realworld_lc(): def test_realworld_lc_with_comment_in_between(): result = parse_file(_tests_path + '/data/lc_with_comment.pro') + + my_var = result[1]['value'][0] + assert my_var == 'foo' + + my_var = result[2]['value'][0] + assert my_var == 'foo2' + + my_var = result[3]['value'][0] + assert my_var == 'foo3' + + my_var = result[4]['value'][0] + assert my_var == 'foo4' + + my_var = result[5]['value'][0] + assert my_var == 'foo5' + + sub_dirs = result[0]['value'] + assert sub_dirs[0] == 'tga' + assert sub_dirs[1] == 'wbmp' assert len(result) == 6 From ac16a1228c0d16012658a97f9de4825b5a2ae97f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 6 Jun 2019 09:03:48 +0200 Subject: [PATCH 0645/1322] Prevent accidental conflicts with external cmake configuration files Make sure to prepend our own paths instead of appending, as we'd like cmake to search there first. Change-Id: I0caea3a2654fbb07d5843f255cc35fca8892e19d Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6be7a6edcbb..841ea3fa03f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,14 +8,14 @@ project(QtBase ) ## Add some paths to check for cmake modules: -list(APPEND CMAKE_MODULE_PATH +list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules/find-modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin" ) ## Find the build internals package. -list(APPEND CMAKE_PREFIX_PATH +list(PREPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ) find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH) From 053766d7968296b171aea1410a0e00184309185c Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 6 Jun 2019 13:08:41 +0200 Subject: [PATCH 0646/1322] Fix Standalone Example build when crosscompiling Added qt_examples_begin() and qt_examples_end() macros to setup the example list so it can be re-used in other projects. When cross-compiling, we also need to set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE to BOTH in order for find_package() to work correctly. Removed support for building the whole qtbase/examples folder as a standalone project. Building examples is only supported when building the whole of qtbase (qtbase + examples together) or each individual example is built separately against an installed Qt version. Change-Id: I9d26b94b48b95af230b76ab618becb21d2d45581 Reviewed-by: Simon Hausmann --- .../QtBuildInternalsConfig.cmake | 31 +++++++++++++++ examples/CMakeLists.txt | 38 +------------------ 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 79186ac046f..6a1202ac2eb 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -96,3 +96,34 @@ macro(qt_build_tests) add_subdirectory(benchmarks) endif() endmacro() + +macro(qt_examples_build_begin) + # It is part of a Qt build => Use the CMake config files from the binary dir + list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}") + # Also make sure the CMake config files do not recreate the already-existing targets + set(QT_NO_CREATE_TARGETS TRUE) + set(BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE "BOTH") +endmacro() + +macro(qt_examples_build_end) + # We use AUTOMOC/UIC/RCC in the examples. Make sure to not fail on a fresh Qt build, that e.g. the moc binary does not exist yet. + + # This function gets all targets below this directory + function(get_all_targets _result _dir) + get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES) + foreach(_subdir IN LISTS _subdirs) + get_all_targets(${_result} "${_subdir}") + endforeach() + get_property(_sub_targets DIRECTORY "${_dir}" PROPERTY BUILDSYSTEM_TARGETS) + set(${_result} ${${_result}} ${_sub_targets} PARENT_SCOPE) + endfunction() + + get_all_targets(targets "${CMAKE_CURRENT_SOURCE_DIR}") + + foreach(target ${targets}) + qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS "moc" "uic" "rcc") + endforeach() + + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE}) +endmacro() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 5f61a098bd0..c9abbd8ec97 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,21 +1,6 @@ # special case begin -cmake_minimum_required(VERSION 3.14.0) +qt_examples_build_begin() -project(QtBaseExamples LANGUAGES CXX C ASM) - -# Check whether this project is built as part of a Qt build -if (CMAKE_PROJECT_NAME STREQUAL "QtBaseExamples") - set(QT_STANDALONE_EXAMPLES_BUILD TRUE) -endif() - -if (NOT QT_STANDALONE_EXAMPLES_BUILD) - # It is part of a Qt build => Use the CMake config files from the binary dir - list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}") - # Also make sure the CMake config files do not recreate the already-existing targets - set(QT_NO_CREATE_TARGETS TRUE) -endif() - -find_package(Qt5 COMPONENTS DBus Network Test Concurrent Sql Widgets Xml Gui) # special case end # Generated from examples.pro. @@ -65,24 +50,5 @@ if(TARGET Qt::Gui) endif() # special case begin -if (NOT QT_STANDALONE_EXAMPLES_BUILD) - # We use AUTOMOC/UIC/RCC in the examples. Make sure to not fail on a fresh Qt build, that e.g. the moc binary does not exist yet. - - # This function gets all targets below this directory - function(get_all_targets _result _dir) - get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES) - foreach(_subdir IN LISTS _subdirs) - get_all_targets(${_result} "${_subdir}") - endforeach() - get_property(_sub_targets DIRECTORY "${_dir}" PROPERTY BUILDSYSTEM_TARGETS) - set(${_result} ${${_result}} ${_sub_targets} PARENT_SCOPE) - endfunction() - - get_all_targets(targets "${CMAKE_CURRENT_SOURCE_DIR}") - - foreach(target ${targets}) - qt_autogen_tools(${target} ENABLE_AUTOGEN_TOOLS "moc" "uic" "rcc") - endforeach() - -endif() +qt_examples_build_end() # special case end From e7d1ec61e39da682fb4942af9a9bf74a9dd5913c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 22:26:12 +0200 Subject: [PATCH 0647/1322] Collect more known modules when considering private libraries in extend_target. In extend_target(Foo) we go over all the ModulePrivate dependencies to assign them to FooPrivate. To do that we use the QT_KNOWN_MODULES variable. The problem is that the variable gets reset when we build a new repository, so when we build qtdeclarative, QT_KNOWN_MODULES has no entries for Core, Gui, etc, but only Qml, Quick, etc. And yet QmlPrivate has to depend on CorePrivate. Change the module Config.cmake files to append their target name to a global variable called QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE. The global variable gets populated every time find_package(QtFoo) is called. Use the union of QT_KNOWN_MODULES and QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE when considering FooPrivate libraries. Change-Id: Ibd9449744478cea58eb5d9737cc8887b4df92420 Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 13 +++++++++++-- cmake/QtModuleConfig.cmake.in | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 166bb3b6c4f..3ea85504c2c 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -849,9 +849,18 @@ function(extend_target target) _qt_target_deps "${target_deps}" ) - # When a public module depends on private, also make its private depend on the other's private + # When computing the private library dependencies, we need to check not only the known + # modules added by this repo's qt_build_repo() (which are stored in QT_KNOWN_MODULES), but + # also all module dependencies that were found via find_package() (which are stored in + # QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE). + set(known_modules ${QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE} ${QT_KNOWN_MODULES}) + list(REMOVE_DUPLICATES known_modules) + + # When a public module depends on a private module (Gui on CorePrivate) + # make its private module depend on the other private module (GuiPrivate will depend on + # CorePrivate). set(qt_libs_private "") - foreach(it ${QT_KNOWN_MODULES}) + foreach(it ${known_modules}) list(FIND arg_LIBRARIES "Qt::${it}Private" pos) if(pos GREATER -1) list(APPEND qt_libs_private "Qt::${it}Private") diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index fcf5ba4644d..0522b7d1e23 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -31,3 +31,5 @@ set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" TRUE) if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake") include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake") endif() + +list(APPEND QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE "@target@") From abe12f600b1f626c9d228ad5234c14784e7845f1 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 6 Jun 2019 15:09:40 +0200 Subject: [PATCH 0648/1322] Simplify per-module option handling Move flags/options that we use for modules from add_module to the new platform module target. Change-Id: I89e414690336dcd37253432fe5116226d1c8dd82 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 14 -------------- cmake/QtInternalTargets.cmake | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3ea85504c2c..8f0fbc674d1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1179,14 +1179,6 @@ function(add_qt_module target) DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) - if(WIN32) - # Needed for M_PI define. Same as mkspecs/features/qt_module.prf. - # It's set for every module being built, but it's not propagated to user apps. - target_compile_definitions("${target}" PRIVATE _USE_MATH_DEFINES) - endif() - if(FEATURE_largefile) - target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") - endif() if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${target}") endif() @@ -1332,12 +1324,6 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") if(NOT ${arg_DISABLE_TOOLS_EXPORT}) qt_export_tools(${target}) endif() - - # We can't use the gold linker on android with the NDK, which is the default - # linker. To build our own target we will use the lld linker. - if (ANDROID) - target_link_options("${target}" PRIVATE -fuse-ld=lld) - endif() endfunction() function(qt_export_tools module_name) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 832e5d21b49..7ca78fbbff8 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -67,3 +67,17 @@ if(WARNINGS_ARE_ERRORS) qt_internal_set_warnings_are_errors_flags(PlatformPluginInternal) qt_internal_set_warnings_are_errors_flags(PlatformToolInternal) endif() +if(WIN32) + # Needed for M_PI define. Same as mkspecs/features/qt_module.prf. + # It's set for every module being built, but it's not propagated to user apps. + target_compile_definitions(PlatformModuleInternal INTERFACE _USE_MATH_DEFINES) +endif() +if(FEATURE_largefile) + target_compile_definitions(PlatformModuleInternal INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") +endif() + +# We can't use the gold linker on android with the NDK, which is the default +# linker. To build our own target we will use the lld linker. +if (ANDROID) + target_link_options(PlatformModuleInternal INTERFACE -fuse-ld=lld) +endif() From 39f720e6ddf5b37159e25e6263a5931d61e5f01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Thu, 6 Jun 2019 16:18:37 +0200 Subject: [PATCH 0649/1322] MSVC: Split the warning suppression compile options string cl: Command line error D8021 : invalid numeric argument '/wd4530 /wd4577' Change-Id: I222e779870ebacfc6f8a71e90dbf47867a84f72f Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 8f0fbc674d1..f2db5134dae 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1034,7 +1034,7 @@ endfunction() function(qt_internal_set_no_exceptions_flags target) target_compile_definitions("${target}" PRIVATE "QT_NO_EXCEPTIONS") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - target_compile_options("${target}" PRIVATE "/wd4530 /wd4577") + target_compile_options("${target}" PRIVATE "/wd4530" "/wd4577") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") target_compile_options("${target}" PRIVATE "-fno-exceptions") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") From aa956e08229ee4884d88cc63b640b2cf19ef45d3 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 5 Jun 2019 16:10:59 +0200 Subject: [PATCH 0650/1322] Change qt_build_repo to build tools if present and needed This is needed for qtdeclarative, to automatically start building the tools if needed. Change-Id: I3cbe129e8bb6fa8572a8e34fd3653b51727cb244 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index 6a1202ac2eb..e4468aa3555 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -70,6 +70,12 @@ macro(qt_build_repo) add_subdirectory(src) endif() + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt") + ## Decide whether tools will be built. + qt_check_if_tools_will_be_built() + add_subdirectory(tools) + endif() + if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") find_package(Qt5 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test Xml) add_subdirectory(tests) From 38b1474c516810b7c1bef8d660ff594817f1cf08 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 7 Jun 2019 10:51:55 +0200 Subject: [PATCH 0651/1322] Handle minimal_syncqt as not running syncqt for now This is needed for QmlDevTools in qtdeclarative. Change-Id: I41adec15f292c91192e171b45d1e5d48764c37c4 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 4 ++-- util/cmake/pro2cmake.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f2db5134dae..30986c14fbd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1061,7 +1061,7 @@ function(add_qt_module target) # Process arguments: qt_parse_all_arguments(arg "add_qt_module" - "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE" + "NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE;NO_SYNC_QT" "CONFIG_MODULE_NAME" "${__default_private_args};${__default_public_args};QMAKE_MODULE_CONFIG" ${ARGN}) @@ -1087,7 +1087,7 @@ function(add_qt_module target) qt_internal_add_target_aliases("${target_private}") # Module headers: - if(${arg_NO_MODULE_HEADERS}) + if(${arg_NO_MODULE_HEADERS} OR ${arg_NO_SYNC_QT}) set_target_properties("${target}" PROPERTIES MODULE_HAS_HEADERS OFF) else() # Use QT_BUILD_DIR for the syncqt call. diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 2eda9b69d3e..0de5fce5591 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1609,6 +1609,8 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, extra.append('INTERNAL_MODULE') if 'no_module_headers' in scope.get('CONFIG'): extra.append('NO_MODULE_HEADERS') + if 'minimal_syncqt' in scope.get('CONFIG'): + extra.append('NO_SYNC_QT') module_config = scope.get("MODULE_CONFIG") if len(module_config): From 44c9ad561799b51c1e4d10c8b9821fbff6143ef1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 7 Jun 2019 18:13:53 +0200 Subject: [PATCH 0652/1322] Improve pro2cmake.py more Fix incorrect usage of CMAKE_CURRENT_BUILD_DIR, there is no such CMake variable, it's actually CMAKE_CURRENT_BINARY_DIR. Also if the host_build option is set when building a module, the library should be a static library. Change-Id: I9fb39905118dbd7f33d9821960eaed11f20b30c6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- util/cmake/pro2cmake.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0de5fce5591..94c79656386 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -601,9 +601,9 @@ class Scope(object): return ['${CMAKE_CURRENT_SOURCE_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] if key == 'OUT_PWD': if is_same_path: - return ['${CMAKE_CURRENT_BUILD_DIR}'] + return ['${CMAKE_CURRENT_BINARY_DIR}'] else: - return ['${CMAKE_CURRENT_BUILD_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] + return ['${CMAKE_CURRENT_BINARY_DIR}/' + os.path.relpath(self.currentdir, self.basedir),] return self._evalOps(key, None, [], inherrit=inherrit) @@ -1603,7 +1603,12 @@ def write_module(cm_fh: typing.IO[str], scope: Scope, *, print('XXXXXX Module name {} does not start with Qt!'.format(module_name)) extra = [] - if 'static' in scope.get('CONFIG'): + + # A module should be static when 'static' is in CONFIG + # or when option(host_build) is used, as described in qt_module.prf. + is_static = 'static' in scope.get('CONFIG') or 'host_build' in scope.get('_OPTION') + + if is_static: extra.append('STATIC') if 'internal_module' in scope.get('CONFIG'): extra.append('INTERNAL_MODULE') From 449eee2d108589d2b8549d6682c8b5e792e659b8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 11 Jun 2019 11:21:17 +0200 Subject: [PATCH 0653/1322] Don't add _LARGEFILE64_SOURCE define on Windows In qmake land, the largefile.prf feature is automatically loaded due to 'largefile' being added to CONFIG via the equivalent feature. The prf file is in the 'unix' subfolder though, which means that qmake doesn't load it on Windows. We need to do the same, otherwise we get build errors due to the define being checked in ZLIB headers, and selecting an invalid code branch on Windows. Change-Id: Ibe9202a639754927262bb8aaa28289934f2e23ef Reviewed-by: Simon Hausmann --- cmake/QtInternalTargets.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 7ca78fbbff8..083be94ab47 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -72,8 +72,9 @@ if(WIN32) # It's set for every module being built, but it's not propagated to user apps. target_compile_definitions(PlatformModuleInternal INTERFACE _USE_MATH_DEFINES) endif() -if(FEATURE_largefile) - target_compile_definitions(PlatformModuleInternal INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") +if(FEATURE_largefile AND UNIX) + target_compile_definitions(PlatformModuleInternal + INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") endif() # We can't use the gold linker on android with the NDK, which is the default From c09e770a5d3932e8d3cd91d97f75fcb7e7cceebd Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 11 Jun 2019 11:40:26 +0200 Subject: [PATCH 0654/1322] Add appropriate MSVC version check for warnings are errors feature In qmake land warnings_are_errors is only enabled for specific MSVC versions, ending with MSVC2015. Presumably the warnings have not yet been fixed for newer MSVC versions, so we stick with the same status quo for now. Change-Id: Idc3741d39c888f77ed324a5eb8c654416591785f Reviewed-by: Simon Hausmann --- cmake/QtInternalTargets.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 083be94ab47..f289326de08 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -48,8 +48,12 @@ function(qt_internal_set_warnings_are_errors_flags target) endif() endif() elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - # using Visual Studio C++ - target_compile_options("${target}" INTERFACE /WX) + # In qmake land, currently warnings as errors are only enabled for + # MSVC 2012, 2013, 2015. + # Respectively MSVC_VERRSIONs are: 1700-1799, 1800-1899, 1900-1909. + if(MSVC_VERSION GREATER_EQUAL 1700 AND MSVC_VERSION LESS_EQUAL 1909) + target_compile_options("${target}" INTERFACE /WX) + endif() endif() endfunction() From 118e04013ab35fd5b6607ca239a44ab80fb064ed Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 11 Jun 2019 15:13:59 +0200 Subject: [PATCH 0655/1322] Improve special case handler to work on Windows There were some issues with not finding the git executable and trying to remove read-only files / files that are still held by a process. Change-Id: I7f587c4e96cff763cc0b3438d9ed2249da8f122f Reviewed-by: Simon Hausmann --- util/cmake/special_case_helper.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/util/cmake/special_case_helper.py b/util/cmake/special_case_helper.py index 1cb25ac1e2d..b9cb93dce0f 100644 --- a/util/cmake/special_case_helper.py +++ b/util/cmake/special_case_helper.py @@ -88,6 +88,8 @@ import os import subprocess import filecmp import time +import typing +import stat from shutil import copyfile from shutil import rmtree @@ -136,8 +138,11 @@ def copyfile_log(src: str, dst: str, debug=False): def check_if_git_in_path() -> bool: + is_win = os.name == 'nt' for path in os.environ['PATH'].split(os.pathsep): git_path = os.path.join(path, 'git') + if is_win: + git_path += '.exe' if os.path.isfile(git_path) and os.access(git_path, os.X_OK): return True return False @@ -187,6 +192,17 @@ def create_file_with_no_special_cases(original_file_path: str, no_special_cases_ write_content_to_file(no_special_cases_file_path, content_no_special_cases) +def rm_tree_on_error_handler(func: typing.Callable[..., None], + path: str, exception_info: tuple): + # If the path is read only, try to make it writable, and try + # to remove the path again. + if not os.access(path, os.W_OK): + os.chmod(path, stat.S_IWRITE) + func(path) + else: + print('Error while trying to remove path: {}. Exception: {}'.format(path, exception_info)) + + class SpecialCaseHandler(object): def __init__(self, @@ -275,14 +291,14 @@ class SpecialCaseHandler(object): print('Git merge conflict resolution process failed. Exception: {}'.format(e)) raise e finally: + os.chdir(current_dir) + # Remove the temporary repo. try: if not self.keep_temporary_files: - rmtree(repo_absolute_path) + rmtree(repo_absolute_path, onerror=rm_tree_on_error_handler) except Exception as e: - print(e) - - os.chdir(current_dir) + print('Error removing temporary repo. Exception: {}'.format(e)) def save_next_clean_file(self): files_are_equivalent = filecmp.cmp(self.generated_file_path, self.post_merge_file_path) From 152b22a7b00c8365808dd58d2afb42ff86ed75ec Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 6 Jun 2019 14:29:31 +0200 Subject: [PATCH 0656/1322] Android: Generate deployment-settings.json Generate the android deployment settings json for android apk targets. QtPlatformAndroid is now also deployed as a public build dependency of QtCore. Some minor refactoring has been performed to the naming of variables and functions to better match the public facing apis. Extra settings for the file can be configured using the following target properties: set_target_properties(Core PROPERTIES QT_ANDROID_DEPLOYMENT_DEPENDENCIES "foo;bar" QT_ANDROID_EXTRA_LIBS "foo;bar" QT_ANDROID_EXTRA_PLUGINS "foo;bar" QT_ANDROID_PACKAGE_SOURCE_DIR "/foo/bar/" ) The file is generated using the function qt_android_generate_depoyment_settings(). We need to install the android template files and jar files during the android build as the androiddeployqt tool wont work if parts of it are split between the host install and the android install. Added QT_BUILD_QT variable to check whether we are building Qt from source. Finally, we also force the stdlib to shared via cmake configuration with -DANDROID_STL="c++_shared" Change-Id: I063c47e11749d56ba4c6f02101dbcc09e1b9fe87 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 9 +- cmake/QtBuild.cmake | 2 +- cmake/QtPlatformAndroid.cmake | 264 ++++++++++++++++++++++++++++++-- cmake/QtProperties.cmake | 1 + cmake/QtSetup.cmake | 6 + cmake/README.md | 5 +- src/android/CMakeLists.txt | 9 +- src/android/jar/CMakeLists.txt | 2 +- 8 files changed, 278 insertions(+), 20 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 0b4bfa093c4..f89bb405b58 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -10,7 +10,6 @@ target_include_directories(Platform ) target_compile_definitions(Platform INTERFACE ${QT_PLATFORM_DEFINITIONS}) - # When building on android we need to link against the logging library # in order to satisfy linker dependencies. Both of these libraries are part of # the NDK. @@ -22,6 +21,14 @@ set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}") qt_path_join(__GlobalConfig_build_dir ${QT_CONFIG_BUILD_DIR} ${__GlobalConfig_path_suffix}) qt_path_join(__GlobalConfig_install_dir ${QT_CONFIG_INSTALL_DIR} ${__GlobalConfig_path_suffix}) + +if (ANDROID) + qt_install(FILES + "${QT_CMAKE_DIR}/QtPlatformAndroid.cmake" + DESTINATION "${__GlobalConfig_install_dir}" + ) +endif() + # Generate and install Qt5 config file. configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 30986c14fbd..17bd41915a1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1269,8 +1269,8 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})") DESTINATION "${config_install_dir}" COMPONENT Devel ) - file(COPY ${extra_cmake_files} DESTINATION "${config_build_dir}") + file(COPY ${extra_cmake_files} DESTINATION "${config_build_dir}") set(exported_targets ${target} ${target_private}) set(export_name "${INSTALL_CMAKE_NAMESPACE}${target}Targets") qt_install(TARGETS ${exported_targets} diff --git a/cmake/QtPlatformAndroid.cmake b/cmake/QtPlatformAndroid.cmake index 46a8fe06a4a..8d0d8b67da1 100644 --- a/cmake/QtPlatformAndroid.cmake +++ b/cmake/QtPlatformAndroid.cmake @@ -1,9 +1,28 @@ # -# Platform Settings for Android +# Self contained Platform Settings for Android +# +# Note: This file is used both by the internal and public builds. +# + +# +# Public variables: +# QT_ANDROID_JAR +# Location of the adroid sdk jar for java code +# QT_ANDROID_APIVERSION +# Android API version +# QT_ANDROID_SDK_BUILD_TOOLS_VERSION +# Detected Android sdk build tools version +# QT_ANDROID_NDK_STDLIB_PATH +# Detected path to the c++ stl lib shared library +# +# Public functions: +# +# qt_android_generate_depolyment_settings() +# Generate the depolyment settings json file for a cmake target. # if (NOT DEFINED ANDROID_SDK_ROOT) - message(FATAL_ERROR "ANDROID_SDK_ROOT is not defined") + message(FATAL_ERROR "Please provide the location of the Android SDK directory via -DANDROID_SDK_ROOT=") endif() if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}") @@ -11,11 +30,11 @@ if (NOT IS_DIRECTORY "${ANDROID_SDK_ROOT}") endif() # Minimum recommend android SDK api version -set(qt_android_api_version "android-21") +set(QT_ANDROID_API_VERSION "android-21") # Locate android.jar -set(android_jar "${ANDROID_SDK_ROOT}/platforms/${qt_android_api_version}/android.jar") -if(NOT EXISTS "${android_jar}") +set(QT_ANDROID_JAR "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_VERSION}/android.jar") +if(NOT EXISTS "${QT_ANDROID_JAR}") # Locate the highest available platform file(GLOB android_platforms LIST_DIRECTORIES true @@ -26,19 +45,244 @@ if(NOT EXISTS "${android_jar}") list(SORT android_platforms) list(REVERSE android_platforms) list(GET android_platforms 0 android_platform_latest) - set(qt_android_api_version ${android_platform_latest}) - set(android_jar "${ANDROID_SDK_ROOT}/platforms/${qt_android_api_version}/android.jar") + set(QT_ANDROID_API_VERSION ${android_platform_latest}) + set(QT_ANDROID_JAR "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_VERSION}/android.jar") endif() endif() -if(NOT EXISTS "${android_jar}") - message(FATAL_ERROR "No suitable Android SDK platform found. Minimum version is ${qt_android_api_version}") +if(NOT EXISTS "${QT_ANDROID_JAR}") + message(FATAL_ERROR "No suitable Android SDK platform found. Minimum version is ${QT_ANDROID_API_VERSION}") endif() -message(STATUS "Using Android SDK API ${qt_android_api_version} from ${ANDROID_SDK_ROOT}/platforms") +message(STATUS "Using Android SDK API ${QT_ANDROID_API_VERSION} from ${ANDROID_SDK_ROOT}/platforms") # Locate Java include(UseJava) # Find JDK 8.0 find_package(Java 1.8 COMPONENTS Development REQUIRED) + +# Locate newest android sdk build tools +if (NOT QT_ANDROID_SDK_BUILD_TOOLS_VERSION) + file(GLOB android_build_tools + LIST_DIRECTORIES true + RELATIVE "${ANDROID_SDK_ROOT}/build-tools" + "${ANDROID_SDK_ROOT}/build-tools/*") + if (NOT android_build_tools) + message(FATAL_ERROR "Could not locate Android SDK build tools under \"${ANDROID_SDK}/build-tools\"") + endif() + list(SORT android_build_tools) + list(REVERSE android_build_tools) + list(GET android_build_tools 0 android_build_tools_latest) + set(qt_QT_ANDROID_SDK_BUILD_TOOLS_VERSION ${android_build_tools_latest}) +endif() + +# Ensure we are using the shared version of libc++ +if(NOT ANDROID_STL STREQUAL c++_shared) + message(FATAL_ERROR "The Qt libraries on Android only supports the shared library configuration of stl. Please use -DANDROID_STL=\"c++_shared\" as configuration argument.") +endif() + + +# Location of stdlibc++ +set(QT_ANDROID_NDK_STDLIB_PATH "${ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libs/${ANDROID_ABI}/libc++_shared.so") + +# Target properties required for android deploy tool +define_property(TARGET + PROPERTY + QT_ANDROID_DEPLOYMENT_DEPENDENCIES + BRIEF_DOCS + "Specify additional plugins that need to be deployed with the current android application" + FULL_DOCS + "By default, androiddeployqt will detect the dependencies of your application. But since run-time usage of plugins cannot be detected, there could be false positives, as your application will depend on any plugins that are potential dependencies. If you want to minimize the size of your APK, it's possible to override the automatic detection using the ANDROID_DEPLOYMENT_DEPENDENCIES variable. This should contain a list of all Qt files which need to be included, with paths relative to the Qt install root. Note that only the Qt files specified here will be included. Failing to include the correct files can result in crashes. It's also important to make sure the files are listed in the correct loading order. This variable provides a way to override the automatic detection entirely, so if a library is listed before its dependencies, it will fail to load on some devices." +) + +define_property(TARGET + PROPERTY + QT_ANDROID_EXTRA_LIBS + BRIEF_DOCS + "A list of external libraries that will be copied into your application's library folder and loaded on start-up." + FULL_DOCS + "A list of external libraries that will be copied into your application's library folder and loaded on start-up. This can be used, for instance, to enable OpenSSL in your application. Simply set the paths to the required libssl.so and libcrypto.so libraries here and OpenSSL should be enabled automatically." +) + +define_property(TARGET + PROPERTY + QT_ANDROID_EXTRA_PLUGINS + BRIEF_DOCS + "This variable can be used to specify different resources that your project has to bundle but cannot be delivered through the assets system, such as qml plugins." + FULL_DOCS + "This variable can be used to specify different resources that your project has to bundle but cannot be delivered through the assets system, such as qml plugins. When using this variable, androiddeployqt will make sure everything is packaged and deployed properly." +) + +define_property(TARGET + PROPERTY + QT_ANDROID_PACKAGE_SOURCE_DIR + BRIEF_DOCS + "This variable can be used to specify a directory where additions and modifications can be made to the default Android package template." + FULL_DOCS + "This variable can be used to specify a directory where additions and modifications can be made to the default Android package template. The androiddeployqt tool will copy the application template from Qt into the build directory, and then it will copy the contents of the ANDROID_PACKAGE_SOURCE_DIR on top of this, overwriting any existing files. The update step where parts of the source files are modified automatically to reflect your other settings is then run on the resulting merged package. If you, for instance, want to make a custom AndroidManifest.xml for your application, then place this directly into the folder specified in this variable. You can also add custom Java files in ANDROID_PACKAGE_SOURCE_DIR/src." +) + +define_property(TARGET + PROPERTY + QT_ANDROID_DEPLOYMENT_SETTINGS_FILE + BRIEF_DOCS + " " + FULL_DOCS + " " +) + +# Generate deployment tool json +function(qt_android_generate_depolyment_settings target) + # Information extracted from mkspecs/features/android/android_deployment_settings.prf + if (NOT TARGET ${target}) + message(SEND_ERROR "${target} is not a cmake target") + return() + endif() + + get_target_property(target_type ${target} TYPE) + + if (NOT "${target_type}" STREQUAL "MODULE_LIBRARY") + message(SEND_ERROR "QT_ANDROID_GENERATE_DEPOLYMENT_SETTINGS only works on Module targets") + return() + endif() + + get_target_property(target_source_dir ${target} SOURCE_DIR) + get_target_property(target_binary_dir ${target} BINARY_DIR) + get_target_property(target_output_name ${target} OUTPUT_NAME) + if (NOT target_output_name) + set(target_output_name ${target}) + endif() + set(deploy_file "${target_binary_dir}/android-lib${target_output_name}.so-deployment-settings.json") + + file(WRITE ${deploy_file} "{\n") + # content begin + file(APPEND ${deploy_file} + " \"description\": \"This file is generated by cmake to be read by androiddeployqt and should not be modified by hand.\",\n") + + # Host Qt Android install path + if (NOT QT_BUILD_QT) + set(file_check "${Qt5_DIR}/plugins/platforms/android/libqtforandroid.so") + if (NOT EXISTS ${file_check}) + message(SEND_ERROR "Detected Qt installation does not containt libqtforandroid.so. This is most likely due to the installation not being a build of Qt for Android. Please update your settings.") + return() + endif() + set(qt_android_install_dir ${Qt5_Dir}) + else() + # Building from source, use the same install prefix + set(qt_android_install_dir ${CMAKE_INSTALL_PREFIX}) + endif() + + file(TO_NATIVE_PATH "${qt_android_install_dir}" qt_android_install_dir_native) + file(APPEND ${deploy_file} + " \"qt\": \"${qt_android_install_dir_native}\",\n") + + # Android SDK path + file(TO_NATIVE_PATH "${ANDROID_SDK_ROOT}" android_sdk_root_native) + file(APPEND ${deploy_file} + " \"sdk\": \"${android_sdk_root_native}\",\n") + + # Android SDK Build Tools Revision + file(APPEND ${deploy_file} + " \"sdkBuildToolsRevision\": \"${QT_ANDROID_SDK_BUILD_TOOLS_VERSION}\",\n") + + # Android NDK + file(TO_NATIVE_PATH "${ANDROID_NDK}" android_ndk_root_native) + file(APPEND ${deploy_file} + " \"ndk\": \"${android_ndk_root_native}\",\n") + + # Setup LLVM toolchain + file(APPEND ${deploy_file} + " \"toolchain-prefix\": \"llvm\",\n") + file(APPEND ${deploy_file} + " \"tool-prefix\": \"llvm\",\n") + file(APPEND ${deploy_file} + " \"useLLVM\": true,\n") + + # NDK Toolchain Version + file(APPEND ${deploy_file} + " \"toolchain-version\": \"${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}\",\n") + + # NDK Host + file(APPEND ${deploy_file} + " \"ndk-host\": \"${ANDROID_NDK_HOST_SYSTEM_NAME}\",\n") + + # Architecture + file(APPEND ${deploy_file} + " \"target-architecture\": \"${CMAKE_ANDROID_ARCH_ABI}\",\n") + + # deployment dependencies + get_target_property(android_deployment_dependencies + ${target} QT_ANDROID_DEPLOYMENT_DEPENDENCIES) + if (android_deployment_dependencies) + list(JOIN android_deployment_dependencies "," android_deployment_dependencies) + file(APPEND ${deploy_file} + " \"deployment-dependencies\": \"${android_deployment_dependencies}\",\n") + endif() + + # Extra plugins + get_target_property(android_extra_plugins + ${target} QT_ANDROID_EXTRA_PLUGINS) + if (android_extra_plugins) + list(JOIN android_extra_plugins "," android_extra_plugins) + file(APPEND ${deploy_file} + " \"android-extra-plugins\": \"${android_extra_plugins}\",\n") + endif() + + # Extra libs + get_target_property(android_extra_libs + ${target} QT_ANDROID_EXTRA_LIBS) + if (android_extra_libs) + list(JOIN android_extra_libs "," android_extra_libs) + file(APPEND ${deploy_file} + " \"android-extra-libs\": \"${android_extra_libs}\",\n") + endif() + + # package source dir + get_target_property(android_package_source_dir + ${target} QT_ANDROID_PACKAGE_SOURCE_DIR) + if (android_package_source_dir) + file(TO_NATIVE_PATH "${android_package_source_dir}" android_package_source_dir_native) + file(APPEND ${deploy_file} + " \"android-package-source-directory\": \"${android_package_source_dir_native}\",\n") +endif() + + #TODO: ANDROID_VERSION_NAME, doesn't seem to be used? + + #TODO: ANDROID_VERSION_CODE, doesn't seem to be used? + + #TODO: QML import path, could be a property? Example below: + #get_target_property(qml_import_path ${target} QT_QML_IMPORT_PATH) + #if (qml_import_path) + # file(TO_NATIVE_PATH "${qml_import_path}" qml_import_path_native) + # file(APPEND ${deploy_file} + # " \"qml-import-path\": \"${qml_import_path_native}\",\n") + #endif() + + #TODO: QML root path, could be a property? Example below: + #get_target_property(qml_root_path ${target} QT_QML_ROOT_PATH) + #if(NOT qml_root_path) + # set(qml_root_path "${target_source_dir}") + #endif() + #file(TO_NATIVE_PATH "${qml_root_path}" qml_root_path_native) + #file(APPEND ${deploy_file} + # " \"qml-root-path\": \"${qml_root_path_native}\",\n") + + # App binary + file(TO_NATIVE_PATH "${target_binary_dir}/lib${target_output_name}.so" target_binary_dir_native) + file(APPEND ${deploy_file} + " \"application-binary\": \"${target_binary_dir_native}\",\n") + + # Lats item in json file + + file(APPEND ${deploy_file} + " \"stdcpp-path\": \"${QT_ANDROID_NDK_STDLIB_PATH}\"\n") + + # content end + file(APPEND ${deploy_file} "}\n") + + set_target_properties(${target} + PROPERTIES + QT_ANDROID_DEPLOYMENT_SETTINGS_FILE ${deploy_file} + ) +endfunction() diff --git a/cmake/QtProperties.cmake b/cmake/QtProperties.cmake index b0621e7b469..e8b1fbf4f08 100644 --- a/cmake/QtProperties.cmake +++ b/cmake/QtProperties.cmake @@ -46,3 +46,4 @@ define_property(GLOBAL FULL_DOCS "" ) + diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 62d4b0decea..3277a1af35b 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -1,4 +1,10 @@ ## Set a default build type if none was specified + +# Set the QT_IS_BUILDING_QT variable so we can verify whether we are building +# Qt from source +set(QT_BUILDING_QT TRUE CACHE + TYPE STRING "When this is present and set to true, it signals that we are building Qt from source.") + set(_default_build_type "Release") if(EXISTS "${CMAKE_SOURCE_DIR}/.git") set(_default_build_type "Debug") diff --git a/cmake/README.md b/cmake/README.md index 88d4b0aa31a..bf878800d6f 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -123,7 +123,7 @@ The specified path needs to point to a directory that contains an installed host ### Cross Compiling for Android -In order to cross-compile Qt to Android, the above instructions apply. In addition, it is necessary to install the Android NDK as well as vcpkg. Vcpkg is needed to supply third-party libraries that Qt requires but that are not part of the Android NDK. +In order to cross-compile Qt to Android, you need a host build (see instructions above) and an Android build. In addition, it is necessary to install the Android NDK as well as vcpkg. Vcpkg is needed to supply third-party libraries that Qt requires but that are not part of the Android NDK. Vcpkg for Android can be set up using the following steps: @@ -134,8 +134,7 @@ Vcpkg for Android can be set up using the following steps: * Set the ``ANDROID_SDK_HOME`` environment variable to the path where you have installed the Android SDK. * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` -When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME`` - +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` # Debugging CMake files diff --git a/src/android/CMakeLists.txt b/src/android/CMakeLists.txt index 7b0b0cd930e..a61ff1c4b01 100644 --- a/src/android/CMakeLists.txt +++ b/src/android/CMakeLists.txt @@ -1,12 +1,13 @@ # Generated from android.pro. # special case begin -# Only build jars during android build? +# Only build jars during Android build and install the templates for the +# androiddeployqt tool. +# android if (ANDROID) add_subdirectory(jar) + add_subdirectory(java) + add_subdirectory(templates) endif() # special case end -# Templates need to be installed during host build -add_subdirectory(java) -add_subdirectory(templates) diff --git a/src/android/jar/CMakeLists.txt b/src/android/jar/CMakeLists.txt index 31afb3fdf4d..066a67591fb 100644 --- a/src/android/jar/CMakeLists.txt +++ b/src/android/jar/CMakeLists.txt @@ -22,7 +22,7 @@ set(java_sources ${path_prefix}/QtThread.java) add_jar(QtAndroid - INCLUDE_JARS ${android_jar} + INCLUDE_JARS ${QT_ANDROID_JAR} SOURCES ${java_sources} ) From 0d224dbb9ccbba72742b83fd9c0aae4a05cad30d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jun 2019 09:31:48 +0200 Subject: [PATCH 0657/1322] Remove redundant installation of QtPlatformAndroid.cmake It's already installed right where QtSetup.cmake is installed. Change-Id: Ie88363ae3878cda8f92aa44160333886f64565d8 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index f89bb405b58..6c5c7e1951f 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -21,14 +21,6 @@ set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}") qt_path_join(__GlobalConfig_build_dir ${QT_CONFIG_BUILD_DIR} ${__GlobalConfig_path_suffix}) qt_path_join(__GlobalConfig_install_dir ${QT_CONFIG_INSTALL_DIR} ${__GlobalConfig_path_suffix}) - -if (ANDROID) - qt_install(FILES - "${QT_CMAKE_DIR}/QtPlatformAndroid.cmake" - DESTINATION "${__GlobalConfig_install_dir}" - ) -endif() - # Generate and install Qt5 config file. configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in" From b4e5b6493680185dcb9bcda08b3743696233f29e Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jun 2019 12:00:39 +0200 Subject: [PATCH 0658/1322] Prospective Windows build fix Commit abe12f600b1f626c9d228ad5234c14784e7845f1 moved the _LARGEFILE64_SOURCE define to a central place and commit 449eee2d108589d2b8549d6682c8b5e792e659b8 made it conditional to UNIX (not WIN32). Somehow these two were left over though. Change-Id: I23b08e84db804e9d5a4dde706af501c0918b460e Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 17bd41915a1..c0436866af9 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1509,9 +1509,6 @@ function(add_qt_plugin target) ENABLE_AUTOGEN_TOOLS ${arg_ENABLE_AUTOGEN_TOOLS} DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS} ) - if(FEATURE_largefile) - target_compile_definitions("${target}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") - endif() if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${target}") endif() @@ -1626,9 +1623,6 @@ function(add_qt_executable name) WIN32_EXECUTABLE "${arg_GUI}" MACOSX_BUNDLE "${arg_GUI}" ) - if(FEATURE_largefile) - target_compile_definitions("${name}" PRIVATE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") - endif() if(NOT ${arg_EXCEPTIONS}) qt_internal_set_no_exceptions_flags("${name}") endif() From ce11410caa6b2ba94a88a1368b379df96839f865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Wed, 22 May 2019 17:01:13 +0200 Subject: [PATCH 0659/1322] Use ninja as default builder That allows us to skip all the madness of choosing between make/nmake/jom. In addition it is actually faster to build with ninja, then other tools. Change-Id: I31049a292495800606cede6f15011d97af7c3e41 Reviewed-by: Liang Qi Reviewed-by: Qt CMake Build Bot --- coin/module_config.yaml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 5290784a197..ef0269cc527 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -11,31 +11,20 @@ build_instructions: - type: ChangeDirectory directory: "{{.BuildDir}}" - type: ExecuteCommand - command: cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} {{.SourceDir}} + command: cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -GNinja {{.SourceDir}} maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > Failed to call cmake. Contact Liang then. + - type: EnvironmentVariable + variableName: DESTDIR + variableValue: "{{.InstallRoot}}" - type: ExecuteCommand - command: make DESTDIR={{.InstallRoot}} install + command: ninja install maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > - Failed to call make install. Contact Liang then. - disable_if: - condition: property - property: host.os - equals_value: Windows - - type: ExecuteCommand - command: jom DESTDIR={{.InstallRoot}} install - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 120 - userMessageOnFailure: > - Failed to call jom install. Contact Liang then. - disable_if: - condition: property - property: host.os - not_equals_value: Windows + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. - type: SignPackage disable_if: condition: property From 82840d2660202c6d8f3c53ad1d620667901cb954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 3 Jun 2019 13:35:41 +0200 Subject: [PATCH 0660/1322] Implement command prefix The current CI magically add prefix to every executed command if target compiler is MSVC. The prefix just calls vcvarsall.bat. The script has to be called for every command, because of the CI agent runs every command as a subprocess. It means that script sourced environment is not passed to subsequent commands, therefore all changes are lost. The prefix, as a concept, has known performance issues (COIN-253), so in long term it would be nice to move to another solution. CustomModule doesn't support prefix. Therefore the proposed approach moves the ugliness from CI code to the yaml configuration file. It has two advantages; nothing needs to be implemented on the CI level and hopefully someone in future will clean it up as the problem is more visible and publicly fixable. Change-Id: Ice3cff89e3a59b2a57e675b7892fde0d04433ba8 Reviewed-by: Liang Qi --- coin/module_config.yaml | 170 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 168 insertions(+), 2 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index ef0269cc527..1e47a02a1de 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -3,6 +3,137 @@ accept_configuration: condition: property property: host.os equals_property: target.os + +windows_specific_instrucitons: + - &export_target_architecture_and_sdk + # Export TARGET_ARCHITECTURE and WINDOWS_SDK_VERSION for MSVC cross compilation + type: Group + disable_if: + condition: property + property: host.os + not_equals_value: Windows + instructions: + - type: EnvironmentVariable + variableName: TARGET_ARCHITECTURE + variableValue: amd64 # TODO add something like "{{toLower .Config host.arch}}" + disable_if: + condition: property + property: host.arch + not_equals_property: target.arch + - type: EnvironmentVariable + variableName: TARGET_ARCHITECTURE + variableValue: amd64_x86 + disable_if: + condition: and + conditions: + - condition: property + property: target.arch + not_equals_property: X86 + - condition: property + property: host.arch + not_equals_property: X86_64 + - type: EnvironmentVariable + # HACK. Overwrite TARGET_ARCHITECTURE as we do not use standard MSVC cross + # compilation targets here. The target architecture will be detected by Qt. + variableName: TARGET_ARCHITECTURE + variableValue: x86 + disable_if: + condition: property + property: target.os + not_in_values: ["WINRT", "WINPHONE", "WINCE"] + - type: EnvironmentVariable + variableName: WINDOWS_SDK_VERSION + variableValue: "10.0.14393.0" + disable_if: + condition: property + property: target.os + not_equals_value: WINRT + - type: EnvironmentVariable + variableName: WINDOWS_SDK_VERSION + variableValue: "" + disable_if: + condition: property + property: host.os + equals_value: WINRT # TODO set windows sdk version for desktop windows as well + + - &find_path_to_compiler + # MSVC is installed in somehow arbitrary places. To reduce amount of combinations we need to make a variable. + # This seems inverted, but on 64 bit hosts VS is installed into the x86 path, otherwise the regular one + # TODO cleanup, that step could be removed if we have same installation paths or we read the path from registry + # or we use %ProgramFiles(x86)%. + type: Group + disable_if: + condition: property + property: host.os + not_equals_value: Windows + instructions: + - type: EnvironmentVariable + variableName: PROGRAM_FILES_PATH + variableValue: "C:\\Program Files" + disable_if: + condition: property + property: host.arch + not_equals_value: X86 + - type: EnvironmentVariable + variableName: PROGRAM_FILES_PATH + variableValue: "C:\\Program Files (x86)" + disable_if: + condition: property + property: host.arch + equals_value: X86 + # Try to pick one of many coexistent MSVC installation to use + # TODO cleanup, that could be much simpler if all tools are installed to similar paths, so it would + # be enough to substitute compiler name. + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%VS90COMNTOOLS%\\vsvars32.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2008 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%VS100COMNTOOLS%\\vsvars32.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2010 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2012 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2013 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2015 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio\\2017\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2017 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + disable_if: + condition: property + property: host.compiler + not_equals_value: MSVC2019 + build_instructions: - type: MakeDirectory directory: .git @@ -10,8 +141,35 @@ build_instructions: directory: "{{.SourceDir}}" - type: ChangeDirectory directory: "{{.BuildDir}}" + - *export_target_architecture_and_sdk + - *find_path_to_compiler + # With MSVC we need setup the environment before every subprocess call. + - type: WriteFile + fileContents: "call \"{{.Env.VC_SCRIPT}}\" {{.Env.TARGET_ARCHITECTURE}} {{.Env.WINDOWS_SDK_VERSION}}\r\ncmd /c %*" + filename: c:\\users\\qt\\prefix.bat + fileMode: 420 + maxTimeInSeconds: 20 + maxTimeBetweenOutput: 20 + disable_if: + condition: property + property: host.os + not_equals_value: Windows + - type: EnvironmentVariable + variableName: ENV_PREFIX + variableValue: "c:\\users\\qt\\prefix.bat" + disable_if: + condition: property + property: host.os + not_equals_value: Windows + - type: EnvironmentVariable + variableName: ENV_PREFIX + variableValue: "" + disable_if: + condition: property + property: host.os + equals_value: Windows - type: ExecuteCommand - command: cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -GNinja {{.SourceDir}} + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -GNinja {{.SourceDir}}" maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > @@ -19,8 +177,16 @@ build_instructions: - type: EnvironmentVariable variableName: DESTDIR variableValue: "{{.InstallRoot}}" + - type: ExecuteCommand # TODO: remove me, just debuging + command: cmd.exe /c type {{.BuildDir}}\\CMakeCache.txt + disable_if: + condition: property + property: host.os + not_equals_value: Windows + maxTimeInSeconds: 60 + userMessageOnFailure: Could not print the file cmake config file. This should not be possible. - type: ExecuteCommand - command: ninja install + command: "{{.Env.ENV_PREFIX}} ninja install" maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > From 6732fa3a291e77acad3ab6ba829d1026462dc139 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 11 Jun 2019 15:46:31 +0200 Subject: [PATCH 0661/1322] Fix linking of examples Provide add_qt_gui_executable() as function in our public API that takes care of automaticWinMain linkage. We can use this in the future to encapsulate similarplatform-specific behavior and adjustments, such as module generation onAndroid. In order for the examples to see the function in Qt5CoreMacros, three more additional fixes were required: * Do the build_repo_end() call _before_ attempting to build the examples, as we need the build_repo_end() to include QtPostProcess and complete the creation of all the target config files. Otherwise the find_package() calls in the examples see something incomplete. * Add more QT_NO_CREATE_TARGET guards * Always call find_dependency on the dependencies, regardless of the target creation mode. This way a find_package(Qt5 COMPONENTS Widgets) will still load Qt5CoreMacros. Change-Id: I03ce856e2f4312a050fe8043b8331cbe8a6c93e6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 4 ++-- cmake/QtBuild.cmake | 8 +++++--- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 4 ++-- cmake/QtModuleConfig.cmake.in | 10 +++++----- .../corelib/ipc/localfortuneclient/CMakeLists.txt | 2 +- .../corelib/ipc/localfortuneserver/CMakeLists.txt | 2 +- examples/corelib/ipc/sharedmemory/CMakeLists.txt | 2 +- .../corelib/mimetypes/mimetypebrowser/CMakeLists.txt | 2 +- examples/corelib/threads/mandelbrot/CMakeLists.txt | 2 +- .../corelib/threads/queuedcustomtype/CMakeLists.txt | 2 +- examples/corelib/tools/contiguouscache/CMakeLists.txt | 2 +- examples/corelib/tools/customtype/CMakeLists.txt | 2 +- .../corelib/tools/customtypesending/CMakeLists.txt | 2 +- examples/dbus/chat/CMakeLists.txt | 2 +- examples/dbus/complexpingpong/CMakeLists.txt | 2 +- examples/dbus/listnames/CMakeLists.txt | 2 +- examples/dbus/pingpong/CMakeLists.txt | 2 +- examples/dbus/remotecontrolledcar/car/CMakeLists.txt | 2 +- .../remotecontrolledcar/controller/CMakeLists.txt | 2 +- examples/embedded/digiflip/CMakeLists.txt | 2 +- examples/embedded/flickable/CMakeLists.txt | 2 +- examples/embedded/flightinfo/CMakeLists.txt | 2 +- examples/embedded/lightmaps/CMakeLists.txt | 2 +- examples/embedded/raycasting/CMakeLists.txt | 2 +- examples/embedded/styleexample/CMakeLists.txt | 2 +- examples/gui/analogclock/CMakeLists.txt | 2 +- examples/gui/openglwindow/CMakeLists.txt | 2 +- examples/gui/rasterwindow/CMakeLists.txt | 2 +- examples/network/blockingfortuneclient/CMakeLists.txt | 2 +- examples/network/broadcastreceiver/CMakeLists.txt | 2 +- examples/network/broadcastsender/CMakeLists.txt | 2 +- examples/network/fortuneclient/CMakeLists.txt | 2 +- examples/network/fortuneserver/CMakeLists.txt | 2 +- examples/network/googlesuggest/CMakeLists.txt | 2 +- examples/network/http/CMakeLists.txt | 2 +- examples/network/loopback/CMakeLists.txt | 2 +- examples/network/multicastreceiver/CMakeLists.txt | 2 +- examples/network/multicastsender/CMakeLists.txt | 2 +- examples/network/multistreamclient/CMakeLists.txt | 2 +- examples/network/multistreamserver/CMakeLists.txt | 2 +- examples/network/network-chat/CMakeLists.txt | 2 +- examples/network/securesocketclient/CMakeLists.txt | 2 +- examples/network/secureudpclient/CMakeLists.txt | 2 +- examples/network/secureudpserver/CMakeLists.txt | 2 +- examples/network/threadedfortuneserver/CMakeLists.txt | 2 +- examples/network/torrent/.prev_CMakeLists.txt | 2 +- examples/network/torrent/CMakeLists.txt | 2 +- examples/qpa/qrasterwindow/CMakeLists.txt | 2 +- examples/qtconcurrent/imagescaling/CMakeLists.txt | 2 +- examples/qtestlib/tutorial1/CMakeLists.txt | 2 +- examples/qtestlib/tutorial2/CMakeLists.txt | 2 +- examples/qtestlib/tutorial3/CMakeLists.txt | 2 +- examples/qtestlib/tutorial4/CMakeLists.txt | 2 +- examples/qtestlib/tutorial5/CMakeLists.txt | 2 +- examples/sql/books/CMakeLists.txt | 2 +- examples/sql/cachedtable/CMakeLists.txt | 2 +- examples/sql/drilldown/CMakeLists.txt | 2 +- examples/sql/masterdetail/CMakeLists.txt | 2 +- examples/sql/querymodel/CMakeLists.txt | 2 +- examples/sql/relationaltablemodel/CMakeLists.txt | 2 +- examples/sql/sqlbrowser/CMakeLists.txt | 2 +- examples/sql/sqlwidgetmapper/CMakeLists.txt | 2 +- examples/sql/tablemodel/CMakeLists.txt | 2 +- .../widgets/animation/animatedtiles/CMakeLists.txt | 2 +- examples/widgets/animation/easing/CMakeLists.txt | 2 +- examples/widgets/animation/moveblocks/CMakeLists.txt | 2 +- examples/widgets/animation/states/CMakeLists.txt | 2 +- examples/widgets/animation/stickman/CMakeLists.txt | 2 +- examples/widgets/animation/sub-attaq/CMakeLists.txt | 2 +- examples/widgets/desktop/screenshot/CMakeLists.txt | 2 +- examples/widgets/desktop/systray/CMakeLists.txt | 2 +- examples/widgets/dialogs/classwizard/CMakeLists.txt | 2 +- examples/widgets/dialogs/extension/CMakeLists.txt | 2 +- examples/widgets/dialogs/findfiles/CMakeLists.txt | 2 +- examples/widgets/dialogs/licensewizard/CMakeLists.txt | 2 +- .../widgets/dialogs/standarddialogs/CMakeLists.txt | 2 +- examples/widgets/dialogs/tabdialog/CMakeLists.txt | 2 +- examples/widgets/dialogs/trivialwizard/CMakeLists.txt | 2 +- .../widgets/draganddrop/draggableicons/CMakeLists.txt | 2 +- .../widgets/draganddrop/draggabletext/CMakeLists.txt | 2 +- examples/widgets/draganddrop/dropsite/CMakeLists.txt | 2 +- .../widgets/draganddrop/fridgemagnets/CMakeLists.txt | 2 +- examples/widgets/draganddrop/puzzle/CMakeLists.txt | 2 +- examples/widgets/effects/blurpicker/CMakeLists.txt | 2 +- examples/widgets/effects/fademessage/CMakeLists.txt | 2 +- .../widgets/gestures/imagegestures/CMakeLists.txt | 2 +- .../widgets/graphicsview/anchorlayout/CMakeLists.txt | 2 +- .../graphicsview/basicgraphicslayouts/CMakeLists.txt | 2 +- examples/widgets/graphicsview/boxes/CMakeLists.txt | 2 +- examples/widgets/graphicsview/chip/CMakeLists.txt | 2 +- .../widgets/graphicsview/collidingmice/CMakeLists.txt | 2 +- .../widgets/graphicsview/diagramscene/CMakeLists.txt | 2 +- .../widgets/graphicsview/dragdroprobot/CMakeLists.txt | 2 +- .../widgets/graphicsview/elasticnodes/CMakeLists.txt | 2 +- .../graphicsview/embeddeddialogs/CMakeLists.txt | 2 +- .../widgets/graphicsview/flowlayout/CMakeLists.txt | 2 +- .../graphicsview/simpleanchorlayout/CMakeLists.txt | 2 +- .../graphicsview/weatheranchorlayout/CMakeLists.txt | 2 +- examples/widgets/itemviews/addressbook/CMakeLists.txt | 2 +- .../itemviews/basicsortfiltermodel/CMakeLists.txt | 2 +- examples/widgets/itemviews/chart/CMakeLists.txt | 2 +- .../itemviews/coloreditorfactory/CMakeLists.txt | 2 +- .../itemviews/combowidgetmapper/CMakeLists.txt | 2 +- .../itemviews/customsortfiltermodel/CMakeLists.txt | 2 +- examples/widgets/itemviews/dirview/CMakeLists.txt | 2 +- .../itemviews/editabletreemodel/CMakeLists.txt | 2 +- examples/widgets/itemviews/fetchmore/CMakeLists.txt | 2 +- .../widgets/itemviews/flattreeview/CMakeLists.txt | 2 +- .../widgets/itemviews/frozencolumn/CMakeLists.txt | 2 +- examples/widgets/itemviews/interview/CMakeLists.txt | 2 +- examples/widgets/itemviews/pixelator/CMakeLists.txt | 2 +- examples/widgets/itemviews/puzzle/CMakeLists.txt | 2 +- .../widgets/itemviews/simpledommodel/CMakeLists.txt | 2 +- .../widgets/itemviews/simpletreemodel/CMakeLists.txt | 2 +- .../itemviews/simplewidgetmapper/CMakeLists.txt | 2 +- .../widgets/itemviews/spinboxdelegate/CMakeLists.txt | 2 +- examples/widgets/itemviews/spreadsheet/CMakeLists.txt | 2 +- .../widgets/itemviews/stardelegate/CMakeLists.txt | 2 +- examples/widgets/itemviews/storageview/CMakeLists.txt | 2 +- examples/widgets/layouts/basiclayouts/CMakeLists.txt | 2 +- examples/widgets/layouts/borderlayout/CMakeLists.txt | 2 +- .../widgets/layouts/dynamiclayouts/CMakeLists.txt | 2 +- examples/widgets/layouts/flowlayout/CMakeLists.txt | 2 +- .../widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt | 2 +- examples/widgets/mac/qmacnativewidget/CMakeLists.txt | 2 +- .../widgets/mainwindows/application/CMakeLists.txt | 2 +- .../widgets/mainwindows/dockwidgets/CMakeLists.txt | 2 +- .../widgets/mainwindows/mainwindow/CMakeLists.txt | 2 +- examples/widgets/mainwindows/mdi/CMakeLists.txt | 2 +- examples/widgets/mainwindows/menus/CMakeLists.txt | 2 +- examples/widgets/mainwindows/sdi/CMakeLists.txt | 2 +- examples/widgets/painting/affine/CMakeLists.txt | 2 +- examples/widgets/painting/basicdrawing/CMakeLists.txt | 2 +- examples/widgets/painting/composition/CMakeLists.txt | 2 +- .../widgets/painting/concentriccircles/CMakeLists.txt | 2 +- examples/widgets/painting/deform/CMakeLists.txt | 2 +- examples/widgets/painting/fontsampler/CMakeLists.txt | 2 +- examples/widgets/painting/gradients/CMakeLists.txt | 2 +- .../widgets/painting/imagecomposition/CMakeLists.txt | 2 +- examples/widgets/painting/painterpaths/CMakeLists.txt | 2 +- examples/widgets/painting/pathstroke/CMakeLists.txt | 2 +- .../widgets/painting/transformations/CMakeLists.txt | 2 +- examples/widgets/richtext/calendar/CMakeLists.txt | 2 +- examples/widgets/richtext/orderform/CMakeLists.txt | 2 +- .../widgets/richtext/syntaxhighlighter/CMakeLists.txt | 2 +- examples/widgets/richtext/textedit/CMakeLists.txt | 2 +- examples/widgets/scroller/graphicsview/CMakeLists.txt | 2 +- .../statemachine/eventtransitions/CMakeLists.txt | 2 +- examples/widgets/statemachine/rogue/CMakeLists.txt | 2 +- .../widgets/statemachine/trafficlight/CMakeLists.txt | 2 +- .../widgets/statemachine/twowaybutton/CMakeLists.txt | 2 +- examples/widgets/tools/codecs/CMakeLists.txt | 2 +- examples/widgets/tools/completer/CMakeLists.txt | 2 +- examples/widgets/tools/customcompleter/CMakeLists.txt | 2 +- .../tools/echoplugin/echowindow/CMakeLists.txt | 2 +- examples/widgets/tools/i18n/CMakeLists.txt | 2 +- .../widgets/tools/plugandpaint/app/CMakeLists.txt | 2 +- examples/widgets/tools/regexp/CMakeLists.txt | 2 +- .../widgets/tools/regularexpression/CMakeLists.txt | 2 +- examples/widgets/tools/settingseditor/CMakeLists.txt | 2 +- .../tools/styleplugin/stylewindow/CMakeLists.txt | 2 +- .../widgets/tools/treemodelcompleter/CMakeLists.txt | 2 +- examples/widgets/tools/undo/CMakeLists.txt | 2 +- examples/widgets/tools/undoframework/CMakeLists.txt | 2 +- examples/widgets/touch/dials/CMakeLists.txt | 2 +- examples/widgets/touch/fingerpaint/CMakeLists.txt | 2 +- examples/widgets/touch/knobs/CMakeLists.txt | 2 +- examples/widgets/touch/pinchzoom/CMakeLists.txt | 2 +- .../tutorials/addressbook/part1/CMakeLists.txt | 2 +- .../tutorials/addressbook/part2/CMakeLists.txt | 2 +- .../tutorials/addressbook/part3/CMakeLists.txt | 2 +- .../tutorials/addressbook/part4/CMakeLists.txt | 2 +- .../tutorials/addressbook/part5/CMakeLists.txt | 2 +- .../tutorials/addressbook/part6/CMakeLists.txt | 2 +- .../tutorials/addressbook/part7/CMakeLists.txt | 2 +- .../gettingStarted/gsQt/part1/CMakeLists.txt | 2 +- .../gettingStarted/gsQt/part2/CMakeLists.txt | 2 +- .../gettingStarted/gsQt/part3/CMakeLists.txt | 2 +- .../gettingStarted/gsQt/part4/CMakeLists.txt | 2 +- .../gettingStarted/gsQt/part5/CMakeLists.txt | 2 +- .../tutorials/modelview/1_readonly/CMakeLists.txt | 2 +- .../tutorials/modelview/2_formatting/CMakeLists.txt | 2 +- .../modelview/3_changingmodel/CMakeLists.txt | 2 +- .../tutorials/modelview/4_headers/CMakeLists.txt | 2 +- .../widgets/tutorials/modelview/5_edit/CMakeLists.txt | 2 +- .../tutorials/modelview/6_treeview/CMakeLists.txt | 2 +- .../tutorials/modelview/7_selections/CMakeLists.txt | 2 +- examples/widgets/tutorials/notepad/CMakeLists.txt | 2 +- .../tutorials/widgets/childwidget/CMakeLists.txt | 2 +- .../tutorials/widgets/nestedlayouts/CMakeLists.txt | 2 +- .../widgets/tutorials/widgets/toplevel/CMakeLists.txt | 2 +- .../tutorials/widgets/windowlayout/CMakeLists.txt | 2 +- examples/widgets/widgets/analogclock/CMakeLists.txt | 2 +- examples/widgets/widgets/calculator/CMakeLists.txt | 2 +- .../widgets/widgets/calendarwidget/CMakeLists.txt | 2 +- examples/widgets/widgets/charactermap/CMakeLists.txt | 2 +- examples/widgets/widgets/codeeditor/CMakeLists.txt | 2 +- examples/widgets/widgets/digitalclock/CMakeLists.txt | 2 +- examples/widgets/widgets/elidedlabel/CMakeLists.txt | 2 +- examples/widgets/widgets/groupbox/CMakeLists.txt | 2 +- examples/widgets/widgets/icons/CMakeLists.txt | 2 +- examples/widgets/widgets/imageviewer/CMakeLists.txt | 2 +- examples/widgets/widgets/lineedits/CMakeLists.txt | 2 +- examples/widgets/widgets/mousebuttons/CMakeLists.txt | 2 +- examples/widgets/widgets/movie/CMakeLists.txt | 2 +- examples/widgets/widgets/scribble/CMakeLists.txt | 2 +- examples/widgets/widgets/shapedclock/CMakeLists.txt | 2 +- examples/widgets/widgets/sliders/CMakeLists.txt | 2 +- examples/widgets/widgets/spinboxes/CMakeLists.txt | 2 +- examples/widgets/widgets/styles/CMakeLists.txt | 2 +- examples/widgets/widgets/stylesheet/CMakeLists.txt | 2 +- examples/widgets/widgets/tablet/CMakeLists.txt | 2 +- examples/widgets/widgets/tetrix/CMakeLists.txt | 2 +- examples/widgets/widgets/tooltips/CMakeLists.txt | 2 +- examples/widgets/widgets/validators/CMakeLists.txt | 2 +- examples/widgets/widgets/wiggly/CMakeLists.txt | 2 +- examples/widgets/widgets/windowflags/CMakeLists.txt | 2 +- examples/widgets/windowcontainer/CMakeLists.txt | 2 +- examples/xml/dombookmarks/CMakeLists.txt | 2 +- examples/xml/rsslisting/CMakeLists.txt | 2 +- examples/xml/saxbookmarks/CMakeLists.txt | 2 +- examples/xml/streambookmarks/CMakeLists.txt | 2 +- src/corelib/Qt5CoreMacros.cmake | 11 +++++++++++ util/cmake/pro2cmake.py | 2 +- 224 files changed, 244 insertions(+), 231 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 841ea3fa03f..09143fa5a82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,9 +52,9 @@ if (QT_WILL_BUILD_TOOLS) add_subdirectory(qmake) endif() +qt_build_repo_end() + option(BUILD_EXAMPLES "Build Qt examples" ON) if (BUILD_EXAMPLES) add_subdirectory(examples) endif() - -qt_build_repo_end() diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c0436866af9..67c80ab2d68 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1349,9 +1349,11 @@ function(qt_export_tools module_name) set(tool_targets "") foreach(tool_name ${QT_KNOWN_MODULE_${module_name}_TOOLS}) set(extra_cmake_statements "${extra_cmake_statements} -get_property(is_global TARGET ${INSTALL_CMAKE_NAMESPACE}::${tool_name} PROPERTY IMPORTED_GLOBAL) -if(NOT is_global) - set_property(TARGET ${INSTALL_CMAKE_NAMESPACE}::${tool_name} PROPERTY IMPORTED_GLOBAL TRUE) +if (NOT QT_NO_CREATE_TARGETS) + get_property(is_global TARGET ${INSTALL_CMAKE_NAMESPACE}::${tool_name} PROPERTY IMPORTED_GLOBAL) + if(NOT is_global) + set_property(TARGET ${INSTALL_CMAKE_NAMESPACE}::${tool_name} PROPERTY IMPORTED_GLOBAL TRUE) + endif() endif() ") list(APPEND tool_targets "${QT_CMAKE_EXPORT_NAMESPACE}::${tool_name}") diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index e4468aa3555..d6b65b5b381 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -81,11 +81,11 @@ macro(qt_build_repo) add_subdirectory(tests) endif() + qt_build_repo_end() + if (BUILD_EXAMPLES AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt") add_subdirectory(examples) endif() - - qt_build_repo_end() endmacro() macro(qt_set_up_standalone_tests_build) diff --git a/cmake/QtModuleConfig.cmake.in b/cmake/QtModuleConfig.cmake.in index 0522b7d1e23..4bbd485fc4c 100644 --- a/cmake/QtModuleConfig.cmake.in +++ b/cmake/QtModuleConfig.cmake.in @@ -9,12 +9,12 @@ get_filename_component(_import_prefix "${_import_prefix}" REALPATH) @extra_cmake_code@ # Extra cmake code end -if (NOT QT_NO_CREATE_TARGETS) - # Find required dependencies, if any. - if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") - endif() +# Find required dependencies, if any. +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Dependencies.cmake") +endif() +if (NOT QT_NO_CREATE_TARGETS) include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Targets.cmake") include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@VersionlessTargets.cmake") endif() diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt index ae0492fe260..a171965bbba 100644 --- a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(localfortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(localfortuneclient WIN32 MACOSX_BUNDLE client.cpp client.h main.cpp ) diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt index 11fcf4e2977..5804aa69faf 100644 --- a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(localfortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(localfortuneserver WIN32 MACOSX_BUNDLE main.cpp server.cpp server.h ) diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt index f4e37803480..55f42ada888 100644 --- a/examples/corelib/ipc/sharedmemory/CMakeLists.txt +++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(sharedmemory WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sharedmemory WIN32 MACOSX_BUNDLE dialog.cpp dialog.h dialog.ui main.cpp ) diff --git a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt index 05e68e6d674..1493bdd31d3 100644 --- a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt +++ b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mimetypebrowser WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mimetypebrowser WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h mimetypemodel.cpp mimetypemodel.h diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt index 9b5995b1a5f..cc0385a9ce3 100644 --- a/examples/corelib/threads/mandelbrot/CMakeLists.txt +++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mandelbrot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mandelbrot WIN32 MACOSX_BUNDLE main.cpp mandelbrotwidget.cpp mandelbrotwidget.h renderthread.cpp renderthread.h diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt index 9fc8234e4d9..ef07b36301a 100644 --- a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt +++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(queuedcustomtype WIN32 MACOSX_BUNDLE +add_qt_gui_executable(queuedcustomtype WIN32 MACOSX_BUNDLE block.cpp block.h main.cpp renderthread.cpp renderthread.h diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt index 62214a46d56..9b0638bea20 100644 --- a/examples/corelib/tools/contiguouscache/CMakeLists.txt +++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(contiguouscache WIN32 MACOSX_BUNDLE +add_qt_gui_executable(contiguouscache WIN32 MACOSX_BUNDLE main.cpp randomlistmodel.cpp randomlistmodel.h ) diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt index 394534f5eef..2cab51c0732 100644 --- a/examples/corelib/tools/customtype/CMakeLists.txt +++ b/examples/corelib/tools/customtype/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(customtype WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customtype WIN32 MACOSX_BUNDLE main.cpp message.cpp message.h ) diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt index 53a39c57ce3..06ed26ba485 100644 --- a/examples/corelib/tools/customtypesending/CMakeLists.txt +++ b/examples/corelib/tools/customtypesending/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(customtypesending WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customtypesending WIN32 MACOSX_BUNDLE main.cpp message.cpp message.h window.cpp window.h diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt index 26388c51eb2..85da98583ca 100644 --- a/examples/dbus/chat/CMakeLists.txt +++ b/examples/dbus/chat/CMakeLists.txt @@ -27,7 +27,7 @@ qt5_add_dbus_adaptor(chat_SRCS chat_adaptor ) # special case end -add_executable(chat WIN32 MACOSX_BUNDLE +add_qt_gui_executable(chat WIN32 MACOSX_BUNDLE chat.cpp chat.h chatmainwindow.ui chatsetnickname.ui diff --git a/examples/dbus/complexpingpong/CMakeLists.txt b/examples/dbus/complexpingpong/CMakeLists.txt index 543af8491b9..fb96f826b47 100644 --- a/examples/dbus/complexpingpong/CMakeLists.txt +++ b/examples/dbus/complexpingpong/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS DBus) -add_executable(complexpong WIN32 MACOSX_BUNDLE +add_qt_gui_executable(complexpong WIN32 MACOSX_BUNDLE complexpong.cpp complexpong.h ) target_link_libraries(complexpong PUBLIC diff --git a/examples/dbus/listnames/CMakeLists.txt b/examples/dbus/listnames/CMakeLists.txt index 5fe935f24a1..c888a1df49a 100644 --- a/examples/dbus/listnames/CMakeLists.txt +++ b/examples/dbus/listnames/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS DBus) -add_executable(listnames WIN32 MACOSX_BUNDLE +add_qt_gui_executable(listnames WIN32 MACOSX_BUNDLE listnames.cpp ) target_link_libraries(listnames PUBLIC diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt index e82fe78c514..1e93e3cef31 100644 --- a/examples/dbus/pingpong/CMakeLists.txt +++ b/examples/dbus/pingpong/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS DBus) -add_executable(pong WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pong WIN32 MACOSX_BUNDLE ping-common.h pong.cpp pong.h ) diff --git a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt index 9532d0cceec..cee3b2bb50e 100644 --- a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt @@ -23,7 +23,7 @@ qt5_add_dbus_adaptor(car_SRCS car_adaptor ) # special case end -add_executable(car WIN32 MACOSX_BUNDLE +add_qt_gui_executable(car WIN32 MACOSX_BUNDLE car.cpp car.h main.cpp ${car_SRCS} # special case diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt index 00bf809392b..ee97e0d1e4c 100644 --- a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt @@ -21,7 +21,7 @@ qt5_add_dbus_interface(controller_SRCS car_interface ) # special case end -add_executable(controller WIN32 MACOSX_BUNDLE +add_qt_gui_executable(controller WIN32 MACOSX_BUNDLE controller.cpp controller.h controller.ui main.cpp ${controller_SRCS} # special case diff --git a/examples/embedded/digiflip/CMakeLists.txt b/examples/embedded/digiflip/CMakeLists.txt index bc94d6809ad..ee20c34c114 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_executable(digiflip WIN32 MACOSX_BUNDLE +add_qt_gui_executable(digiflip WIN32 MACOSX_BUNDLE digiflip.cpp ) target_link_libraries(digiflip PUBLIC diff --git a/examples/embedded/flickable/CMakeLists.txt b/examples/embedded/flickable/CMakeLists.txt index 8d5d9878f06..c71699b693a 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_executable(flickable WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flickable WIN32 MACOSX_BUNDLE flickable.cpp flickable.h main.cpp ) diff --git a/examples/embedded/flightinfo/CMakeLists.txt b/examples/embedded/flightinfo/CMakeLists.txt index 9afc98df76a..e9055311143 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_executable(flightinfo WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flightinfo WIN32 MACOSX_BUNDLE flightinfo.cpp form.ui flightinfo.qrc # special case: add diff --git a/examples/embedded/lightmaps/CMakeLists.txt b/examples/embedded/lightmaps/CMakeLists.txt index 35171451bfc..ea7239b7ac9 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_executable(lightmaps WIN32 MACOSX_BUNDLE +add_qt_gui_executable(lightmaps WIN32 MACOSX_BUNDLE lightmaps.cpp lightmaps.h main.cpp mapzoom.cpp mapzoom.h diff --git a/examples/embedded/raycasting/CMakeLists.txt b/examples/embedded/raycasting/CMakeLists.txt index 0578b6e0bd8..d27dbbe7a4f 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_executable(raycasting WIN32 MACOSX_BUNDLE +add_qt_gui_executable(raycasting WIN32 MACOSX_BUNDLE raycasting.cpp raycasting.qrc ) target_link_libraries(raycasting PUBLIC diff --git a/examples/embedded/styleexample/CMakeLists.txt b/examples/embedded/styleexample/CMakeLists.txt index 2210d8cf9b6..34ab6e4a223 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_executable(styleexample WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styleexample WIN32 MACOSX_BUNDLE main.cpp stylewidget.cpp stylewidget.h stylewidget.ui styleexample.qrc # special case: add diff --git a/examples/gui/analogclock/CMakeLists.txt b/examples/gui/analogclock/CMakeLists.txt index d35b5a7502f..7fe1aed8dea 100644 --- a/examples/gui/analogclock/CMakeLists.txt +++ b/examples/gui/analogclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_executable(gui_analogclock WIN32 MACOSX_BUNDLE # special case: renamed target +add_qt_gui_executable(gui_analogclock WIN32 MACOSX_BUNDLE # special case: renamed target ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h main.cpp ) diff --git a/examples/gui/openglwindow/CMakeLists.txt b/examples/gui/openglwindow/CMakeLists.txt index ee62a2c43e4..c77dabd0c1b 100644 --- a/examples/gui/openglwindow/CMakeLists.txt +++ b/examples/gui/openglwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_executable(openglwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(openglwindow WIN32 MACOSX_BUNDLE main.cpp openglwindow.cpp openglwindow.h ) diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt index f200899fbdf..9ddf9163696 100644 --- a/examples/gui/rasterwindow/CMakeLists.txt +++ b/examples/gui/rasterwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_executable(rasterwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(rasterwindow WIN32 MACOSX_BUNDLE main.cpp rasterwindow.cpp rasterwindow.h ) diff --git a/examples/network/blockingfortuneclient/CMakeLists.txt b/examples/network/blockingfortuneclient/CMakeLists.txt index 603c7d9fd2a..47933d66ff4 100644 --- a/examples/network/blockingfortuneclient/CMakeLists.txt +++ b/examples/network/blockingfortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(blockingfortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(blockingfortuneclient WIN32 MACOSX_BUNDLE blockingclient.cpp blockingclient.h fortunethread.cpp fortunethread.h main.cpp diff --git a/examples/network/broadcastreceiver/CMakeLists.txt b/examples/network/broadcastreceiver/CMakeLists.txt index 79075f35580..d8cdae0b42e 100644 --- a/examples/network/broadcastreceiver/CMakeLists.txt +++ b/examples/network/broadcastreceiver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(broadcastreceiver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(broadcastreceiver WIN32 MACOSX_BUNDLE main.cpp receiver.cpp receiver.h ) diff --git a/examples/network/broadcastsender/CMakeLists.txt b/examples/network/broadcastsender/CMakeLists.txt index f6da1a57333..31681c29c33 100644 --- a/examples/network/broadcastsender/CMakeLists.txt +++ b/examples/network/broadcastsender/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(broadcastsender WIN32 MACOSX_BUNDLE +add_qt_gui_executable(broadcastsender WIN32 MACOSX_BUNDLE main.cpp sender.cpp sender.h ) diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt index a9e0e00c7eb..6530cdcf00b 100644 --- a/examples/network/fortuneclient/CMakeLists.txt +++ b/examples/network/fortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(fortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fortuneclient WIN32 MACOSX_BUNDLE client.cpp client.h main.cpp ) diff --git a/examples/network/fortuneserver/CMakeLists.txt b/examples/network/fortuneserver/CMakeLists.txt index 03604f121ec..43ca6f7d2b0 100644 --- a/examples/network/fortuneserver/CMakeLists.txt +++ b/examples/network/fortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(fortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fortuneserver WIN32 MACOSX_BUNDLE main.cpp server.cpp server.h ) diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt index d445bf646d5..b1556de464e 100644 --- a/examples/network/googlesuggest/CMakeLists.txt +++ b/examples/network/googlesuggest/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(googlesuggest WIN32 MACOSX_BUNDLE +add_qt_gui_executable(googlesuggest WIN32 MACOSX_BUNDLE googlesuggest.cpp googlesuggest.h main.cpp searchbox.cpp searchbox.h diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt index 931c834eae3..3da3b8c3ac7 100644 --- a/examples/network/http/CMakeLists.txt +++ b/examples/network/http/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(http WIN32 MACOSX_BUNDLE +add_qt_gui_executable(http WIN32 MACOSX_BUNDLE authenticationdialog.ui httpwindow.cpp httpwindow.h main.cpp diff --git a/examples/network/loopback/CMakeLists.txt b/examples/network/loopback/CMakeLists.txt index 06410c7b5cd..e6f46b0933d 100644 --- a/examples/network/loopback/CMakeLists.txt +++ b/examples/network/loopback/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(loopback WIN32 MACOSX_BUNDLE +add_qt_gui_executable(loopback WIN32 MACOSX_BUNDLE dialog.cpp dialog.h main.cpp ) diff --git a/examples/network/multicastreceiver/CMakeLists.txt b/examples/network/multicastreceiver/CMakeLists.txt index 71bcadc2536..eaabf8a5d52 100644 --- a/examples/network/multicastreceiver/CMakeLists.txt +++ b/examples/network/multicastreceiver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(multicastreceiver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multicastreceiver WIN32 MACOSX_BUNDLE main.cpp receiver.cpp receiver.h ) diff --git a/examples/network/multicastsender/CMakeLists.txt b/examples/network/multicastsender/CMakeLists.txt index bcb23706494..8504bc36472 100644 --- a/examples/network/multicastsender/CMakeLists.txt +++ b/examples/network/multicastsender/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(multicastsender WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multicastsender WIN32 MACOSX_BUNDLE main.cpp sender.cpp sender.h ) diff --git a/examples/network/multistreamclient/CMakeLists.txt b/examples/network/multistreamclient/CMakeLists.txt index 399333fd29a..c0091d10466 100644 --- a/examples/network/multistreamclient/CMakeLists.txt +++ b/examples/network/multistreamclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(multistreamclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multistreamclient WIN32 MACOSX_BUNDLE chatconsumer.cpp chatconsumer.h client.cpp client.h consumer.h diff --git a/examples/network/multistreamserver/CMakeLists.txt b/examples/network/multistreamserver/CMakeLists.txt index bf48042f58f..44c36e43221 100644 --- a/examples/network/multistreamserver/CMakeLists.txt +++ b/examples/network/multistreamserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(multistreamserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multistreamserver WIN32 MACOSX_BUNDLE chatprovider.cpp chatprovider.h main.cpp movieprovider.cpp movieprovider.h diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt index a4fb9503708..be60e01f142 100644 --- a/examples/network/network-chat/CMakeLists.txt +++ b/examples/network/network-chat/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(network-chat WIN32 MACOSX_BUNDLE +add_qt_gui_executable(network-chat WIN32 MACOSX_BUNDLE chatdialog.cpp chatdialog.h chatdialog.ui client.cpp client.h connection.cpp connection.h diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt index d112af044a6..f00d138d805 100644 --- a/examples/network/securesocketclient/CMakeLists.txt +++ b/examples/network/securesocketclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(securesocketclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(securesocketclient WIN32 MACOSX_BUNDLE certificateinfo.cpp certificateinfo.h certificateinfo.ui main.cpp securesocketclient.qrc diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt index 531b1196a38..6af110c4122 100644 --- a/examples/network/secureudpclient/CMakeLists.txt +++ b/examples/network/secureudpclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Network) -add_executable(secureudpclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(secureudpclient WIN32 MACOSX_BUNDLE addressdialog.cpp addressdialog.h addressdialog.ui association.cpp association.h main.cpp diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt index e6e60711d0c..f30d8808009 100644 --- a/examples/network/secureudpserver/CMakeLists.txt +++ b/examples/network/secureudpserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Network) -add_executable(secureudpserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(secureudpserver WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h mainwindow.ui nicselector.cpp nicselector.h nicselector.ui diff --git a/examples/network/threadedfortuneserver/CMakeLists.txt b/examples/network/threadedfortuneserver/CMakeLists.txt index 43b95e60d5c..ce5c0e0d194 100644 --- a/examples/network/threadedfortuneserver/CMakeLists.txt +++ b/examples/network/threadedfortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(threadedfortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(threadedfortuneserver WIN32 MACOSX_BUNDLE dialog.cpp dialog.h fortuneserver.cpp fortuneserver.h fortunethread.cpp fortunethread.h diff --git a/examples/network/torrent/.prev_CMakeLists.txt b/examples/network/torrent/.prev_CMakeLists.txt index 8391a0a9db3..3673b7e05a0 100644 --- a/examples/network/torrent/.prev_CMakeLists.txt +++ b/examples/network/torrent/.prev_CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(torrent WIN32 MACOSX_BUNDLE +add_qt_gui_executable(torrent WIN32 MACOSX_BUNDLE addtorrentdialog.cpp addtorrentdialog.h bencodeparser.cpp bencodeparser.h connectionmanager.cpp connectionmanager.h diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt index 2a49e3800bd..86bad72ab7e 100644 --- a/examples/network/torrent/CMakeLists.txt +++ b/examples/network/torrent/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_executable(torrent WIN32 MACOSX_BUNDLE +add_qt_gui_executable(torrent WIN32 MACOSX_BUNDLE addtorrentdialog.cpp addtorrentdialog.h bencodeparser.cpp bencodeparser.h connectionmanager.cpp connectionmanager.h diff --git a/examples/qpa/qrasterwindow/CMakeLists.txt b/examples/qpa/qrasterwindow/CMakeLists.txt index c74ce2974b2..f718796eb94 100644 --- a/examples/qpa/qrasterwindow/CMakeLists.txt +++ b/examples/qpa/qrasterwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_executable(qrasterwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qrasterwindow WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(qrasterwindow PUBLIC Qt::Gui) # special case: add diff --git a/examples/qtconcurrent/imagescaling/CMakeLists.txt b/examples/qtconcurrent/imagescaling/CMakeLists.txt index a288397de7d..448bcf848e1 100644 --- a/examples/qtconcurrent/imagescaling/CMakeLists.txt +++ b/examples/qtconcurrent/imagescaling/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Concurrent) find_package(Qt5 COMPONENTS Widgets) -add_executable(imagescaling WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imagescaling WIN32 MACOSX_BUNDLE imagescaling.cpp imagescaling.h main.cpp ) diff --git a/examples/qtestlib/tutorial1/CMakeLists.txt b/examples/qtestlib/tutorial1/CMakeLists.txt index b30293a3e3f..fb834211a7f 100644 --- a/examples/qtestlib/tutorial1/CMakeLists.txt +++ b/examples/qtestlib/tutorial1/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_executable(tutorial1 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial1 WIN32 MACOSX_BUNDLE testqstring.cpp ) target_link_libraries(tutorial1 PUBLIC diff --git a/examples/qtestlib/tutorial2/CMakeLists.txt b/examples/qtestlib/tutorial2/CMakeLists.txt index ed7cc3f2240..600cbb2ddd4 100644 --- a/examples/qtestlib/tutorial2/CMakeLists.txt +++ b/examples/qtestlib/tutorial2/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_executable(tutorial2 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial2 WIN32 MACOSX_BUNDLE testqstring.cpp ) target_link_libraries(tutorial2 PUBLIC diff --git a/examples/qtestlib/tutorial3/CMakeLists.txt b/examples/qtestlib/tutorial3/CMakeLists.txt index 975ac4dfd66..457495997fc 100644 --- a/examples/qtestlib/tutorial3/CMakeLists.txt +++ b/examples/qtestlib/tutorial3/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_executable(tutorial3 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial3 WIN32 MACOSX_BUNDLE testgui.cpp ) target_link_libraries(tutorial3 PUBLIC diff --git a/examples/qtestlib/tutorial4/CMakeLists.txt b/examples/qtestlib/tutorial4/CMakeLists.txt index 069afd031e7..6d2c0f2ce12 100644 --- a/examples/qtestlib/tutorial4/CMakeLists.txt +++ b/examples/qtestlib/tutorial4/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_executable(tutorial4 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial4 WIN32 MACOSX_BUNDLE testgui.cpp ) target_link_libraries(tutorial4 PUBLIC diff --git a/examples/qtestlib/tutorial5/CMakeLists.txt b/examples/qtestlib/tutorial5/CMakeLists.txt index 65dba6dcb53..b0e2995b2ae 100644 --- a/examples/qtestlib/tutorial5/CMakeLists.txt +++ b/examples/qtestlib/tutorial5/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_executable(tutorial5 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial5 WIN32 MACOSX_BUNDLE benchmarking.cpp ) target_link_libraries(tutorial5 PUBLIC diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt index 294a764a9be..cfee3e237da 100644 --- a/examples/sql/books/CMakeLists.txt +++ b/examples/sql/books/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(books WIN32 MACOSX_BUNDLE +add_qt_gui_executable(books WIN32 MACOSX_BUNDLE bookdelegate.cpp bookdelegate.h books.qrc bookwindow.cpp bookwindow.h bookwindow.ui diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt index 3ccea061ff7..16ef886b1c4 100644 --- a/examples/sql/cachedtable/CMakeLists.txt +++ b/examples/sql/cachedtable/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(cachedtable WIN32 MACOSX_BUNDLE +add_qt_gui_executable(cachedtable WIN32 MACOSX_BUNDLE ../connection.h main.cpp tableeditor.cpp tableeditor.h diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt index b8fab77b0c4..ed411d1ca34 100644 --- a/examples/sql/drilldown/CMakeLists.txt +++ b/examples/sql/drilldown/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(drilldown WIN32 MACOSX_BUNDLE +add_qt_gui_executable(drilldown WIN32 MACOSX_BUNDLE ../connection.h drilldown.qrc imageitem.cpp imageitem.h diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt index d1f4883da1d..832cbdea8b0 100644 --- a/examples/sql/masterdetail/CMakeLists.txt +++ b/examples/sql/masterdetail/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Xml) -add_executable(masterdetail WIN32 MACOSX_BUNDLE +add_qt_gui_executable(masterdetail WIN32 MACOSX_BUNDLE database.h dialog.cpp dialog.h main.cpp diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt index 7f617c7c33b..6dc59a4bb76 100644 --- a/examples/sql/querymodel/CMakeLists.txt +++ b/examples/sql/querymodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(querymodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(querymodel WIN32 MACOSX_BUNDLE ../connection.h customsqlmodel.cpp customsqlmodel.h editablesqlmodel.cpp editablesqlmodel.h diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt index de4dba49ccf..0d35a9abdbc 100644 --- a/examples/sql/relationaltablemodel/CMakeLists.txt +++ b/examples/sql/relationaltablemodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(relationaltablemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(relationaltablemodel WIN32 MACOSX_BUNDLE ../connection.h relationaltablemodel.cpp ) diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt index dee4d4a58e8..f52de00ce66 100644 --- a/examples/sql/sqlbrowser/CMakeLists.txt +++ b/examples/sql/sqlbrowser/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(sqlbrowser WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sqlbrowser WIN32 MACOSX_BUNDLE browser.cpp browser.h browserwidget.ui connectionwidget.cpp connectionwidget.h diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt index 586592fb181..48e68209c5d 100644 --- a/examples/sql/sqlwidgetmapper/CMakeLists.txt +++ b/examples/sql/sqlwidgetmapper/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt index 99729271662..fb7dbac9275 100644 --- a/examples/sql/tablemodel/CMakeLists.txt +++ b/examples/sql/tablemodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_executable(tablemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tablemodel WIN32 MACOSX_BUNDLE ../connection.h tablemodel.cpp ) diff --git a/examples/widgets/animation/animatedtiles/CMakeLists.txt b/examples/widgets/animation/animatedtiles/CMakeLists.txt index dacde5535cc..e3fa88aebba 100644 --- a/examples/widgets/animation/animatedtiles/CMakeLists.txt +++ b/examples/widgets/animation/animatedtiles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(animatedtiles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(animatedtiles WIN32 MACOSX_BUNDLE animatedtiles.qrc main.cpp ) diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt index 1500b11f3bf..441b27b0c49 100644 --- a/examples/widgets/animation/easing/CMakeLists.txt +++ b/examples/widgets/animation/easing/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(easing WIN32 MACOSX_BUNDLE +add_qt_gui_executable(easing WIN32 MACOSX_BUNDLE animation.h easing.qrc form.ui diff --git a/examples/widgets/animation/moveblocks/CMakeLists.txt b/examples/widgets/animation/moveblocks/CMakeLists.txt index cc2b70af44b..971bf2e7e53 100644 --- a/examples/widgets/animation/moveblocks/CMakeLists.txt +++ b/examples/widgets/animation/moveblocks/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(moveblocks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(moveblocks WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(moveblocks PUBLIC diff --git a/examples/widgets/animation/states/CMakeLists.txt b/examples/widgets/animation/states/CMakeLists.txt index a28995db997..bd353422d28 100644 --- a/examples/widgets/animation/states/CMakeLists.txt +++ b/examples/widgets/animation/states/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(states WIN32 MACOSX_BUNDLE +add_qt_gui_executable(states WIN32 MACOSX_BUNDLE main.cpp states.qrc ) diff --git a/examples/widgets/animation/stickman/CMakeLists.txt b/examples/widgets/animation/stickman/CMakeLists.txt index 5cb2e86c487..90bc09e5d74 100644 --- a/examples/widgets/animation/stickman/CMakeLists.txt +++ b/examples/widgets/animation/stickman/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(stickman WIN32 MACOSX_BUNDLE +add_qt_gui_executable(stickman WIN32 MACOSX_BUNDLE animation.cpp animation.h graphicsview.cpp graphicsview.h lifecycle.cpp lifecycle.h diff --git a/examples/widgets/animation/sub-attaq/CMakeLists.txt b/examples/widgets/animation/sub-attaq/CMakeLists.txt index 3260a5f75d1..883c1cd0c58 100644 --- a/examples/widgets/animation/sub-attaq/CMakeLists.txt +++ b/examples/widgets/animation/sub-attaq/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS OpenGL) # special case -add_executable(sub-attaq WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sub-attaq WIN32 MACOSX_BUNDLE animationmanager.cpp animationmanager.h boat.cpp boat.h boat_p.h bomb.cpp bomb.h diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt index e4533298d07..4c207f1bef5 100644 --- a/examples/widgets/desktop/screenshot/CMakeLists.txt +++ b/examples/widgets/desktop/screenshot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(screenshot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(screenshot WIN32 MACOSX_BUNDLE main.cpp screenshot.cpp screenshot.h ) diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt index 2e89c2a8f9d..754ccad8e3c 100644 --- a/examples/widgets/desktop/systray/CMakeLists.txt +++ b/examples/widgets/desktop/systray/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(systray WIN32 MACOSX_BUNDLE +add_qt_gui_executable(systray WIN32 MACOSX_BUNDLE main.cpp systray.qrc window.cpp window.h diff --git a/examples/widgets/dialogs/classwizard/CMakeLists.txt b/examples/widgets/dialogs/classwizard/CMakeLists.txt index 1c9ecebcee8..5a57c5905ac 100644 --- a/examples/widgets/dialogs/classwizard/CMakeLists.txt +++ b/examples/widgets/dialogs/classwizard/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(classwizard WIN32 MACOSX_BUNDLE +add_qt_gui_executable(classwizard WIN32 MACOSX_BUNDLE classwizard.cpp classwizard.h classwizard.qrc main.cpp ) diff --git a/examples/widgets/dialogs/extension/CMakeLists.txt b/examples/widgets/dialogs/extension/CMakeLists.txt index 8037d670d93..fa35d52048b 100644 --- a/examples/widgets/dialogs/extension/CMakeLists.txt +++ b/examples/widgets/dialogs/extension/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(extension WIN32 MACOSX_BUNDLE +add_qt_gui_executable(extension WIN32 MACOSX_BUNDLE finddialog.cpp finddialog.h main.cpp ) diff --git a/examples/widgets/dialogs/findfiles/CMakeLists.txt b/examples/widgets/dialogs/findfiles/CMakeLists.txt index 11e971b7f21..12ce6ce05ee 100644 --- a/examples/widgets/dialogs/findfiles/CMakeLists.txt +++ b/examples/widgets/dialogs/findfiles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(findfiles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(findfiles WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt index eef8e33ca15..a82800363e0 100644 --- a/examples/widgets/dialogs/licensewizard/CMakeLists.txt +++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) -add_executable(licensewizard WIN32 MACOSX_BUNDLE +add_qt_gui_executable(licensewizard WIN32 MACOSX_BUNDLE licensewizard.cpp licensewizard.h licensewizard.qrc main.cpp ) diff --git a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt index 2aa96fba067..91c74b71e11 100644 --- a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt +++ b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(standarddialogs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(standarddialogs WIN32 MACOSX_BUNDLE dialog.cpp dialog.h main.cpp ) diff --git a/examples/widgets/dialogs/tabdialog/CMakeLists.txt b/examples/widgets/dialogs/tabdialog/CMakeLists.txt index da05a322f31..ec88fd66d02 100644 --- a/examples/widgets/dialogs/tabdialog/CMakeLists.txt +++ b/examples/widgets/dialogs/tabdialog/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(tabdialog WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tabdialog WIN32 MACOSX_BUNDLE main.cpp tabdialog.cpp tabdialog.h ) diff --git a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt index 307945b2c2c..394816619d3 100644 --- a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt +++ b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(trivialwizard WIN32 MACOSX_BUNDLE +add_qt_gui_executable(trivialwizard WIN32 MACOSX_BUNDLE trivialwizard.cpp ) target_link_libraries(trivialwizard PUBLIC diff --git a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt index ced583e1dbb..d7ec690a986 100644 --- a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt +++ b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(draggableicons WIN32 MACOSX_BUNDLE +add_qt_gui_executable(draggableicons WIN32 MACOSX_BUNDLE draggableicons.qrc dragwidget.cpp dragwidget.h main.cpp diff --git a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt index aa6656ed0bc..c145771015a 100644 --- a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt +++ b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(draggabletext WIN32 MACOSX_BUNDLE +add_qt_gui_executable(draggabletext WIN32 MACOSX_BUNDLE draggabletext.qrc dragwidget.cpp dragwidget.h main.cpp diff --git a/examples/widgets/draganddrop/dropsite/CMakeLists.txt b/examples/widgets/draganddrop/dropsite/CMakeLists.txt index abb850c0b63..863a757f39c 100644 --- a/examples/widgets/draganddrop/dropsite/CMakeLists.txt +++ b/examples/widgets/draganddrop/dropsite/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(dropsite WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dropsite WIN32 MACOSX_BUNDLE droparea.cpp droparea.h dropsitewindow.cpp dropsitewindow.h main.cpp diff --git a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt index e0ab3d36c51..d7acb41b219 100644 --- a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt +++ b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(fridgemagnets WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fridgemagnets WIN32 MACOSX_BUNDLE draglabel.cpp draglabel.h dragwidget.cpp dragwidget.h fridgemagnets.qrc diff --git a/examples/widgets/draganddrop/puzzle/CMakeLists.txt b/examples/widgets/draganddrop/puzzle/CMakeLists.txt index b95d7b2cf44..44191011177 100644 --- a/examples/widgets/draganddrop/puzzle/CMakeLists.txt +++ b/examples/widgets/draganddrop/puzzle/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(draganddrop_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle +add_qt_gui_executable(draganddrop_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle main.cpp mainwindow.cpp mainwindow.h pieceslist.cpp pieceslist.h diff --git a/examples/widgets/effects/blurpicker/CMakeLists.txt b/examples/widgets/effects/blurpicker/CMakeLists.txt index c99beb310f0..f5b7047b8aa 100644 --- a/examples/widgets/effects/blurpicker/CMakeLists.txt +++ b/examples/widgets/effects/blurpicker/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(blurpicker WIN32 MACOSX_BUNDLE +add_qt_gui_executable(blurpicker WIN32 MACOSX_BUNDLE blureffect.cpp blureffect.h blurpicker.cpp blurpicker.h blurpicker.qrc main.cpp diff --git a/examples/widgets/effects/fademessage/CMakeLists.txt b/examples/widgets/effects/fademessage/CMakeLists.txt index 689b0593eaf..e53fc405f76 100644 --- a/examples/widgets/effects/fademessage/CMakeLists.txt +++ b/examples/widgets/effects/fademessage/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(fademessage WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fademessage WIN32 MACOSX_BUNDLE fademessage.cpp fademessage.h fademessage.qrc main.cpp ) diff --git a/examples/widgets/gestures/imagegestures/CMakeLists.txt b/examples/widgets/gestures/imagegestures/CMakeLists.txt index 1efaa427742..75f2b981b79 100644 --- a/examples/widgets/gestures/imagegestures/CMakeLists.txt +++ b/examples/widgets/gestures/imagegestures/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(imagegestures WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imagegestures WIN32 MACOSX_BUNDLE imagewidget.cpp imagewidget.h main.cpp mainwidget.cpp mainwidget.h diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt index 1488f394c6a..9676dbbcbad 100644 --- a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(anchorlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(anchorlayout WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(anchorlayout PUBLIC diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt index 0ce632e6b6a..982fd541c60 100644 --- a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt +++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(basicgraphicslayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basicgraphicslayouts WIN32 MACOSX_BUNDLE basicgraphicslayouts.qrc layoutitem.cpp layoutitem.h main.cpp diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt index 4e1d105a3af..b5441bcfdf5 100644 --- a/examples/widgets/graphicsview/boxes/CMakeLists.txt +++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS OpenGL) find_package(Qt5 COMPONENTS Widgets) -add_executable(boxes WIN32 MACOSX_BUNDLE +add_qt_gui_executable(boxes WIN32 MACOSX_BUNDLE 3rdparty/fbm.c 3rdparty/fbm.h boxes.qrc glbuffers.cpp glbuffers.h diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt index 81f290be995..141645a22c6 100644 --- a/examples/widgets/graphicsview/chip/CMakeLists.txt +++ b/examples/widgets/graphicsview/chip/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS OpenGL) # special case find_package(Qt5 COMPONENTS PrintSupport) # special case -add_executable(chip WIN32 MACOSX_BUNDLE +add_qt_gui_executable(chip WIN32 MACOSX_BUNDLE chip.cpp chip.h images.qrc main.cpp diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt index 36b1fb85c17..90018588170 100644 --- a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt +++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(collidingmice WIN32 MACOSX_BUNDLE +add_qt_gui_executable(collidingmice WIN32 MACOSX_BUNDLE main.cpp mice.qrc mouse.cpp mouse.h diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt index 76f60aabaad..bfdd3b8f5b0 100644 --- a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt +++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(diagramscene WIN32 MACOSX_BUNDLE +add_qt_gui_executable(diagramscene WIN32 MACOSX_BUNDLE arrow.cpp arrow.h diagramitem.cpp diagramitem.h diagramscene.cpp diagramscene.h diagramscene.qrc diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt index 2adcff3ae5b..d85dcd1ff94 100644 --- a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt +++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(dragdroprobot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dragdroprobot WIN32 MACOSX_BUNDLE coloritem.cpp coloritem.h main.cpp robot.cpp robot.h robot.qrc diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt index 42fd71fa5f9..b1e04b2a20b 100644 --- a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt +++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(elasticnodes WIN32 MACOSX_BUNDLE +add_qt_gui_executable(elasticnodes WIN32 MACOSX_BUNDLE edge.cpp edge.h graphwidget.cpp graphwidget.h main.cpp diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt index 2652b985dfa..fc9f6086cef 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt +++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(embeddeddialogs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(embeddeddialogs WIN32 MACOSX_BUNDLE customproxy.cpp customproxy.h embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui embeddeddialogs.qrc diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt index 96b82b79557..ef5a4d55642 100644 --- a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(graphicsview_flowlayout WIN32 MACOSX_BUNDLE # special case: renamed flowlayout +add_qt_gui_executable(graphicsview_flowlayout WIN32 MACOSX_BUNDLE # special case: renamed flowlayout flowlayout.cpp flowlayout.h main.cpp window.cpp window.h diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt index afb35675d80..bc1564cb8c9 100644 --- a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(simpleanchorlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simpleanchorlayout WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(simpleanchorlayout PUBLIC diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt index 750352e3251..22e92cc68b1 100644 --- a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(weatheranchorlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(weatheranchorlayout WIN32 MACOSX_BUNDLE main.cpp weatheranchorlayout.qrc ) diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt index 026c2406a4b..2831e860a55 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_executable(addressbook WIN32 MACOSX_BUNDLE +add_qt_gui_executable(addressbook WIN32 MACOSX_BUNDLE adddialog.cpp adddialog.h addresswidget.cpp addresswidget.h main.cpp diff --git a/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/basicsortfiltermodel/CMakeLists.txt index 2efba58b105..8c4d84431e1 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_executable(basicsortfiltermodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basicsortfiltermodel WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/itemviews/chart/CMakeLists.txt b/examples/widgets/itemviews/chart/CMakeLists.txt index 79c489b03e1..7aceadab54b 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_executable(chart WIN32 MACOSX_BUNDLE +add_qt_gui_executable(chart WIN32 MACOSX_BUNDLE chart.qrc main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt b/examples/widgets/itemviews/coloreditorfactory/CMakeLists.txt index c33cc611182..e3cea3e2351 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_executable(coloreditorfactory WIN32 MACOSX_BUNDLE +add_qt_gui_executable(coloreditorfactory WIN32 MACOSX_BUNDLE colorlisteditor.cpp colorlisteditor.h main.cpp window.cpp window.h diff --git a/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/combowidgetmapper/CMakeLists.txt index 7cce164bc6d..175f78e7732 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_executable(combowidgetmapper WIN32 MACOSX_BUNDLE +add_qt_gui_executable(combowidgetmapper WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt b/examples/widgets/itemviews/customsortfiltermodel/CMakeLists.txt index 0aa34c46d88..2c3627657ae 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_executable(customsortfiltermodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customsortfiltermodel WIN32 MACOSX_BUNDLE customsortfiltermodel.qrc filterwidget.cpp filterwidget.h main.cpp diff --git a/examples/widgets/itemviews/dirview/CMakeLists.txt b/examples/widgets/itemviews/dirview/CMakeLists.txt index 3e6e7c9ac7b..105d420f1af 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_executable(dirview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dirview WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(dirview PUBLIC diff --git a/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt b/examples/widgets/itemviews/editabletreemodel/CMakeLists.txt index c86c0d7272d..f3e574c8110 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_executable(editabletreemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(editabletreemodel WIN32 MACOSX_BUNDLE editabletreemodel.qrc main.cpp mainwindow.cpp mainwindow.h mainwindow.ui diff --git a/examples/widgets/itemviews/fetchmore/CMakeLists.txt b/examples/widgets/itemviews/fetchmore/CMakeLists.txt index 5013d5bab2c..be2771970a2 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_executable(fetchmore WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fetchmore WIN32 MACOSX_BUNDLE filelistmodel.cpp filelistmodel.h main.cpp window.cpp window.h diff --git a/examples/widgets/itemviews/flattreeview/CMakeLists.txt b/examples/widgets/itemviews/flattreeview/CMakeLists.txt index afcb66a6b29..b026b2442f3 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_executable(flattreeview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flattreeview WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(flattreeview PUBLIC diff --git a/examples/widgets/itemviews/frozencolumn/CMakeLists.txt b/examples/widgets/itemviews/frozencolumn/CMakeLists.txt index a17ffef5fcc..fee5570bd60 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_executable(frozencolumn WIN32 MACOSX_BUNDLE +add_qt_gui_executable(frozencolumn WIN32 MACOSX_BUNDLE freezetablewidget.cpp freezetablewidget.h grades.qrc main.cpp diff --git a/examples/widgets/itemviews/interview/CMakeLists.txt b/examples/widgets/itemviews/interview/CMakeLists.txt index f14bded157b..76a145c7d8b 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_executable(interview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(interview WIN32 MACOSX_BUNDLE interview.qrc main.cpp model.cpp model.h diff --git a/examples/widgets/itemviews/pixelator/CMakeLists.txt b/examples/widgets/itemviews/pixelator/CMakeLists.txt index e9a04a0807b..e3e3388ba93 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_executable(pixelator WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pixelator WIN32 MACOSX_BUNDLE imagemodel.cpp imagemodel.h images.qrc main.cpp diff --git a/examples/widgets/itemviews/puzzle/CMakeLists.txt b/examples/widgets/itemviews/puzzle/CMakeLists.txt index cffbdbb1b01..77abd09eaf5 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_executable(itemviews_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle +add_qt_gui_executable(itemviews_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle main.cpp mainwindow.cpp mainwindow.h piecesmodel.cpp piecesmodel.h diff --git a/examples/widgets/itemviews/simpledommodel/CMakeLists.txt b/examples/widgets/itemviews/simpledommodel/CMakeLists.txt index 4a1812d96d5..3573eca461e 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_executable(simpledommodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simpledommodel WIN32 MACOSX_BUNDLE domitem.cpp domitem.h dommodel.cpp dommodel.h main.cpp diff --git a/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt b/examples/widgets/itemviews/simpletreemodel/CMakeLists.txt index 3fb889229d0..34c59d55ae9 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_executable(simpletreemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simpletreemodel WIN32 MACOSX_BUNDLE main.cpp simpletreemodel.qrc treeitem.cpp treeitem.h diff --git a/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt b/examples/widgets/itemviews/simplewidgetmapper/CMakeLists.txt index d25d4915443..dedf063b5f3 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_executable(simplewidgetmapper WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simplewidgetmapper WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt b/examples/widgets/itemviews/spinboxdelegate/CMakeLists.txt index 809c1cd0d0e..ed2ebc8ab30 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_executable(spinboxdelegate WIN32 MACOSX_BUNDLE +add_qt_gui_executable(spinboxdelegate WIN32 MACOSX_BUNDLE delegate.cpp delegate.h main.cpp ) diff --git a/examples/widgets/itemviews/spreadsheet/CMakeLists.txt b/examples/widgets/itemviews/spreadsheet/CMakeLists.txt index 811caec6a69..7e3676e780b 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_executable(spreadsheet WIN32 MACOSX_BUNDLE +add_qt_gui_executable(spreadsheet WIN32 MACOSX_BUNDLE main.cpp printview.cpp printview.h spreadsheet.cpp spreadsheet.h spreadsheet.qrc diff --git a/examples/widgets/itemviews/stardelegate/CMakeLists.txt b/examples/widgets/itemviews/stardelegate/CMakeLists.txt index 8cfb9911438..0d3bc684f8e 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_executable(stardelegate WIN32 MACOSX_BUNDLE +add_qt_gui_executable(stardelegate WIN32 MACOSX_BUNDLE main.cpp stardelegate.cpp stardelegate.h stareditor.cpp stareditor.h diff --git a/examples/widgets/itemviews/storageview/CMakeLists.txt b/examples/widgets/itemviews/storageview/CMakeLists.txt index d25d839347c..b254a217bcf 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_executable(storageview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(storageview WIN32 MACOSX_BUNDLE main.cpp storagemodel.cpp storagemodel.h ) diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt index 83c4833b9d7..927cbd7520e 100644 --- a/examples/widgets/layouts/basiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(basiclayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basiclayouts WIN32 MACOSX_BUNDLE dialog.cpp dialog.h main.cpp ) diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt index cfe34ad68f1..74e867f6f18 100644 --- a/examples/widgets/layouts/borderlayout/CMakeLists.txt +++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(borderlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(borderlayout WIN32 MACOSX_BUNDLE borderlayout.cpp borderlayout.h main.cpp window.cpp window.h diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt index 1989672b9c9..fad7509823d 100644 --- a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(dynamiclayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dynamiclayouts WIN32 MACOSX_BUNDLE dialog.cpp dialog.h main.cpp ) diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt index 6a7ad689cab..b8257d9b4c5 100644 --- a/examples/widgets/layouts/flowlayout/CMakeLists.txt +++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(flowlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flowlayout WIN32 MACOSX_BUNDLE flowlayout.cpp flowlayout.h main.cpp window.cpp window.h diff --git a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt index d442ccacd09..7a29a4cbc5b 100644 --- a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt +++ b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(qmaccocoaviewcontainer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qmaccocoaviewcontainer WIN32 MACOSX_BUNDLE main.mm ) target_link_libraries(qmaccocoaviewcontainer PUBLIC diff --git a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt index 267b49361f6..b17b8454b3a 100644 --- a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt +++ b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(qmacnativewidget WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qmacnativewidget WIN32 MACOSX_BUNDLE main.mm ) target_link_libraries(qmacnativewidget PUBLIC diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt index 67ac4637ffa..090cac61c70 100644 --- a/examples/widgets/mainwindows/application/CMakeLists.txt +++ b/examples/widgets/mainwindows/application/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(application WIN32 MACOSX_BUNDLE +add_qt_gui_executable(application WIN32 MACOSX_BUNDLE application.qrc main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt index ceacc184dab..b3fe472db40 100644 --- a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt +++ b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) # special case -add_executable(dockwidgets WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dockwidgets WIN32 MACOSX_BUNDLE dockwidgets.qrc main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt index 5af2a7ffe94..15824de79c6 100644 --- a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt +++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mainwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mainwindow WIN32 MACOSX_BUNDLE colorswatch.cpp colorswatch.h main.cpp mainwindow.cpp mainwindow.h mainwindow.qrc diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt index 481e2477c13..fda2522b90e 100644 --- a/examples/widgets/mainwindows/mdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mdi WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mdi WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h mdi.qrc diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt index a10ef9090e6..1e4d21248e5 100644 --- a/examples/widgets/mainwindows/menus/CMakeLists.txt +++ b/examples/widgets/mainwindows/menus/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(menus WIN32 MACOSX_BUNDLE +add_qt_gui_executable(menus WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h ) diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt index 81cb80f7a38..89c929fc5e5 100644 --- a/examples/widgets/mainwindows/sdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(sdi WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sdi WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h sdi.qrc diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt index a3dc7861fa3..4c8d408e9c5 100644 --- a/examples/widgets/painting/affine/CMakeLists.txt +++ b/examples/widgets/painting/affine/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(affine WIN32 MACOSX_BUNDLE +add_qt_gui_executable(affine WIN32 MACOSX_BUNDLE # special case: remove files from ../shared affine.qrc main.cpp diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt index d0a0ac749d8..112334797ff 100644 --- a/examples/widgets/painting/basicdrawing/CMakeLists.txt +++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(basicdrawing WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basicdrawing WIN32 MACOSX_BUNDLE basicdrawing.qrc main.cpp renderarea.cpp renderarea.h diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt index d083cf00dde..930374270ed 100644 --- a/examples/widgets/painting/composition/CMakeLists.txt +++ b/examples/widgets/painting/composition/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(composition WIN32 MACOSX_BUNDLE +add_qt_gui_executable(composition WIN32 MACOSX_BUNDLE # special case: remove files from ../shared composition.cpp composition.h composition.qrc main.cpp diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt index edbfea218d8..6005d5e8065 100644 --- a/examples/widgets/painting/concentriccircles/CMakeLists.txt +++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(concentriccircles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(concentriccircles WIN32 MACOSX_BUNDLE circlewidget.cpp circlewidget.h main.cpp window.cpp window.h diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt index 591bc552eae..56e1a2e9d2f 100644 --- a/examples/widgets/painting/deform/CMakeLists.txt +++ b/examples/widgets/painting/deform/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(deform WIN32 MACOSX_BUNDLE +add_qt_gui_executable(deform WIN32 MACOSX_BUNDLE # special case: remove files from ../shared deform.qrc main.cpp diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt index e533cdb63a3..e0be3158f2d 100644 --- a/examples/widgets/painting/fontsampler/CMakeLists.txt +++ b/examples/widgets/painting/fontsampler/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(fontsampler WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fontsampler WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h mainwindowbase.ui diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt index b25739e919e..69b7fac2947 100644 --- a/examples/widgets/painting/gradients/CMakeLists.txt +++ b/examples/widgets/painting/gradients/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(gradients WIN32 MACOSX_BUNDLE +add_qt_gui_executable(gradients WIN32 MACOSX_BUNDLE # special case: remove files from ../shared gradients.cpp gradients.h gradients.qrc main.cpp diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt index 506a3d8510b..1fcedbcc9fb 100644 --- a/examples/widgets/painting/imagecomposition/CMakeLists.txt +++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(imagecomposition WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imagecomposition WIN32 MACOSX_BUNDLE imagecomposer.cpp imagecomposer.h imagecomposition.qrc main.cpp diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt index 423d7d98ed9..56007a3e548 100644 --- a/examples/widgets/painting/painterpaths/CMakeLists.txt +++ b/examples/widgets/painting/painterpaths/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(painterpaths WIN32 MACOSX_BUNDLE +add_qt_gui_executable(painterpaths WIN32 MACOSX_BUNDLE main.cpp renderarea.cpp renderarea.h window.cpp window.h diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt index ce32f385499..fac73d2a534 100644 --- a/examples/widgets/painting/pathstroke/CMakeLists.txt +++ b/examples/widgets/painting/pathstroke/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(pathstroke WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pathstroke WIN32 MACOSX_BUNDLE ../shared/arthurstyle.cpp ../shared/arthurstyle.h ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h ../shared/hoverpoints.cpp ../shared/hoverpoints.h diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt index 5837f90f9d9..3218073a961 100644 --- a/examples/widgets/painting/transformations/CMakeLists.txt +++ b/examples/widgets/painting/transformations/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(transformations WIN32 MACOSX_BUNDLE +add_qt_gui_executable(transformations WIN32 MACOSX_BUNDLE main.cpp renderarea.cpp renderarea.h window.cpp window.h diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt index 099991172d6..803deb9243e 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_executable(calendar WIN32 MACOSX_BUNDLE +add_qt_gui_executable(calendar WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h ) diff --git a/examples/widgets/richtext/orderform/CMakeLists.txt b/examples/widgets/richtext/orderform/CMakeLists.txt index 9dd715c752a..4fc3c579192 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_executable(orderform WIN32 MACOSX_BUNDLE +add_qt_gui_executable(orderform WIN32 MACOSX_BUNDLE detailsdialog.cpp detailsdialog.h main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt b/examples/widgets/richtext/syntaxhighlighter/CMakeLists.txt index 918843e1bd6..d70211e24cb 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_executable(syntaxhighlighter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(syntaxhighlighter WIN32 MACOSX_BUNDLE highlighter.cpp highlighter.h main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/richtext/textedit/CMakeLists.txt b/examples/widgets/richtext/textedit/CMakeLists.txt index 54689bae5b5..602baa84f27 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_executable(textedit WIN32 MACOSX_BUNDLE +add_qt_gui_executable(textedit WIN32 MACOSX_BUNDLE main.cpp textedit.cpp textedit.h textedit.qrc ) diff --git a/examples/widgets/scroller/graphicsview/CMakeLists.txt b/examples/widgets/scroller/graphicsview/CMakeLists.txt index 5b36cfc9aed..53ce4ff2477 100644 --- a/examples/widgets/scroller/graphicsview/CMakeLists.txt +++ b/examples/widgets/scroller/graphicsview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(graphicsview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(graphicsview WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(graphicsview PUBLIC diff --git a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt index 758265686b9..21372f8856a 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_executable(eventtransitions WIN32 MACOSX_BUNDLE +add_qt_gui_executable(eventtransitions WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(eventtransitions PUBLIC diff --git a/examples/widgets/statemachine/rogue/CMakeLists.txt b/examples/widgets/statemachine/rogue/CMakeLists.txt index 7ce3c5c9660..1ae6b511da8 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_executable(rogue WIN32 MACOSX_BUNDLE +add_qt_gui_executable(rogue WIN32 MACOSX_BUNDLE main.cpp movementtransition.h window.cpp window.h diff --git a/examples/widgets/statemachine/trafficlight/CMakeLists.txt b/examples/widgets/statemachine/trafficlight/CMakeLists.txt index 3325c5fe465..0122fa72cd5 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_executable(trafficlight WIN32 MACOSX_BUNDLE +add_qt_gui_executable(trafficlight WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(trafficlight PUBLIC diff --git a/examples/widgets/statemachine/twowaybutton/CMakeLists.txt b/examples/widgets/statemachine/twowaybutton/CMakeLists.txt index 3ea05f9595a..6c68cdd2fb5 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_executable(twowaybutton WIN32 MACOSX_BUNDLE +add_qt_gui_executable(twowaybutton WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(twowaybutton PUBLIC diff --git a/examples/widgets/tools/codecs/CMakeLists.txt b/examples/widgets/tools/codecs/CMakeLists.txt index 99040e807ea..0bb5f379380 100644 --- a/examples/widgets/tools/codecs/CMakeLists.txt +++ b/examples/widgets/tools/codecs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(codecs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(codecs WIN32 MACOSX_BUNDLE codecs.qrc encodingdialog.cpp encodingdialog.h main.cpp diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt index 9db2d089d93..8e86cc6b897 100644 --- a/examples/widgets/tools/completer/CMakeLists.txt +++ b/examples/widgets/tools/completer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(completer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(completer WIN32 MACOSX_BUNDLE completer.qrc fsmodel.cpp fsmodel.h main.cpp diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt index 7c1db10befe..7ac00d7345a 100644 --- a/examples/widgets/tools/customcompleter/CMakeLists.txt +++ b/examples/widgets/tools/customcompleter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(customcompleter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customcompleter WIN32 MACOSX_BUNDLE customcompleter.qrc main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt index 941007505d6..20615d1e3bc 100644 --- a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt +++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(echopluginwindow WIN32 MACOSX_BUNDLE # special case: renamed target +add_qt_gui_executable(echopluginwindow WIN32 MACOSX_BUNDLE # special case: renamed target echointerface.h echowindow.cpp echowindow.h main.cpp diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt index 3835cc27ea6..a0347d8453f 100644 --- a/examples/widgets/tools/i18n/CMakeLists.txt +++ b/examples/widgets/tools/i18n/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(i18n WIN32 MACOSX_BUNDLE +add_qt_gui_executable(i18n WIN32 MACOSX_BUNDLE i18n.qrc languagechooser.cpp languagechooser.h main.cpp diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt index 2e730791cc4..a7c642a1beb 100644 --- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(plugandpaint WIN32 MACOSX_BUNDLE +add_qt_gui_executable(plugandpaint WIN32 MACOSX_BUNDLE interfaces.h main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/tools/regexp/CMakeLists.txt b/examples/widgets/tools/regexp/CMakeLists.txt index 026e72673a3..0b64cf06f8e 100644 --- a/examples/widgets/tools/regexp/CMakeLists.txt +++ b/examples/widgets/tools/regexp/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(regexp WIN32 MACOSX_BUNDLE +add_qt_gui_executable(regexp WIN32 MACOSX_BUNDLE main.cpp regexpdialog.cpp regexpdialog.h ) diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt index ba7274b007e..a9ce374ce22 100644 --- a/examples/widgets/tools/regularexpression/CMakeLists.txt +++ b/examples/widgets/tools/regularexpression/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(regularexpression WIN32 MACOSX_BUNDLE +add_qt_gui_executable(regularexpression WIN32 MACOSX_BUNDLE main.cpp regularexpression.qrc regularexpressiondialog.cpp regularexpressiondialog.h diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt index 7bfa75cade5..49a014e3590 100644 --- a/examples/widgets/tools/settingseditor/CMakeLists.txt +++ b/examples/widgets/tools/settingseditor/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(settingseditor WIN32 MACOSX_BUNDLE +add_qt_gui_executable(settingseditor WIN32 MACOSX_BUNDLE locationdialog.cpp locationdialog.h main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt index 3e3893ad03c..6e470824711 100644 --- a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt +++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(styleplugin WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styleplugin WIN32 MACOSX_BUNDLE main.cpp stylewindow.cpp stylewindow.h ) diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt index a6bd7177f10..9fa16e06dd0 100644 --- a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt +++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(treemodelcompleter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(treemodelcompleter WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h treemodelcompleter.cpp treemodelcompleter.h treemodelcompleter.qrc diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt index 5cd91dda0a2..bc4a8762113 100644 --- a/examples/widgets/tools/undo/CMakeLists.txt +++ b/examples/widgets/tools/undo/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(undo WIN32 MACOSX_BUNDLE +add_qt_gui_executable(undo WIN32 MACOSX_BUNDLE commands.cpp commands.h document.cpp document.h main.cpp diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt index a1a6c2c624f..064cb651507 100644 --- a/examples/widgets/tools/undoframework/CMakeLists.txt +++ b/examples/widgets/tools/undoframework/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(undoframework WIN32 MACOSX_BUNDLE +add_qt_gui_executable(undoframework WIN32 MACOSX_BUNDLE commands.cpp commands.h diagramitem.cpp diagramitem.h diagramscene.cpp diagramscene.h diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt index 0589e555f3e..fa31852b3df 100644 --- a/examples/widgets/touch/dials/CMakeLists.txt +++ b/examples/widgets/touch/dials/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(dials WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dials WIN32 MACOSX_BUNDLE dials.ui main.cpp ) diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt index a419a614be8..606e6bbc64f 100644 --- a/examples/widgets/touch/fingerpaint/CMakeLists.txt +++ b/examples/widgets/touch/fingerpaint/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) # special case -add_executable(fingerpaint WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fingerpaint WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h scribblearea.cpp scribblearea.h diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt index 4a8f55820a9..c23a11f0247 100644 --- a/examples/widgets/touch/knobs/CMakeLists.txt +++ b/examples/widgets/touch/knobs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(knobs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(knobs WIN32 MACOSX_BUNDLE knob.cpp knob.h main.cpp ) diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt index 379dde1e9f3..44951db7277 100644 --- a/examples/widgets/touch/pinchzoom/CMakeLists.txt +++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(pinchzoom WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pinchzoom WIN32 MACOSX_BUNDLE graphicsview.cpp graphicsview.h main.cpp mice.qrc diff --git a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt index 14533cb8dce..6c333420f49 100644 --- a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part1 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part1 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h main.cpp ) diff --git a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt index aace9f86af8..2c5d438bc5b 100644 --- a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part2 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part2 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h main.cpp ) diff --git a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt index b9fadf57d04..5be04b1e2f3 100644 --- a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part3 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part3 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h main.cpp ) diff --git a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt index af8dfd49046..309e8eea668 100644 --- a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part4 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part4 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h main.cpp ) diff --git a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt index eec0af2bac6..9d73fd0e96e 100644 --- a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part5 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part5 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h finddialog.cpp finddialog.h main.cpp diff --git a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt index 294f16a26d5..015a4cb244e 100644 --- a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part6 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part6 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h finddialog.cpp finddialog.h main.cpp diff --git a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt index 3d50ebcc6ca..acb3a2903ba 100644 --- a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part7 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part7 WIN32 MACOSX_BUNDLE addressbook.cpp addressbook.h finddialog.cpp finddialog.h main.cpp diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt index 50f6e31364d..c148f20a035 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part1 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part1 WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(part1 PUBLIC diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt index 9df643de4aa..ddbef50ca23 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part2 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part2 WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(part2 PUBLIC diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt index 048d2d60abc..66cd8827cfa 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part3 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part3 WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(part3 PUBLIC diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt index c752b44d04f..0c7b9f62f97 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part4 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part4 WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(part4 PUBLIC diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt index fc4fd05b6e0..4fc0df77b78 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(part5 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part5 WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(part5 PUBLIC diff --git a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt index 82e1b4dbab6..ee859409e51 100644 --- a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_readonly WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_readonly WIN32 MACOSX_BUNDLE main.cpp mymodel.cpp mymodel.h ) diff --git a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt index 898df9bfbfb..75c5f431c1e 100644 --- a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_formatting WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_formatting WIN32 MACOSX_BUNDLE main.cpp mymodel.cpp mymodel.h ) diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt index b460b7b2816..60d240f1704 100644 --- a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_changingmodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_changingmodel WIN32 MACOSX_BUNDLE main.cpp mymodel.cpp mymodel.h ) diff --git a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt index e76299ee0c8..b719caf8ecb 100644 --- a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_headers WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_headers WIN32 MACOSX_BUNDLE main.cpp mymodel.cpp mymodel.h ) diff --git a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt index ceb2ef0ed52..67c34521f49 100644 --- a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_edit WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_edit WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h mymodel.cpp mymodel.h diff --git a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt index f6409036fd9..2feb364569d 100644 --- a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_tree WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_tree WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h ) diff --git a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt index f328863a1f7..a974313bd75 100644 --- a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(mv_selections WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_selections WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h ) diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt index fee3e14285a..44606d522c8 100644 --- a/examples/widgets/tutorials/notepad/CMakeLists.txt +++ b/examples/widgets/tutorials/notepad/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_executable(notepad WIN32 MACOSX_BUNDLE +add_qt_gui_executable(notepad WIN32 MACOSX_BUNDLE main.cpp notepad.cpp notepad.h notepad.qrc notepad.ui ) diff --git a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt index 6725ad69f50..b5fb51c77df 100644 --- a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(childwidget WIN32 MACOSX_BUNDLE +add_qt_gui_executable(childwidget WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(childwidget PUBLIC diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt index 32ca867208b..e963dd77f31 100644 --- a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(nestedlayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(nestedlayouts WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(nestedlayouts PUBLIC diff --git a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt index b18e09a2782..b607403c55c 100644 --- a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(toplevel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(toplevel WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(toplevel PUBLIC diff --git a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt index 4d8899227aa..a9db86bccf5 100644 --- a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(windowlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(windowlayout WIN32 MACOSX_BUNDLE main.cpp ) target_link_libraries(windowlayout PUBLIC diff --git a/examples/widgets/widgets/analogclock/CMakeLists.txt b/examples/widgets/widgets/analogclock/CMakeLists.txt index 064b9f23e86..32ed38e46a8 100644 --- a/examples/widgets/widgets/analogclock/CMakeLists.txt +++ b/examples/widgets/widgets/analogclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(analogclock WIN32 MACOSX_BUNDLE +add_qt_gui_executable(analogclock WIN32 MACOSX_BUNDLE analogclock.cpp analogclock.h main.cpp ) diff --git a/examples/widgets/widgets/calculator/CMakeLists.txt b/examples/widgets/widgets/calculator/CMakeLists.txt index 779272f31a9..cd8a8372817 100644 --- a/examples/widgets/widgets/calculator/CMakeLists.txt +++ b/examples/widgets/widgets/calculator/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(calculator WIN32 MACOSX_BUNDLE +add_qt_gui_executable(calculator WIN32 MACOSX_BUNDLE button.cpp button.h calculator.cpp calculator.h main.cpp diff --git a/examples/widgets/widgets/calendarwidget/CMakeLists.txt b/examples/widgets/widgets/calendarwidget/CMakeLists.txt index ed496bdad7d..4c09d47a170 100644 --- a/examples/widgets/widgets/calendarwidget/CMakeLists.txt +++ b/examples/widgets/widgets/calendarwidget/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(calendarwidget WIN32 MACOSX_BUNDLE +add_qt_gui_executable(calendarwidget WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/widgets/charactermap/CMakeLists.txt b/examples/widgets/widgets/charactermap/CMakeLists.txt index f397822c592..fdd5d75b26e 100644 --- a/examples/widgets/widgets/charactermap/CMakeLists.txt +++ b/examples/widgets/widgets/charactermap/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(charactermap WIN32 MACOSX_BUNDLE +add_qt_gui_executable(charactermap WIN32 MACOSX_BUNDLE characterwidget.cpp characterwidget.h main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/widgets/codeeditor/CMakeLists.txt b/examples/widgets/widgets/codeeditor/CMakeLists.txt index f352b060cb5..8e3e3dbdc1d 100644 --- a/examples/widgets/widgets/codeeditor/CMakeLists.txt +++ b/examples/widgets/widgets/codeeditor/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(codeeditor WIN32 MACOSX_BUNDLE +add_qt_gui_executable(codeeditor WIN32 MACOSX_BUNDLE codeeditor.cpp codeeditor.h main.cpp ) diff --git a/examples/widgets/widgets/digitalclock/CMakeLists.txt b/examples/widgets/widgets/digitalclock/CMakeLists.txt index 505e6a67b62..978d208b954 100644 --- a/examples/widgets/widgets/digitalclock/CMakeLists.txt +++ b/examples/widgets/widgets/digitalclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(digitalclock WIN32 MACOSX_BUNDLE +add_qt_gui_executable(digitalclock WIN32 MACOSX_BUNDLE digitalclock.cpp digitalclock.h main.cpp ) diff --git a/examples/widgets/widgets/elidedlabel/CMakeLists.txt b/examples/widgets/widgets/elidedlabel/CMakeLists.txt index 1efb7a1bb3c..e21f5a1e15e 100644 --- a/examples/widgets/widgets/elidedlabel/CMakeLists.txt +++ b/examples/widgets/widgets/elidedlabel/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Core) find_package(Qt5 COMPONENTS Gui) find_package(Qt5 COMPONENTS Widgets) -add_executable(elidedlabel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(elidedlabel WIN32 MACOSX_BUNDLE elidedlabel.cpp elidedlabel.h main.cpp testwidget.cpp testwidget.h diff --git a/examples/widgets/widgets/groupbox/CMakeLists.txt b/examples/widgets/widgets/groupbox/CMakeLists.txt index 0b13e4587d2..f6d2769a65b 100644 --- a/examples/widgets/widgets/groupbox/CMakeLists.txt +++ b/examples/widgets/widgets/groupbox/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(groupbox WIN32 MACOSX_BUNDLE +add_qt_gui_executable(groupbox WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/widgets/icons/CMakeLists.txt b/examples/widgets/widgets/icons/CMakeLists.txt index ef20d8d2b09..0306ff69204 100644 --- a/examples/widgets/widgets/icons/CMakeLists.txt +++ b/examples/widgets/widgets/icons/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(icons WIN32 MACOSX_BUNDLE +add_qt_gui_executable(icons WIN32 MACOSX_BUNDLE iconpreviewarea.cpp iconpreviewarea.h iconsizespinbox.cpp iconsizespinbox.h imagedelegate.cpp imagedelegate.h diff --git a/examples/widgets/widgets/imageviewer/CMakeLists.txt b/examples/widgets/widgets/imageviewer/CMakeLists.txt index 49695865c76..3bdcc27d9e3 100644 --- a/examples/widgets/widgets/imageviewer/CMakeLists.txt +++ b/examples/widgets/widgets/imageviewer/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) # special case -add_executable(imageviewer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imageviewer WIN32 MACOSX_BUNDLE imageviewer.cpp imageviewer.h main.cpp ) diff --git a/examples/widgets/widgets/lineedits/CMakeLists.txt b/examples/widgets/widgets/lineedits/CMakeLists.txt index eb8f210f6cb..0d39f973152 100644 --- a/examples/widgets/widgets/lineedits/CMakeLists.txt +++ b/examples/widgets/widgets/lineedits/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(lineedits WIN32 MACOSX_BUNDLE +add_qt_gui_executable(lineedits WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/widgets/mousebuttons/CMakeLists.txt b/examples/widgets/widgets/mousebuttons/CMakeLists.txt index 2746ca670a4..a2bf41193be 100644 --- a/examples/widgets/widgets/mousebuttons/CMakeLists.txt +++ b/examples/widgets/widgets/mousebuttons/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Core) find_package(Qt5 COMPONENTS Widgets) -add_executable(mousebuttons WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mousebuttons WIN32 MACOSX_BUNDLE buttontester.cpp buttontester.h main.cpp ) diff --git a/examples/widgets/widgets/movie/CMakeLists.txt b/examples/widgets/widgets/movie/CMakeLists.txt index b96cce628e1..46c84740026 100644 --- a/examples/widgets/widgets/movie/CMakeLists.txt +++ b/examples/widgets/widgets/movie/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(movie WIN32 MACOSX_BUNDLE +add_qt_gui_executable(movie WIN32 MACOSX_BUNDLE main.cpp movieplayer.cpp movieplayer.h ) diff --git a/examples/widgets/widgets/scribble/CMakeLists.txt b/examples/widgets/widgets/scribble/CMakeLists.txt index 51db261f223..9fb19a64429 100644 --- a/examples/widgets/widgets/scribble/CMakeLists.txt +++ b/examples/widgets/widgets/scribble/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) # special case -add_executable(scribble WIN32 MACOSX_BUNDLE +add_qt_gui_executable(scribble WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h scribblearea.cpp scribblearea.h diff --git a/examples/widgets/widgets/shapedclock/CMakeLists.txt b/examples/widgets/widgets/shapedclock/CMakeLists.txt index 144d3006c54..60e2bd208e0 100644 --- a/examples/widgets/widgets/shapedclock/CMakeLists.txt +++ b/examples/widgets/widgets/shapedclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(shapedclock WIN32 MACOSX_BUNDLE +add_qt_gui_executable(shapedclock WIN32 MACOSX_BUNDLE main.cpp shapedclock.cpp shapedclock.h ) diff --git a/examples/widgets/widgets/sliders/CMakeLists.txt b/examples/widgets/widgets/sliders/CMakeLists.txt index bfdd22a7cc4..db365140074 100644 --- a/examples/widgets/widgets/sliders/CMakeLists.txt +++ b/examples/widgets/widgets/sliders/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(sliders WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sliders WIN32 MACOSX_BUNDLE main.cpp slidersgroup.cpp slidersgroup.h window.cpp window.h diff --git a/examples/widgets/widgets/spinboxes/CMakeLists.txt b/examples/widgets/widgets/spinboxes/CMakeLists.txt index 680ecad2a81..6bb7618f6b1 100644 --- a/examples/widgets/widgets/spinboxes/CMakeLists.txt +++ b/examples/widgets/widgets/spinboxes/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(spinboxes WIN32 MACOSX_BUNDLE +add_qt_gui_executable(spinboxes WIN32 MACOSX_BUNDLE main.cpp window.cpp window.h ) diff --git a/examples/widgets/widgets/styles/CMakeLists.txt b/examples/widgets/widgets/styles/CMakeLists.txt index e0db35653ca..fd639e17ed3 100644 --- a/examples/widgets/widgets/styles/CMakeLists.txt +++ b/examples/widgets/widgets/styles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(styles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styles WIN32 MACOSX_BUNDLE main.cpp norwegianwoodstyle.cpp norwegianwoodstyle.h styles.qrc diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt index 7e99a396952..0a38fdd3e5f 100644 --- a/examples/widgets/widgets/stylesheet/CMakeLists.txt +++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(stylesheet WIN32 MACOSX_BUNDLE +add_qt_gui_executable(stylesheet WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h mainwindow.ui stylesheet.qrc diff --git a/examples/widgets/widgets/tablet/CMakeLists.txt b/examples/widgets/widgets/tablet/CMakeLists.txt index febec2afd0c..ee9e2b7e269 100644 --- a/examples/widgets/widgets/tablet/CMakeLists.txt +++ b/examples/widgets/widgets/tablet/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(qttablet WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qttablet WIN32 MACOSX_BUNDLE images.qrc main.cpp mainwindow.cpp mainwindow.h diff --git a/examples/widgets/widgets/tetrix/CMakeLists.txt b/examples/widgets/widgets/tetrix/CMakeLists.txt index ec795779289..205a0d27445 100644 --- a/examples/widgets/widgets/tetrix/CMakeLists.txt +++ b/examples/widgets/widgets/tetrix/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(tetrix WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tetrix WIN32 MACOSX_BUNDLE main.cpp tetrixboard.cpp tetrixboard.h tetrixpiece.cpp tetrixpiece.h diff --git a/examples/widgets/widgets/tooltips/CMakeLists.txt b/examples/widgets/widgets/tooltips/CMakeLists.txt index 90601659f64..038a8881f2c 100644 --- a/examples/widgets/widgets/tooltips/CMakeLists.txt +++ b/examples/widgets/widgets/tooltips/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(tooltips WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tooltips WIN32 MACOSX_BUNDLE main.cpp shapeitem.cpp shapeitem.h sortingbox.cpp sortingbox.h diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt index b09d10dd9aa..5ed36901581 100644 --- a/examples/widgets/widgets/validators/CMakeLists.txt +++ b/examples/widgets/widgets/validators/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(validators WIN32 MACOSX_BUNDLE +add_qt_gui_executable(validators WIN32 MACOSX_BUNDLE ledwidget.cpp ledwidget.h localeselector.cpp localeselector.h main.cpp diff --git a/examples/widgets/widgets/wiggly/CMakeLists.txt b/examples/widgets/widgets/wiggly/CMakeLists.txt index 2fabcafb0e7..da0e64a8644 100644 --- a/examples/widgets/widgets/wiggly/CMakeLists.txt +++ b/examples/widgets/widgets/wiggly/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(wiggly WIN32 MACOSX_BUNDLE +add_qt_gui_executable(wiggly WIN32 MACOSX_BUNDLE dialog.cpp dialog.h main.cpp wigglywidget.cpp wigglywidget.h diff --git a/examples/widgets/widgets/windowflags/CMakeLists.txt b/examples/widgets/widgets/windowflags/CMakeLists.txt index 0eab6f64524..f7da42114d1 100644 --- a/examples/widgets/widgets/windowflags/CMakeLists.txt +++ b/examples/widgets/widgets/windowflags/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(windowflags WIN32 MACOSX_BUNDLE +add_qt_gui_executable(windowflags WIN32 MACOSX_BUNDLE controllerwindow.cpp controllerwindow.h main.cpp previewwindow.cpp previewwindow.h diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt index f67a6515bde..80c8897c9b3 100644 --- a/examples/widgets/windowcontainer/CMakeLists.txt +++ b/examples/widgets/windowcontainer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_executable(windowcontainer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(windowcontainer WIN32 MACOSX_BUNDLE ../../gui/openglwindow/openglwindow.cpp ../../gui/openglwindow/openglwindow.h windowcontainer.cpp ) diff --git a/examples/xml/dombookmarks/CMakeLists.txt b/examples/xml/dombookmarks/CMakeLists.txt index e7d5577b0e9..95e58c6025c 100644 --- a/examples/xml/dombookmarks/CMakeLists.txt +++ b/examples/xml/dombookmarks/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_executable(dombookmarks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dombookmarks WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h xbeltree.cpp xbeltree.h diff --git a/examples/xml/rsslisting/CMakeLists.txt b/examples/xml/rsslisting/CMakeLists.txt index f8c3a67c7fb..09879771ba5 100644 --- a/examples/xml/rsslisting/CMakeLists.txt +++ b/examples/xml/rsslisting/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_executable(rsslisting WIN32 MACOSX_BUNDLE +add_qt_gui_executable(rsslisting WIN32 MACOSX_BUNDLE main.cpp rsslisting.cpp rsslisting.h ) diff --git a/examples/xml/saxbookmarks/CMakeLists.txt b/examples/xml/saxbookmarks/CMakeLists.txt index 8d003a95a53..d5d8bba53a9 100644 --- a/examples/xml/saxbookmarks/CMakeLists.txt +++ b/examples/xml/saxbookmarks/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_executable(saxbookmarks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(saxbookmarks WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h xbelgenerator.cpp xbelgenerator.h diff --git a/examples/xml/streambookmarks/CMakeLists.txt b/examples/xml/streambookmarks/CMakeLists.txt index 442e46ffd1a..3393c47a665 100644 --- a/examples/xml/streambookmarks/CMakeLists.txt +++ b/examples/xml/streambookmarks/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_executable(streambookmarks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(streambookmarks WIN32 MACOSX_BUNDLE main.cpp mainwindow.cpp mainwindow.h xbelreader.cpp xbelreader.h diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index bae1518375b..8d4943aa3f3 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -388,3 +388,14 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) endforeach() endmacro() endif() + +function(add_qt_gui_executable target) + add_executable(${ARGV}) + 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) + target_link_libraries("${target}" PRIVATE Qt::WinMain) + endif() +endfunction() + diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 94c79656386..5e4e9abc9e6 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1711,7 +1711,7 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, (public_libs, private_libs) = extract_cmake_libraries(scope) write_find_package_section(cm_fh, public_libs, private_libs, indent=indent) - add_executable = 'add_executable({}'.format(binary_name); + add_executable = 'add_{}executable({}'.format("qt_gui_" if gui else "", binary_name); if gui: add_executable += ' WIN32 MACOSX_BUNDLE' From efa9998521cb061051fe8b75d0df3206d0b32ec5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jun 2019 10:21:40 +0200 Subject: [PATCH 0662/1322] 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 --- cmake/QtPlatformAndroid.cmake | 12 ++++++------ .../corelib/ipc/localfortuneclient/CMakeLists.txt | 3 ++- .../corelib/ipc/localfortuneserver/CMakeLists.txt | 3 ++- examples/corelib/ipc/sharedmemory/CMakeLists.txt | 3 ++- .../mimetypes/mimetypebrowser/CMakeLists.txt | 3 ++- .../corelib/serialization/cbordump/CMakeLists.txt | 1 + .../corelib/serialization/convert/CMakeLists.txt | 1 + .../corelib/serialization/savegame/CMakeLists.txt | 1 + examples/corelib/threads/mandelbrot/CMakeLists.txt | 3 ++- .../corelib/threads/queuedcustomtype/CMakeLists.txt | 3 ++- examples/corelib/threads/semaphores/CMakeLists.txt | 1 + .../corelib/threads/waitconditions/CMakeLists.txt | 1 + .../corelib/tools/contiguouscache/CMakeLists.txt | 3 ++- examples/corelib/tools/customtype/CMakeLists.txt | 3 ++- .../corelib/tools/customtypesending/CMakeLists.txt | 3 ++- examples/dbus/chat/CMakeLists.txt | 3 ++- examples/dbus/complexpingpong/CMakeLists.txt | 3 ++- examples/dbus/listnames/CMakeLists.txt | 3 ++- examples/dbus/pingpong/CMakeLists.txt | 3 ++- .../dbus/remotecontrolledcar/car/CMakeLists.txt | 3 ++- .../remotecontrolledcar/controller/CMakeLists.txt | 3 ++- examples/embedded/digiflip/CMakeLists.txt | 3 ++- examples/embedded/flickable/CMakeLists.txt | 3 ++- examples/embedded/flightinfo/CMakeLists.txt | 3 ++- examples/embedded/lightmaps/CMakeLists.txt | 3 ++- examples/embedded/raycasting/CMakeLists.txt | 3 ++- examples/embedded/styleexample/CMakeLists.txt | 3 ++- examples/gui/analogclock/CMakeLists.txt | 3 ++- examples/gui/openglwindow/CMakeLists.txt | 3 ++- examples/gui/rasterwindow/CMakeLists.txt | 3 ++- examples/network/bearermonitor/CMakeLists.txt | 1 + .../network/blockingfortuneclient/CMakeLists.txt | 3 ++- examples/network/broadcastreceiver/CMakeLists.txt | 3 ++- examples/network/broadcastsender/CMakeLists.txt | 3 ++- examples/network/dnslookup/CMakeLists.txt | 1 + examples/network/download/CMakeLists.txt | 1 + examples/network/downloadmanager/CMakeLists.txt | 1 + examples/network/fortuneclient/CMakeLists.txt | 3 ++- examples/network/fortuneserver/CMakeLists.txt | 3 ++- examples/network/googlesuggest/CMakeLists.txt | 3 ++- examples/network/http/CMakeLists.txt | 3 ++- examples/network/loopback/CMakeLists.txt | 3 ++- examples/network/multicastreceiver/CMakeLists.txt | 3 ++- examples/network/multicastsender/CMakeLists.txt | 3 ++- examples/network/multistreamclient/CMakeLists.txt | 3 ++- examples/network/multistreamserver/CMakeLists.txt | 3 ++- examples/network/network-chat/CMakeLists.txt | 3 ++- examples/network/securesocketclient/CMakeLists.txt | 3 ++- examples/network/secureudpclient/CMakeLists.txt | 3 ++- examples/network/secureudpserver/CMakeLists.txt | 3 ++- .../network/threadedfortuneserver/CMakeLists.txt | 3 ++- examples/network/torrent/.prev_CMakeLists.txt | 2 +- examples/network/torrent/CMakeLists.txt | 3 ++- examples/qpa/qrasterwindow/CMakeLists.txt | 3 ++- examples/qpa/windows/CMakeLists.txt | 1 + examples/qtconcurrent/imagescaling/CMakeLists.txt | 3 ++- examples/qtconcurrent/map/CMakeLists.txt | 1 + examples/qtconcurrent/progressdialog/CMakeLists.txt | 1 + examples/qtconcurrent/runfunction/CMakeLists.txt | 1 + examples/qtconcurrent/wordcount/CMakeLists.txt | 1 + examples/qtestlib/tutorial1/CMakeLists.txt | 3 ++- examples/qtestlib/tutorial2/CMakeLists.txt | 3 ++- examples/qtestlib/tutorial3/CMakeLists.txt | 3 ++- examples/qtestlib/tutorial4/CMakeLists.txt | 3 ++- examples/qtestlib/tutorial5/CMakeLists.txt | 3 ++- examples/sql/books/CMakeLists.txt | 3 ++- examples/sql/cachedtable/CMakeLists.txt | 3 ++- examples/sql/drilldown/CMakeLists.txt | 3 ++- examples/sql/masterdetail/CMakeLists.txt | 3 ++- examples/sql/querymodel/CMakeLists.txt | 3 ++- examples/sql/relationaltablemodel/CMakeLists.txt | 3 ++- examples/sql/sqlbrowser/CMakeLists.txt | 3 ++- examples/sql/sqlwidgetmapper/CMakeLists.txt | 3 ++- examples/sql/tablemodel/CMakeLists.txt | 3 ++- .../widgets/animation/animatedtiles/CMakeLists.txt | 3 ++- examples/widgets/animation/easing/CMakeLists.txt | 3 ++- .../widgets/animation/moveblocks/CMakeLists.txt | 3 ++- examples/widgets/animation/states/CMakeLists.txt | 3 ++- examples/widgets/animation/stickman/CMakeLists.txt | 3 ++- examples/widgets/animation/sub-attaq/CMakeLists.txt | 3 ++- examples/widgets/desktop/screenshot/CMakeLists.txt | 3 ++- examples/widgets/desktop/systray/CMakeLists.txt | 3 ++- examples/widgets/dialogs/classwizard/CMakeLists.txt | 3 ++- examples/widgets/dialogs/extension/CMakeLists.txt | 3 ++- examples/widgets/dialogs/findfiles/CMakeLists.txt | 3 ++- .../widgets/dialogs/licensewizard/CMakeLists.txt | 3 ++- .../widgets/dialogs/standarddialogs/CMakeLists.txt | 3 ++- examples/widgets/dialogs/tabdialog/CMakeLists.txt | 3 ++- .../widgets/dialogs/trivialwizard/CMakeLists.txt | 3 ++- .../draganddrop/draggableicons/CMakeLists.txt | 3 ++- .../draganddrop/draggabletext/CMakeLists.txt | 3 ++- .../widgets/draganddrop/dropsite/CMakeLists.txt | 3 ++- .../draganddrop/fridgemagnets/CMakeLists.txt | 3 ++- examples/widgets/draganddrop/puzzle/CMakeLists.txt | 3 ++- examples/widgets/effects/blurpicker/CMakeLists.txt | 3 ++- examples/widgets/effects/fademessage/CMakeLists.txt | 3 ++- .../widgets/gestures/imagegestures/CMakeLists.txt | 3 ++- .../graphicsview/anchorlayout/CMakeLists.txt | 3 ++- .../basicgraphicslayouts/CMakeLists.txt | 3 ++- examples/widgets/graphicsview/boxes/CMakeLists.txt | 3 ++- examples/widgets/graphicsview/chip/CMakeLists.txt | 3 ++- .../graphicsview/collidingmice/CMakeLists.txt | 3 ++- .../graphicsview/diagramscene/CMakeLists.txt | 3 ++- .../graphicsview/dragdroprobot/CMakeLists.txt | 3 ++- .../graphicsview/elasticnodes/CMakeLists.txt | 3 ++- .../graphicsview/embeddeddialogs/CMakeLists.txt | 3 ++- .../widgets/graphicsview/flowlayout/CMakeLists.txt | 3 ++- .../graphicsview/padnavigator/CMakeLists.txt | 1 + .../graphicsview/simpleanchorlayout/CMakeLists.txt | 3 ++- .../graphicsview/weatheranchorlayout/CMakeLists.txt | 3 ++- .../widgets/itemviews/addressbook/CMakeLists.txt | 3 ++- .../itemviews/basicsortfiltermodel/CMakeLists.txt | 3 ++- examples/widgets/itemviews/chart/CMakeLists.txt | 3 ++- .../itemviews/coloreditorfactory/CMakeLists.txt | 3 ++- .../itemviews/combowidgetmapper/CMakeLists.txt | 3 ++- .../itemviews/customsortfiltermodel/CMakeLists.txt | 3 ++- examples/widgets/itemviews/dirview/CMakeLists.txt | 3 ++- .../itemviews/editabletreemodel/CMakeLists.txt | 3 ++- examples/widgets/itemviews/fetchmore/CMakeLists.txt | 3 ++- .../widgets/itemviews/flattreeview/CMakeLists.txt | 3 ++- .../widgets/itemviews/frozencolumn/CMakeLists.txt | 3 ++- examples/widgets/itemviews/interview/CMakeLists.txt | 3 ++- examples/widgets/itemviews/pixelator/CMakeLists.txt | 3 ++- examples/widgets/itemviews/puzzle/CMakeLists.txt | 3 ++- .../widgets/itemviews/simpledommodel/CMakeLists.txt | 3 ++- .../itemviews/simpletreemodel/CMakeLists.txt | 3 ++- .../itemviews/simplewidgetmapper/CMakeLists.txt | 3 ++- .../itemviews/spinboxdelegate/CMakeLists.txt | 3 ++- .../widgets/itemviews/spreadsheet/CMakeLists.txt | 3 ++- .../widgets/itemviews/stardelegate/CMakeLists.txt | 3 ++- .../widgets/itemviews/storageview/CMakeLists.txt | 3 ++- .../widgets/layouts/basiclayouts/CMakeLists.txt | 3 ++- .../widgets/layouts/borderlayout/CMakeLists.txt | 3 ++- .../widgets/layouts/dynamiclayouts/CMakeLists.txt | 3 ++- examples/widgets/layouts/flowlayout/CMakeLists.txt | 3 ++- .../mac/qmaccocoaviewcontainer/CMakeLists.txt | 3 ++- .../widgets/mac/qmacnativewidget/CMakeLists.txt | 3 ++- .../widgets/mainwindows/application/CMakeLists.txt | 3 ++- .../widgets/mainwindows/dockwidgets/CMakeLists.txt | 3 ++- .../widgets/mainwindows/mainwindow/CMakeLists.txt | 3 ++- examples/widgets/mainwindows/mdi/CMakeLists.txt | 3 ++- examples/widgets/mainwindows/menus/CMakeLists.txt | 3 ++- examples/widgets/mainwindows/sdi/CMakeLists.txt | 3 ++- examples/widgets/painting/affine/CMakeLists.txt | 3 ++- .../widgets/painting/basicdrawing/CMakeLists.txt | 3 ++- .../widgets/painting/composition/CMakeLists.txt | 3 ++- .../painting/concentriccircles/CMakeLists.txt | 3 ++- examples/widgets/painting/deform/CMakeLists.txt | 3 ++- .../widgets/painting/fontsampler/CMakeLists.txt | 3 ++- examples/widgets/painting/gradients/CMakeLists.txt | 3 ++- .../painting/imagecomposition/CMakeLists.txt | 3 ++- .../widgets/painting/painterpaths/CMakeLists.txt | 3 ++- examples/widgets/painting/pathstroke/CMakeLists.txt | 3 ++- .../widgets/painting/transformations/CMakeLists.txt | 3 ++- examples/widgets/richtext/calendar/CMakeLists.txt | 3 ++- examples/widgets/richtext/orderform/CMakeLists.txt | 3 ++- .../richtext/syntaxhighlighter/CMakeLists.txt | 3 ++- examples/widgets/richtext/textedit/CMakeLists.txt | 3 ++- .../widgets/scroller/graphicsview/CMakeLists.txt | 3 ++- .../statemachine/eventtransitions/CMakeLists.txt | 3 ++- .../widgets/statemachine/factorial/CMakeLists.txt | 1 + .../widgets/statemachine/pingpong/CMakeLists.txt | 1 + examples/widgets/statemachine/rogue/CMakeLists.txt | 3 ++- .../statemachine/trafficlight/CMakeLists.txt | 3 ++- .../statemachine/twowaybutton/CMakeLists.txt | 3 ++- examples/widgets/tools/codecs/CMakeLists.txt | 3 ++- examples/widgets/tools/completer/CMakeLists.txt | 3 ++- .../widgets/tools/customcompleter/CMakeLists.txt | 3 ++- .../tools/echoplugin/echowindow/CMakeLists.txt | 3 ++- examples/widgets/tools/i18n/CMakeLists.txt | 3 ++- .../widgets/tools/plugandpaint/app/CMakeLists.txt | 3 ++- examples/widgets/tools/regexp/CMakeLists.txt | 3 ++- .../widgets/tools/regularexpression/CMakeLists.txt | 3 ++- .../widgets/tools/settingseditor/CMakeLists.txt | 3 ++- .../tools/styleplugin/stylewindow/CMakeLists.txt | 3 ++- .../widgets/tools/treemodelcompleter/CMakeLists.txt | 3 ++- examples/widgets/tools/undo/CMakeLists.txt | 3 ++- examples/widgets/tools/undoframework/CMakeLists.txt | 3 ++- examples/widgets/touch/dials/CMakeLists.txt | 3 ++- examples/widgets/touch/fingerpaint/CMakeLists.txt | 3 ++- examples/widgets/touch/knobs/CMakeLists.txt | 3 ++- examples/widgets/touch/pinchzoom/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part1/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part2/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part3/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part4/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part5/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part6/CMakeLists.txt | 3 ++- .../tutorials/addressbook/part7/CMakeLists.txt | 3 ++- .../gettingStarted/gsQt/part1/CMakeLists.txt | 3 ++- .../gettingStarted/gsQt/part2/CMakeLists.txt | 3 ++- .../gettingStarted/gsQt/part3/CMakeLists.txt | 3 ++- .../gettingStarted/gsQt/part4/CMakeLists.txt | 3 ++- .../gettingStarted/gsQt/part5/CMakeLists.txt | 3 ++- .../tutorials/modelview/1_readonly/CMakeLists.txt | 3 ++- .../tutorials/modelview/2_formatting/CMakeLists.txt | 3 ++- .../modelview/3_changingmodel/CMakeLists.txt | 3 ++- .../tutorials/modelview/4_headers/CMakeLists.txt | 3 ++- .../tutorials/modelview/5_edit/CMakeLists.txt | 3 ++- .../tutorials/modelview/6_treeview/CMakeLists.txt | 3 ++- .../tutorials/modelview/7_selections/CMakeLists.txt | 3 ++- examples/widgets/tutorials/notepad/CMakeLists.txt | 3 ++- .../tutorials/widgets/childwidget/CMakeLists.txt | 3 ++- .../tutorials/widgets/nestedlayouts/CMakeLists.txt | 3 ++- .../tutorials/widgets/toplevel/CMakeLists.txt | 3 ++- .../tutorials/widgets/windowlayout/CMakeLists.txt | 3 ++- examples/widgets/widgets/analogclock/CMakeLists.txt | 3 ++- examples/widgets/widgets/calculator/CMakeLists.txt | 3 ++- .../widgets/widgets/calendarwidget/CMakeLists.txt | 3 ++- .../widgets/widgets/charactermap/CMakeLists.txt | 3 ++- examples/widgets/widgets/codeeditor/CMakeLists.txt | 3 ++- .../widgets/widgets/digitalclock/CMakeLists.txt | 3 ++- examples/widgets/widgets/elidedlabel/CMakeLists.txt | 3 ++- examples/widgets/widgets/groupbox/CMakeLists.txt | 3 ++- examples/widgets/widgets/icons/CMakeLists.txt | 3 ++- examples/widgets/widgets/imageviewer/CMakeLists.txt | 3 ++- examples/widgets/widgets/lineedits/CMakeLists.txt | 3 ++- .../widgets/widgets/mousebuttons/CMakeLists.txt | 3 ++- examples/widgets/widgets/movie/CMakeLists.txt | 3 ++- examples/widgets/widgets/scribble/CMakeLists.txt | 3 ++- examples/widgets/widgets/shapedclock/CMakeLists.txt | 3 ++- examples/widgets/widgets/sliders/CMakeLists.txt | 3 ++- examples/widgets/widgets/spinboxes/CMakeLists.txt | 3 ++- examples/widgets/widgets/styles/CMakeLists.txt | 3 ++- examples/widgets/widgets/stylesheet/CMakeLists.txt | 3 ++- examples/widgets/widgets/tablet/CMakeLists.txt | 3 ++- examples/widgets/widgets/tetrix/CMakeLists.txt | 3 ++- examples/widgets/widgets/tooltips/CMakeLists.txt | 3 ++- examples/widgets/widgets/validators/CMakeLists.txt | 3 ++- examples/widgets/widgets/wiggly/CMakeLists.txt | 3 ++- examples/widgets/widgets/windowflags/CMakeLists.txt | 3 ++- examples/widgets/windowcontainer/CMakeLists.txt | 3 ++- examples/xml/dombookmarks/CMakeLists.txt | 3 ++- examples/xml/htmlinfo/CMakeLists.txt | 1 + examples/xml/rsslisting/CMakeLists.txt | 3 ++- examples/xml/saxbookmarks/CMakeLists.txt | 3 ++- examples/xml/streambookmarks/CMakeLists.txt | 3 ++- examples/xml/xmlstreamlint/CMakeLists.txt | 1 + src/corelib/Qt5CoreMacros.cmake | 13 ++++++++++--- util/cmake/pro2cmake.py | 3 +-- 240 files changed, 471 insertions(+), 229 deletions(-) diff --git a/cmake/QtPlatformAndroid.cmake b/cmake/QtPlatformAndroid.cmake index 8d0d8b67da1..1d601e684b4 100644 --- a/cmake/QtPlatformAndroid.cmake +++ b/cmake/QtPlatformAndroid.cmake @@ -17,8 +17,8 @@ # # Public functions: # -# qt_android_generate_depolyment_settings() -# Generate the depolyment settings json file for a cmake target. +# qt_android_generate_deployment_settings() +# Generate the deployment settings json file for a cmake target. # if (NOT DEFINED ANDROID_SDK_ROOT) @@ -133,7 +133,7 @@ define_property(TARGET ) # Generate deployment tool json -function(qt_android_generate_depolyment_settings target) +function(qt_android_generate_deployment_settings target) # Information extracted from mkspecs/features/android/android_deployment_settings.prf if (NOT TARGET ${target}) message(SEND_ERROR "${target} is not a cmake target") @@ -143,7 +143,7 @@ function(qt_android_generate_depolyment_settings target) get_target_property(target_type ${target} TYPE) if (NOT "${target_type}" STREQUAL "MODULE_LIBRARY") - message(SEND_ERROR "QT_ANDROID_GENERATE_DEPOLYMENT_SETTINGS only works on Module targets") + message(SEND_ERROR "QT_ANDROID_GENERATE_DEPLOYMENT_SETTINGS only works on Module targets") return() endif() @@ -161,10 +161,10 @@ function(qt_android_generate_depolyment_settings target) " \"description\": \"This file is generated by cmake to be read by androiddeployqt and should not be modified by hand.\",\n") # Host Qt Android install path - if (NOT QT_BUILD_QT) + if (NOT QT_BUILDING_QT) set(file_check "${Qt5_DIR}/plugins/platforms/android/libqtforandroid.so") if (NOT EXISTS ${file_check}) - message(SEND_ERROR "Detected Qt installation does not containt libqtforandroid.so. This is most likely due to the installation not being a build of Qt for Android. Please update your settings.") + message(SEND_ERROR "Detected Qt installation does not contain libqtforandroid.so. This is most likely due to the installation not being a build of Qt for Android. Please update your settings.") return() endif() set(qt_android_install_dir ${Qt5_Dir}) diff --git a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt index a171965bbba..a49a5451ddb 100644 --- a/examples/corelib/ipc/localfortuneclient/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(localfortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(localfortuneclient client.cpp client.h main.cpp ) @@ -25,4 +25,5 @@ target_link_libraries(localfortuneclient PUBLIC install(TARGETS localfortuneclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt index 5804aa69faf..48dec3318d2 100644 --- a/examples/corelib/ipc/localfortuneserver/CMakeLists.txt +++ b/examples/corelib/ipc/localfortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(localfortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(localfortuneserver main.cpp server.cpp server.h ) @@ -25,4 +25,5 @@ target_link_libraries(localfortuneserver PUBLIC install(TARGETS localfortuneserver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/ipc/sharedmemory/CMakeLists.txt b/examples/corelib/ipc/sharedmemory/CMakeLists.txt index 55f42ada888..c63cf569bd6 100644 --- a/examples/corelib/ipc/sharedmemory/CMakeLists.txt +++ b/examples/corelib/ipc/sharedmemory/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sharedmemory WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sharedmemory dialog.cpp dialog.h dialog.ui main.cpp ) @@ -23,4 +23,5 @@ target_link_libraries(sharedmemory PUBLIC install(TARGETS sharedmemory RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt index 1493bdd31d3..78944e74155 100644 --- a/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt +++ b/examples/corelib/mimetypes/mimetypebrowser/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mimetypebrowser WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mimetypebrowser main.cpp mainwindow.cpp mainwindow.h mimetypemodel.cpp mimetypemodel.h @@ -24,4 +24,5 @@ target_link_libraries(mimetypebrowser PUBLIC install(TARGETS mimetypebrowser RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/serialization/cbordump/CMakeLists.txt b/examples/corelib/serialization/cbordump/CMakeLists.txt index f9f6be09d9f..5b924878c4c 100644 --- a/examples/corelib/serialization/cbordump/CMakeLists.txt +++ b/examples/corelib/serialization/cbordump/CMakeLists.txt @@ -23,4 +23,5 @@ target_link_libraries(cbordump PUBLIC install(TARGETS cbordump RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/serialization/convert/CMakeLists.txt b/examples/corelib/serialization/convert/CMakeLists.txt index f03d3aa9dc4..821a913df2f 100644 --- a/examples/corelib/serialization/convert/CMakeLists.txt +++ b/examples/corelib/serialization/convert/CMakeLists.txt @@ -30,4 +30,5 @@ target_link_libraries(convert PUBLIC install(TARGETS convert RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/serialization/savegame/CMakeLists.txt b/examples/corelib/serialization/savegame/CMakeLists.txt index 637613fef88..ea4bf79ea36 100644 --- a/examples/corelib/serialization/savegame/CMakeLists.txt +++ b/examples/corelib/serialization/savegame/CMakeLists.txt @@ -26,4 +26,5 @@ target_link_libraries(savegame PUBLIC install(TARGETS savegame RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/mandelbrot/CMakeLists.txt b/examples/corelib/threads/mandelbrot/CMakeLists.txt index cc0385a9ce3..1d4e7eaf4d3 100644 --- a/examples/corelib/threads/mandelbrot/CMakeLists.txt +++ b/examples/corelib/threads/mandelbrot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mandelbrot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mandelbrot main.cpp mandelbrotwidget.cpp mandelbrotwidget.h renderthread.cpp renderthread.h @@ -24,4 +24,5 @@ target_link_libraries(mandelbrot PUBLIC install(TARGETS mandelbrot RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt index ef07b36301a..3351018d726 100644 --- a/examples/corelib/threads/queuedcustomtype/CMakeLists.txt +++ b/examples/corelib/threads/queuedcustomtype/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(queuedcustomtype WIN32 MACOSX_BUNDLE +add_qt_gui_executable(queuedcustomtype block.cpp block.h main.cpp renderthread.cpp renderthread.h @@ -25,4 +25,5 @@ target_link_libraries(queuedcustomtype PUBLIC install(TARGETS queuedcustomtype RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/semaphores/CMakeLists.txt b/examples/corelib/threads/semaphores/CMakeLists.txt index 51638e0ff8c..45959f0c546 100644 --- a/examples/corelib/threads/semaphores/CMakeLists.txt +++ b/examples/corelib/threads/semaphores/CMakeLists.txt @@ -22,4 +22,5 @@ target_link_libraries(semaphores PUBLIC install(TARGETS semaphores RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/threads/waitconditions/CMakeLists.txt b/examples/corelib/threads/waitconditions/CMakeLists.txt index 4d3e61050c0..ee351493cc1 100644 --- a/examples/corelib/threads/waitconditions/CMakeLists.txt +++ b/examples/corelib/threads/waitconditions/CMakeLists.txt @@ -22,4 +22,5 @@ target_link_libraries(waitconditions PUBLIC install(TARGETS waitconditions RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/tools/contiguouscache/CMakeLists.txt b/examples/corelib/tools/contiguouscache/CMakeLists.txt index 9b0638bea20..68244a019f2 100644 --- a/examples/corelib/tools/contiguouscache/CMakeLists.txt +++ b/examples/corelib/tools/contiguouscache/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(contiguouscache WIN32 MACOSX_BUNDLE +add_qt_gui_executable(contiguouscache main.cpp randomlistmodel.cpp randomlistmodel.h ) @@ -23,4 +23,5 @@ target_link_libraries(contiguouscache PUBLIC install(TARGETS contiguouscache RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/tools/customtype/CMakeLists.txt b/examples/corelib/tools/customtype/CMakeLists.txt index 2cab51c0732..c2d9f18a823 100644 --- a/examples/corelib/tools/customtype/CMakeLists.txt +++ b/examples/corelib/tools/customtype/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(customtype WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customtype main.cpp message.cpp message.h ) @@ -23,4 +23,5 @@ target_link_libraries(customtype PUBLIC install(TARGETS customtype RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/corelib/tools/customtypesending/CMakeLists.txt b/examples/corelib/tools/customtypesending/CMakeLists.txt index 06ed26ba485..27adf1f1b59 100644 --- a/examples/corelib/tools/customtypesending/CMakeLists.txt +++ b/examples/corelib/tools/customtypesending/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(customtypesending WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customtypesending main.cpp message.cpp message.h window.cpp window.h @@ -24,4 +24,5 @@ target_link_libraries(customtypesending PUBLIC install(TARGETS customtypesending RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/chat/CMakeLists.txt b/examples/dbus/chat/CMakeLists.txt index 85da98583ca..54becdb2d32 100644 --- a/examples/dbus/chat/CMakeLists.txt +++ b/examples/dbus/chat/CMakeLists.txt @@ -27,7 +27,7 @@ qt5_add_dbus_adaptor(chat_SRCS chat_adaptor ) # special case end -add_qt_gui_executable(chat WIN32 MACOSX_BUNDLE +add_qt_gui_executable(chat chat.cpp chat.h chatmainwindow.ui chatsetnickname.ui @@ -40,4 +40,5 @@ target_link_libraries(chat PUBLIC install(TARGETS chat RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/complexpingpong/CMakeLists.txt b/examples/dbus/complexpingpong/CMakeLists.txt index fb96f826b47..d9b882657ee 100644 --- a/examples/dbus/complexpingpong/CMakeLists.txt +++ b/examples/dbus/complexpingpong/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS DBus) -add_qt_gui_executable(complexpong WIN32 MACOSX_BUNDLE +add_qt_gui_executable(complexpong complexpong.cpp complexpong.h ) target_link_libraries(complexpong PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(complexpong PUBLIC install(TARGETS complexpong RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/listnames/CMakeLists.txt b/examples/dbus/listnames/CMakeLists.txt index c888a1df49a..334d841cdf5 100644 --- a/examples/dbus/listnames/CMakeLists.txt +++ b/examples/dbus/listnames/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS DBus) -add_qt_gui_executable(listnames WIN32 MACOSX_BUNDLE +add_qt_gui_executable(listnames listnames.cpp ) target_link_libraries(listnames PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(listnames PUBLIC install(TARGETS listnames RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/pingpong/CMakeLists.txt b/examples/dbus/pingpong/CMakeLists.txt index 1e93e3cef31..4cae8ecfdf8 100644 --- a/examples/dbus/pingpong/CMakeLists.txt +++ b/examples/dbus/pingpong/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS DBus) -add_qt_gui_executable(pong WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pong ping-common.h pong.cpp pong.h ) @@ -24,4 +24,5 @@ target_link_libraries(pong PUBLIC install(TARGETS pong RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt index cee3b2bb50e..18af20fe387 100644 --- a/examples/dbus/remotecontrolledcar/car/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/car/CMakeLists.txt @@ -23,7 +23,7 @@ qt5_add_dbus_adaptor(car_SRCS car_adaptor ) # special case end -add_qt_gui_executable(car WIN32 MACOSX_BUNDLE +add_qt_gui_executable(car car.cpp car.h main.cpp ${car_SRCS} # special case @@ -35,4 +35,5 @@ target_link_libraries(car PUBLIC install(TARGETS car RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt index ee97e0d1e4c..06a975db7e9 100644 --- a/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt +++ b/examples/dbus/remotecontrolledcar/controller/CMakeLists.txt @@ -21,7 +21,7 @@ qt5_add_dbus_interface(controller_SRCS car_interface ) # special case end -add_qt_gui_executable(controller WIN32 MACOSX_BUNDLE +add_qt_gui_executable(controller controller.cpp controller.h controller.ui main.cpp ${controller_SRCS} # special case @@ -33,4 +33,5 @@ target_link_libraries(controller PUBLIC install(TARGETS controller RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/embedded/digiflip/CMakeLists.txt b/examples/embedded/digiflip/CMakeLists.txt index ee20c34c114..340dc34859c 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 c71699b693a..cc2611cc1bc 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 e9055311143..4415ab91b53 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 ea7239b7ac9..3a3ab6fd43a 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 d27dbbe7a4f..64844bca567 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 34ab6e4a223..44b9a8ae1eb 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}" ) diff --git a/examples/gui/analogclock/CMakeLists.txt b/examples/gui/analogclock/CMakeLists.txt index 7fe1aed8dea..8d2d51a97f0 100644 --- a/examples/gui/analogclock/CMakeLists.txt +++ b/examples/gui/analogclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_qt_gui_executable(gui_analogclock WIN32 MACOSX_BUNDLE # special case: renamed target +add_qt_gui_executable(gui_analogclock # special case: renamed target ../rasterwindow/rasterwindow.cpp ../rasterwindow/rasterwindow.h main.cpp ) @@ -29,4 +29,5 @@ target_link_libraries(gui_analogclock PUBLIC install(TARGETS gui_analogclock RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/gui/openglwindow/CMakeLists.txt b/examples/gui/openglwindow/CMakeLists.txt index c77dabd0c1b..cde169deb57 100644 --- a/examples/gui/openglwindow/CMakeLists.txt +++ b/examples/gui/openglwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_qt_gui_executable(openglwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(openglwindow main.cpp openglwindow.cpp openglwindow.h ) @@ -28,4 +28,5 @@ target_link_libraries(openglwindow PUBLIC install(TARGETS openglwindow RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/gui/rasterwindow/CMakeLists.txt b/examples/gui/rasterwindow/CMakeLists.txt index 9ddf9163696..eab79cee2f6 100644 --- a/examples/gui/rasterwindow/CMakeLists.txt +++ b/examples/gui/rasterwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_qt_gui_executable(rasterwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(rasterwindow main.cpp rasterwindow.cpp rasterwindow.h ) @@ -28,4 +28,5 @@ target_link_libraries(rasterwindow PUBLIC install(TARGETS rasterwindow RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/bearermonitor/CMakeLists.txt b/examples/network/bearermonitor/CMakeLists.txt index 55893a7138c..8cb67e13b6e 100644 --- a/examples/network/bearermonitor/CMakeLists.txt +++ b/examples/network/bearermonitor/CMakeLists.txt @@ -33,4 +33,5 @@ target_link_libraries(bearermonitor PUBLIC install(TARGETS bearermonitor RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/blockingfortuneclient/CMakeLists.txt b/examples/network/blockingfortuneclient/CMakeLists.txt index 47933d66ff4..f79e15cb59b 100644 --- a/examples/network/blockingfortuneclient/CMakeLists.txt +++ b/examples/network/blockingfortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(blockingfortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(blockingfortuneclient blockingclient.cpp blockingclient.h fortunethread.cpp fortunethread.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(blockingfortuneclient PUBLIC install(TARGETS blockingfortuneclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/broadcastreceiver/CMakeLists.txt b/examples/network/broadcastreceiver/CMakeLists.txt index d8cdae0b42e..05074f6d919 100644 --- a/examples/network/broadcastreceiver/CMakeLists.txt +++ b/examples/network/broadcastreceiver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(broadcastreceiver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(broadcastreceiver main.cpp receiver.cpp receiver.h ) @@ -26,4 +26,5 @@ target_link_libraries(broadcastreceiver PUBLIC install(TARGETS broadcastreceiver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/broadcastsender/CMakeLists.txt b/examples/network/broadcastsender/CMakeLists.txt index 31681c29c33..323ea5e9cbf 100644 --- a/examples/network/broadcastsender/CMakeLists.txt +++ b/examples/network/broadcastsender/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(broadcastsender WIN32 MACOSX_BUNDLE +add_qt_gui_executable(broadcastsender main.cpp sender.cpp sender.h ) @@ -26,4 +26,5 @@ target_link_libraries(broadcastsender PUBLIC install(TARGETS broadcastsender RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/dnslookup/CMakeLists.txt b/examples/network/dnslookup/CMakeLists.txt index 8aa5bea4cbb..b79445370b7 100644 --- a/examples/network/dnslookup/CMakeLists.txt +++ b/examples/network/dnslookup/CMakeLists.txt @@ -25,4 +25,5 @@ target_link_libraries(dnslookup PUBLIC install(TARGETS dnslookup RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/download/CMakeLists.txt b/examples/network/download/CMakeLists.txt index 0ec20216b5b..2b48217c384 100644 --- a/examples/network/download/CMakeLists.txt +++ b/examples/network/download/CMakeLists.txt @@ -25,4 +25,5 @@ target_link_libraries(download PUBLIC install(TARGETS download RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/downloadmanager/CMakeLists.txt b/examples/network/downloadmanager/CMakeLists.txt index 574073c7eb1..b8eb8db4002 100644 --- a/examples/network/downloadmanager/CMakeLists.txt +++ b/examples/network/downloadmanager/CMakeLists.txt @@ -27,4 +27,5 @@ target_link_libraries(downloadmanager PUBLIC install(TARGETS downloadmanager RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/fortuneclient/CMakeLists.txt b/examples/network/fortuneclient/CMakeLists.txt index 6530cdcf00b..0169b4eb4ca 100644 --- a/examples/network/fortuneclient/CMakeLists.txt +++ b/examples/network/fortuneclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(fortuneclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fortuneclient client.cpp client.h main.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(fortuneclient PUBLIC install(TARGETS fortuneclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/fortuneserver/CMakeLists.txt b/examples/network/fortuneserver/CMakeLists.txt index 43ca6f7d2b0..fb2a6814131 100644 --- a/examples/network/fortuneserver/CMakeLists.txt +++ b/examples/network/fortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(fortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fortuneserver main.cpp server.cpp server.h ) @@ -26,4 +26,5 @@ target_link_libraries(fortuneserver PUBLIC install(TARGETS fortuneserver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/googlesuggest/CMakeLists.txt b/examples/network/googlesuggest/CMakeLists.txt index b1556de464e..f0f7f143780 100644 --- a/examples/network/googlesuggest/CMakeLists.txt +++ b/examples/network/googlesuggest/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(googlesuggest WIN32 MACOSX_BUNDLE +add_qt_gui_executable(googlesuggest googlesuggest.cpp googlesuggest.h main.cpp searchbox.cpp searchbox.h @@ -27,4 +27,5 @@ target_link_libraries(googlesuggest PUBLIC install(TARGETS googlesuggest RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/http/CMakeLists.txt b/examples/network/http/CMakeLists.txt index 3da3b8c3ac7..890f2891a22 100644 --- a/examples/network/http/CMakeLists.txt +++ b/examples/network/http/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(http WIN32 MACOSX_BUNDLE +add_qt_gui_executable(http authenticationdialog.ui httpwindow.cpp httpwindow.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(http PUBLIC install(TARGETS http RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/loopback/CMakeLists.txt b/examples/network/loopback/CMakeLists.txt index e6f46b0933d..4e4e265edd3 100644 --- a/examples/network/loopback/CMakeLists.txt +++ b/examples/network/loopback/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(loopback WIN32 MACOSX_BUNDLE +add_qt_gui_executable(loopback dialog.cpp dialog.h main.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(loopback PUBLIC install(TARGETS loopback RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multicastreceiver/CMakeLists.txt b/examples/network/multicastreceiver/CMakeLists.txt index eaabf8a5d52..19a062aff38 100644 --- a/examples/network/multicastreceiver/CMakeLists.txt +++ b/examples/network/multicastreceiver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(multicastreceiver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multicastreceiver main.cpp receiver.cpp receiver.h ) @@ -26,4 +26,5 @@ target_link_libraries(multicastreceiver PUBLIC install(TARGETS multicastreceiver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multicastsender/CMakeLists.txt b/examples/network/multicastsender/CMakeLists.txt index 8504bc36472..ba4386963e8 100644 --- a/examples/network/multicastsender/CMakeLists.txt +++ b/examples/network/multicastsender/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(multicastsender WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multicastsender main.cpp sender.cpp sender.h ) @@ -26,4 +26,5 @@ target_link_libraries(multicastsender PUBLIC install(TARGETS multicastsender RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multistreamclient/CMakeLists.txt b/examples/network/multistreamclient/CMakeLists.txt index c0091d10466..efb4c7bf35e 100644 --- a/examples/network/multistreamclient/CMakeLists.txt +++ b/examples/network/multistreamclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(multistreamclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multistreamclient chatconsumer.cpp chatconsumer.h client.cpp client.h consumer.h @@ -30,4 +30,5 @@ target_link_libraries(multistreamclient PUBLIC install(TARGETS multistreamclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/multistreamserver/CMakeLists.txt b/examples/network/multistreamserver/CMakeLists.txt index 44c36e43221..88aefc9af05 100644 --- a/examples/network/multistreamserver/CMakeLists.txt +++ b/examples/network/multistreamserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(multistreamserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(multistreamserver chatprovider.cpp chatprovider.h main.cpp movieprovider.cpp movieprovider.h @@ -30,4 +30,5 @@ target_link_libraries(multistreamserver PUBLIC install(TARGETS multistreamserver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/network-chat/CMakeLists.txt b/examples/network/network-chat/CMakeLists.txt index be60e01f142..c3cbf32d9f7 100644 --- a/examples/network/network-chat/CMakeLists.txt +++ b/examples/network/network-chat/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(network-chat WIN32 MACOSX_BUNDLE +add_qt_gui_executable(network-chat chatdialog.cpp chatdialog.h chatdialog.ui client.cpp client.h connection.cpp connection.h @@ -30,4 +30,5 @@ target_link_libraries(network-chat PUBLIC install(TARGETS network-chat RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/securesocketclient/CMakeLists.txt b/examples/network/securesocketclient/CMakeLists.txt index f00d138d805..d514d21508d 100644 --- a/examples/network/securesocketclient/CMakeLists.txt +++ b/examples/network/securesocketclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(securesocketclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(securesocketclient certificateinfo.cpp certificateinfo.h certificateinfo.ui main.cpp securesocketclient.qrc @@ -29,4 +29,5 @@ target_link_libraries(securesocketclient PUBLIC install(TARGETS securesocketclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/secureudpclient/CMakeLists.txt b/examples/network/secureudpclient/CMakeLists.txt index 6af110c4122..08854bd334e 100644 --- a/examples/network/secureudpclient/CMakeLists.txt +++ b/examples/network/secureudpclient/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Network) -add_qt_gui_executable(secureudpclient WIN32 MACOSX_BUNDLE +add_qt_gui_executable(secureudpclient addressdialog.cpp addressdialog.h addressdialog.ui association.cpp association.h main.cpp @@ -28,4 +28,5 @@ target_link_libraries(secureudpclient PUBLIC install(TARGETS secureudpclient RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/secureudpserver/CMakeLists.txt b/examples/network/secureudpserver/CMakeLists.txt index f30d8808009..e991c9822c9 100644 --- a/examples/network/secureudpserver/CMakeLists.txt +++ b/examples/network/secureudpserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Network) -add_qt_gui_executable(secureudpserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(secureudpserver main.cpp mainwindow.cpp mainwindow.h mainwindow.ui nicselector.cpp nicselector.h nicselector.ui @@ -28,4 +28,5 @@ target_link_libraries(secureudpserver PUBLIC install(TARGETS secureudpserver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/threadedfortuneserver/CMakeLists.txt b/examples/network/threadedfortuneserver/CMakeLists.txt index ce5c0e0d194..4e5f61ceca8 100644 --- a/examples/network/threadedfortuneserver/CMakeLists.txt +++ b/examples/network/threadedfortuneserver/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(threadedfortuneserver WIN32 MACOSX_BUNDLE +add_qt_gui_executable(threadedfortuneserver dialog.cpp dialog.h fortuneserver.cpp fortuneserver.h fortunethread.cpp fortunethread.h @@ -28,4 +28,5 @@ target_link_libraries(threadedfortuneserver PUBLIC install(TARGETS threadedfortuneserver RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/network/torrent/.prev_CMakeLists.txt b/examples/network/torrent/.prev_CMakeLists.txt index 3673b7e05a0..3ed78c7e3b4 100644 --- a/examples/network/torrent/.prev_CMakeLists.txt +++ b/examples/network/torrent/.prev_CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(torrent WIN32 MACOSX_BUNDLE +add_qt_gui_executable(torrent addtorrentdialog.cpp addtorrentdialog.h bencodeparser.cpp bencodeparser.h connectionmanager.cpp connectionmanager.h diff --git a/examples/network/torrent/CMakeLists.txt b/examples/network/torrent/CMakeLists.txt index 86bad72ab7e..205b1b45272 100644 --- a/examples/network/torrent/CMakeLists.txt +++ b/examples/network/torrent/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(torrent WIN32 MACOSX_BUNDLE +add_qt_gui_executable(torrent addtorrentdialog.cpp addtorrentdialog.h bencodeparser.cpp bencodeparser.h connectionmanager.cpp connectionmanager.h @@ -39,4 +39,5 @@ target_link_libraries(torrent PUBLIC install(TARGETS torrent RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qpa/qrasterwindow/CMakeLists.txt b/examples/qpa/qrasterwindow/CMakeLists.txt index f718796eb94..3baff1ed61d 100644 --- a/examples/qpa/qrasterwindow/CMakeLists.txt +++ b/examples/qpa/qrasterwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_qt_gui_executable(qrasterwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qrasterwindow main.cpp ) target_link_libraries(qrasterwindow PUBLIC Qt::Gui) # special case: add @@ -21,4 +21,5 @@ target_link_libraries(qrasterwindow PUBLIC Qt::Gui) # special case: add install(TARGETS qrasterwindow RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qpa/windows/CMakeLists.txt b/examples/qpa/windows/CMakeLists.txt index 2bd7b6fd850..afd1b57615e 100644 --- a/examples/qpa/windows/CMakeLists.txt +++ b/examples/qpa/windows/CMakeLists.txt @@ -30,4 +30,5 @@ target_link_libraries(windows PUBLIC install(TARGETS windows RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtconcurrent/imagescaling/CMakeLists.txt b/examples/qtconcurrent/imagescaling/CMakeLists.txt index 448bcf848e1..f75291cabd0 100644 --- a/examples/qtconcurrent/imagescaling/CMakeLists.txt +++ b/examples/qtconcurrent/imagescaling/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Concurrent) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(imagescaling WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imagescaling imagescaling.cpp imagescaling.h main.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(imagescaling PUBLIC install(TARGETS imagescaling RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtconcurrent/map/CMakeLists.txt b/examples/qtconcurrent/map/CMakeLists.txt index a5bac9a9738..f6d72538474 100644 --- a/examples/qtconcurrent/map/CMakeLists.txt +++ b/examples/qtconcurrent/map/CMakeLists.txt @@ -24,4 +24,5 @@ target_link_libraries(mapdemo PUBLIC install(TARGETS mapdemo RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtconcurrent/progressdialog/CMakeLists.txt b/examples/qtconcurrent/progressdialog/CMakeLists.txt index 8a61fd0e0a9..0eff435ed25 100644 --- a/examples/qtconcurrent/progressdialog/CMakeLists.txt +++ b/examples/qtconcurrent/progressdialog/CMakeLists.txt @@ -25,4 +25,5 @@ target_link_libraries(progressdialog PUBLIC install(TARGETS progressdialog RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtconcurrent/runfunction/CMakeLists.txt b/examples/qtconcurrent/runfunction/CMakeLists.txt index f71a7894234..95f53e8637f 100644 --- a/examples/qtconcurrent/runfunction/CMakeLists.txt +++ b/examples/qtconcurrent/runfunction/CMakeLists.txt @@ -25,4 +25,5 @@ target_link_libraries(runfunction PUBLIC install(TARGETS runfunction RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtconcurrent/wordcount/CMakeLists.txt b/examples/qtconcurrent/wordcount/CMakeLists.txt index 4c6402102d2..8e79f716c6b 100644 --- a/examples/qtconcurrent/wordcount/CMakeLists.txt +++ b/examples/qtconcurrent/wordcount/CMakeLists.txt @@ -25,4 +25,5 @@ target_link_libraries(wordcount PUBLIC install(TARGETS wordcount RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial1/CMakeLists.txt b/examples/qtestlib/tutorial1/CMakeLists.txt index fb834211a7f..b1bc5203394 100644 --- a/examples/qtestlib/tutorial1/CMakeLists.txt +++ b/examples/qtestlib/tutorial1/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_qt_gui_executable(tutorial1 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial1 testqstring.cpp ) target_link_libraries(tutorial1 PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(tutorial1 PUBLIC install(TARGETS tutorial1 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial2/CMakeLists.txt b/examples/qtestlib/tutorial2/CMakeLists.txt index 600cbb2ddd4..1c89575d140 100644 --- a/examples/qtestlib/tutorial2/CMakeLists.txt +++ b/examples/qtestlib/tutorial2/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_qt_gui_executable(tutorial2 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial2 testqstring.cpp ) target_link_libraries(tutorial2 PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(tutorial2 PUBLIC install(TARGETS tutorial2 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial3/CMakeLists.txt b/examples/qtestlib/tutorial3/CMakeLists.txt index 457495997fc..f6ef8776f53 100644 --- a/examples/qtestlib/tutorial3/CMakeLists.txt +++ b/examples/qtestlib/tutorial3/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_qt_gui_executable(tutorial3 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial3 testgui.cpp ) target_link_libraries(tutorial3 PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(tutorial3 PUBLIC install(TARGETS tutorial3 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial4/CMakeLists.txt b/examples/qtestlib/tutorial4/CMakeLists.txt index 6d2c0f2ce12..11d62ad582b 100644 --- a/examples/qtestlib/tutorial4/CMakeLists.txt +++ b/examples/qtestlib/tutorial4/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_qt_gui_executable(tutorial4 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial4 testgui.cpp ) target_link_libraries(tutorial4 PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(tutorial4 PUBLIC install(TARGETS tutorial4 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/qtestlib/tutorial5/CMakeLists.txt b/examples/qtestlib/tutorial5/CMakeLists.txt index b0e2995b2ae..799cff62c60 100644 --- a/examples/qtestlib/tutorial5/CMakeLists.txt +++ b/examples/qtestlib/tutorial5/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Test) -add_qt_gui_executable(tutorial5 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tutorial5 benchmarking.cpp ) target_link_libraries(tutorial5 PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(tutorial5 PUBLIC install(TARGETS tutorial5 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/books/CMakeLists.txt b/examples/sql/books/CMakeLists.txt index cfee3e237da..e9044e34b8f 100644 --- a/examples/sql/books/CMakeLists.txt +++ b/examples/sql/books/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(books WIN32 MACOSX_BUNDLE +add_qt_gui_executable(books bookdelegate.cpp bookdelegate.h books.qrc bookwindow.cpp bookwindow.h bookwindow.ui @@ -32,4 +32,5 @@ target_link_libraries(books PUBLIC install(TARGETS books RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/cachedtable/CMakeLists.txt b/examples/sql/cachedtable/CMakeLists.txt index 16ef886b1c4..f3341791a10 100644 --- a/examples/sql/cachedtable/CMakeLists.txt +++ b/examples/sql/cachedtable/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(cachedtable WIN32 MACOSX_BUNDLE +add_qt_gui_executable(cachedtable ../connection.h main.cpp tableeditor.cpp tableeditor.h @@ -27,4 +27,5 @@ target_link_libraries(cachedtable PUBLIC install(TARGETS cachedtable RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/drilldown/CMakeLists.txt b/examples/sql/drilldown/CMakeLists.txt index ed411d1ca34..97a26202097 100644 --- a/examples/sql/drilldown/CMakeLists.txt +++ b/examples/sql/drilldown/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(drilldown WIN32 MACOSX_BUNDLE +add_qt_gui_executable(drilldown ../connection.h drilldown.qrc imageitem.cpp imageitem.h @@ -30,4 +30,5 @@ target_link_libraries(drilldown PUBLIC install(TARGETS drilldown RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/masterdetail/CMakeLists.txt b/examples/sql/masterdetail/CMakeLists.txt index 832cbdea8b0..59ce1eb77d5 100644 --- a/examples/sql/masterdetail/CMakeLists.txt +++ b/examples/sql/masterdetail/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS Xml) -add_qt_gui_executable(masterdetail WIN32 MACOSX_BUNDLE +add_qt_gui_executable(masterdetail database.h dialog.cpp dialog.h main.cpp @@ -31,4 +31,5 @@ target_link_libraries(masterdetail PUBLIC install(TARGETS masterdetail RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/querymodel/CMakeLists.txt b/examples/sql/querymodel/CMakeLists.txt index 6dc59a4bb76..1f7bb512fc6 100644 --- a/examples/sql/querymodel/CMakeLists.txt +++ b/examples/sql/querymodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(querymodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(querymodel ../connection.h customsqlmodel.cpp customsqlmodel.h editablesqlmodel.cpp editablesqlmodel.h @@ -28,4 +28,5 @@ target_link_libraries(querymodel PUBLIC install(TARGETS querymodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/relationaltablemodel/CMakeLists.txt b/examples/sql/relationaltablemodel/CMakeLists.txt index 0d35a9abdbc..6a9840b9df7 100644 --- a/examples/sql/relationaltablemodel/CMakeLists.txt +++ b/examples/sql/relationaltablemodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(relationaltablemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(relationaltablemodel ../connection.h relationaltablemodel.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(relationaltablemodel PUBLIC install(TARGETS relationaltablemodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/sqlbrowser/CMakeLists.txt b/examples/sql/sqlbrowser/CMakeLists.txt index f52de00ce66..3f4d7cf9084 100644 --- a/examples/sql/sqlbrowser/CMakeLists.txt +++ b/examples/sql/sqlbrowser/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sqlbrowser WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sqlbrowser browser.cpp browser.h browserwidget.ui connectionwidget.cpp connectionwidget.h @@ -29,4 +29,5 @@ target_link_libraries(sqlbrowser PUBLIC install(TARGETS sqlbrowser RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/sqlwidgetmapper/CMakeLists.txt b/examples/sql/sqlwidgetmapper/CMakeLists.txt index 48e68209c5d..0ec052db0a1 100644 --- a/examples/sql/sqlwidgetmapper/CMakeLists.txt +++ b/examples/sql/sqlwidgetmapper/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sqlwidgetmapper WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sqlwidgetmapper main.cpp window.cpp window.h ) @@ -26,4 +26,5 @@ target_link_libraries(sqlwidgetmapper PUBLIC install(TARGETS sqlwidgetmapper RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/sql/tablemodel/CMakeLists.txt b/examples/sql/tablemodel/CMakeLists.txt index fb7dbac9275..8f7cfa3439e 100644 --- a/examples/sql/tablemodel/CMakeLists.txt +++ b/examples/sql/tablemodel/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Sql) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(tablemodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tablemodel ../connection.h tablemodel.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(tablemodel PUBLIC install(TARGETS tablemodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/animatedtiles/CMakeLists.txt b/examples/widgets/animation/animatedtiles/CMakeLists.txt index e3fa88aebba..ea48cf56a39 100644 --- a/examples/widgets/animation/animatedtiles/CMakeLists.txt +++ b/examples/widgets/animation/animatedtiles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(animatedtiles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(animatedtiles animatedtiles.qrc main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(animatedtiles PUBLIC install(TARGETS animatedtiles RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/easing/CMakeLists.txt b/examples/widgets/animation/easing/CMakeLists.txt index 441b27b0c49..840e4e59abf 100644 --- a/examples/widgets/animation/easing/CMakeLists.txt +++ b/examples/widgets/animation/easing/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(easing WIN32 MACOSX_BUNDLE +add_qt_gui_executable(easing animation.h easing.qrc form.ui @@ -27,4 +27,5 @@ target_link_libraries(easing PUBLIC install(TARGETS easing RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/moveblocks/CMakeLists.txt b/examples/widgets/animation/moveblocks/CMakeLists.txt index 971bf2e7e53..6f8aa9cefff 100644 --- a/examples/widgets/animation/moveblocks/CMakeLists.txt +++ b/examples/widgets/animation/moveblocks/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(moveblocks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(moveblocks main.cpp ) target_link_libraries(moveblocks PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(moveblocks PUBLIC install(TARGETS moveblocks RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/states/CMakeLists.txt b/examples/widgets/animation/states/CMakeLists.txt index bd353422d28..5974f28de80 100644 --- a/examples/widgets/animation/states/CMakeLists.txt +++ b/examples/widgets/animation/states/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(states WIN32 MACOSX_BUNDLE +add_qt_gui_executable(states main.cpp states.qrc ) @@ -24,4 +24,5 @@ target_link_libraries(states PUBLIC install(TARGETS states RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/stickman/CMakeLists.txt b/examples/widgets/animation/stickman/CMakeLists.txt index 90bc09e5d74..62a35ed796c 100644 --- a/examples/widgets/animation/stickman/CMakeLists.txt +++ b/examples/widgets/animation/stickman/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(stickman WIN32 MACOSX_BUNDLE +add_qt_gui_executable(stickman animation.cpp animation.h graphicsview.cpp graphicsview.h lifecycle.cpp lifecycle.h @@ -29,4 +29,5 @@ target_link_libraries(stickman PUBLIC install(TARGETS stickman RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/animation/sub-attaq/CMakeLists.txt b/examples/widgets/animation/sub-attaq/CMakeLists.txt index 883c1cd0c58..969a24c1da4 100644 --- a/examples/widgets/animation/sub-attaq/CMakeLists.txt +++ b/examples/widgets/animation/sub-attaq/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS OpenGL) # special case -add_qt_gui_executable(sub-attaq WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sub-attaq animationmanager.cpp animationmanager.h boat.cpp boat.h boat_p.h bomb.cpp bomb.h @@ -40,4 +40,5 @@ endif() install(TARGETS sub-attaq RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/desktop/screenshot/CMakeLists.txt b/examples/widgets/desktop/screenshot/CMakeLists.txt index 4c207f1bef5..494515029d1 100644 --- a/examples/widgets/desktop/screenshot/CMakeLists.txt +++ b/examples/widgets/desktop/screenshot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(screenshot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(screenshot main.cpp screenshot.cpp screenshot.h ) @@ -24,4 +24,5 @@ target_link_libraries(screenshot PUBLIC install(TARGETS screenshot RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/desktop/systray/CMakeLists.txt b/examples/widgets/desktop/systray/CMakeLists.txt index 754ccad8e3c..cd47d5d8337 100644 --- a/examples/widgets/desktop/systray/CMakeLists.txt +++ b/examples/widgets/desktop/systray/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(systray WIN32 MACOSX_BUNDLE +add_qt_gui_executable(systray main.cpp systray.qrc window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(systray PUBLIC install(TARGETS systray RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/classwizard/CMakeLists.txt b/examples/widgets/dialogs/classwizard/CMakeLists.txt index 5a57c5905ac..1f763111d5b 100644 --- a/examples/widgets/dialogs/classwizard/CMakeLists.txt +++ b/examples/widgets/dialogs/classwizard/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(classwizard WIN32 MACOSX_BUNDLE +add_qt_gui_executable(classwizard classwizard.cpp classwizard.h classwizard.qrc main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(classwizard PUBLIC install(TARGETS classwizard RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/extension/CMakeLists.txt b/examples/widgets/dialogs/extension/CMakeLists.txt index fa35d52048b..f21fddf7227 100644 --- a/examples/widgets/dialogs/extension/CMakeLists.txt +++ b/examples/widgets/dialogs/extension/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(extension WIN32 MACOSX_BUNDLE +add_qt_gui_executable(extension finddialog.cpp finddialog.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(extension PUBLIC install(TARGETS extension RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/findfiles/CMakeLists.txt b/examples/widgets/dialogs/findfiles/CMakeLists.txt index 12ce6ce05ee..9865d67076b 100644 --- a/examples/widgets/dialogs/findfiles/CMakeLists.txt +++ b/examples/widgets/dialogs/findfiles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(findfiles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(findfiles main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(findfiles PUBLIC install(TARGETS findfiles RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/licensewizard/CMakeLists.txt b/examples/widgets/dialogs/licensewizard/CMakeLists.txt index a82800363e0..b09c1a48027 100644 --- a/examples/widgets/dialogs/licensewizard/CMakeLists.txt +++ b/examples/widgets/dialogs/licensewizard/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS PrintSupport) -add_qt_gui_executable(licensewizard WIN32 MACOSX_BUNDLE +add_qt_gui_executable(licensewizard licensewizard.cpp licensewizard.h licensewizard.qrc main.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(licensewizard PUBLIC install(TARGETS licensewizard RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt index 91c74b71e11..0cce717924a 100644 --- a/examples/widgets/dialogs/standarddialogs/CMakeLists.txt +++ b/examples/widgets/dialogs/standarddialogs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(standarddialogs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(standarddialogs dialog.cpp dialog.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(standarddialogs PUBLIC install(TARGETS standarddialogs RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/tabdialog/CMakeLists.txt b/examples/widgets/dialogs/tabdialog/CMakeLists.txt index ec88fd66d02..50d6209cb80 100644 --- a/examples/widgets/dialogs/tabdialog/CMakeLists.txt +++ b/examples/widgets/dialogs/tabdialog/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(tabdialog WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tabdialog main.cpp tabdialog.cpp tabdialog.h ) @@ -24,4 +24,5 @@ target_link_libraries(tabdialog PUBLIC install(TARGETS tabdialog RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt index 394816619d3..a8601f02ecd 100644 --- a/examples/widgets/dialogs/trivialwizard/CMakeLists.txt +++ b/examples/widgets/dialogs/trivialwizard/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(trivialwizard WIN32 MACOSX_BUNDLE +add_qt_gui_executable(trivialwizard trivialwizard.cpp ) target_link_libraries(trivialwizard PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(trivialwizard PUBLIC install(TARGETS trivialwizard RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt index d7ec690a986..a8fbaa17edd 100644 --- a/examples/widgets/draganddrop/draggableicons/CMakeLists.txt +++ b/examples/widgets/draganddrop/draggableicons/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(draggableicons WIN32 MACOSX_BUNDLE +add_qt_gui_executable(draggableicons draggableicons.qrc dragwidget.cpp dragwidget.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(draggableicons PUBLIC install(TARGETS draggableicons RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt index c145771015a..9a0c6addc9b 100644 --- a/examples/widgets/draganddrop/draggabletext/CMakeLists.txt +++ b/examples/widgets/draganddrop/draggabletext/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(draggabletext WIN32 MACOSX_BUNDLE +add_qt_gui_executable(draggabletext draggabletext.qrc dragwidget.cpp dragwidget.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(draggabletext PUBLIC install(TARGETS draggabletext RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/dropsite/CMakeLists.txt b/examples/widgets/draganddrop/dropsite/CMakeLists.txt index 863a757f39c..5b6e5be4357 100644 --- a/examples/widgets/draganddrop/dropsite/CMakeLists.txt +++ b/examples/widgets/draganddrop/dropsite/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dropsite WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dropsite droparea.cpp droparea.h dropsitewindow.cpp dropsitewindow.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(dropsite PUBLIC install(TARGETS dropsite RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt index d7acb41b219..e1888ab59c4 100644 --- a/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt +++ b/examples/widgets/draganddrop/fridgemagnets/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(fridgemagnets WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fridgemagnets draglabel.cpp draglabel.h dragwidget.cpp dragwidget.h fridgemagnets.qrc @@ -26,4 +26,5 @@ target_link_libraries(fridgemagnets PUBLIC install(TARGETS fridgemagnets RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/draganddrop/puzzle/CMakeLists.txt b/examples/widgets/draganddrop/puzzle/CMakeLists.txt index 44191011177..267aa6fbe70 100644 --- a/examples/widgets/draganddrop/puzzle/CMakeLists.txt +++ b/examples/widgets/draganddrop/puzzle/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(draganddrop_puzzle WIN32 MACOSX_BUNDLE # special case: renamed puzzle +add_qt_gui_executable(draganddrop_puzzle # special case: renamed puzzle main.cpp mainwindow.cpp mainwindow.h pieceslist.cpp pieceslist.h @@ -27,4 +27,5 @@ target_link_libraries(draganddrop_puzzle PUBLIC # special case: renamed puzzle install(TARGETS draganddrop_puzzle # special case: renamed puzzle RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/effects/blurpicker/CMakeLists.txt b/examples/widgets/effects/blurpicker/CMakeLists.txt index f5b7047b8aa..ddb36841cfc 100644 --- a/examples/widgets/effects/blurpicker/CMakeLists.txt +++ b/examples/widgets/effects/blurpicker/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(blurpicker WIN32 MACOSX_BUNDLE +add_qt_gui_executable(blurpicker blureffect.cpp blureffect.h blurpicker.cpp blurpicker.h blurpicker.qrc main.cpp @@ -25,4 +25,5 @@ target_link_libraries(blurpicker PUBLIC install(TARGETS blurpicker RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/effects/fademessage/CMakeLists.txt b/examples/widgets/effects/fademessage/CMakeLists.txt index e53fc405f76..42c01c00e0c 100644 --- a/examples/widgets/effects/fademessage/CMakeLists.txt +++ b/examples/widgets/effects/fademessage/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(fademessage WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fademessage fademessage.cpp fademessage.h fademessage.qrc main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(fademessage PUBLIC install(TARGETS fademessage RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/gestures/imagegestures/CMakeLists.txt b/examples/widgets/gestures/imagegestures/CMakeLists.txt index 75f2b981b79..5cef59b15e4 100644 --- a/examples/widgets/gestures/imagegestures/CMakeLists.txt +++ b/examples/widgets/gestures/imagegestures/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(imagegestures WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imagegestures imagewidget.cpp imagewidget.h main.cpp mainwidget.cpp mainwidget.h @@ -25,4 +25,5 @@ target_link_libraries(imagegestures PUBLIC install(TARGETS imagegestures RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt index 9676dbbcbad..7137e76d9bc 100644 --- a/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/anchorlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(anchorlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(anchorlayout main.cpp ) target_link_libraries(anchorlayout PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(anchorlayout PUBLIC install(TARGETS anchorlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt index 982fd541c60..afe4475bbfa 100644 --- a/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt +++ b/examples/widgets/graphicsview/basicgraphicslayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(basicgraphicslayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basicgraphicslayouts basicgraphicslayouts.qrc layoutitem.cpp layoutitem.h main.cpp @@ -26,4 +26,5 @@ target_link_libraries(basicgraphicslayouts PUBLIC install(TARGETS basicgraphicslayouts RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/boxes/CMakeLists.txt b/examples/widgets/graphicsview/boxes/CMakeLists.txt index b5441bcfdf5..856dfd17164 100644 --- a/examples/widgets/graphicsview/boxes/CMakeLists.txt +++ b/examples/widgets/graphicsview/boxes/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS OpenGL) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(boxes WIN32 MACOSX_BUNDLE +add_qt_gui_executable(boxes 3rdparty/fbm.c 3rdparty/fbm.h boxes.qrc glbuffers.cpp glbuffers.h @@ -35,4 +35,5 @@ target_link_libraries(boxes PUBLIC install(TARGETS boxes RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/chip/CMakeLists.txt b/examples/widgets/graphicsview/chip/CMakeLists.txt index 141645a22c6..f02cbacf37f 100644 --- a/examples/widgets/graphicsview/chip/CMakeLists.txt +++ b/examples/widgets/graphicsview/chip/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Widgets) find_package(Qt5 COMPONENTS OpenGL) # special case find_package(Qt5 COMPONENTS PrintSupport) # special case -add_qt_gui_executable(chip WIN32 MACOSX_BUNDLE +add_qt_gui_executable(chip chip.cpp chip.h images.qrc main.cpp @@ -35,4 +35,5 @@ endif() install(TARGETS chip RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt index 90018588170..2817710600f 100644 --- a/examples/widgets/graphicsview/collidingmice/CMakeLists.txt +++ b/examples/widgets/graphicsview/collidingmice/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(collidingmice WIN32 MACOSX_BUNDLE +add_qt_gui_executable(collidingmice main.cpp mice.qrc mouse.cpp mouse.h @@ -25,4 +25,5 @@ target_link_libraries(collidingmice PUBLIC install(TARGETS collidingmice RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt index bfdd3b8f5b0..b1baf34b2d2 100644 --- a/examples/widgets/graphicsview/diagramscene/CMakeLists.txt +++ b/examples/widgets/graphicsview/diagramscene/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(diagramscene WIN32 MACOSX_BUNDLE +add_qt_gui_executable(diagramscene arrow.cpp arrow.h diagramitem.cpp diagramitem.h diagramscene.cpp diagramscene.h diagramscene.qrc @@ -28,4 +28,5 @@ target_link_libraries(diagramscene PUBLIC install(TARGETS diagramscene RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt index d85dcd1ff94..df6d2ec4e81 100644 --- a/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt +++ b/examples/widgets/graphicsview/dragdroprobot/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dragdroprobot WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dragdroprobot coloritem.cpp coloritem.h main.cpp robot.cpp robot.h robot.qrc @@ -25,4 +25,5 @@ target_link_libraries(dragdroprobot PUBLIC install(TARGETS dragdroprobot RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt index b1e04b2a20b..5fc7a424b0c 100644 --- a/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt +++ b/examples/widgets/graphicsview/elasticnodes/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(elasticnodes WIN32 MACOSX_BUNDLE +add_qt_gui_executable(elasticnodes edge.cpp edge.h graphwidget.cpp graphwidget.h main.cpp @@ -26,4 +26,5 @@ target_link_libraries(elasticnodes PUBLIC install(TARGETS elasticnodes RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt index fc9f6086cef..bfa68f15cb7 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt +++ b/examples/widgets/graphicsview/embeddeddialogs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(embeddeddialogs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(embeddeddialogs customproxy.cpp customproxy.h embeddeddialog.cpp embeddeddialog.h embeddeddialog.ui embeddeddialogs.qrc @@ -26,4 +26,5 @@ target_link_libraries(embeddeddialogs PUBLIC install(TARGETS embeddeddialogs RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt index ef5a4d55642..14b6ea8561d 100644 --- a/examples/widgets/graphicsview/flowlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/flowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(graphicsview_flowlayout WIN32 MACOSX_BUNDLE # special case: renamed flowlayout +add_qt_gui_executable(graphicsview_flowlayout # special case: renamed flowlayout flowlayout.cpp flowlayout.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(graphicsview_flowlayout PUBLIC # special case: renamed flo install(TARGETS graphicsview_flowlayout # special case: renamed flowlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt index e995f2a16e9..2db8aa1cded 100644 --- a/examples/widgets/graphicsview/padnavigator/CMakeLists.txt +++ b/examples/widgets/graphicsview/padnavigator/CMakeLists.txt @@ -34,4 +34,5 @@ endif() install(TARGETS padnavigator RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt index bc1564cb8c9..f8def269b6f 100644 --- a/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/simpleanchorlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(simpleanchorlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(simpleanchorlayout main.cpp ) target_link_libraries(simpleanchorlayout PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(simpleanchorlayout PUBLIC install(TARGETS simpleanchorlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt index 22e92cc68b1..939e6c3fc77 100644 --- a/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt +++ b/examples/widgets/graphicsview/weatheranchorlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(weatheranchorlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(weatheranchorlayout main.cpp weatheranchorlayout.qrc ) @@ -24,4 +24,5 @@ target_link_libraries(weatheranchorlayout PUBLIC install(TARGETS weatheranchorlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/itemviews/addressbook/CMakeLists.txt b/examples/widgets/itemviews/addressbook/CMakeLists.txt index 2831e860a55..8b0b8c9a9c0 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 8c4d84431e1..234ab0eb33a 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 7aceadab54b..10327842030 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 e3cea3e2351..d3648bf3e5d 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 175f78e7732..5134666a3a3 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 2c3627657ae..2981ea3d452 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 105d420f1af..818fe8323e7 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 f3e574c8110..d0bc1ea930e 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 be2771970a2..3880c610786 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 b026b2442f3..792287ff32d 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 fee5570bd60..a075fdc4609 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 76a145c7d8b..6da99388d12 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 e3e3388ba93..53f014d39aa 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 77abd09eaf5..e54d9dc770f 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 3573eca461e..a77e6543621 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 34c59d55ae9..dc3934abfa1 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 dedf063b5f3..69030f63983 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 ed2ebc8ab30..333a86faf77 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 7e3676e780b..5c91eea5e34 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 0d3bc684f8e..39125cf76fb 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 b254a217bcf..56cb5a1e10f 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}" ) diff --git a/examples/widgets/layouts/basiclayouts/CMakeLists.txt b/examples/widgets/layouts/basiclayouts/CMakeLists.txt index 927cbd7520e..374d66bdf4a 100644 --- a/examples/widgets/layouts/basiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/basiclayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(basiclayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basiclayouts dialog.cpp dialog.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(basiclayouts PUBLIC install(TARGETS basiclayouts RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/borderlayout/CMakeLists.txt b/examples/widgets/layouts/borderlayout/CMakeLists.txt index 74e867f6f18..1cdaa5738fd 100644 --- a/examples/widgets/layouts/borderlayout/CMakeLists.txt +++ b/examples/widgets/layouts/borderlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(borderlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(borderlayout borderlayout.cpp borderlayout.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(borderlayout PUBLIC install(TARGETS borderlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt index fad7509823d..a10fc71f263 100644 --- a/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt +++ b/examples/widgets/layouts/dynamiclayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dynamiclayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dynamiclayouts dialog.cpp dialog.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(dynamiclayouts PUBLIC install(TARGETS dynamiclayouts RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/layouts/flowlayout/CMakeLists.txt b/examples/widgets/layouts/flowlayout/CMakeLists.txt index b8257d9b4c5..56cc086a70d 100644 --- a/examples/widgets/layouts/flowlayout/CMakeLists.txt +++ b/examples/widgets/layouts/flowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(flowlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(flowlayout flowlayout.cpp flowlayout.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(flowlayout PUBLIC install(TARGETS flowlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt index 7a29a4cbc5b..0f1b48b5c5b 100644 --- a/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt +++ b/examples/widgets/mac/qmaccocoaviewcontainer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(qmaccocoaviewcontainer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qmaccocoaviewcontainer main.mm ) target_link_libraries(qmaccocoaviewcontainer PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(qmaccocoaviewcontainer PUBLIC install(TARGETS qmaccocoaviewcontainer RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt index b17b8454b3a..38b7d764b13 100644 --- a/examples/widgets/mac/qmacnativewidget/CMakeLists.txt +++ b/examples/widgets/mac/qmacnativewidget/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(qmacnativewidget WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qmacnativewidget main.mm ) target_link_libraries(qmacnativewidget PUBLIC @@ -24,4 +24,5 @@ target_link_libraries(qmacnativewidget PUBLIC install(TARGETS qmacnativewidget RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/application/CMakeLists.txt b/examples/widgets/mainwindows/application/CMakeLists.txt index 090cac61c70..67b00de33a8 100644 --- a/examples/widgets/mainwindows/application/CMakeLists.txt +++ b/examples/widgets/mainwindows/application/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(application WIN32 MACOSX_BUNDLE +add_qt_gui_executable(application application.qrc main.cpp mainwindow.cpp mainwindow.h @@ -25,4 +25,5 @@ target_link_libraries(application PUBLIC install(TARGETS application RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt b/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt index b3fe472db40..f07fbbcd9bf 100644 --- a/examples/widgets/mainwindows/dockwidgets/CMakeLists.txt +++ b/examples/widgets/mainwindows/dockwidgets/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(dockwidgets WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dockwidgets dockwidgets.qrc main.cpp mainwindow.cpp mainwindow.h @@ -31,4 +31,5 @@ endif() install(TARGETS dockwidgets RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt index 15824de79c6..63fe927e92b 100644 --- a/examples/widgets/mainwindows/mainwindow/CMakeLists.txt +++ b/examples/widgets/mainwindows/mainwindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mainwindow WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mainwindow colorswatch.cpp colorswatch.h main.cpp mainwindow.cpp mainwindow.h mainwindow.qrc @@ -26,4 +26,5 @@ target_link_libraries(mainwindow PUBLIC install(TARGETS mainwindow RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/mdi/CMakeLists.txt b/examples/widgets/mainwindows/mdi/CMakeLists.txt index fda2522b90e..806e96ed14d 100644 --- a/examples/widgets/mainwindows/mdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/mdi/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mdi WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mdi main.cpp mainwindow.cpp mainwindow.h mdi.qrc @@ -26,4 +26,5 @@ target_link_libraries(mdi PUBLIC install(TARGETS mdi RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/menus/CMakeLists.txt b/examples/widgets/mainwindows/menus/CMakeLists.txt index 1e4d21248e5..92c6fd22846 100644 --- a/examples/widgets/mainwindows/menus/CMakeLists.txt +++ b/examples/widgets/mainwindows/menus/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(menus WIN32 MACOSX_BUNDLE +add_qt_gui_executable(menus main.cpp mainwindow.cpp mainwindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(menus PUBLIC install(TARGETS menus RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/mainwindows/sdi/CMakeLists.txt b/examples/widgets/mainwindows/sdi/CMakeLists.txt index 89c929fc5e5..be09a0c2408 100644 --- a/examples/widgets/mainwindows/sdi/CMakeLists.txt +++ b/examples/widgets/mainwindows/sdi/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sdi WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sdi main.cpp mainwindow.cpp mainwindow.h sdi.qrc @@ -25,4 +25,5 @@ target_link_libraries(sdi PUBLIC install(TARGETS sdi RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/affine/CMakeLists.txt b/examples/widgets/painting/affine/CMakeLists.txt index 4c8d408e9c5..950503d9a79 100644 --- a/examples/widgets/painting/affine/CMakeLists.txt +++ b/examples/widgets/painting/affine/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(affine WIN32 MACOSX_BUNDLE +add_qt_gui_executable(affine # special case: remove files from ../shared affine.qrc main.cpp @@ -30,4 +30,5 @@ target_link_libraries(affine PUBLIC install(TARGETS affine RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/basicdrawing/CMakeLists.txt b/examples/widgets/painting/basicdrawing/CMakeLists.txt index 112334797ff..57a3dd346c3 100644 --- a/examples/widgets/painting/basicdrawing/CMakeLists.txt +++ b/examples/widgets/painting/basicdrawing/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(basicdrawing WIN32 MACOSX_BUNDLE +add_qt_gui_executable(basicdrawing basicdrawing.qrc main.cpp renderarea.cpp renderarea.h @@ -26,4 +26,5 @@ target_link_libraries(basicdrawing PUBLIC install(TARGETS basicdrawing RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/composition/CMakeLists.txt b/examples/widgets/painting/composition/CMakeLists.txt index 930374270ed..48b139edc50 100644 --- a/examples/widgets/painting/composition/CMakeLists.txt +++ b/examples/widgets/painting/composition/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(composition WIN32 MACOSX_BUNDLE +add_qt_gui_executable(composition # special case: remove files from ../shared composition.cpp composition.h composition.qrc main.cpp @@ -29,4 +29,5 @@ target_link_libraries(composition PUBLIC install(TARGETS composition RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/concentriccircles/CMakeLists.txt b/examples/widgets/painting/concentriccircles/CMakeLists.txt index 6005d5e8065..4c26eb1ab34 100644 --- a/examples/widgets/painting/concentriccircles/CMakeLists.txt +++ b/examples/widgets/painting/concentriccircles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(concentriccircles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(concentriccircles circlewidget.cpp circlewidget.h main.cpp window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(concentriccircles PUBLIC install(TARGETS concentriccircles RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/deform/CMakeLists.txt b/examples/widgets/painting/deform/CMakeLists.txt index 56e1a2e9d2f..8e2fa52d19e 100644 --- a/examples/widgets/painting/deform/CMakeLists.txt +++ b/examples/widgets/painting/deform/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(deform WIN32 MACOSX_BUNDLE +add_qt_gui_executable(deform # special case: remove files from ../shared deform.qrc main.cpp @@ -30,4 +30,5 @@ target_link_libraries(deform PUBLIC install(TARGETS deform RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/fontsampler/CMakeLists.txt b/examples/widgets/painting/fontsampler/CMakeLists.txt index e0be3158f2d..ee7ff6b7680 100644 --- a/examples/widgets/painting/fontsampler/CMakeLists.txt +++ b/examples/widgets/painting/fontsampler/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(fontsampler WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fontsampler main.cpp mainwindow.cpp mainwindow.h mainwindowbase.ui @@ -25,4 +25,5 @@ target_link_libraries(fontsampler PUBLIC install(TARGETS fontsampler RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/gradients/CMakeLists.txt b/examples/widgets/painting/gradients/CMakeLists.txt index 69b7fac2947..218efc72a38 100644 --- a/examples/widgets/painting/gradients/CMakeLists.txt +++ b/examples/widgets/painting/gradients/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(gradients WIN32 MACOSX_BUNDLE +add_qt_gui_executable(gradients # special case: remove files from ../shared gradients.cpp gradients.h gradients.qrc main.cpp @@ -29,4 +29,5 @@ target_link_libraries(gradients PUBLIC install(TARGETS gradients RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/imagecomposition/CMakeLists.txt b/examples/widgets/painting/imagecomposition/CMakeLists.txt index 1fcedbcc9fb..4b3e9c78ea5 100644 --- a/examples/widgets/painting/imagecomposition/CMakeLists.txt +++ b/examples/widgets/painting/imagecomposition/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(imagecomposition WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imagecomposition imagecomposer.cpp imagecomposer.h imagecomposition.qrc main.cpp @@ -25,4 +25,5 @@ target_link_libraries(imagecomposition PUBLIC install(TARGETS imagecomposition RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/painterpaths/CMakeLists.txt b/examples/widgets/painting/painterpaths/CMakeLists.txt index 56007a3e548..14fd70f3d34 100644 --- a/examples/widgets/painting/painterpaths/CMakeLists.txt +++ b/examples/widgets/painting/painterpaths/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(painterpaths WIN32 MACOSX_BUNDLE +add_qt_gui_executable(painterpaths main.cpp renderarea.cpp renderarea.h window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(painterpaths PUBLIC install(TARGETS painterpaths RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/pathstroke/CMakeLists.txt b/examples/widgets/painting/pathstroke/CMakeLists.txt index fac73d2a534..f12ccb0b545 100644 --- a/examples/widgets/painting/pathstroke/CMakeLists.txt +++ b/examples/widgets/painting/pathstroke/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(pathstroke WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pathstroke ../shared/arthurstyle.cpp ../shared/arthurstyle.h ../shared/arthurwidgets.cpp ../shared/arthurwidgets.h ../shared/hoverpoints.cpp ../shared/hoverpoints.h @@ -31,4 +31,5 @@ target_link_libraries(pathstroke PUBLIC install(TARGETS pathstroke RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/painting/transformations/CMakeLists.txt b/examples/widgets/painting/transformations/CMakeLists.txt index 3218073a961..baa527d8573 100644 --- a/examples/widgets/painting/transformations/CMakeLists.txt +++ b/examples/widgets/painting/transformations/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(transformations WIN32 MACOSX_BUNDLE +add_qt_gui_executable(transformations main.cpp renderarea.cpp renderarea.h window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(transformations PUBLIC install(TARGETS transformations RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/richtext/calendar/CMakeLists.txt b/examples/widgets/richtext/calendar/CMakeLists.txt index 803deb9243e..f0ce5defc9c 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 4fc3c579192..12406d183a5 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 d70211e24cb..96d824e559c 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 602baa84f27..12b428c6c49 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}" ) diff --git a/examples/widgets/scroller/graphicsview/CMakeLists.txt b/examples/widgets/scroller/graphicsview/CMakeLists.txt index 53ce4ff2477..2f4ab320970 100644 --- a/examples/widgets/scroller/graphicsview/CMakeLists.txt +++ b/examples/widgets/scroller/graphicsview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(graphicsview WIN32 MACOSX_BUNDLE +add_qt_gui_executable(graphicsview main.cpp ) target_link_libraries(graphicsview PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(graphicsview PUBLIC install(TARGETS graphicsview RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/statemachine/eventtransitions/CMakeLists.txt b/examples/widgets/statemachine/eventtransitions/CMakeLists.txt index 21372f8856a..902bc009d07 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 e3832257058..e7eba926c4d 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 e3745a280da..7f255dd4d1c 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 1ae6b511da8..25ca4f45f1f 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 0122fa72cd5..89f05f22ff7 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 6c68cdd2fb5..9c5bf3cb45a 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}" ) diff --git a/examples/widgets/tools/codecs/CMakeLists.txt b/examples/widgets/tools/codecs/CMakeLists.txt index 0bb5f379380..5a1f4297880 100644 --- a/examples/widgets/tools/codecs/CMakeLists.txt +++ b/examples/widgets/tools/codecs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(codecs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(codecs codecs.qrc encodingdialog.cpp encodingdialog.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(codecs PUBLIC install(TARGETS codecs RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/completer/CMakeLists.txt b/examples/widgets/tools/completer/CMakeLists.txt index 8e86cc6b897..855fd54930e 100644 --- a/examples/widgets/tools/completer/CMakeLists.txt +++ b/examples/widgets/tools/completer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(completer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(completer completer.qrc fsmodel.cpp fsmodel.h main.cpp @@ -26,4 +26,5 @@ target_link_libraries(completer PUBLIC install(TARGETS completer RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/customcompleter/CMakeLists.txt b/examples/widgets/tools/customcompleter/CMakeLists.txt index 7ac00d7345a..22481eab5c9 100644 --- a/examples/widgets/tools/customcompleter/CMakeLists.txt +++ b/examples/widgets/tools/customcompleter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(customcompleter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(customcompleter customcompleter.qrc main.cpp mainwindow.cpp mainwindow.h @@ -26,4 +26,5 @@ target_link_libraries(customcompleter PUBLIC install(TARGETS customcompleter RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt index 20615d1e3bc..bb5ec4c96a4 100644 --- a/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt +++ b/examples/widgets/tools/echoplugin/echowindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(echopluginwindow WIN32 MACOSX_BUNDLE # special case: renamed target +add_qt_gui_executable(echopluginwindow # special case: renamed target echointerface.h echowindow.cpp echowindow.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(echopluginwindow PUBLIC # special case: renamed target install(TARGETS echopluginwindow # special case: renamed target RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/i18n/CMakeLists.txt b/examples/widgets/tools/i18n/CMakeLists.txt index a0347d8453f..45d51351ba1 100644 --- a/examples/widgets/tools/i18n/CMakeLists.txt +++ b/examples/widgets/tools/i18n/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(i18n WIN32 MACOSX_BUNDLE +add_qt_gui_executable(i18n i18n.qrc languagechooser.cpp languagechooser.h main.cpp @@ -26,4 +26,5 @@ target_link_libraries(i18n PUBLIC install(TARGETS i18n RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt index a7c642a1beb..54c6b153104 100644 --- a/examples/widgets/tools/plugandpaint/app/CMakeLists.txt +++ b/examples/widgets/tools/plugandpaint/app/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(plugandpaint WIN32 MACOSX_BUNDLE +add_qt_gui_executable(plugandpaint interfaces.h main.cpp mainwindow.cpp mainwindow.h @@ -30,4 +30,5 @@ target_link_libraries(plugandpaint PUBLIC pnp_basictools) # special case install(TARGETS plugandpaint RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/regexp/CMakeLists.txt b/examples/widgets/tools/regexp/CMakeLists.txt index 0b64cf06f8e..8e3eb4abe8f 100644 --- a/examples/widgets/tools/regexp/CMakeLists.txt +++ b/examples/widgets/tools/regexp/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(regexp WIN32 MACOSX_BUNDLE +add_qt_gui_executable(regexp main.cpp regexpdialog.cpp regexpdialog.h ) @@ -24,4 +24,5 @@ target_link_libraries(regexp PUBLIC install(TARGETS regexp RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/regularexpression/CMakeLists.txt b/examples/widgets/tools/regularexpression/CMakeLists.txt index a9ce374ce22..dcd69756b4f 100644 --- a/examples/widgets/tools/regularexpression/CMakeLists.txt +++ b/examples/widgets/tools/regularexpression/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(regularexpression WIN32 MACOSX_BUNDLE +add_qt_gui_executable(regularexpression main.cpp regularexpression.qrc regularexpressiondialog.cpp regularexpressiondialog.h @@ -25,4 +25,5 @@ target_link_libraries(regularexpression PUBLIC install(TARGETS regularexpression RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/settingseditor/CMakeLists.txt b/examples/widgets/tools/settingseditor/CMakeLists.txt index 49a014e3590..77177beaddc 100644 --- a/examples/widgets/tools/settingseditor/CMakeLists.txt +++ b/examples/widgets/tools/settingseditor/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(settingseditor WIN32 MACOSX_BUNDLE +add_qt_gui_executable(settingseditor locationdialog.cpp locationdialog.h main.cpp mainwindow.cpp mainwindow.h @@ -27,4 +27,5 @@ target_link_libraries(settingseditor PUBLIC install(TARGETS settingseditor RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt index 6e470824711..f23d53c3aa4 100644 --- a/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt +++ b/examples/widgets/tools/styleplugin/stylewindow/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(styleplugin WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styleplugin main.cpp stylewindow.cpp stylewindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(styleplugin PUBLIC install(TARGETS styleplugin RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt index 9fa16e06dd0..d8f3dff9298 100644 --- a/examples/widgets/tools/treemodelcompleter/CMakeLists.txt +++ b/examples/widgets/tools/treemodelcompleter/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(treemodelcompleter WIN32 MACOSX_BUNDLE +add_qt_gui_executable(treemodelcompleter main.cpp mainwindow.cpp mainwindow.h treemodelcompleter.cpp treemodelcompleter.h treemodelcompleter.qrc @@ -25,4 +25,5 @@ target_link_libraries(treemodelcompleter PUBLIC install(TARGETS treemodelcompleter RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/undo/CMakeLists.txt b/examples/widgets/tools/undo/CMakeLists.txt index bc4a8762113..c8188b8f0f7 100644 --- a/examples/widgets/tools/undo/CMakeLists.txt +++ b/examples/widgets/tools/undo/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(undo WIN32 MACOSX_BUNDLE +add_qt_gui_executable(undo commands.cpp commands.h document.cpp document.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(undo PUBLIC install(TARGETS undo RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tools/undoframework/CMakeLists.txt b/examples/widgets/tools/undoframework/CMakeLists.txt index 064cb651507..27672edd825 100644 --- a/examples/widgets/tools/undoframework/CMakeLists.txt +++ b/examples/widgets/tools/undoframework/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(undoframework WIN32 MACOSX_BUNDLE +add_qt_gui_executable(undoframework commands.cpp commands.h diagramitem.cpp diagramitem.h diagramscene.cpp diagramscene.h @@ -28,4 +28,5 @@ target_link_libraries(undoframework PUBLIC install(TARGETS undoframework RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/dials/CMakeLists.txt b/examples/widgets/touch/dials/CMakeLists.txt index fa31852b3df..2bfe6b78cf5 100644 --- a/examples/widgets/touch/dials/CMakeLists.txt +++ b/examples/widgets/touch/dials/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dials WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dials dials.ui main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(dials PUBLIC install(TARGETS dials RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/fingerpaint/CMakeLists.txt b/examples/widgets/touch/fingerpaint/CMakeLists.txt index 606e6bbc64f..4ba2710e671 100644 --- a/examples/widgets/touch/fingerpaint/CMakeLists.txt +++ b/examples/widgets/touch/fingerpaint/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(fingerpaint WIN32 MACOSX_BUNDLE +add_qt_gui_executable(fingerpaint main.cpp mainwindow.cpp mainwindow.h scribblearea.cpp scribblearea.h @@ -31,4 +31,5 @@ endif() install(TARGETS fingerpaint RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/knobs/CMakeLists.txt b/examples/widgets/touch/knobs/CMakeLists.txt index c23a11f0247..55f9820f68b 100644 --- a/examples/widgets/touch/knobs/CMakeLists.txt +++ b/examples/widgets/touch/knobs/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(knobs WIN32 MACOSX_BUNDLE +add_qt_gui_executable(knobs knob.cpp knob.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(knobs PUBLIC install(TARGETS knobs RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/touch/pinchzoom/CMakeLists.txt b/examples/widgets/touch/pinchzoom/CMakeLists.txt index 44951db7277..f0cece0acd6 100644 --- a/examples/widgets/touch/pinchzoom/CMakeLists.txt +++ b/examples/widgets/touch/pinchzoom/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(pinchzoom WIN32 MACOSX_BUNDLE +add_qt_gui_executable(pinchzoom graphicsview.cpp graphicsview.h main.cpp mice.qrc @@ -26,4 +26,5 @@ target_link_libraries(pinchzoom PUBLIC install(TARGETS pinchzoom RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt index 6c333420f49..07ff78f7d36 100644 --- a/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part1/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part1 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part1 addressbook.cpp addressbook.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(part1 PUBLIC install(TARGETS part1 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt index 2c5d438bc5b..28a3a6a472f 100644 --- a/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part2/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part2 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part2 addressbook.cpp addressbook.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(part2 PUBLIC install(TARGETS part2 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt index 5be04b1e2f3..d8d1147306e 100644 --- a/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part3/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part3 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part3 addressbook.cpp addressbook.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(part3 PUBLIC install(TARGETS part3 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt index 309e8eea668..9818a511818 100644 --- a/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part4/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part4 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part4 addressbook.cpp addressbook.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(part4 PUBLIC install(TARGETS part4 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt index 9d73fd0e96e..6ddf50aac72 100644 --- a/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part5/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part5 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part5 addressbook.cpp addressbook.h finddialog.cpp finddialog.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(part5 PUBLIC install(TARGETS part5 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt index 015a4cb244e..75b75924848 100644 --- a/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part6/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part6 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part6 addressbook.cpp addressbook.h finddialog.cpp finddialog.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(part6 PUBLIC install(TARGETS part6 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt index acb3a2903ba..5dcb53e470a 100644 --- a/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt +++ b/examples/widgets/tutorials/addressbook/part7/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part7 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part7 addressbook.cpp addressbook.h finddialog.cpp finddialog.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(part7 PUBLIC install(TARGETS part7 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt index c148f20a035..739d1384d97 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part1/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part1 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part1 main.cpp ) target_link_libraries(part1 PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(part1 PUBLIC install(TARGETS part1 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt index ddbef50ca23..db6bfc8beaa 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part2/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part2 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part2 main.cpp ) target_link_libraries(part2 PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(part2 PUBLIC install(TARGETS part2 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt index 66cd8827cfa..f1cc350d1e8 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part3/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part3 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part3 main.cpp ) target_link_libraries(part3 PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(part3 PUBLIC install(TARGETS part3 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt index 0c7b9f62f97..bfd358f3819 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part4/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part4 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part4 main.cpp ) target_link_libraries(part4 PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(part4 PUBLIC install(TARGETS part4 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt index 4fc0df77b78..006b1a6ea5a 100644 --- a/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt +++ b/examples/widgets/tutorials/gettingStarted/gsQt/part5/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(part5 WIN32 MACOSX_BUNDLE +add_qt_gui_executable(part5 main.cpp ) target_link_libraries(part5 PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(part5 PUBLIC install(TARGETS part5 RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt index ee859409e51..001f6d80702 100644 --- a/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/1_readonly/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_readonly WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_readonly main.cpp mymodel.cpp mymodel.h ) @@ -24,4 +24,5 @@ target_link_libraries(mv_readonly PUBLIC install(TARGETS mv_readonly RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt index 75c5f431c1e..6b9d5732cf6 100644 --- a/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/2_formatting/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_formatting WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_formatting main.cpp mymodel.cpp mymodel.h ) @@ -24,4 +24,5 @@ target_link_libraries(mv_formatting PUBLIC install(TARGETS mv_formatting RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt index 60d240f1704..52c4ddfc38c 100644 --- a/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/3_changingmodel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_changingmodel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_changingmodel main.cpp mymodel.cpp mymodel.h ) @@ -24,4 +24,5 @@ target_link_libraries(mv_changingmodel PUBLIC install(TARGETS mv_changingmodel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt index b719caf8ecb..b248a47f57a 100644 --- a/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/4_headers/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_headers WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_headers main.cpp mymodel.cpp mymodel.h ) @@ -24,4 +24,5 @@ target_link_libraries(mv_headers PUBLIC install(TARGETS mv_headers RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt index 67c34521f49..d40e8674d8d 100644 --- a/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/5_edit/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_edit WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_edit main.cpp mainwindow.cpp mainwindow.h mymodel.cpp mymodel.h @@ -25,4 +25,5 @@ target_link_libraries(mv_edit PUBLIC install(TARGETS mv_edit RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt index 2feb364569d..592f7bb5281 100644 --- a/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/6_treeview/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_tree WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_tree main.cpp mainwindow.cpp mainwindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(mv_tree PUBLIC install(TARGETS mv_tree RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt index a974313bd75..65b58dfa74c 100644 --- a/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt +++ b/examples/widgets/tutorials/modelview/7_selections/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mv_selections WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mv_selections main.cpp mainwindow.cpp mainwindow.h ) @@ -24,4 +24,5 @@ target_link_libraries(mv_selections PUBLIC install(TARGETS mv_selections RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/notepad/CMakeLists.txt b/examples/widgets/tutorials/notepad/CMakeLists.txt index 44606d522c8..2d1b13e469c 100644 --- a/examples/widgets/tutorials/notepad/CMakeLists.txt +++ b/examples/widgets/tutorials/notepad/CMakeLists.txt @@ -14,7 +14,7 @@ set(CMAKE_AUTOUIC ON) set(INSTALL_EXAMPLEDIR "examples") -add_qt_gui_executable(notepad WIN32 MACOSX_BUNDLE +add_qt_gui_executable(notepad main.cpp notepad.cpp notepad.h notepad.qrc notepad.ui ) @@ -32,4 +32,5 @@ endif() install(TARGETS notepad RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt index b5fb51c77df..f6192757b2a 100644 --- a/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/childwidget/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(childwidget WIN32 MACOSX_BUNDLE +add_qt_gui_executable(childwidget main.cpp ) target_link_libraries(childwidget PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(childwidget PUBLIC install(TARGETS childwidget RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt index e963dd77f31..59f0053c1e3 100644 --- a/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/nestedlayouts/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(nestedlayouts WIN32 MACOSX_BUNDLE +add_qt_gui_executable(nestedlayouts main.cpp ) target_link_libraries(nestedlayouts PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(nestedlayouts PUBLIC install(TARGETS nestedlayouts RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt index b607403c55c..033746d0d77 100644 --- a/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/toplevel/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(toplevel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(toplevel main.cpp ) target_link_libraries(toplevel PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(toplevel PUBLIC install(TARGETS toplevel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt index a9db86bccf5..3f3335d9e70 100644 --- a/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt +++ b/examples/widgets/tutorials/widgets/windowlayout/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(windowlayout WIN32 MACOSX_BUNDLE +add_qt_gui_executable(windowlayout main.cpp ) target_link_libraries(windowlayout PUBLIC @@ -23,4 +23,5 @@ target_link_libraries(windowlayout PUBLIC install(TARGETS windowlayout RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/analogclock/CMakeLists.txt b/examples/widgets/widgets/analogclock/CMakeLists.txt index 32ed38e46a8..7debc7114b8 100644 --- a/examples/widgets/widgets/analogclock/CMakeLists.txt +++ b/examples/widgets/widgets/analogclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(analogclock WIN32 MACOSX_BUNDLE +add_qt_gui_executable(analogclock analogclock.cpp analogclock.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(analogclock PUBLIC install(TARGETS analogclock RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/calculator/CMakeLists.txt b/examples/widgets/widgets/calculator/CMakeLists.txt index cd8a8372817..9b689b58c0e 100644 --- a/examples/widgets/widgets/calculator/CMakeLists.txt +++ b/examples/widgets/widgets/calculator/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(calculator WIN32 MACOSX_BUNDLE +add_qt_gui_executable(calculator button.cpp button.h calculator.cpp calculator.h main.cpp @@ -25,4 +25,5 @@ target_link_libraries(calculator PUBLIC install(TARGETS calculator RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/calendarwidget/CMakeLists.txt b/examples/widgets/widgets/calendarwidget/CMakeLists.txt index 4c09d47a170..4d6f7b74782 100644 --- a/examples/widgets/widgets/calendarwidget/CMakeLists.txt +++ b/examples/widgets/widgets/calendarwidget/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(calendarwidget WIN32 MACOSX_BUNDLE +add_qt_gui_executable(calendarwidget main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(calendarwidget PUBLIC install(TARGETS calendarwidget RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/charactermap/CMakeLists.txt b/examples/widgets/widgets/charactermap/CMakeLists.txt index fdd5d75b26e..51bb16ba5eb 100644 --- a/examples/widgets/widgets/charactermap/CMakeLists.txt +++ b/examples/widgets/widgets/charactermap/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(charactermap WIN32 MACOSX_BUNDLE +add_qt_gui_executable(charactermap characterwidget.cpp characterwidget.h main.cpp mainwindow.cpp mainwindow.h @@ -25,4 +25,5 @@ target_link_libraries(charactermap PUBLIC install(TARGETS charactermap RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/codeeditor/CMakeLists.txt b/examples/widgets/widgets/codeeditor/CMakeLists.txt index 8e3e3dbdc1d..8d60821cf81 100644 --- a/examples/widgets/widgets/codeeditor/CMakeLists.txt +++ b/examples/widgets/widgets/codeeditor/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(codeeditor WIN32 MACOSX_BUNDLE +add_qt_gui_executable(codeeditor codeeditor.cpp codeeditor.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(codeeditor PUBLIC install(TARGETS codeeditor RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/digitalclock/CMakeLists.txt b/examples/widgets/widgets/digitalclock/CMakeLists.txt index 978d208b954..463209b2dbc 100644 --- a/examples/widgets/widgets/digitalclock/CMakeLists.txt +++ b/examples/widgets/widgets/digitalclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(digitalclock WIN32 MACOSX_BUNDLE +add_qt_gui_executable(digitalclock digitalclock.cpp digitalclock.h main.cpp ) @@ -24,4 +24,5 @@ target_link_libraries(digitalclock PUBLIC install(TARGETS digitalclock RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/elidedlabel/CMakeLists.txt b/examples/widgets/widgets/elidedlabel/CMakeLists.txt index e21f5a1e15e..fece6e4db99 100644 --- a/examples/widgets/widgets/elidedlabel/CMakeLists.txt +++ b/examples/widgets/widgets/elidedlabel/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(elidedlabel WIN32 MACOSX_BUNDLE +add_qt_gui_executable(elidedlabel elidedlabel.cpp elidedlabel.h main.cpp testwidget.cpp testwidget.h @@ -29,4 +29,5 @@ target_link_libraries(elidedlabel PUBLIC install(TARGETS elidedlabel RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/groupbox/CMakeLists.txt b/examples/widgets/widgets/groupbox/CMakeLists.txt index f6d2769a65b..c5b3faaa402 100644 --- a/examples/widgets/widgets/groupbox/CMakeLists.txt +++ b/examples/widgets/widgets/groupbox/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(groupbox WIN32 MACOSX_BUNDLE +add_qt_gui_executable(groupbox main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(groupbox PUBLIC install(TARGETS groupbox RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/icons/CMakeLists.txt b/examples/widgets/widgets/icons/CMakeLists.txt index 0306ff69204..1b489d06b28 100644 --- a/examples/widgets/widgets/icons/CMakeLists.txt +++ b/examples/widgets/widgets/icons/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(icons WIN32 MACOSX_BUNDLE +add_qt_gui_executable(icons iconpreviewarea.cpp iconpreviewarea.h iconsizespinbox.cpp iconsizespinbox.h imagedelegate.cpp imagedelegate.h @@ -29,4 +29,5 @@ target_link_libraries(icons PUBLIC install(TARGETS icons RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/imageviewer/CMakeLists.txt b/examples/widgets/widgets/imageviewer/CMakeLists.txt index 3bdcc27d9e3..6f06a01b499 100644 --- a/examples/widgets/widgets/imageviewer/CMakeLists.txt +++ b/examples/widgets/widgets/imageviewer/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(imageviewer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(imageviewer imageviewer.cpp imageviewer.h main.cpp ) @@ -30,4 +30,5 @@ endif() install(TARGETS imageviewer RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/lineedits/CMakeLists.txt b/examples/widgets/widgets/lineedits/CMakeLists.txt index 0d39f973152..035b0c5fd55 100644 --- a/examples/widgets/widgets/lineedits/CMakeLists.txt +++ b/examples/widgets/widgets/lineedits/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(lineedits WIN32 MACOSX_BUNDLE +add_qt_gui_executable(lineedits main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(lineedits PUBLIC install(TARGETS lineedits RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/mousebuttons/CMakeLists.txt b/examples/widgets/widgets/mousebuttons/CMakeLists.txt index a2bf41193be..acba290da07 100644 --- a/examples/widgets/widgets/mousebuttons/CMakeLists.txt +++ b/examples/widgets/widgets/mousebuttons/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Core) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(mousebuttons WIN32 MACOSX_BUNDLE +add_qt_gui_executable(mousebuttons buttontester.cpp buttontester.h main.cpp ) @@ -26,4 +26,5 @@ target_link_libraries(mousebuttons PUBLIC install(TARGETS mousebuttons RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/movie/CMakeLists.txt b/examples/widgets/widgets/movie/CMakeLists.txt index 46c84740026..ea82d7ee5a7 100644 --- a/examples/widgets/widgets/movie/CMakeLists.txt +++ b/examples/widgets/widgets/movie/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(movie WIN32 MACOSX_BUNDLE +add_qt_gui_executable(movie main.cpp movieplayer.cpp movieplayer.h ) @@ -24,4 +24,5 @@ target_link_libraries(movie PUBLIC install(TARGETS movie RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/scribble/CMakeLists.txt b/examples/widgets/widgets/scribble/CMakeLists.txt index 9fb19a64429..3363c47ba57 100644 --- a/examples/widgets/widgets/scribble/CMakeLists.txt +++ b/examples/widgets/widgets/scribble/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(scribble WIN32 MACOSX_BUNDLE +add_qt_gui_executable(scribble main.cpp mainwindow.cpp mainwindow.h scribblearea.cpp scribblearea.h @@ -31,4 +31,5 @@ endif() install(TARGETS scribble RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/shapedclock/CMakeLists.txt b/examples/widgets/widgets/shapedclock/CMakeLists.txt index 60e2bd208e0..c01243d09ee 100644 --- a/examples/widgets/widgets/shapedclock/CMakeLists.txt +++ b/examples/widgets/widgets/shapedclock/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(shapedclock WIN32 MACOSX_BUNDLE +add_qt_gui_executable(shapedclock main.cpp shapedclock.cpp shapedclock.h ) @@ -24,4 +24,5 @@ target_link_libraries(shapedclock PUBLIC install(TARGETS shapedclock RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/sliders/CMakeLists.txt b/examples/widgets/widgets/sliders/CMakeLists.txt index db365140074..11402b467e1 100644 --- a/examples/widgets/widgets/sliders/CMakeLists.txt +++ b/examples/widgets/widgets/sliders/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(sliders WIN32 MACOSX_BUNDLE +add_qt_gui_executable(sliders main.cpp slidersgroup.cpp slidersgroup.h window.cpp window.h @@ -25,4 +25,5 @@ target_link_libraries(sliders PUBLIC install(TARGETS sliders RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/spinboxes/CMakeLists.txt b/examples/widgets/widgets/spinboxes/CMakeLists.txt index 6bb7618f6b1..ae9f577b747 100644 --- a/examples/widgets/widgets/spinboxes/CMakeLists.txt +++ b/examples/widgets/widgets/spinboxes/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(spinboxes WIN32 MACOSX_BUNDLE +add_qt_gui_executable(spinboxes main.cpp window.cpp window.h ) @@ -24,4 +24,5 @@ target_link_libraries(spinboxes PUBLIC install(TARGETS spinboxes RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/styles/CMakeLists.txt b/examples/widgets/widgets/styles/CMakeLists.txt index fd639e17ed3..f9d83dc3b26 100644 --- a/examples/widgets/widgets/styles/CMakeLists.txt +++ b/examples/widgets/widgets/styles/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(styles WIN32 MACOSX_BUNDLE +add_qt_gui_executable(styles main.cpp norwegianwoodstyle.cpp norwegianwoodstyle.h styles.qrc @@ -26,4 +26,5 @@ target_link_libraries(styles PUBLIC install(TARGETS styles RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/stylesheet/CMakeLists.txt b/examples/widgets/widgets/stylesheet/CMakeLists.txt index 0a38fdd3e5f..574acc88a55 100644 --- a/examples/widgets/widgets/stylesheet/CMakeLists.txt +++ b/examples/widgets/widgets/stylesheet/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(stylesheet WIN32 MACOSX_BUNDLE +add_qt_gui_executable(stylesheet main.cpp mainwindow.cpp mainwindow.h mainwindow.ui stylesheet.qrc @@ -26,4 +26,5 @@ target_link_libraries(stylesheet PUBLIC install(TARGETS stylesheet RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/tablet/CMakeLists.txt b/examples/widgets/widgets/tablet/CMakeLists.txt index ee9e2b7e269..568d9c17d7d 100644 --- a/examples/widgets/widgets/tablet/CMakeLists.txt +++ b/examples/widgets/widgets/tablet/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(qttablet WIN32 MACOSX_BUNDLE +add_qt_gui_executable(qttablet images.qrc main.cpp mainwindow.cpp mainwindow.h @@ -27,4 +27,5 @@ target_link_libraries(qttablet PUBLIC install(TARGETS qttablet RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/tetrix/CMakeLists.txt b/examples/widgets/widgets/tetrix/CMakeLists.txt index 205a0d27445..8da13d1f237 100644 --- a/examples/widgets/widgets/tetrix/CMakeLists.txt +++ b/examples/widgets/widgets/tetrix/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(tetrix WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tetrix main.cpp tetrixboard.cpp tetrixboard.h tetrixpiece.cpp tetrixpiece.h @@ -26,4 +26,5 @@ target_link_libraries(tetrix PUBLIC install(TARGETS tetrix RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/tooltips/CMakeLists.txt b/examples/widgets/widgets/tooltips/CMakeLists.txt index 038a8881f2c..085da5b7e18 100644 --- a/examples/widgets/widgets/tooltips/CMakeLists.txt +++ b/examples/widgets/widgets/tooltips/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(tooltips WIN32 MACOSX_BUNDLE +add_qt_gui_executable(tooltips main.cpp shapeitem.cpp shapeitem.h sortingbox.cpp sortingbox.h @@ -26,4 +26,5 @@ target_link_libraries(tooltips PUBLIC install(TARGETS tooltips RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/validators/CMakeLists.txt b/examples/widgets/widgets/validators/CMakeLists.txt index 5ed36901581..be9fdb1cd2b 100644 --- a/examples/widgets/widgets/validators/CMakeLists.txt +++ b/examples/widgets/widgets/validators/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(validators WIN32 MACOSX_BUNDLE +add_qt_gui_executable(validators ledwidget.cpp ledwidget.h localeselector.cpp localeselector.h main.cpp @@ -27,4 +27,5 @@ target_link_libraries(validators PUBLIC install(TARGETS validators RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/wiggly/CMakeLists.txt b/examples/widgets/widgets/wiggly/CMakeLists.txt index da0e64a8644..0e721370ba9 100644 --- a/examples/widgets/widgets/wiggly/CMakeLists.txt +++ b/examples/widgets/widgets/wiggly/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(wiggly WIN32 MACOSX_BUNDLE +add_qt_gui_executable(wiggly dialog.cpp dialog.h main.cpp wigglywidget.cpp wigglywidget.h @@ -25,4 +25,5 @@ target_link_libraries(wiggly PUBLIC install(TARGETS wiggly RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/widgets/windowflags/CMakeLists.txt b/examples/widgets/widgets/windowflags/CMakeLists.txt index f7da42114d1..4b6d325db51 100644 --- a/examples/widgets/widgets/windowflags/CMakeLists.txt +++ b/examples/widgets/widgets/windowflags/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(windowflags WIN32 MACOSX_BUNDLE +add_qt_gui_executable(windowflags controllerwindow.cpp controllerwindow.h main.cpp previewwindow.cpp previewwindow.h @@ -25,4 +25,5 @@ target_link_libraries(windowflags PUBLIC install(TARGETS windowflags RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/widgets/windowcontainer/CMakeLists.txt b/examples/widgets/windowcontainer/CMakeLists.txt index 80c8897c9b3..16269348305 100644 --- a/examples/widgets/windowcontainer/CMakeLists.txt +++ b/examples/widgets/windowcontainer/CMakeLists.txt @@ -13,7 +13,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(windowcontainer WIN32 MACOSX_BUNDLE +add_qt_gui_executable(windowcontainer ../../gui/openglwindow/openglwindow.cpp ../../gui/openglwindow/openglwindow.h windowcontainer.cpp ) @@ -27,4 +27,5 @@ target_link_libraries(windowcontainer PUBLIC install(TARGETS windowcontainer RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/dombookmarks/CMakeLists.txt b/examples/xml/dombookmarks/CMakeLists.txt index 95e58c6025c..f570fe49c50 100644 --- a/examples/xml/dombookmarks/CMakeLists.txt +++ b/examples/xml/dombookmarks/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(dombookmarks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(dombookmarks main.cpp mainwindow.cpp mainwindow.h xbeltree.cpp xbeltree.h @@ -26,4 +26,5 @@ target_link_libraries(dombookmarks PUBLIC install(TARGETS dombookmarks RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/htmlinfo/CMakeLists.txt b/examples/xml/htmlinfo/CMakeLists.txt index 00ecced0c56..737d4685e5e 100644 --- a/examples/xml/htmlinfo/CMakeLists.txt +++ b/examples/xml/htmlinfo/CMakeLists.txt @@ -22,4 +22,5 @@ target_link_libraries(htmlinfo PUBLIC install(TARGETS htmlinfo RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/rsslisting/CMakeLists.txt b/examples/xml/rsslisting/CMakeLists.txt index 09879771ba5..b013404de3f 100644 --- a/examples/xml/rsslisting/CMakeLists.txt +++ b/examples/xml/rsslisting/CMakeLists.txt @@ -15,7 +15,7 @@ find_package(Qt5 COMPONENTS Network) find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(rsslisting WIN32 MACOSX_BUNDLE +add_qt_gui_executable(rsslisting main.cpp rsslisting.cpp rsslisting.h ) @@ -27,4 +27,5 @@ target_link_libraries(rsslisting PUBLIC install(TARGETS rsslisting RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/saxbookmarks/CMakeLists.txt b/examples/xml/saxbookmarks/CMakeLists.txt index d5d8bba53a9..79ce88f182b 100644 --- a/examples/xml/saxbookmarks/CMakeLists.txt +++ b/examples/xml/saxbookmarks/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(saxbookmarks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(saxbookmarks main.cpp mainwindow.cpp mainwindow.h xbelgenerator.cpp xbelgenerator.h @@ -27,4 +27,5 @@ target_link_libraries(saxbookmarks PUBLIC install(TARGETS saxbookmarks RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/streambookmarks/CMakeLists.txt b/examples/xml/streambookmarks/CMakeLists.txt index 3393c47a665..6a93d8b18cb 100644 --- a/examples/xml/streambookmarks/CMakeLists.txt +++ b/examples/xml/streambookmarks/CMakeLists.txt @@ -14,7 +14,7 @@ set(INSTALL_EXAMPLEDIR "examples") find_package(Qt5 COMPONENTS Xml) find_package(Qt5 COMPONENTS Widgets) -add_qt_gui_executable(streambookmarks WIN32 MACOSX_BUNDLE +add_qt_gui_executable(streambookmarks main.cpp mainwindow.cpp mainwindow.h xbelreader.cpp xbelreader.h @@ -27,4 +27,5 @@ target_link_libraries(streambookmarks PUBLIC install(TARGETS streambookmarks RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/examples/xml/xmlstreamlint/CMakeLists.txt b/examples/xml/xmlstreamlint/CMakeLists.txt index a3677a2c814..d67f25c4331 100644 --- a/examples/xml/xmlstreamlint/CMakeLists.txt +++ b/examples/xml/xmlstreamlint/CMakeLists.txt @@ -23,4 +23,5 @@ target_link_libraries(xmlstreamlint PUBLIC install(TARGETS xmlstreamlint RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 8d4943aa3f3..7b4c7e9d3b2 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() diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 5e4e9abc9e6..28724b1fc05 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1712,8 +1712,6 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, write_find_package_section(cm_fh, public_libs, private_libs, indent=indent) add_executable = 'add_{}executable({}'.format("qt_gui_" if gui else "", binary_name); - if gui: - add_executable += ' WIN32 MACOSX_BUNDLE' write_all_source_file_lists(cm_fh, scope, add_executable, indent=0, extra_keys=['RESOURCES']) @@ -1733,6 +1731,7 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, cm_fh.write('\ninstall(TARGETS {}\n'.format(binary_name) + ' RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + ' BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + + ' LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"\n' + ')\n') From 319fd4ea9ae89874671296c33880805c401844c9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 12 Jun 2019 13:09:13 +0200 Subject: [PATCH 0663/1322] Make WinMain linkage compatible with Qt 5 In Qt 5, the Qt5Core target was extended by Qt5CoreConfigExtras.cmake to have a generator expression as interface linkage that would conditionally link WinMain. This patch implements the same through regular interface linkage right in corelib. Since the linkage happens through a generator expression, our dependency generator does not see this as a dependency. Therefore we add this as an unconditional package dependency for corelib, on Windows. In theory this could be done also in winmain's CMakeLists.txt, as targets can be extended outside of their directory. However this adds a directory id (WinMain:@<023423>) to the linkage, which mysteriously is not removed on the exported core target. Change-Id: If2abb9ba790f51274f582c9ec28c13d968b84302 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- cmake/QtPostProcess.cmake | 5 +++++ src/corelib/CMakeLists.txt | 11 +++++++++++ src/corelib/Qt5CoreMacros.cmake | 4 ---- src/winmain/CMakeLists.txt | 2 -- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index 24f0621fc4d..dc165148257 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -59,6 +59,11 @@ function(qt_internal_create_module_depends_file target) get_target_property(target_deps "${target}" _qt_target_deps) set(target_deps_seen "") + get_target_property(extra_depends "${target}" QT_EXTRA_PACKAGE_DEPENDENCIES) + if(NOT extra_depends STREQUAL "${extra_depends}-NOTFOUND") + list(APPEND target_deps ${extra_depends}) + endif() + set(qtdeps "") set(third_party_deps "") set(third_party_deps_seen "") diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 1932af8b6d3..f6571df7c6a 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -1080,6 +1080,17 @@ if(WIN32) endif() qt_internal_add_link_flags_gc_sections(Core PRIVATE) + +if(WIN32) + set(isExe $,EXECUTABLE>) + set(isWin32 $>) + set(isNotExcluded $>>) + set(isPolicyNEW $) + + target_link_libraries(Core INTERFACE $<$:Qt::WinMain>) + qt_internal_module_info(win_main_module WinMain) + set_property(TARGET Core APPEND PROPERTY QT_EXTRA_PACKAGE_DEPENDENCIES "${win_main_module_versioned}\\\;${PROJECT_VERSION}") +endif() # special case end qt_create_tracepoints(Core qtcore.tracepoints) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 7b4c7e9d3b2..738816ee4e9 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -397,10 +397,6 @@ function(add_qt_gui_executable target) endif() target_link_libraries("${target}" PRIVATE Qt::Core Qt::Gui) - if(WIN32) - target_link_libraries("${target}" PRIVATE Qt::WinMain) - endif() - if(ANDROID) qt_android_generate_deployment_settings("${target}") endif() diff --git a/src/winmain/CMakeLists.txt b/src/winmain/CMakeLists.txt index 10c3252f432..1095a0e907f 100644 --- a/src/winmain/CMakeLists.txt +++ b/src/winmain/CMakeLists.txt @@ -23,6 +23,4 @@ extend_target(WinMain CONDITION NOT WINRT extend_target(WinMain CONDITION MINGW DEFINES QT_NEEDS_QMAIN ) - -extend_target(Core LIBRARIES WinMain) # special case end From fbfa067a304e8aea6ba6719395fd12a05688b6f8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 12 Jun 2019 15:08:24 +0200 Subject: [PATCH 0664/1322] Fix static builds There were a few issues: - Third party dependency info for plugins was not generated, because the depends and public_depends variables were not fetched. This caused issues when trying to use the qcocoa plugin in a consuming application, because Cups::Cups was not found. - Privately linked libraries in extend_target were not considered when generating dependency info for modules. This caused issues in QtThemeSupport, becauese it could not find Qt::DBus, due to that target only being added as a private library in a conditional scope. - Make sure to handle privately linked internal modules like PlatformModuleInternal to map to the Qt5 package, because there is no standalone package for it. Also remove a TODO comment that says that qt_register_target_dependencies should maybe be called in extend_target. That's already the case. Change-Id: Ie99c52e800cd89e6f82008f1e38f4da5cd602929 Reviewed-by: Qt CMake Build Bot Reviewed-by: Tobias Hunger --- cmake/QtBuild.cmake | 11 +++++++---- cmake/QtPostProcess.cmake | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 67c80ab2d68..3058e22bb51 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -766,12 +766,13 @@ function(qt_register_target_dependencies target public_libs private_libs) set(target_deps "") endif() - # TODO: should this also be in extend_target ? From the looks of it I would say that - # it is not necessary but I'm not sure foreach(lib IN LISTS public_libs private_libs) if ("${lib}" MATCHES "^Qt::(.*)") set(lib "${CMAKE_MATCH_1}") - if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig) + if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig + OR lib STREQUAL PlatformModuleInternal + OR lib STREQUAL PlatformPluginInternal + OR lib STREQUAL PlatformToolInternal) list(APPEND target_deps "Qt5\;${PROJECT_VERSION}") elseif ("${lib}" MATCHES "(.*)Private") list(APPEND target_deps "${INSTALL_CMAKE_NAMESPACE}${CMAKE_MATCH_1}\;${PROJECT_VERSION}") @@ -871,7 +872,9 @@ function(extend_target target) if(TARGET "${target_private}") target_link_libraries("${target_private}" INTERFACE "${target}" "${qt_libs_private}") endif() - qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}") + qt_register_target_dependencies("${target}" + "${arg_PUBLIC_LIBRARIES}" + "${qt_libs_private};${arg_LIBRARIES}") qt_autogen_tools(${target} diff --git a/cmake/QtPostProcess.cmake b/cmake/QtPostProcess.cmake index dc165148257..568719d4f0b 100644 --- a/cmake/QtPostProcess.cmake +++ b/cmake/QtPostProcess.cmake @@ -171,6 +171,8 @@ endfunction() function(qt_internal_create_plugin_depends_file target) get_target_property(qt_module "${target}" QT_MODULE) + get_target_property(depends "${target}" LINK_LIBRARIES) + get_target_property(public_depends "${target}" INTERFACE_LINK_LIBRARIES) get_target_property(target_deps "${target}" _qt_target_deps) set(target_deps_seen "") From bf0ee8c4e8d831151ee882f8491a30d1eee6558b Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 12 Jun 2019 17:43:25 +0200 Subject: [PATCH 0665/1322] Fix the 'Fix static builds' commit The GlobalConfigPrivate target should also be filtered out when registering target dependencies, because there's no standalone Qt5GlobalConfigPrivate.cmake file. Amends fbfa067a304e8aea6ba6719395fd12a05688b6f8. Change-Id: If89732bc2fd004b9644959f71339e22210483d7c Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 3058e22bb51..9f358d164dd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -769,7 +769,9 @@ function(qt_register_target_dependencies target public_libs private_libs) foreach(lib IN LISTS public_libs private_libs) if ("${lib}" MATCHES "^Qt::(.*)") set(lib "${CMAKE_MATCH_1}") - if (lib STREQUAL Platform OR lib STREQUAL GlobalConfig + if (lib STREQUAL Platform + OR lib STREQUAL GlobalConfig + OR lib STREQUAL GlobalConfigPrivate OR lib STREQUAL PlatformModuleInternal OR lib STREQUAL PlatformPluginInternal OR lib STREQUAL PlatformToolInternal) From d59fadb2daaecd91285fc3aa6b9a33cb13cce7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Wed, 12 Jun 2019 15:36:06 +0200 Subject: [PATCH 0666/1322] Remove double negations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As now the configuration syntax supports enable_if, we can get rid of double negations. Change-Id: I5b8b695d4f7a72cd1a836b9b427096fb4e3b85a7 Reviewed-by: Liang Qi Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 66 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 1e47a02a1de..e596240b589 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -8,10 +8,10 @@ windows_specific_instrucitons: - &export_target_architecture_and_sdk # Export TARGET_ARCHITECTURE and WINDOWS_SDK_VERSION for MSVC cross compilation type: Group - disable_if: + enable_if: condition: property property: host.os - not_equals_value: Windows + equals_value: Windows instructions: - type: EnvironmentVariable variableName: TARGET_ARCHITECTURE @@ -23,31 +23,31 @@ windows_specific_instrucitons: - type: EnvironmentVariable variableName: TARGET_ARCHITECTURE variableValue: amd64_x86 - disable_if: + enable_if: condition: and conditions: - condition: property property: target.arch - not_equals_property: X86 + equals_property: X86 - condition: property property: host.arch - not_equals_property: X86_64 + equals_property: X86_64 - type: EnvironmentVariable # HACK. Overwrite TARGET_ARCHITECTURE as we do not use standard MSVC cross # compilation targets here. The target architecture will be detected by Qt. variableName: TARGET_ARCHITECTURE variableValue: x86 - disable_if: + enable_if: condition: property property: target.os - not_in_values: ["WINRT", "WINPHONE", "WINCE"] + in_values: ["WINRT", "WINPHONE", "WINCE"] - type: EnvironmentVariable variableName: WINDOWS_SDK_VERSION variableValue: "10.0.14393.0" - disable_if: + enable_if: condition: property property: target.os - not_equals_value: WINRT + equals_value: WINRT - type: EnvironmentVariable variableName: WINDOWS_SDK_VERSION variableValue: "" @@ -62,10 +62,10 @@ windows_specific_instrucitons: # TODO cleanup, that step could be removed if we have same installation paths or we read the path from registry # or we use %ProgramFiles(x86)%. type: Group - disable_if: + enable_if: condition: property property: host.os - not_equals_value: Windows + equals_value: Windows instructions: - type: EnvironmentVariable variableName: PROGRAM_FILES_PATH @@ -87,52 +87,52 @@ windows_specific_instrucitons: - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "%VS90COMNTOOLS%\\vsvars32.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2008 + equals_value: MSVC2008 - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "%VS100COMNTOOLS%\\vsvars32.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2010 + equals_value: MSVC2010 - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2012 + equals_value: MSVC2012 - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2013 + equals_value: MSVC2013 - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2015 + equals_value: MSVC2015 - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio\\2017\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2017 + equals_value: MSVC2017 - type: EnvironmentVariable variableName: VC_SCRIPT variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" - disable_if: + enable_if: condition: property property: host.compiler - not_equals_value: MSVC2019 + equals_value: MSVC2019 build_instructions: - type: MakeDirectory @@ -150,17 +150,17 @@ build_instructions: fileMode: 420 maxTimeInSeconds: 20 maxTimeBetweenOutput: 20 - disable_if: + enable_if: condition: property property: host.os - not_equals_value: Windows + equals_value: Windows - type: EnvironmentVariable variableName: ENV_PREFIX variableValue: "c:\\users\\qt\\prefix.bat" - disable_if: + enable_if: condition: property property: host.os - not_equals_value: Windows + equals_value: Windows - type: EnvironmentVariable variableName: ENV_PREFIX variableValue: "" @@ -179,10 +179,10 @@ build_instructions: variableValue: "{{.InstallRoot}}" - type: ExecuteCommand # TODO: remove me, just debuging command: cmd.exe /c type {{.BuildDir}}\\CMakeCache.txt - disable_if: + enable_if: condition: property property: host.os - not_equals_value: Windows + equals_value: Windows maxTimeInSeconds: 60 userMessageOnFailure: Could not print the file cmake config file. This should not be possible. - type: ExecuteCommand @@ -192,10 +192,10 @@ build_instructions: userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. Contact Liang first. - type: SignPackage - disable_if: + enable_if: condition: property property: host.os - not_equals_value: Windows + equals_value: Windows directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 From 341cc6e5bba4d06d2a17e85be7f5b9e52c0ac4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Wed, 12 Jun 2019 16:09:31 +0200 Subject: [PATCH 0667/1322] Try to use %ProgramFiles(x86)% instead of custom code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, we have a problem with locating MSVC. Depending on system version it can be installed in different directories. Currently we have a custom logic to handle it, but in theory we could just use "ProgramFiles(x86)" to abstract it. Change-Id: Ia94a41d9ef6229de712606f9a9d3d61a0abeb24f Reviewed-by: Liang Qi Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index e596240b589..4de47d1e40a 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -59,28 +59,13 @@ windows_specific_instrucitons: - &find_path_to_compiler # MSVC is installed in somehow arbitrary places. To reduce amount of combinations we need to make a variable. # This seems inverted, but on 64 bit hosts VS is installed into the x86 path, otherwise the regular one - # TODO cleanup, that step could be removed if we have same installation paths or we read the path from registry - # or we use %ProgramFiles(x86)%. + # TODO cleanup, that step could be removed if we have same installation paths or we read the path from registry. type: Group enable_if: condition: property property: host.os equals_value: Windows instructions: - - type: EnvironmentVariable - variableName: PROGRAM_FILES_PATH - variableValue: "C:\\Program Files" - disable_if: - condition: property - property: host.arch - not_equals_value: X86 - - type: EnvironmentVariable - variableName: PROGRAM_FILES_PATH - variableValue: "C:\\Program Files (x86)" - disable_if: - condition: property - property: host.arch - equals_value: X86 # Try to pick one of many coexistent MSVC installation to use # TODO cleanup, that could be much simpler if all tools are installed to similar paths, so it would # be enough to substitute compiler name. @@ -100,35 +85,35 @@ windows_specific_instrucitons: equals_value: MSVC2010 - type: EnvironmentVariable variableName: VC_SCRIPT - variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat" + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat" enable_if: condition: property property: host.compiler equals_value: MSVC2012 - type: EnvironmentVariable variableName: VC_SCRIPT - variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat" + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat" enable_if: condition: property property: host.compiler equals_value: MSVC2013 - type: EnvironmentVariable variableName: VC_SCRIPT - variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" enable_if: condition: property property: host.compiler equals_value: MSVC2015 - type: EnvironmentVariable variableName: VC_SCRIPT - variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio\\2017\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2017\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" enable_if: condition: property property: host.compiler equals_value: MSVC2017 - type: EnvironmentVariable variableName: VC_SCRIPT - variableValue: "{{.Env.PROGRAM_FILES_PATH}}\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" enable_if: condition: property property: host.compiler From a34e7717a43795d79037146c23217b54636d9cf7 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 13 Jun 2019 10:37:39 +0200 Subject: [PATCH 0668/1322] Correct install path for QtForAndroid plugin Installation directory for libqtforandroid.so should be plugins/platform/android instead of plugins/platform. Change-Id: I124bed4d43664eddcceca197c4df26a1e8d3d0af Reviewed-by: Alexandru Croitor --- src/plugins/platforms/android/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/platforms/android/CMakeLists.txt b/src/plugins/platforms/android/CMakeLists.txt index b60712a7188..eaba0109284 100644 --- a/src/plugins/platforms/android/CMakeLists.txt +++ b/src/plugins/platforms/android/CMakeLists.txt @@ -59,6 +59,14 @@ add_qt_plugin(qtforandroid Qt::Gui android jnigraphics +# special case begin + INSTALL_DIRECTORY + platforms/android + OUTPUT_DIRECTORY + platforms/android + ARCHIVE_INSTALL_DIRECTORY + platforms/android +# special case end ) #### Keys ignored in scope 1:.:.:android.pro:: From 2e30f1d9b6b7ccacf435b710ea44a930ec1ea4bf Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 13 Jun 2019 14:18:36 +0200 Subject: [PATCH 0669/1322] Android: Correct install path for libqtforandroid.so I didn't notice I forgot to prepend the plugin/ to install path. On my local tests I forgot to delete some cached state and I didn't notice it was installing in the wrong directory. Change-Id: Ic898a37388aa0508ad995f922bef4d187f75688f Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- src/plugins/platforms/android/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/android/CMakeLists.txt b/src/plugins/platforms/android/CMakeLists.txt index eaba0109284..5b91a733f1e 100644 --- a/src/plugins/platforms/android/CMakeLists.txt +++ b/src/plugins/platforms/android/CMakeLists.txt @@ -61,11 +61,11 @@ add_qt_plugin(qtforandroid jnigraphics # special case begin INSTALL_DIRECTORY - platforms/android + plugins/platforms/android OUTPUT_DIRECTORY - platforms/android + plugins/platforms/android ARCHIVE_INSTALL_DIRECTORY - platforms/android + plugins/platforms/android # special case end ) From bb959af00a424b1be4ef45a03ed6cf6d51b9a261 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 13 Jun 2019 15:55:38 +0200 Subject: [PATCH 0670/1322] Automatically find apple frameworks when building a repo Instead of doing it just in qtbase/src, we need to do it for all repos before building ./src. Change-Id: I57f226b849cd5370ffbbbea8a694697d400957a4 Reviewed-by: Leander Beernaert Reviewed-by: Liang Qi --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 3 +++ qmake/CMakeLists.txt | 2 -- src/CMakeLists.txt | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index d6b65b5b381..eeba186a705 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -36,6 +36,9 @@ macro(qt_build_repo_begin) # Optionally include a repo specific Setup module. include(${PROJECT_NAME}Setup OPTIONAL) + + # Find Apple frameworks if needed. + qt_find_apple_system_frameworks() endmacro() macro(qt_build_repo_end) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 408a14dd26b..6f8763524f5 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -8,8 +8,6 @@ qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" DESTINATION ${mkspecs_install_dir}) # special case end -qt_find_apple_system_frameworks() # special case - ##################################################################### ## qmake Binary: ##################################################################### diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 682f70ebd21..36bdd3d4ca9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ -qt_find_apple_system_frameworks() - add_subdirectory(3rdparty) function(find_or_build_bootstrap_names) From 60c2f9f3b4603398674dfb8ec9020a7920c64eb2 Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 13 Jun 2019 14:03:23 +0200 Subject: [PATCH 0671/1322] Android: Install gradle templates Install the required gradle templates for the android deployment tool to work correctly. Change-Id: I1b18235c354dbea2d4b47ce1d8146a477676a6cb Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- src/3rdparty/CMakeLists.txt | 6 ++++++ src/3rdparty/gradle/CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/3rdparty/gradle/CMakeLists.txt diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index d3b30fea651..2d6aed76902 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -1,3 +1,9 @@ add_subdirectory(tinycbor) add_subdirectory(harfbuzz) add_subdirectory(double-conversion) + +#special case begin +if (ANDROID) + add_subdirectory(gradle) +endif() +#special case end diff --git a/src/3rdparty/gradle/CMakeLists.txt b/src/3rdparty/gradle/CMakeLists.txt new file mode 100644 index 00000000000..fd4857f8ab7 --- /dev/null +++ b/src/3rdparty/gradle/CMakeLists.txt @@ -0,0 +1,20 @@ +# special case begin + +install( + FILES + gradlew + gradlew.bat + DESTINATION + src/3rdparty/gradle + COMPONENT + Devel) + +install( + DIRECTORY + gradle + DESTINATION + src/3rdparty/gradle + COMPONENT + Devel) + +# special case end From cfcd50875b84273942709f224a1cf37fa70b41b7 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 13 Jun 2019 15:35:26 +0200 Subject: [PATCH 0672/1322] Try to find Test package before calling add_subdirectory(src) in qt_build_repo(). This is important for qtdeclarative for example, which builds QmlTest functionality in ./src, and thus needs Test lib to be available. Change-Id: I84326d79844526f2f177c19de30bab0c858773e3 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- cmake/QtBuildInternals/QtBuildInternalsConfig.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake index eeba186a705..b2b262d05cd 100644 --- a/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake +++ b/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake @@ -69,6 +69,13 @@ endmacro() macro(qt_build_repo) qt_build_repo_begin(${ARGN}) + # If testing is enabled, try to find the qtbase Test package. + # Do this before adding src, because there might be test related conditions + # in source. + if (BUILD_TESTING) + find_package(Qt5 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test) + endif() + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt") add_subdirectory(src) endif() @@ -80,7 +87,6 @@ macro(qt_build_repo) endif() if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt") - find_package(Qt5 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test Xml) add_subdirectory(tests) endif() From 7559d508d1993dd90a4939441eaf353d55462ae5 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Thu, 6 Jun 2019 22:25:05 +0200 Subject: [PATCH 0673/1322] cmake: Make CMake superbuilds work In case of a CMake superbuild, the actual install root in a non-prefix build is the top-level build directory (not $TOP_BUILDDIR/qtbase anymore). This is more in line how CMake lays out things by default. Task-number: QTBUG-75582 Change-Id: I4e1744b5c877508fedc33e237eec28cb7436010b Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 10 +++++----- cmake/QtBuild.cmake | 25 ++++++++++++++++--------- qmake/CMakeLists.txt | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 6c5c7e1951f..ac039cb4d01 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -4,7 +4,7 @@ add_library(Qt::Platform ALIAS Platform) target_include_directories(Platform INTERFACE $ - $ + $ $ $ ) @@ -65,8 +65,8 @@ qt_install(FILES ## files always lived in Qt::Core, so we keep it that way add_library(GlobalConfig INTERFACE) target_include_directories(GlobalConfig INTERFACE - $ - $ + $ + $ $ $ ) @@ -84,8 +84,8 @@ add_library(Qt::GlobalConfig ALIAS GlobalConfig) add_library(GlobalConfigPrivate INTERFACE) target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig) target_include_directories(GlobalConfigPrivate INTERFACE - $ - $ + $ + $ $ $ ) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 9f358d164dd..f69c5f5f21f 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -272,6 +272,10 @@ endfunction() # cmake_install.cmake file with an empty one. This means we will always replace the file on # every reconfiguration, but not when doing null builds. function(remove_install_target) + if (TARGET remove_cmake_install) + return() # target was already created + endif() + set(file_in "${CMAKE_BINARY_DIR}/.remove_cmake_install_in.txt") set(file_generated "${CMAKE_BINARY_DIR}/.remove_cmake_install_generated.txt") set(cmake_install_file "${CMAKE_BINARY_DIR}/cmake_install.cmake") @@ -943,20 +947,24 @@ function(qt_install_injections module build_dir install_dir) # # ${some_prefix}'s value depends on the build type. # If doing a prefix build, it should point to - # ${current_repo_build_dir} which is ${qtdeclarative_build_dir}. + # the current repo's build dir which is ${qtdeclarative_build_dir}. # If doing a non-prefix build, it should point to - # ${qtbase_build_dir}. + # qtbase's build dir. # # In the code below, ${some_prefix} == ${build_dir}. set(lower_case_forwarding_header_path "${build_dir}/${INSTALL_INCLUDEDIR}/${module}") if(destinationdir) string(APPEND lower_case_forwarding_header_path "/${destinationdir}") endif() - set(current_repo_build_dir "${PROJECT_BINARY_DIR}") + if (IS_ABSOLUTE "${file}") + set(file_path "${file}") + else() + set(file_path "${PROJECT_BINARY_DIR}/${file}") + endif() file(RELATIVE_PATH relpath "${lower_case_forwarding_header_path}" - "${current_repo_build_dir}/${file}") + "${file_path}") set(main_contents "#include \"${relpath}\"") file(GENERATE OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" CONTENT "${main_contents}") @@ -966,7 +974,7 @@ function(qt_install_injections module build_dir install_dir) # will be a no-op. qt_path_join(install_destination ${install_dir} ${INSTALL_INCLUDEDIR} ${module} ${destinationdir}) - qt_install(FILES ${current_repo_build_dir}/${file} + qt_install(FILES ${file_path} DESTINATION ${install_destination} RENAME ${destinationname} OPTIONAL) @@ -1137,7 +1145,7 @@ function(add_qt_module target) qt_autogen_tools_initial_setup(${target}) set(_public_includes - $ + $ $ ) if(NOT arg_NO_MODULE_HEADERS) @@ -1489,7 +1497,7 @@ function(add_qt_plugin target) "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" # For the syncqt headers - $ + $ ${arg_INCLUDE_DIRECTORIES} PUBLIC_INCLUDE_DIRECTORIES ${arg_PUBLIC_INCLUDE_DIRECTORIES} LIBRARIES ${arg_LIBRARIES} Qt::PlatformPluginInternal @@ -2055,7 +2063,6 @@ function(qt_compute_injection_forwarding_header target) get_filename_component(file_name "${arg_SOURCE}" NAME) set(source_absolute_path "${CMAKE_CURRENT_BINARY_DIR}/${arg_SOURCE}") - file(RELATIVE_PATH relpath "${CMAKE_BINARY_DIR}" "${source_absolute_path}") if (arg_PRIVATE) set(fwd "${PROJECT_VERSION}/${module}/private/${file_name}") @@ -2063,7 +2070,7 @@ function(qt_compute_injection_forwarding_header target) set(fwd "${file_name}") endif() - string(APPEND ${arg_OUT_VAR} " ${relpath}:${fwd}") + string(APPEND ${arg_OUT_VAR} " ${source_absolute_path}:${fwd}") set(${arg_OUT_VAR} ${${arg_OUT_VAR}} PARENT_SCOPE) endfunction() diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 6f8763524f5..22fbda307b3 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -124,7 +124,7 @@ add_qt_tool(qmake # special case generators/win32 library $ # special case - ${CMAKE_BINARY_DIR}/src/corelib/global # special case: for qconfig.cpp + ${CMAKE_CURRENT_BINARY_DIR}/../src/corelib/global # special case: for qconfig.cpp ) qt_internal_add_target_aliases(Bootstrap) # special case From 72066a3a585b4f4fed499c64464ca5ad2ba9f71d Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 14 Jun 2019 15:29:21 +0200 Subject: [PATCH 0674/1322] Revert "cmake: Make CMake superbuilds work" Builds fail on Windows, due to splitting on ':' on absolute file paths, when handling syncqt injections. Revert for now to get qt6 merge in faster. This reverts commit 7559d508d1993dd90a4939441eaf353d55462ae5. Change-Id: If139a8a1eb4ae7ccc8d7b835b12e83b03176e28b Reviewed-by: Tobias Hunger Reviewed-by: Qt CMake Build Bot --- cmake/QtBaseGlobalTargets.cmake | 10 +++++----- cmake/QtBuild.cmake | 25 +++++++++---------------- qmake/CMakeLists.txt | 2 +- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index ac039cb4d01..6c5c7e1951f 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -4,7 +4,7 @@ add_library(Qt::Platform ALIAS Platform) target_include_directories(Platform INTERFACE $ - $ + $ $ $ ) @@ -65,8 +65,8 @@ qt_install(FILES ## files always lived in Qt::Core, so we keep it that way add_library(GlobalConfig INTERFACE) target_include_directories(GlobalConfig INTERFACE - $ - $ + $ + $ $ $ ) @@ -84,8 +84,8 @@ add_library(Qt::GlobalConfig ALIAS GlobalConfig) add_library(GlobalConfigPrivate INTERFACE) target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig) target_include_directories(GlobalConfigPrivate INTERFACE - $ - $ + $ + $ $ $ ) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index f69c5f5f21f..9f358d164dd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -272,10 +272,6 @@ endfunction() # cmake_install.cmake file with an empty one. This means we will always replace the file on # every reconfiguration, but not when doing null builds. function(remove_install_target) - if (TARGET remove_cmake_install) - return() # target was already created - endif() - set(file_in "${CMAKE_BINARY_DIR}/.remove_cmake_install_in.txt") set(file_generated "${CMAKE_BINARY_DIR}/.remove_cmake_install_generated.txt") set(cmake_install_file "${CMAKE_BINARY_DIR}/cmake_install.cmake") @@ -947,24 +943,20 @@ function(qt_install_injections module build_dir install_dir) # # ${some_prefix}'s value depends on the build type. # If doing a prefix build, it should point to - # the current repo's build dir which is ${qtdeclarative_build_dir}. + # ${current_repo_build_dir} which is ${qtdeclarative_build_dir}. # If doing a non-prefix build, it should point to - # qtbase's build dir. + # ${qtbase_build_dir}. # # In the code below, ${some_prefix} == ${build_dir}. set(lower_case_forwarding_header_path "${build_dir}/${INSTALL_INCLUDEDIR}/${module}") if(destinationdir) string(APPEND lower_case_forwarding_header_path "/${destinationdir}") endif() - if (IS_ABSOLUTE "${file}") - set(file_path "${file}") - else() - set(file_path "${PROJECT_BINARY_DIR}/${file}") - endif() + set(current_repo_build_dir "${PROJECT_BINARY_DIR}") file(RELATIVE_PATH relpath "${lower_case_forwarding_header_path}" - "${file_path}") + "${current_repo_build_dir}/${file}") set(main_contents "#include \"${relpath}\"") file(GENERATE OUTPUT "${lower_case_forwarding_header_path}/${original_file_name}" CONTENT "${main_contents}") @@ -974,7 +966,7 @@ function(qt_install_injections module build_dir install_dir) # will be a no-op. qt_path_join(install_destination ${install_dir} ${INSTALL_INCLUDEDIR} ${module} ${destinationdir}) - qt_install(FILES ${file_path} + qt_install(FILES ${current_repo_build_dir}/${file} DESTINATION ${install_destination} RENAME ${destinationname} OPTIONAL) @@ -1145,7 +1137,7 @@ function(add_qt_module target) qt_autogen_tools_initial_setup(${target}) set(_public_includes - $ + $ $ ) if(NOT arg_NO_MODULE_HEADERS) @@ -1497,7 +1489,7 @@ function(add_qt_plugin target) "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}" # For the syncqt headers - $ + $ ${arg_INCLUDE_DIRECTORIES} PUBLIC_INCLUDE_DIRECTORIES ${arg_PUBLIC_INCLUDE_DIRECTORIES} LIBRARIES ${arg_LIBRARIES} Qt::PlatformPluginInternal @@ -2063,6 +2055,7 @@ function(qt_compute_injection_forwarding_header target) get_filename_component(file_name "${arg_SOURCE}" NAME) set(source_absolute_path "${CMAKE_CURRENT_BINARY_DIR}/${arg_SOURCE}") + file(RELATIVE_PATH relpath "${CMAKE_BINARY_DIR}" "${source_absolute_path}") if (arg_PRIVATE) set(fwd "${PROJECT_VERSION}/${module}/private/${file_name}") @@ -2070,7 +2063,7 @@ function(qt_compute_injection_forwarding_header target) set(fwd "${file_name}") endif() - string(APPEND ${arg_OUT_VAR} " ${source_absolute_path}:${fwd}") + string(APPEND ${arg_OUT_VAR} " ${relpath}:${fwd}") set(${arg_OUT_VAR} ${${arg_OUT_VAR}} PARENT_SCOPE) endfunction() diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 22fbda307b3..6f8763524f5 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -124,7 +124,7 @@ add_qt_tool(qmake # special case generators/win32 library $ # special case - ${CMAKE_CURRENT_BINARY_DIR}/../src/corelib/global # special case: for qconfig.cpp + ${CMAKE_BINARY_DIR}/src/corelib/global # special case: for qconfig.cpp ) qt_internal_add_target_aliases(Bootstrap) # special case From 4de70ce95278b29c3e811f1496505459f257adc4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 17 Jun 2019 09:00:38 +0200 Subject: [PATCH 0675/1322] Avoid hardcoding the underlying build tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 3.15, not only --build can call the low-level build tool, --install can also be used to run the installation. There's also an environment variable that can be used to control the backend at cmake time, but that may only be useful later. Change-Id: I8c1ee48f946e110af3e824cf8980bbacbb94db99 Reviewed-by: Jędrzej Nowacki Reviewed-by: Qt CMake Build Bot --- coin/module_config.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 4de47d1e40a..90effa8dbd3 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -171,11 +171,17 @@ build_instructions: maxTimeInSeconds: 60 userMessageOnFailure: Could not print the file cmake config file. This should not be possible. - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} ninja install" + command: "{{.Env.ENV_PREFIX}} cmake --build ." maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to install sources. In the current state bug can be everywhere. Contact Liang first. - type: SignPackage enable_if: condition: property From d48940044852111b2ee8f7a69a3faa750032bf44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 13 Jun 2019 14:27:31 +0200 Subject: [PATCH 0676/1322] Simple typo fixup Change-Id: Ifd2c6c3eef5aea4decdbe1fc6221139bf3447ba6 Reviewed-by: Qt CMake Build Bot Reviewed-by: Liang Qi --- coin/module_config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 90effa8dbd3..12f53d2d02a 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -4,7 +4,7 @@ accept_configuration: property: host.os equals_property: target.os -windows_specific_instrucitons: +windows_specific_instructions: - &export_target_architecture_and_sdk # Export TARGET_ARCHITECTURE and WINDOWS_SDK_VERSION for MSVC cross compilation type: Group From 06a552eab0cb81dc50aebbfb330770519241f042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 13 Jun 2019 14:23:44 +0200 Subject: [PATCH 0677/1322] Port ICC specific instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coin implicitly was exporting some variables if ICC was used. This patch is just a first step to enable ICC in CI. To make it really working one would need to fix the QtBase code and enable ICC in qt5 repository. Change-Id: I2fca19ff10d7390fa013f511f167c0c1c2fba427 Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 12f53d2d02a..f15e07d4985 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -119,6 +119,20 @@ windows_specific_instructions: property: host.compiler equals_value: MSVC2019 +icc_specific_instructions: &icc_export_variables + type: Group + instructions: + - type: EnvironmentVariable + variableName: LD_LIBRARY_PATH + variableValue: "{{.Env.ICC64_18_LDLP}}" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.ICC64_18_PATH}}" + enable_if: + condition: property + property: host.compiler + equals_value: ICC_18 + build_instructions: - type: MakeDirectory directory: .git @@ -126,6 +140,7 @@ build_instructions: directory: "{{.SourceDir}}" - type: ChangeDirectory directory: "{{.BuildDir}}" + - *icc_export_variables - *export_target_architecture_and_sdk - *find_path_to_compiler # With MSVC we need setup the environment before every subprocess call. From aaa7ce460a67737b6a279db12442595a815aee90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 17 Jun 2019 12:13:48 +0200 Subject: [PATCH 0678/1322] Add ICC platform specific mkspec Change-Id: I6d33439a251723c409d395b459207843804d295c Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a09cdf1f641..6d6c6b95885 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -83,6 +83,8 @@ elseif(LINUX) set(QT_QMAKE_TARGET_MKSPEC linux-g++) elseif(CLANG) set(QT_QMAKE_TARGET_MKSPEC linux-clang) + elseif(ICC) + set(QT_QMAKE_TARGET_MKSPEC linux-icc-64) endif() elseif(ANDROID) if(GCC) From 264d3bc9ba886b3e71dc3bad98a382c0b090c2ce Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 17 Jun 2019 15:54:10 +0200 Subject: [PATCH 0679/1322] CMake: clarify readme Always install - not installing doesn't make much sense. Add information about developer-build. Change-Id: I406d007e9b167ee83d126ffa6e78235743402c33 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- cmake/README.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 01efe221cfb..2580fd97fd8 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -46,35 +46,43 @@ The basic way of building with cmake is as follows: ``` cd {build directory} - cmake {path to source directory} + cmake -DCMAKE_INSTALL_PREFIX=/path/where/to/install {path to source directory} cmake --build . + cmake --install . ``` -``cmake --build`` is just a simple wrapper around the basic build tool that CMake generated a build system for. It works with any supported build backend supported by cmake, but you can also use the backend build tool directly, e.g. by running ``make`` in this case. +You need one build directory per Qt module. The build directory can be a sub-directory inside the module ``qtbase/build`` or an independent directory ``qtbase_build``. +The installation prefix is chosen when running cmake by passing ``-DCMAKE_INSTALL_PREFIX``. To build more than one Qt module, make sure to pass the same install prefix. + +``cmake --build`` and ``cmake --install`` are simple wrappers around the basic build tool that CMake generated a build system for. It works with any supported build backend supported by cmake, but you can also use the backend build tool directly, e.g. by running ``make``. CMake has a ninja backend that works quite well and is noticeably faster than make, so you may want to use that: ``` cd {build directory} - cmake -GNinja {path to source directory} - cmake --build . # ... or ninja ;-) + cmake -GNinja -DCMAKE_INSTALL_PREFIX=/path/where/to/install {path to source directory} + cmake --build . + cmake --install . ``` You can look into the generated ``build.ninja`` file if you're curious and you can also build targets directory such as ``ninja lib/libQt6Core.so``. -When you're done with the build, you may want to install it, using ``ninja install`` or ``make install``. The installation prefix is chosen when running cmake though: - -``` - cd {build directory} - cmake -GNinja -DCMAKE_INSTALL_PREFIX=/path/where/to/install {path to source directory} - ninja - ninja install -``` - Make sure to remove CMakeCache.txt if you forgot to set the CMAKE_INSTALL_PREFIX on the first configuration, otherwise a second re-configuration will not pick up the new install prefix. You can use ``cmake-gui {path to build directory}`` or ``ccmake {path to build directory}`` to configure the values of individual cmake variables or Qt features. After changing a value, you need to choose the *configure* step (usually several times:-/), followed by the *generate* step (to generate makefiles/ninja files). +## Developer Build + +When working on Qt itself, it can be tedious to wait for the install step. In that case you want to use the developer build option, to get as many auto tests enabled and no longer +be required to make install: + +``` + cd {build directory} + cmake -GNinja -DCMAKE_INSTALL_PREFIX=/path/to/qtbase_build -DFEATURE_developer_build=ON {path to source directory} + cmake --build . + # do NOT make install +``` + ## Specifying configure.json features on the command line QMake defines most features in configure.json files, like -developer-build or -no-opengl. From aeaef4d6f316870313ed8fa88e25d3f035c337e0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 20 Jun 2019 10:13:22 +0200 Subject: [PATCH 0680/1322] Fix QPA headers for QtPrintSupport Remove the special case in QtGui and instead handle this in a generic way so that QtPrintSupport is covered, too. For now we do this in the same function where we run the regular target install() commands. It doesn't quite fit into per-target PUBLIC_HEADER or PRIVATE_HEADER properties as the qpa headers sit _next_ to public and private in a separate qpa sub-directory. Change-Id: I30aadaf9496cf0236f39a7c36a5163e4270edecc Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 3 +++ src/gui/CMakeLists.txt | 13 ------------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 6d6c6b95885..98c9c334cfd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1118,6 +1118,9 @@ function(add_qt_module target) set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_headers_public}") set_property(TARGET "${target}" APPEND PROPERTY PUBLIC_HEADER "${module_include_dir}/${module}Depends") set_property(TARGET "${target}" APPEND PROPERTY PRIVATE_HEADER "${module_headers_private}") + if(module_headers_qpa) + qt_install(FILES ${module_headers_qpa} DESTINATION ${INSTALL_INCLUDEDIR}/${module}/${PROJECT_VERSION}/${module}/qpa) + endif() endif() # Plugin types associated to a module diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 635af4faf4a..a6a10faf12c 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -688,19 +688,6 @@ extend_target(Gui CONDITION WASM platform/wasm/qwasmlocalfileaccess.cpp platform/wasm/qwasmlocalfileaccess_p.h ) -# special case begin -# qpa headers are expected to be located right next to QtGui's private -# headers. So a private QtGui header is #include and -# a qpa header is #include , both of them implying -# linkage against Qt::GuiPrivate. -qt_read_headers_pri("Gui" "module_headers") - -# No need to copy these in a non-prefix build, syncqt.pl takes care of generating the files -# in the build dir. -qt_install(FILES ${module_headers_qpa} - DESTINATION ${INSTALL_INCLUDEDIR}/QtGui/${PROJECT_VERSION}/QtGui/qpa) -# special case end - qt_create_tracepoints(Gui qtgui.tracepoints) add_qt_docs( doc/qtgui.qdocconf From fab07ca3ef277e64ccb646700f4da2f7dd3a14ce Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 20 Jun 2019 13:23:19 +0200 Subject: [PATCH 0681/1322] Add support for vcpkg default target triplets As per vcpkg documentation, this is a tweak that allows respecting the vcpkg default target triplet environment variable, which simplifies the command line slightly. In order to make this also work for modules other than qtbase, we're going to need to consider the creation of a toolchain file. Change-Id: I2573f6644d671c710fd823df83e2205dbbfe19e6 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- CMakeLists.txt | 4 ++++ cmake/README.md | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3deeaeb7ad4..d47bc91cbfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.15.0) +if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET) + set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "") +endif() + project(QtBase VERSION 6.0.0 DESCRIPTION "Qt Base Libraries" diff --git a/cmake/README.md b/cmake/README.md index 2580fd97fd8..868b4f2d338 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -28,7 +28,7 @@ You may use vcpkg to install dependencies needed to build QtBase. * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``qt-x64-windows-static`` or ``qt-x86-windows-static`` * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` - * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=%VCPKG_DEFAULT_TRIPLET%`` + * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake`` Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_FILE. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). # Building against homebrew on macOS @@ -142,7 +142,7 @@ Vcpkg for Android can be set up using the following steps: * Set the ``ANDROID_SDK_HOME`` environment variable to the path where you have installed the Android SDK. * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` -When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DVCPKG_TARGET_TRIPLET=$VCPKG_DEFAULT_TRIPLET -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` # Debugging CMake files From 174d87063564978b7becfcfa0431271d89e9c9b6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 20 Jun 2019 14:15:59 +0200 Subject: [PATCH 0682/1322] Add support for picking up vcpkg automatically If VCPKG_ROOT is defined, let's use it and chainload any previously set toolchain file. The detection of vcpkg support via the VCPKG_ROOT environment variable is per vcpkg documentation, the automatic chainloading is something specific to us. Change-Id: I0498effc5b948f0b6f5e223d0454a15a0cbb503a Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 20 ++++++++++++++++++-- cmake/README.md | 11 ++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d47bc91cbfd..5566870576c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,23 @@ cmake_minimum_required(VERSION 3.15.0) -if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET) - set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "") +if(DEFINED ENV{VCPKG_ROOT}) + set(vcpkg_toolchain_file "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") + get_filename_component(vcpkg_toolchain_file "${vcpkg_toolchain_file}" ABSOLUTE) + + if(DEFINED CMAKE_TOOLCHAIN_FILE) + get_filename_component(supplied_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE) + if(NOT supplied_toolchain_file STREQUAL vcpkg_toolchain_file) + set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" CACHE STRING "") + endif() + unset(supplied_toolchain_file) + endif() + set(CMAKE_TOOLCHAIN_FILE "${vcpkg_toolchain_file}" CACHE STRING "" FORCE) + message(STATUS "Using vcpkg from $ENV{VCPKG_ROOT}") + if(DEFINED ENV{VCPKG_DEFAULT_TRIPLET} AND NOT DEFINED VCPKG_TARGET_TRIPLET) + set(VCPKG_TARGET_TRIPLET "$ENV{VCPKG_DEFAULT_TRIPLET}" CACHE STRING "") + message(STATUS "Using vcpkg triplet ${VCPKG_TARGET_TRIPLET}") + endif() + unset(vcpkg_toolchain_file) endif() project(QtBase diff --git a/cmake/README.md b/cmake/README.md index 868b4f2d338..1d00a438f56 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -27,9 +27,9 @@ You may use vcpkg to install dependencies needed to build QtBase. * ```git clone -b qt https://github.com/tronical/vcpkg``` * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``qt-x64-windows-static`` or ``qt-x86-windows-static`` - * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` - * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake`` - Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_FILE. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). + * Set the ``VCPKG_ROOT`` environment variable to the path where you cloned vcpkg + * Build Qt dependencies: ``vcpkg install @qt-packages-windows.txt`` + * When running cmake in qtbase, support for vcpkg will be picked up automatically when the VCPKG_ROOT environment variable is set. # Building against homebrew on macOS @@ -138,11 +138,12 @@ Vcpkg for Android can be set up using the following steps: * ```git clone -b qt https://github.com/tronical/vcpkg``` * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``arm-android`` + * Set the ``VCPKG_ROOT`` environment variable to the path where you cloned vcpkg * Set the ``ANDROID_NDK_HOME`` environment variable to the path where you have installed the Android NDK. * Set the ``ANDROID_SDK_HOME`` environment variable to the path where you have installed the Android SDK. - * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` + * Build Qt dependencies: ``vcpkg install @qt-packages-android.txt`` -When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` # Debugging CMake files From b0bd50d33966d93ba5e24ac6be0c849ce501eed6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 19 Jun 2019 16:10:10 +0200 Subject: [PATCH 0683/1322] Prepare for running tests with cmake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is just a small step towards the situation where we build the tests during the module build phase and later extract and merely run them. The general steps we need are: * build tests separately, which includes the cmake test plan * let coin archive the tests (build) directory * in the test VM unpack everything * run ctest on the test plan that was part of the tests archive This patch implements the first two steps. Change-Id: Ifb8321015d0d18ad20e8cf20bb8b746030202daf Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index f15e07d4985..210da62495d 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -169,14 +169,11 @@ build_instructions: property: host.os equals_value: Windows - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -GNinja {{.SourceDir}}" + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF -GNinja {{.SourceDir}}" maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > Failed to call cmake. Contact Liang then. - - type: EnvironmentVariable - variableName: DESTDIR - variableValue: "{{.InstallRoot}}" - type: ExecuteCommand # TODO: remove me, just debuging command: cmd.exe /c type {{.BuildDir}}\\CMakeCache.txt enable_if: @@ -196,7 +193,16 @@ build_instructions: maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > - Failed to install sources. In the current state bug can be everywhere. Contact Liang first. + Failed to install package. + - type: EnvironmentVariable + variableName: DESTDIR + variableValue: "{{.InstallRoot}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to install package for archiving. - type: SignPackage enable_if: condition: property @@ -210,6 +216,25 @@ build_instructions: transferType: UploadModuleBuildArtifact maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 + - type: ChangeDirectory + directory: "{{.SourceDir}}/tests" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_PREFIX_PATH:PATH={{.InstallDir}} -GNinja {{.SourceDir}}/tests" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 120 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: UploadTestArtifact + transferType: UploadModuleTestsArtifact + archiveDirectory: "{{.SourceDir}}/tests" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 test_instructions: - type: ExecuteCommand command: echo "hello world - test" From 1c4510cfc4c020d54e3c1c52e187b31b67e3a5fb Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 20 Jun 2019 10:56:19 +0200 Subject: [PATCH 0684/1322] Fix build with multi-config VS code generator We want our libraries to end up in the same bin directory, not inside the Debug\ or Release\ sub-directories. Their distinct names avoid a clash. For our tools such as moc, uic, etc. we need to place the release build into the bin directory explicitly, as by default multi-config generators place binaries into the Debug\ or Release\ sub-directory. This is also needed as cmake's automoc itself expects moc to be in the bin directory. One effect of this is that with a multi-config build, it is always necessary to perform a release build first, otherwise the debug build won't find moc/uic. Change-Id: I1361823ddf5961a5f1bb517e4bca69e621cbce9e Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 98c9c334cfd..4427d2438ba 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1131,6 +1131,8 @@ function(add_qt_module target) set_target_properties("${target}" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}" RUNTIME_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_BINDIR}" + RUNTIME_OUTPUT_DIRECTORY_RELEASE "${QT_BUILD_DIR}/${INSTALL_BINDIR}" + RUNTIME_OUTPUT_DIRECTORY_DEBUG "${QT_BUILD_DIR}/${INSTALL_BINDIR}" ARCHIVE_OUTPUT_DIRECTORY "${QT_BUILD_DIR}/${INSTALL_LIBDIR}" VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} @@ -1815,6 +1817,10 @@ function(add_qt_tool name) ) qt_internal_add_target_aliases("${name}") + set_target_properties("${name}" PROPERTIES + RUNTIME_OUTPUT_DIRECTORY_RELEASE "${QT_BUILD_DIR}/${INSTALL_BINDIR}" + ) + if(NOT arg_NO_INSTALL AND arg_TOOLS_TARGET) # Assign a tool to an export set, and mark the module to which the tool belongs. qt_internal_append_known_modules_with_tools("${arg_TOOLS_TARGET}") From d0183527d4f784a2217f98e3e4295bc2468ea62d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 19 Jun 2019 16:13:20 +0200 Subject: [PATCH 0685/1322] Change cmake generator selection mechanism MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By using the new environment variable for the generator selection introduced in 3.15, we can later select the visual studio generator once the qtbase build is fixed. This will simplify the VS selection code in this file and allow getting rid of the ENV_PREFIX and .bat file. Change-Id: I9f76b5714450ffa60b496aef0ce5a0c21e843bef Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 210da62495d..868a106d7e4 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -140,6 +140,9 @@ build_instructions: directory: "{{.SourceDir}}" - type: ChangeDirectory directory: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: CMAKE_GENERATOR + variableValue: Ninja - *icc_export_variables - *export_target_architecture_and_sdk - *find_path_to_compiler @@ -169,7 +172,7 @@ build_instructions: property: host.os equals_value: Windows - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF -GNinja {{.SourceDir}}" + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF {{.SourceDir}}" maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > @@ -219,7 +222,7 @@ build_instructions: - type: ChangeDirectory directory: "{{.SourceDir}}/tests" - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_PREFIX_PATH:PATH={{.InstallDir}} -GNinja {{.SourceDir}}/tests" + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_PREFIX_PATH:PATH={{.InstallDir}} {{.SourceDir}}/tests" maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > From da7f40f7c2eb1a5928876de7b89abb55a2f8fdab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 21 Jun 2019 14:25:44 +0200 Subject: [PATCH 0686/1322] Update the instructions after CI changed way of splitting arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now execute command can directly specified how the arguments should be divided. The default option doesn't work well for CONFIGURE_ARGS, because we want to pass it's result as a separate subprocess arguments. Change-Id: I6b7adb04164f5568d9ad2f45e3334d7a7a49bc79 Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 868a106d7e4..840310ed66b 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -173,6 +173,7 @@ build_instructions: equals_value: Windows - type: ExecuteCommand command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF {{.SourceDir}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > From ebbf4a1d9670e74f4de47319774def93d9487e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 21 Jun 2019 13:54:25 +0200 Subject: [PATCH 0687/1322] Move ICC compiler name setup to instructions level That way we can simplify product level configuration. Change-Id: I6825a10e4652dc7a730d23aaa7d4e7db9c079e50 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann --- coin/module_config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 840310ed66b..63738ffc4ab 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -128,6 +128,9 @@ icc_specific_instructions: &icc_export_variables - type: PrependToEnvironmentVariable variableName: PATH variableValue: "{{.Env.ICC64_18_PATH}}" + - type: PrependToEnvironmentVariable + variableName: CONFIGURE_ARGS + variableValue: "-DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc " enable_if: condition: property property: host.compiler From cccc9fc59be715b920c7bcaef327b06bbbbbfa99 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 24 Jun 2019 09:55:49 +0200 Subject: [PATCH 0688/1322] SplitAfterVariableSubstitution is also needed for building tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just follow da7f40f7c2eb1a5928876de7b89abb55a2f8fdab. Change-Id: Iac0e96a42fa97bc002e3f11b6a6317ddc6e4187b Reviewed-by: Jędrzej Nowacki --- coin/module_config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 63738ffc4ab..03bfc75099f 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -227,6 +227,7 @@ build_instructions: directory: "{{.SourceDir}}/tests" - type: ExecuteCommand command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_PREFIX_PATH:PATH={{.InstallDir}} {{.SourceDir}}/tests" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 120 userMessageOnFailure: > From 1a2a3b72bf8bd3905098d7052287204380e0bfa1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 24 Jun 2019 14:59:21 +0200 Subject: [PATCH 0689/1322] Add PlatformCommonInternal target and QT_NO_DEBUG definition All the other PlatformModuleInternal, PlatformPluginInternal, PlatformToolInternal target will depend on the common one. Also add the QT_NO_DEBUG definition when the build type is not Debug. This fixes the lookup of the Qt platform plugin on macOS, which uses a "_debug" prefix in the plugin name depending on if the QT_NO_DEBUG definition is present or not. This is the same as it is done in mkspecs/features/qt.prf. Change-Id: I82cf461d44b8a3b3c5dc2b2d9f25baa246fc1e4b Reviewed-by: Simon Hausmann --- cmake/QtBaseGlobalTargets.cmake | 10 ++++++++-- cmake/QtInternalTargets.cmake | 10 ++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 05a41ee3e75..5bb0925f5bb 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -91,10 +91,16 @@ target_include_directories(GlobalConfigPrivate INTERFACE ) add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate) -# defines PlatformModuleInternal PlatformPluginInternal PlatformToolInternal +# defines PlatformCommonInternal PlatformModuleInternal PlatformPluginInternal PlatformToolInternal include(QtInternalTargets) -set(__export_targets Platform GlobalConfig GlobalConfigPrivate PlatformModuleInternal PlatformPluginInternal PlatformToolInternal) +set(__export_targets Platform + GlobalConfig + GlobalConfigPrivate + PlatformCommonInternal + PlatformModuleInternal + PlatformPluginInternal + PlatformToolInternal) set(__export_name "${INSTALL_CMAKE_NAMESPACE}Targets") qt_install(TARGETS ${__export_targets} EXPORT "${__export_name}") qt_install(EXPORT ${__export_name} diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index f289326de08..1fb1cc7fcd3 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -57,14 +57,20 @@ function(qt_internal_set_warnings_are_errors_flags target) endif() endfunction() +add_library(PlatformCommonInternal INTERFACE) +add_library(Qt::PlatformCommonInternal ALIAS PlatformCommonInternal) + add_library(PlatformModuleInternal INTERFACE) add_library(Qt::PlatformModuleInternal ALIAS PlatformModuleInternal) +target_link_libraries(PlatformModuleInternal INTERFACE PlatformCommonInternal) add_library(PlatformPluginInternal INTERFACE) add_library(Qt::PlatformPluginInternal ALIAS PlatformPluginInternal) +target_link_libraries(PlatformPluginInternal INTERFACE PlatformCommonInternal) add_library(PlatformToolInternal INTERFACE) add_library(Qt::PlatformToolInternal ALIAS PlatformToolInternal) +target_link_libraries(PlatformToolInternal INTERFACE PlatformCommonInternal) if(WARNINGS_ARE_ERRORS) qt_internal_set_warnings_are_errors_flags(PlatformModuleInternal) @@ -86,3 +92,7 @@ endif() if (ANDROID) target_link_options(PlatformModuleInternal INTERFACE -fuse-ld=lld) endif() + +if(NOT CMAKE_BUILD_TYPE STREQUAL Debug) + target_compile_definitions(PlatformCommonInternal INTERFACE QT_NO_DEBUG) +endif() From a581f917e2043828b032269dd6c8d60f338f3dba Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 24 Jun 2019 15:07:07 +0200 Subject: [PATCH 0690/1322] Fix plugins on macOS to have the .dylib extension add_library(MODULE) creates libraries with .so extension on macOS, but Qt plugins should have the .dylib extension. Change-Id: I603e7abfb9d5b78c0c8ea526f9fe995bf36c3a50 Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 4427d2438ba..a07641a9ad4 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1461,6 +1461,11 @@ function(add_qt_plugin target) add_library("${target}" STATIC) else() add_library("${target}" MODULE) + if(APPLE) + # CMake defaults to using .so extensions for loadable modules, aka plugins, + # but Qt plugins are actually suffixed with .dylib. + set_property(TARGET "${target}" PROPERTY SUFFIX ".dylib") + endif() endif() qt_internal_add_target_aliases("${target}") From 2895f3ffaa632f129232f70564a16f202ead0bda Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 21 Jun 2019 14:58:52 +0200 Subject: [PATCH 0691/1322] Generate a toolchain and convenience cmake wrapper This gets us a step into the direction of convenience that qmake offered: * QtBase is configured with a long command line (especially when cross-compiling) * Afterwards application developers (or other module builds) can just use qmake && make By generating a toolchain file we can capture vcpkg and toolchain chain-loading and a shell script can take care of providing the prefix path. Change-Id: Ided81f5432cab862306f2bea86cfe8e56adf71b0 Reviewed-by: Alexandru Croitor --- bin/qt-cmake.in | 3 +++ cmake/QtBaseGlobalTargets.cmake | 28 ++++++++++++++++++++++++++++ cmake/qt.toolchain.cmake.in | 18 ++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100755 bin/qt-cmake.in create mode 100644 cmake/qt.toolchain.cmake.in diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in new file mode 100755 index 00000000000..efc8a850bea --- /dev/null +++ b/bin/qt-cmake.in @@ -0,0 +1,3 @@ +#!/bin/sh + +exec @CMAKE_COMMAND@ -DCMAKE_TOOLCHAIN_FILE=@CMAKE_INSTALL_PREFIX@/@__GlobalConfig_install_dir@/qt.toolchain.cmake $* diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 5bb0925f5bb..34f2cfe6354 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -60,6 +60,34 @@ qt_install(FILES COMPONENT Devel ) +# Generate toolchain file for convenience +if(QT_HOST_PATH) + get_filename_component(init_qt_host_path "${QT_HOST_PATH}" ABSOLUTE) + set(init_qt_host_path "set(QT_HOST_PATH \"${init_qt_host_path}\" CACHE PATH \"\" FORCE)") +endif() + +if(CMAKE_TOOLCHAIN_FILE) + set(init_original_toolchain_file "set(qt_chainload_toolchain_file \"${CMAKE_TOOLCHAIN_FILE}\")") +endif() + +if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) + list(APPEND init_vcpkg "set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE \"${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}\")") +endif() + +if(VCPKG_TARGET_TRIPLET) + list(APPEND init_vcpkg "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\")") +endif() + +string(REPLACE ";" "\n" init_vcpkg "${init_vcpkg}") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt.toolchain.cmake.in" "${__GlobalConfig_build_dir}/qt.toolchain.cmake" @ONLY) +qt_install(FILES "${__GlobalConfig_build_dir}/qt.toolchain.cmake" DESTINATION "${__GlobalConfig_install_dir}" COMPONENT Devel) + +# Also provide a convenience cmake wrapper +if(UNIX) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake.in" "${QT_BUILD_DIR}/${INSTALL_BINDIR}/qt-cmake" @ONLY) + qt_install(PROGRAMS "${QT_BUILD_DIR}/bin/qt-cmake" DESTINATION "${INSTALL_BINDIR}") +endif() + ## Library to hold global features: ## These features are stored and accessed via Qt::GlobalConfig, but the ## files always lived in Qt::Core, so we keep it that way diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in new file mode 100644 index 00000000000..d816e1dcc9c --- /dev/null +++ b/cmake/qt.toolchain.cmake.in @@ -0,0 +1,18 @@ +list(APPEND CMAKE_PREFIX_PATH "@CMAKE_INSTALL_PREFIX@") +list(APPEND CMAKE_FIND_ROOT_PATH "@CMAKE_INSTALL_PREFIX@") + +@init_qt_host_path@ + +@init_original_toolchain_file@ + +@init_vcpkg@ + +if(qt_chainload_toolchain_file) + include("${qt_chainload_toolchain_file}") + unset(qt_chainload_toolchain_file) +endif() + +if(QT_HOST_PATH) + list(APPEND CMAKE_PREFIX_PATH "${QT_HOST_PATH}") + list(APPEND CMAKE_FIND_ROOT_PATH "${QT_HOST_PATH}") +endif() From a39a0e5419b6b23721ee847f32d9668eb3c2220a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 21 Jun 2019 16:45:37 +0200 Subject: [PATCH 0692/1322] Fix build of modules outside of QtBase when cross-compiling The Qt::Platform target includes the mkspecs/$spec directory, which we must unconditionally install as long as we use it. Change-Id: I272650a887b5b0b3bd868524784dca65b76b02d9 Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- CMakeLists.txt | 9 +++++++++ qmake/CMakeLists.txt | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5566870576c..242961b7173 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,15 @@ if (QT_WILL_BUILD_TOOLS) add_subdirectory(qmake) endif() +# As long as we use the mkspecs (for qplatformdefs.h), we need to always +# install it, especially when cross-compiling. +set(mkspecs_install_dir "${INSTALL_DATADIR}") +qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${mkspecs_install_dir}) + +qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" + DESTINATION ${mkspecs_install_dir}) + + qt_build_repo_end() option(BUILD_EXAMPLES "Build Qt examples" ON) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 7146776d675..438f21d767e 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -1,13 +1,5 @@ # Generated from qmake.pro. -# special case begin -set(path_component "${INSTALL_DATADIR}") -qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${path_component}) - -qt_copy_or_install(DIRECTORY "${PROJECT_SOURCE_DIR}/mkspecs" - DESTINATION ${mkspecs_install_dir}) -# special case end - ##################################################################### ## qmake Binary: ##################################################################### From 03aa74e40d8f1270e1bb28d0791e5bc376ffa0b7 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 24 Jun 2019 14:56:15 +0200 Subject: [PATCH 0693/1322] Fix tools dependencies lookup when cross-compiling When the host system uses 64-bits for pointers and the target 32-bits, then locating the tools dependencies would fail due to the mismatch. Since the tools dependencies don't create linkable targets but merely import executables, we can skip this check like in commit 914b367c7f6a117130b8a56338c46a8102a1f77f. Change-Id: I1ebd0867e4cce34f42df21dc8e8d9176a83a9cac Reviewed-by: Alexandru Croitor --- cmake/QtModuleDependencies.cmake.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/QtModuleDependencies.cmake.in b/cmake/QtModuleDependencies.cmake.in index e6855de5285..b4f27ba85c7 100644 --- a/cmake/QtModuleDependencies.cmake.in +++ b/cmake/QtModuleDependencies.cmake.in @@ -34,6 +34,12 @@ set(CMAKE_MODULE_PATH "${old_CMAKE_MODULE_PATH}") # Find Qt tool package. set(_tool_deps "@main_module_tool_deps@") + +# The tools do not provide linkage targets but executables, where a mismatch +# between 32-bit target and 64-bit host does not matter. +set(BACKUP_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}") +set(CMAKE_SIZEOF_VOID_P "") + foreach(_target_dep ${_tool_deps}) list(GET _target_dep 0 pkg) list(GET _target_dep 1 version) @@ -42,9 +48,11 @@ foreach(_target_dep ${_tool_deps}) if (NOT ${pkg}_FOUND) set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE) + set(CMAKE_SIZEOF_VOID_P "${BACKUP_CMAKE_SIZEOF_VOID_P}") return() endif() endforeach() +set(CMAKE_SIZEOF_VOID_P "${BACKUP_CMAKE_SIZEOF_VOID_P}") # note: target_deps example: "Qt6Core\;5.12.0;Qt6Gui\;5.12.0" set(_target_deps "@target_deps@") From d2c2ff83376e8b902549b8c15597460d721d7250 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 24 Jun 2019 15:01:53 +0200 Subject: [PATCH 0694/1322] Fix tools dependencies in associated modules when cross-compiling When cross-compiling we take a shortcut in add_qt_tool() for moc, etc. as the tools are already imported from the host build of Qt. However we must still add the tools as a dependency in for example QtCore so that when the cross-compiled QtCore is used, the host tools are implicitly imported. Change-Id: I83e4fd7f21e18472c0965c90c058dd2b55b6ec65 Reviewed-by: Alexandru Croitor --- cmake/QtBuild.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index a07641a9ad4..d588ccc5bf1 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1343,7 +1343,7 @@ function(qt_export_tools module_name) # Guards against the case when doing a cross-build and the function is called manually and not # by add_qt_module. - if(NOT "${module_name}" IN_LIST QT_KNOWN_MODULES_WITH_TOOLS) + if(NOT "${module_name}" IN_LIST QT_KNOWN_MODULES_WITH_TOOLS OR CMAKE_CROSSCOMPILING) return() endif() @@ -1760,6 +1760,9 @@ function(add_qt_tool name) set(CMAKE_PREFIX_PATH "${BACKUP_CMAKE_PREFIX_PATH}") if(${${tools_package_name}_FOUND} AND TARGET ${full_name}) + # Even if the tool is already visible, make sure that our modules remain associated + # with the tools. + qt_internal_append_known_modules_with_tools("${arg_TOOLS_TARGET}") get_property(path TARGET ${full_name} PROPERTY LOCATION) message(STATUS "${full_name} was found at ${path} using package ${tools_package_name}.") return() From a37771ebc58f2387b040dcc1e6a2053dbd43cf00 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 24 Jun 2019 15:51:45 +0200 Subject: [PATCH 0695/1322] Check for the correct apple clang version with warnings_are_errors The current state of qtbase is confirmed to be built with no warnings when using up to Xcode 9.2, as per the check in mkspecs/features/qt_common.prf. Add the same check for the CMake build. Change-Id: I0c2409ece048e93fba29c41a8bd053dd112949bd Reviewed-by: Simon Hausmann --- cmake/QtInternalTargets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 1fb1cc7fcd3..ad8ded29cf4 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -8,7 +8,7 @@ function(qt_internal_set_warnings_are_errors_flags target) elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") # using AppleClang # Apple clang 4.0+ - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0") + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "4.0.0" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS_EQUAL "9.2") target_compile_options("${target}" INTERFACE -Werror -Wno-error=\#warnings -Wno-error=deprecated-declarations) endif() elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") From a6576d97ca525034d47b9ae732b752c61f691ea0 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 24 Jun 2019 16:55:20 +0200 Subject: [PATCH 0696/1322] Fix vcpkg default target triplet setting in the qt toolchain file Due to scoping this variable needs to be written into the cache. Change-Id: I2704fe9ac138210571e0b7acada5eb5c65e265af Reviewed-by: Alexandru Croitor --- cmake/QtBaseGlobalTargets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake index 34f2cfe6354..d56cd44cb15 100644 --- a/cmake/QtBaseGlobalTargets.cmake +++ b/cmake/QtBaseGlobalTargets.cmake @@ -75,7 +75,7 @@ if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) endif() if(VCPKG_TARGET_TRIPLET) - list(APPEND init_vcpkg "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\")") + list(APPEND init_vcpkg "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")") endif() string(REPLACE ";" "\n" init_vcpkg "${init_vcpkg}") From ebfd09e7d66b50a93255b7bee8817132ecfc46b5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 25 Jun 2019 09:56:19 +0200 Subject: [PATCH 0697/1322] Fix early warning system Remove dummy test instructions that don't work right now and cause failures. Change-Id: I30195fe605419a8eb462e8315f71718dd86df412 Reviewed-by: Liang Qi --- coin/module_config.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 03bfc75099f..8881e05d127 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -243,10 +243,3 @@ build_instructions: archiveDirectory: "{{.SourceDir}}/tests" maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 -test_instructions: - - type: ExecuteCommand - command: echo "hello world - test" - maxTimeInSeconds: 60 - maxTimeBetweenOutput: 12 - userMessageOnFailure: > - Failed to call echo. Contact Liang then. From e25f9e20081e83a2c98d4be436d2a79a5fdbbc83 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 25 Jun 2019 10:57:20 +0200 Subject: [PATCH 0698/1322] Prepare tests for running in the CI * Add labels so that ctest --print-labels and ctest -L