summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Android: Add support for proxiesAndy Shaw2020-06-161-0/+3
| | | | | | | Pick-to: 5.15 Fixes: QTBUG-78812 Change-Id: Id1f35a5e4ca3d8841edae378df69b65ef599c1ca Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove the openglextensions moduleEirik Aavitsland2020-06-101-1/+0
| | | | | | | | | | | | | [ChangeLog][General] The QtOpenglExtensions module has been discontinued. It provided only convenience functionality for certain direct OpenGL usage. With the new RHI graphics API abstraction, that is no longer a primary use case. Applications that still need to access that API have a number of alternative options, including QOpenGLExtraFunctions. Fixes: QTBUG-84085 Change-Id: I272af61c69ebcec207b576d67d08b59623d485ec Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* CMake: Remove special case handling for OpenSSLLeander Beernaert2020-03-061-11/+0
| | | | | | | | Now that we can generate the library config tests which verify the OpenSSL version, we no longer need these special cases. Change-Id: I8ddccf4ae1c698db9fac391976b3b4b670712582 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow building bundled 3rd party libraries in qtbaseAlexandru Croitor2020-02-251-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few things are needed to accomplish that: - the python scripts do not ignore certain system_foo features anymore (it is a hardcoded list for now just to be safe) - configurejson2cmake now outputs qt_find_package(WrapSystemFoo) calls for bundled libraries (see below) - the harfbuzz .pro file is modified to accommodate pro2cmake not being able to correctly parse some conditional scopes - the freetype .pro file is modified to make sure linking of the library succeeds without duplicate symbol errors, which qmake doesn't encounter due to magical exclusion of cpp files that are included in other cpp files (presumably for include moc_foo.cpp support) - feature evaluation for Core, Gui, Network now happens in the qtbase/src directory, so that bundled libraries can be conditionally built - for each bundled library there are now two FindWrap scripts: - FindWrapSystemFoo which finds an installed library in the system - FindWrapFoo which either uses the system installed library or the built bundled one depending on a condition - projects that intend to use bundled libraries need to link against WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets (this is handled by pro2cmake). Unfortunately manually added qt_find_package(WrapFoo) calls might still be needed as is the case for WrapFreetype and others. - a new cmake/QtFindWrapHelper.cmake file is added that provides a macro to simplify creation of WrapFoo targets that link against a bundled or system library. The implementation is fairly ugly due to CMake macro constraints, but it was deemed better than copy-pasting a bunch of almost identical code across all FindWrapFoo.cmake files. - a qtzlib header-only module is now created when using bundled zlib, to provide public syncqt created headers for consumers that need them. These are projects that have 'QT_PRIVATE += zlib-private' in their .pro files (e.g. qtimageformats, qtlocation, qt3d, etc.) This is unfortunately needed due to QtNetwork using zlib types in its private C++ API. The change includes support for building the following bundled libraries: - zlib - libpng - libjpeg - Freetype - Harfbuzz-ng - PCRE2 The following 3rd party libraries are still using an old implementation within the CMake build system, and should be migrated to the new one in the near future: - double-conversion - Old harfbuzz The are a few libraries that are not yet ported: - system-sqlite - systemxcb - maybe others Among other things, this change allows building qtbase on Windows without requiring vcpkg. Task-number: QTBUG-82167 Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Move QOpenGLWidget from QtOpenGL to its own moduleJohan Klokkhammer Helsing2020-02-181-0/+3
| | | | | | | | Same pattern as QtQuickWidgets. Gets rid of QtOpenGL's dependency on QtWidgets. Task-number: QTBUG-74409 Change-Id: I4f9b55c23e25a1e0519734037b768a16e870c7d2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Post-merge fixesAlexandru Croitor2020-01-301-3/+1
| | | | | Change-Id: I6acd29103f6cc550544e7422328d97ea0e2dcafb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Collect Json Metatypes from CMake's AutomocLeander Beernaert2019-12-041-0/+1
| | | | | | | | | | | | | | | | | | | | This patch adds a new bootstrap tool which will read CMake's AutoGenInfo.json and ParseCache.txt to determine what the current list of json files is that needs to be passed to moc --collect-json option. Right now this is enabled for qt_add_module() with the option GENERATE_METATYPES. pro2cmake has also been updated to detect qmake's CONFIG += metatypes and to generate the above option for modules. The implementation lives in Qt6CoreMacros so it can eventually be used in the public facing apis. The generated meta types file is saved under the target property QT_MODULE_META_TYPES_FILE. Change-Id: I03709c662be81dd0912d0068c23ee2507bfe4383 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add parts needed for QtQuick3DMårten Nordheim2019-11-221-0/+4
| | | | | | | | | | | There is a patch in progress to add mappings for Qt3D, so reuse the old broken Qt3D mappings, delete the duplicates. QtOpenGLExtensions is needed, so this patch includes it. Change-Id: I27896ee88b9e6873c8cd52d86afc330e309e1e14 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Annotate some projects that should not to be regeneratedAlexandru Croitor2019-10-081-0/+1
| | | | | | | Because they are completely custom written. Change-Id: I2f3d2e82ebf037a7bf42b3112fe4282589322b0e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix exporting of Core toolsAlexandru Croitor2019-07-241-3/+0
| | | | | | | | | | | | | | | It should happen after qmake is built, to make sure that the target is made global, otherwise when cross-building qtbase in another build tree, the configuration phase will fail due to not finding qmake. qmake was accidentally exported before if you configured qtbase twice, because the tool was kept around in a cache variable, the second configuration actually recreated the CoreToolsConfig.cmake file to contain qmake as well. Change-Id: I6941e83f7d6bd03c56de120fba1d18e50c4af0e4 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-111-1/+0
| | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
* Automatically find apple frameworks when building a repoAlexandru Croitor2019-06-131-2/+0
| | | | | | | | | 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 <leander.beernaert@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Android: SDK SupportLeander Beernaert2019-06-051-0/+2
| | | | | | | | | | | | | | | 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 <alexandru.croitor@qt.io>
* CMake: Add WinMain supportCristian Adam2019-06-051-0/+2
| | | | | | | Change-Id: I85c56555bc47dcf348daeb3435c621529aa2d381 Fixes: QTBUG-75195 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Allow building the tests directory as a standalone CMake projectAlexandru Croitor2019-05-221-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* Export tool config and target files for each relevant moduleAlexandru Croitor2019-05-021-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <tobias.hunger@qt.io>
* Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-161-0/+1
| | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
* CMake: Re-generate plugins/platforms/cocoaTobias Hunger2019-04-031-0/+5
| | | | | Change-Id: I6d37e018a114ba90690a6fbd8d5af71f6d1b31fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Re-generate platformsupport/clipboardTobias Hunger2019-04-031-0/+1
| | | | | | Change-Id: If05ae02f363a4a9ef6193f7f8822dcbbc58e1738 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Re-generate CMakeLists.txt file for networkTobias Hunger2019-03-111-0/+1
| | | | | Change-Id: Ib75578958a98947efbca853692b24528c1a3e8a5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: fix cocoa and graphics on macOSLiang Qi2019-03-061-1/+1
| | | | | | Change-Id: Ia956c74a54874f91cc0ea8e5105164de88890ff2 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix use of uic when cross-compilingSimon Hausmann2019-02-191-23/+4
| | | | | | | | 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 <kevin.funk@kdab.com>
* cmake: printsupport depends on core, gui and widgetsLiang Qi2019-02-141-1/+3
| | | | | Change-Id: Ifd1f8c23eca3daa788f814b450ad326f6415212f Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* cmake: Create Qt5 compat targets in config filesKevin Funk2019-02-121-1/+1
| | | | | | | | 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 <simon.hausmann@qt.io>
* CMake: Find common frameworks on apple in one placeTobias Hunger2019-01-311-0/+14
| | | | | Change-Id: I38bc631568b438970465a7616464e2b998a74607 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Store Qt features in CMake CacheTobias Hunger2019-01-171-1/+0
| | | | | | | | | | 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 <simon.hausmann@qt.io>
* CMake: Use AUTOMOC/AUTOUIC/AUTORCCTobias Hunger2018-12-141-5/+1
| | | | | Change-Id: I0235ca4f227623e5937348b4b010637921dbf154 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add Sql build and testsTobias Hunger2018-11-051-0/+3
| | | | | | Change-Id: I9bf7d61a65950eafcfe6b3ea9c437e353ff7b2ed Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Build and test QtConcurrentTobias Hunger2018-11-011-4/+15
| | | | | Change-Id: I2d4b64d3e9b2cb22c67ce462155e73b5d600fb32 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Build qdbusxml2cpp and qdbuscpp2xmlTobias Hunger2018-11-011-1/+1
| | | | | Change-Id: Ic14eb1d3608608d00836b216969acb4ed017b678 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+65
Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>