Skip to content

Commit 4010706

Browse files
benoitdm-oslandianyalldawson
authored andcommittedDec 8, 2022
feat(doc): add section with build flags in INSTALL.md
1 parent b27ab6e commit 4010706

File tree

3 files changed

+48
-11
lines changed

3 files changed

+48
-11
lines changed
 

‎CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if(WITH_CORE)
137137

138138
set (WITH_GUI TRUE CACHE BOOL "Determines whether QGIS GUI library (and everything built on top of it) should be built")
139139

140-
set (WITH_OAUTH2_PLUGIN TRUE CACHE BOOL "Build OAuth2 authentication method plugin")
140+
set (WITH_OAUTH2_PLUGIN TRUE CACHE BOOL "Determines whether OAuth2 authentication method plugin should be built")
141141
if(WITH_OAUTH2_PLUGIN)
142142
set(HAVE_OAUTH2_PLUGIN TRUE)
143143
endif()
@@ -176,16 +176,16 @@ if(WITH_CORE)
176176
mark_as_advanced (NATIVE_CRSSYNC_BIN)
177177

178178
# try to configure and build python bindings by default
179-
set (WITH_BINDINGS TRUE CACHE BOOL "Determines whether python bindings should be built")
179+
set (WITH_BINDINGS TRUE CACHE BOOL "Determines whether Python bindings should be built")
180180
if (WITH_BINDINGS)
181181
# By default bindings will be installed only to QGIS directory
182182
# Someone might want to install it to python site-packages directory
183183
# as otherwise user has to use PYTHONPATH environment variable to add
184184
# QGIS bindings to package search path
185-
set (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
185+
set (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global Python directory? (might need root)")
186186
set (SIP_GLOBAL_INSTALL FALSE CACHE BOOL "Install sip source files to system sip directory? (might need root)")
187187
set (WITH_STAGED_PLUGINS TRUE CACHE BOOL "Stage-install core Python plugins to run from build directory? (utilities and console are always staged)")
188-
set (WITH_PY_COMPILE FALSE CACHE BOOL "Determines whether Python modules in staged or installed locations are byte-compiled")
188+
set (WITH_PY_COMPILE FALSE CACHE BOOL "Determines whether Python modules in staged or installed locations should be byte-compiled")
189189
# concatenate QScintilla2 API files
190190
if (WITH_GUI)
191191
set (WITH_QSCIAPI TRUE CACHE BOOL "Whether to generate PyQGIS QScintilla2 API file. (For devs) run 'make qsci-pap-src' in between QGIS build and install to regenerate .pap file in source tree for console auto-completion.")
@@ -201,9 +201,9 @@ if(WITH_CORE)
201201

202202
set (SERVER_SKIP_ECW FALSE CACHE BOOL "Determines whether QGIS server should disable ECW (ECW in server apps requires a special license)")
203203

204-
set (WITH_SERVER_PLUGINS ${WITH_BINDINGS} CACHE BOOL "Determines whether QGIS server support for python plugins should be built")
204+
set (WITH_SERVER_PLUGINS ${WITH_BINDINGS} CACHE BOOL "Determines whether QGIS server support for Python plugins should be built")
205205
if(WITH_SERVER_PLUGINS AND NOT WITH_BINDINGS)
206-
message(FATAL_ERROR "Server plugins are not supported without python bindings. Enable WITH_BINDINGS or disable WITH_SERVER_PLUGINS")
206+
message(FATAL_ERROR "Server plugins are not supported without Python bindings. Enable WITH_BINDINGS or disable WITH_SERVER_PLUGINS")
207207
endif()
208208
if(WITH_SERVER_PLUGINS)
209209
set(HAVE_SERVER_PYTHON_PLUGINS TRUE)
@@ -243,7 +243,7 @@ if(WITH_CORE)
243243
endif()
244244

245245
# try to configure and build MDAL support
246-
set (WITH_INTERNAL_MDAL TRUE CACHE BOOL "Determines whether MDAL should be built from internal copy")
246+
set (WITH_INTERNAL_MDAL TRUE CACHE BOOL "Determines whether MDAL should be built from internal copy (recommended)")
247247
if (NOT WITH_INTERNAL_MDAL)
248248
set (MDAL_PREFIX "" CACHE PATH "Path to MDAL base directory")
249249
endif()
@@ -408,7 +408,7 @@ if(WITH_CORE)
408408
message(STATUS "Qt WebKit support DISABLED.")
409409
endif()
410410

411-
set (WITH_INTERNAL_LAZPERF TRUE CACHE BOOL "Determines whether LazPerf should be built from internal copy")
411+
set (WITH_INTERNAL_LAZPERF TRUE CACHE BOOL "Determines whether LazPerf should be built from internal copy (recommended)")
412412
if (WITH_EPT OR WITH_COPC)
413413
if (NOT WITH_INTERNAL_LAZPERF)
414414
find_package(LazPerf) # for decompression of point clouds
@@ -438,7 +438,7 @@ if(WITH_CORE)
438438
#############################################################
439439
# search for Qt
440440

441-
set (BUILD_WITH_QT6 FALSE CACHE BOOL "Enable (broken, experimental) Qt6 support")
441+
set (BUILD_WITH_QT6 FALSE CACHE BOOL "Enable (experimental) Qt6 support")
442442
if (BUILD_WITH_QT6)
443443
set(QT_MIN_VERSION 6.0.0)
444444
set(QT_VERSION_BASE "Qt6")
@@ -542,7 +542,7 @@ endif()
542542
set(CMAKE_AUTOMOC ON)
543543

544544
# build our version of astyle
545-
set (WITH_ASTYLE FALSE CACHE BOOL "If you plan to contribute you should reindent with scripts/prepare_commit.sh (using 'our' astyle)")
545+
set (WITH_ASTYLE FALSE CACHE BOOL "Deprecated. Should be OFF. If you plan to contribute you should reindent with scripts/prepare_commit.sh (using 'our' astyle)")
546546

547547
# QML
548548
set(QML_IMPORT_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" CACHE PATH "QML directory for QML autocomplete")

‎INSTALL.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Building QGIS from source - step by step
33
<!-- Table of contents generated with https://freelance-tech-writer.github.io/table-of-contents-generator/index.html -->
44

55
# Table of Contents
6+
67
- [1. Introduction](#1-introduction)
78
- [2. Overview](#2-overview)
89
- [3. Building on GNU/Linux](#3-building-on-gnulinux)
@@ -13,6 +14,7 @@ Building QGIS from source - step by step
1314
- [3.5. Prepare your development environment](#35-prepare-your-development-environment)
1415
- [3.6. Check out the QGIS Source Code](#36-check-out-the-qgis-source-code)
1516
- [3.7. Starting the compile](#37-starting-the-compile)
17+
- [3.7.1 Available compilation flags](#371-available-compilation-flags)
1618
- [3.8. Compiling with 3D](#38-compiling-with-3d)
1719
- [3.8.1. Compiling with 3D on old Debian based distributions](#381-compiling-with-3d-on-old-debian-based-distributions)
1820
- [3.9. Building different branches](#39-building-different-branches)
@@ -340,6 +342,35 @@ ninja pycore
340342
ninja qgis_desktop
341343
```
342344

345+
### 3.7.1 Available compilation flags
346+
347+
QGIS build is tunable according to your needs. Many flags are available to activate or deactivate some functionalities, here is a subset:
348+
349+
* `BUILD_WITH_QT6`: Enable (experimental) Qt6 support
350+
* `WITH_3D`: Determines whether QGIS 3D library should be built
351+
* `WITH_ANALYSIS`: Determines whether QGIS analysis library should be built
352+
* `WITH_AUTH`: Determines whether QGIS authentication methods should be built
353+
* `WITH_BINDINGS`: Determines whether Python bindings should be built
354+
* `WITH_COPC`: Determines whether Cloud Optimized Point Cloud (COPC) support should be built
355+
* `WITH_DESKTOP`: Determines whether QGIS desktop should be built
356+
* `WITH_EPT`: Determines whether Entwine Point Cloud (EPT) support should be built
357+
* `WITH_GRASS${GRASS_CACHE_VERSION}`: Determines whether GRASS ${GRASS_SEARCH_VERSION} plugin should be built
358+
* `WITH_GUI`: Determines whether QGIS GUI library (and everything built on top of it) should be built
359+
* `WITH_HANA`: Determines whether SAP HANA Spatial support should be built
360+
* `WITH_ORACLE`: Determines whether Oracle support should be built
361+
* `WITH_PDAL`: Determines whether PDAL support should be built
362+
* `WITH_POSTGRESQL`: Determines whether POSTGRESQL support should be built
363+
* `WITH_QGIS_PROCESS`: Determines whether the standalone \"qgis_process\" tool should be built
364+
* `WITH_QSPATIALITE`: Determines whether QSPATIALITE sql driver should be built
365+
* `WITH_SERVER`: Determines whether QGIS server should be built
366+
* `WITH_SPATIALITE`: Determines whether Spatialite support should be built (required for spatialite, virtual, wfs providers)
367+
368+
A complete list can been extracted from the source code with the following command line:
369+
370+
```bash
371+
cmake .. -N -LH | grep -B1 WITH_
372+
```
373+
343374
## 3.8. Compiling with 3D
344375

345376
In the cmake, you need to enable:
@@ -431,6 +462,7 @@ We assume that you have the source code of QGIS ready and created a
431462
new subdirectory called `build` or `build-qt5` in it.
432463

433464
### 3.11.1. Install build dependencies
465+
434466
|Distribution|Install command for packages|
435467
|------------|----------------------------|
436468
| Fedora 35 Workstation | ``dnf install qt5-qtbase-private-devel qt5-qtwebkit-devel qt5-qtlocation-devel qt5-qttools-static qca-qt5-devel qca-qt5-ossl qt5-qt3d-devel python3-qt5-devel python3-qscintilla-qt5-devel qscintilla-qt5-devel python3-qscintilla-qt5 clang flex bison geos-devel gdal-devel hdf5-devel sqlite-devel libspatialite-devel qt5-qtsvg-devel spatialindex-devel expat-devel netcdf-devel proj-devel qwt-qt5-devel gsl-devel PDAL PDAL-devel postgresql-devel cmake python3-future gdal-python3 gdal-python-tools python3-psycopg2 python3-PyYAML python3-pygments python3-jinja2 python3-OWSLib qca-qt5-ossl qwt-qt5-devel qtkeychain-qt5-devel qwt-devel libzip-devel exiv2-devel python3-sip-devel protobuf-lite protobuf-lite-devel libzstd-devel qt5-qtserialport-devel`` |
@@ -603,6 +635,7 @@ call C:\OSGeo4W64\QGIS\ms-windows\osgeo4w\msvc-env.bat x86_64
603635
Save the batch file as `C:\OSGeo4W64\OSGeo4W-dev.bat` and run it.
604636

605637
#### 4.1.4.1 Using configonly.bat to create the MSVC solution file
638+
606639
We will be using the file `ms-windows/osgeo4w/configonly.bat` to create an MSVC solution file.
607640
There are two supported CMake generators for creating a solution file: Ninja, and native MSVC.
608641
The advantage of using native MSVC solution is that you can find the root of build problems much more easily.
@@ -614,7 +647,9 @@ configonly.bat
614647
```
615648

616649
#### 4.1.4.2 Compiling QGIS with MSVC
650+
617651
We will need to run MSVC with all the environment variables set, thus we will run it as follows:
652+
618653
* Run the batch file OSGeo4W-dev.bat you created before.
619654
* On the command prompt run `call gdal-dev-env.bat` to add the release gdal and proj libraries to your PATH.
620655
* On the command prompt run `devenv` to open MSVC.
@@ -623,12 +658,14 @@ We will need to run MSVC with all the environment variables set, thus we will ru
623658
* If it fails, run it again and again until there are (hopefully) no errors.
624659

625660
Running QGIS from within MSVC:
661+
626662
* Edit the properties of the project ALL_BUILD to include the path to the executable:
627663
* Debugging -> Command -> `C:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo\qgis.exe`.
628664
* To run, use the menu commands: Debug -> Start Debugging (F5) or Start Without Debugging (Ctrl+F5).
629665
* Ignore the "These projects are out of date" message, it appears even if no files were changed.
630666

631667
### 4.1.5 Old alternative method that might still work using cmake-gui
668+
632669
Create a 'build' directory somewhere. This will be where all the build output
633670
will be generated.
634671

‎src/app/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ endif()
374374

375375
find_package(${QT_VERSION_BASE} COMPONENTS UiTools REQUIRED)
376376

377-
set (WITH_QWTPOLAR FALSE CACHE BOOL "Determines whether QwtPolar should be built")
377+
set (WITH_QWTPOLAR FALSE CACHE BOOL "Determines whether QwtPolar is available or whether functionality requiring QwtPolar should be disabled.")
378378

379379
if (WITH_QWTPOLAR)
380380
add_definitions(-DWITH_QWTPOLAR)

0 commit comments

Comments
 (0)
Please sign in to comment.