summaryrefslogtreecommitdiffstats
path: root/cmake/README.md
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Autodetect Android toolchain file and NDKJoerg Bornemann2020-10-131-5/+12
| | | | | | | | | | | | | | | | | | | | The Android toolchain file is now autodetected from the location of the NDK. The NDK location can be specified by setting the CMake variable ANDROID_NDK_ROOT. Auto-detection of the Android toolchain file is the only purpose of this variable. In recent Android SDK installations the path to the NDK is well-known and can be auto-detected too. If only ANDROID_SDK_ROOT is given, we try to detect ANDROID_NDK_ROOT first and from that the Android toolchain file. Adjust the build instructions in cmake/README.md, and remove the part where we suggest to set some environment variables that are only used to create the cmake call. Task-number: QTBUG-87068 Change-Id: Ia0df5df7651e98979e9cead1cdae7b17ecbc4afb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Implement missing iOS-related configure optionsAlexandru Croitor2020-10-121-3/+3
| | | | | | | | | | | | | | | Detect an iOS build when either an -sdk option is passed or when -xplatform macx-ios-clang is passed as a target mkspec. Now that CMake 3.17 is released, change the default behavior of the iOS build to configure with simulator_and_device set to ON, like it is with qmake. Update the documentation regarding iOS configuration. Change-Id: I91aaf706610b8d3c69f1ad4ba9dadee2b1e5db97 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Remove outdated info from README.mdKai Koehne2020-10-081-3/+0
| | | | | | | | | 3.17.0 is released since a while. ANyhow, the requirement for 3.17 for simulator_and_device builds is already mentioned at the start. Change-Id: Ic8813bb60b010feb97a47b878124c3e75658813d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Introduce QT_CHAINLOAD_TOOLCHAIN_FILEJoerg Bornemann2020-10-071-0/+2
| | | | | | | | | This variable can be set when using qt-cmake[-private] to override the CMake toolchain file that is chainloaded by Qt's toolchain file. Task-number: QTBUG-87068 Change-Id: Id529408381e4174becda1ba07a489535c8cf1314 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Document convenience scripts in READMEJoerg Bornemann2020-10-071-0/+45
| | | | | Change-Id: I7ec7f01f744285fc086de8a0430afbf49563adce Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: set default API level to 23 in docsAssam Boudjelthia2020-09-231-1/+1
| | | | | | | | | Android minimum API level for Qt 6 is 23, this reflects that to some instances that still mention 21. Change-Id: I996f3ed3af14dca114129351d6ea06afcb8f45f5 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix markdown syntax in cmake/README.mdJoerg Bornemann2020-09-111-1/+1
| | | | | | | | | Make this file parsable by tools that are less lenient than github. Triple-backquotes are for fenced code blocks. Inline code uses backticks (or double backticks if you have code with backticks). Change-Id: Ic49d946fbcaa6f7e97702eadf4a0b0c726fc3217 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake Port: Remove outdated information in README.mdKai Koehne2020-08-191-3/+0
| | | | | Change-Id: Iefc1e13f5882ca69a2583f2454d00d9dfb42640d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix typo in README about how to build Android for arm64Alexandru Croitor2020-08-171-1/+1
| | | | | | Task-number: QTBUG-85399 Change-Id: I764f5d5155d6548ca61d3217fb5bb10f5b15908f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* cmake, README: clearify the usage of '-' in feature namesRichard Moe Gustavsen2020-08-121-1/+2
| | | | | | | | | | It's not immediately obvious that you need to use all underscores for the feature name, so add a line that explaines it. Change-Id: I508eaf909c808fb0a93442f6e71428c18559b965 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Document the mapping of configure options to CMake argumentsJoerg Bornemann2020-07-021-0/+2
| | | | | | | | | Add internal documentation how to map configure options to CMake arguments. This patch adds a markdown file with a giant table, and cmake/README.md links to it. Change-Id: I94a6a4ee24ed0114ccb3095d2c13cf5d84e2de72 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix typo in readmePaul Wicking2020-05-041-1/+1
| | | | | Change-Id: I6066eb5309ff7e6e4e6fd1b8dff65957be6d5a55 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update instructions for developer builds with CMakeTor Arne Vestbø2020-03-111-1/+1
| | | | | Change-Id: I101a4b12bae393fa188bb2633cc2d74170adbb4c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Update the README regarding the minimum cmake version requiredAlexandru Croitor2020-03-101-2/+1
| | | | | | | | | | | The minimum required CMake version to build Qt on any platform is 3.16.0 at the moment. That's the first version that ships the implementation-specific AutogenInfo.json files, which we parse to implement the Qt moc --collect-json functionality. Change-Id: I6160cd74fa228aa330f4c1e512ffb766afc5f8a3 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Update cmake/README with newer informationAlexandru Croitor2020-03-091-88/+35
| | | | | Change-Id: Ia0e723bb24b8a60dc02d2d218f5a2b5dc2b24017 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* cmake/README.md: Clarify some pointsFriedemann Kleint2019-12-091-4/+6
| | | | | | | | | - Mention location of the configure.cmake - Specify the path to the conversion scripts Change-Id: Ia6e13a1f4d2c29f2fbaf35acdd70ab16c7175d37 Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add initial support for cross-building to iOSAlexandru Croitor2019-12-031-1/+52
| | | | | | | | | | | | | | | | | | | | | | Tested locally with the following configurations: - iOS device builds (arm64) - iOS simulator builds (x86_64) - iOS simulator_and_device builds (fat arm64 and x86_64 archives) All iOS builds currently require a custom vcpkg fork which contains fixes for building the required 3rd party libraries. qtsvg, qtdeclarative, qtgraphicaleffects and qtquickcontrols2 have also been tested to build successfully. simulator_and_device builds are also supported, but require an umerged patch in upstream CMake as well as further patches to vcpkg. Task-number: QTBUG-75576 Change-Id: Icd29913fbbd52a60e07ea5253fd9c7af7f8ce44c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* Fix typo in CMake Android setup instructionsFrederik Gladhorn2019-09-181-1/+1
| | | | | | Change-Id: I793283080dbd8e208c136e368036721a00e9fee2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* cmake/README.md: Make more obvious how to set BUILD_EXAMPLES/TESTINGAlessandro Portale2019-09-161-1/+1
| | | | | | | | | | BUILD_EXAMPLES and BUILD_TESTING are supposed to be defined via arguments when executing cmake. The current text does not make that clear. Change the wording, so that it matches other places in the document that explain which cmake arguments to set when. Change-Id: I058cf9d6bc7660c9f4820e2a7342bc64e99d6a72 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Reflow text in cmake/README.md to be less than 100 chars per lineAlexandru Croitor2019-09-101-38/+99
| | | | | | Change-Id: Ie34c03c409a20546ace1ddc84f8813c1772936f7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Be more verbose on required environment variablesMaurice Kalinowski2019-08-281-1/+1
| | | | | | | | Make sure to document both variables are required when invoking cmake. Otherwise, one might be omitted causing side-effects. Change-Id: I3390df1cb5352ea6113952c99fcedef5336f2fc1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add auto detection routines for androidLeander Beernaert2019-06-271-1/+3
| | | | | | | | | | Add QtAutoDectect cmake which has routines to handle the vcpkg detection as well as set up some android configuration parameters. The latter will contribute towards keeping the cmake configuration commands shorter when targeting android. Change-Id: I721291c8dce39b5c298565a46867ddcab2df90e8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Update README for other Android architecturesLeander Beernaert2019-06-271-1/+10
| | | | | | | | Update the cmake README file with explanations on how to target the other available Android architectures. Change-Id: Id7653abc4a1a6fbb96797014ce2ca2e6bb49943d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add support for picking up vcpkg automaticallySimon Hausmann2019-06-201-5/+6
| | | | | | | | | | 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 <alexandru.croitor@qt.io>
* Add support for vcpkg default target tripletsSimon Hausmann2019-06-201-2/+2
| | | | | | | | | | | | | 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 <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* CMake: clarify readmeFrederik Gladhorn2019-06-171-12/+20
| | | | | | | | | Always install - not installing doesn't make much sense. Add information about developer-build. Change-Id: I406d007e9b167ee83d126ffa6e78235743402c33 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-06-141-1/+1
| | | | | | | | | | This changes many different CMake places to mention Qt6 instead of Qt5. Note that some old qt5 cmake config files in corelib are probably not needed anymore, but I still renamed and kept them for now. Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
* Android: Generate deployment-settings.jsonLeander Beernaert2019-06-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* Android: SDK SupportLeander Beernaert2019-06-051-1/+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: Also bump to CMake 3.15 in READMEKai Koehne2019-06-051-1/+1
| | | | | | | Amends fecd9d90daa Change-Id: I5373844515c83d218f840b3277ac2c49f318620e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix linking QtGui on AndroidSimon Hausmann2019-06-041-1/+1
| | | | | | | | | | | | | 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 <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
* Add some basic instructions for cross-compiling for AndroidSimon Hausmann2019-06-031-0/+15
| | | | | | | Change-Id: I0113a7b1e4e3b4d2fc7f93f9809d08fcaf4715d7 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix static zstd linkageSimon Hausmann2019-05-241-1/+1
| | | | | | | | | 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 <tobias.hunger@qt.io>
* Update vcpkg instructionsSimon Hausmann2019-05-241-21/+5
| | | | | | | | | Let's recommend vcpkg only on Windows for now. That's best maintained and works best there. Change-Id: Ied06b6a3cb26d9e56d3f525c1d5a410223754fba Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Update readme to mention how to set feature flagsAlexandru Croitor2019-05-021-0/+6
| | | | | Change-Id: If63d37af4711c4332129d65b934269c33f041ea4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Export tool config and target files for each relevant moduleAlexandru Croitor2019-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Update readme with some useful infoAlexandru Croitor2019-05-011-14/+39
| | | | | | | | | | | 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 <simon.hausmann@qt.io>
* Update README to mention setting the vcpkg toolchainAlexandru Croitor2019-03-111-1/+2
| | | | | Change-Id: Icac2ba956246901e02bb6aa257f81cccf56560e8 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* cmake: fix the order of parameters for homebrewLiang Qi2019-03-071-1/+1
| | | | | Change-Id: I7b597a8d6bc81eafb21e5368a29700638c351bdf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update README to specify the minimum version of CMake neededAlexandru Croitor2019-03-071-3/+6
| | | | | Change-Id: I10e594859129bddfa56f078389b2272a0072fda0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Provide some basic instructions for cross-compiling and using CCacheSimon Hausmann2019-02-191-0/+24
| | | | | Change-Id: I8bb90746d0cef2ea61a5494ef358713d732dcfce Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* cmake: update README.mdLiang Qi2019-02-121-0/+10
| | | | | | | Added info for using homebrew on macOS. Change-Id: Ie425793d3de1e72a9342f6c2aaf67a4f85592f3a Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* CMake: update README.mdLiang Qi2019-01-161-2/+3
| | | | | | | Because AUTOMOC/AUTOUIC/AUTORCC got merged into master. Change-Id: I0ddfd4443a9892fae1dca54d75b97af4c69ad7ef Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* CMake: Use AUTOMOC/AUTOUIC/AUTORCCTobias Hunger2018-12-141-0/+2
| | | | | Change-Id: I0235ca4f227623e5937348b4b010637921dbf154 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Begin port of qtbase to CMakeSimon Hausmann2018-11-011-0/+103
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>