summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2019-06-17 15:54:10 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2019-06-17 15:52:53 +0000
commit264d3bc9ba886b3e71dc3bad98a382c0b090c2ce (patch)
treeb02513c3bb3ed58f8cf1b412f2a7a96eee00055d /cmake
parentaaa7ce460a67737b6a279db12442595a815aee90 (diff)
CMake: clarify readme
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
Diffstat (limited to 'cmake')
-rw-r--r--cmake/README.md32
1 files changed, 20 insertions, 12 deletions
diff --git a/cmake/README.md b/cmake/README.md
index 01efe221cf..2580fd97fd 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:
+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/where/to/install {path to source directory}
- ninja
- ninja install
+ cmake -GNinja -DCMAKE_INSTALL_PREFIX=/path/to/qtbase_build -DFEATURE_developer_build=ON {path to source directory}
+ cmake --build .
+ # do NOT make 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).
-
## Specifying configure.json features on the command line
QMake defines most features in configure.json files, like -developer-build or -no-opengl.