Skip to content

Commit

Permalink
Merge branch 'master' into settings-registry-migration-core-2
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Dec 9, 2022
2 parents 0c1ca51 + e86dc5f commit 8ca06ea
Show file tree
Hide file tree
Showing 62 changed files with 3,174 additions and 3,051 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Expand Up @@ -137,7 +137,7 @@ if(WITH_CORE)

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

set (WITH_OAUTH2_PLUGIN TRUE CACHE BOOL "Build OAuth2 authentication method plugin")
set (WITH_OAUTH2_PLUGIN TRUE CACHE BOOL "Determines whether OAuth2 authentication method plugin should be built")
if(WITH_OAUTH2_PLUGIN)
set(HAVE_OAUTH2_PLUGIN TRUE)
endif()
Expand Down Expand Up @@ -176,16 +176,16 @@ if(WITH_CORE)
mark_as_advanced (NATIVE_CRSSYNC_BIN)

# try to configure and build python bindings by default
set (WITH_BINDINGS TRUE CACHE BOOL "Determines whether python bindings should be built")
set (WITH_BINDINGS TRUE CACHE BOOL "Determines whether Python bindings should be built")
if (WITH_BINDINGS)
# By default bindings will be installed only to QGIS directory
# Someone might want to install it to python site-packages directory
# as otherwise user has to use PYTHONPATH environment variable to add
# QGIS bindings to package search path
set (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
set (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global Python directory? (might need root)")
set (SIP_GLOBAL_INSTALL FALSE CACHE BOOL "Install sip source files to system sip directory? (might need root)")
set (WITH_STAGED_PLUGINS TRUE CACHE BOOL "Stage-install core Python plugins to run from build directory? (utilities and console are always staged)")
set (WITH_PY_COMPILE FALSE CACHE BOOL "Determines whether Python modules in staged or installed locations are byte-compiled")
set (WITH_PY_COMPILE FALSE CACHE BOOL "Determines whether Python modules in staged or installed locations should be byte-compiled")
# concatenate QScintilla2 API files
if (WITH_GUI)
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.")
Expand All @@ -201,9 +201,9 @@ if(WITH_CORE)

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

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

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

set (WITH_INTERNAL_LAZPERF TRUE CACHE BOOL "Determines whether LazPerf should be built from internal copy")
set (WITH_INTERNAL_LAZPERF TRUE CACHE BOOL "Determines whether LazPerf should be built from internal copy (recommended)")
if (WITH_EPT OR WITH_COPC)
if (NOT WITH_INTERNAL_LAZPERF)
find_package(LazPerf) # for decompression of point clouds
Expand Down Expand Up @@ -438,7 +438,7 @@ if(WITH_CORE)
#############################################################
# search for Qt

set (BUILD_WITH_QT6 FALSE CACHE BOOL "Enable (broken, experimental) Qt6 support")
set (BUILD_WITH_QT6 FALSE CACHE BOOL "Enable (experimental) Qt6 support")
if (BUILD_WITH_QT6)
set(QT_MIN_VERSION 6.0.0)
set(QT_VERSION_BASE "Qt6")
Expand Down Expand Up @@ -542,7 +542,7 @@ endif()
set(CMAKE_AUTOMOC ON)

# build our version of astyle
set (WITH_ASTYLE FALSE CACHE BOOL "If you plan to contribute you should reindent with scripts/prepare_commit.sh (using 'our' astyle)")
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)")

# QML
set(QML_IMPORT_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" CACHE PATH "QML directory for QML autocomplete")
Expand Down
44 changes: 41 additions & 3 deletions INSTALL.md
Expand Up @@ -3,6 +3,7 @@ Building QGIS from source - step by step
<!-- Table of contents generated with https://freelance-tech-writer.github.io/table-of-contents-generator/index.html -->

# Table of Contents

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

### 3.7.1 Available compilation flags

QGIS build is tunable according to your needs. Many flags are available to activate or deactivate some functionalities, here is a subset:

* `BUILD_WITH_QT6`: Enable (experimental) Qt6 support
* `WITH_3D`: Determines whether QGIS 3D library should be built
* `WITH_ANALYSIS`: Determines whether QGIS analysis library should be built
* `WITH_AUTH`: Determines whether QGIS authentication methods should be built
* `WITH_BINDINGS`: Determines whether Python bindings should be built
* `WITH_COPC`: Determines whether Cloud Optimized Point Cloud (COPC) support should be built
* `WITH_DESKTOP`: Determines whether QGIS desktop should be built
* `WITH_EPT`: Determines whether Entwine Point Cloud (EPT) support should be built
* `WITH_GRASS${GRASS_CACHE_VERSION}`: Determines whether GRASS ${GRASS_SEARCH_VERSION} plugin should be built
* `WITH_GUI`: Determines whether QGIS GUI library (and everything built on top of it) should be built
* `WITH_HANA`: Determines whether SAP HANA Spatial support should be built
* `WITH_ORACLE`: Determines whether Oracle support should be built
* `WITH_PDAL`: Determines whether PDAL support should be built
* `WITH_POSTGRESQL`: Determines whether POSTGRESQL support should be built
* `WITH_QGIS_PROCESS`: Determines whether the standalone \"qgis_process\" tool should be built
* `WITH_QSPATIALITE`: Determines whether QSPATIALITE sql driver should be built
* `WITH_SERVER`: Determines whether QGIS server should be built
* `WITH_SPATIALITE`: Determines whether Spatialite support should be built (required for spatialite, virtual, wfs providers)

A complete list can been extracted from the source code with the following command line:

```bash
cmake .. -N -LH | grep -B1 WITH_
```

## 3.8. Compiling with 3D

In the cmake, you need to enable:
Expand Down Expand Up @@ -431,10 +462,12 @@ We assume that you have the source code of QGIS ready and created a
new subdirectory called `build` or `build-qt5` in it.

### 3.11.1. Install build dependencies

|Distribution|Install command for packages|
|------------|----------------------------|
| 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`` |
| older versions | ``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-devel python3-qscintilla-qt5 clang flex bison geos-devel gdal-devel sqlite-devel libspatialite-devel qt5-qtsvg-devel qt5-qtbase-tds qt5-qtbase-odbc spatialindex-devel expat-devel proj-devel qwt-qt5-devel gsl-devel postgresql-devel cmake python3-future gdal-python3 python3-psycopg2 python3-PyYAML python3-pygments python3-jinja2 python3-OWSLib qca-qt5-ossl qwt-qt5-devel qtkeychain-qt5-devel qwt-devel sip-devel libzip-devel exiv2-devel`` |
| Fedora 37 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 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 python3-gdal 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`` |
| Fedora 35/36 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 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`` |
| older versions | ``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-devel python3-qscintilla-qt5 clang flex bison geos-devel gdal gdal-devel sqlite-devel libspatialite-devel qt5-qtsvg-devel qt5-qtbase-tds qt5-qtbase-odbc spatialindex-devel expat-devel proj-devel qwt-qt5-devel gsl-devel postgresql-devel cmake python3-future gdal-python3 python3-psycopg2 python3-PyYAML python3-pygments python3-jinja2 python3-OWSLib qca-qt5-ossl qwt-qt5-devel qtkeychain-qt5-devel qwt-devel sip-devel libzip-devel exiv2-devel`` |

To build QGIS server additional dependencies are required:

Expand Down Expand Up @@ -500,7 +533,7 @@ If you're going to be developing QGIS on a Fedora system, the following extra pa
are required for the various QGIS source formatting and preparation scripts.

```bash
dnf install ccache ninja-build astyle python3-autopep8 perl-YAML-Tiny
dnf install ccache ninja-build astyle python3-autopep8 python3-mock python3-nose2 perl-YAML-Tiny
```

# 4. Building on Windows
Expand Down Expand Up @@ -603,6 +636,7 @@ call C:\OSGeo4W64\QGIS\ms-windows\osgeo4w\msvc-env.bat x86_64
Save the batch file as `C:\OSGeo4W64\OSGeo4W-dev.bat` and run it.

#### 4.1.4.1 Using configonly.bat to create the MSVC solution file

We will be using the file `ms-windows/osgeo4w/configonly.bat` to create an MSVC solution file.
There are two supported CMake generators for creating a solution file: Ninja, and native MSVC.
The advantage of using native MSVC solution is that you can find the root of build problems much more easily.
Expand All @@ -614,7 +648,9 @@ configonly.bat
```

#### 4.1.4.2 Compiling QGIS with MSVC

We will need to run MSVC with all the environment variables set, thus we will run it as follows:

* Run the batch file OSGeo4W-dev.bat you created before.
* On the command prompt run `call gdal-dev-env.bat` to add the release gdal and proj libraries to your PATH.
* On the command prompt run `devenv` to open MSVC.
Expand All @@ -623,12 +659,14 @@ We will need to run MSVC with all the environment variables set, thus we will ru
* If it fails, run it again and again until there are (hopefully) no errors.

Running QGIS from within MSVC:

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

### 4.1.5 Old alternative method that might still work using cmake-gui

Create a 'build' directory somewhere. This will be where all the build output
will be generated.

Expand Down
7 changes: 7 additions & 0 deletions python/core/auto_generated/gps/qgsgpslogger.sip.in
Expand Up @@ -27,6 +27,8 @@ from incoming GPS location points.
%End
public:



QgsGpsLogger( QgsGpsConnection *connection, QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsGpsLogger with the specified ``parent`` object.
Expand Down Expand Up @@ -122,6 +124,11 @@ handling.
double lastElevation() const;
%Docstring
Returns the last recorded elevation the device.
%End

double lastMValue() const;
%Docstring
Returns the last recorded value corresponding to the QgsGpsLogger.settingsGpsMValueComponent setting.
%End

void resetTrack();
Expand Down
38 changes: 19 additions & 19 deletions python/plugins/processing/algs/gdal/gdalcalc.py
Expand Up @@ -227,8 +227,8 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
if noData is not None:
arguments.append('--NoDataValue')
arguments.append(noData)
layer = self.parameterAsRasterLayer(parameters, self.INPUT_A, context)
if layer is None:
layer_a = self.parameterAsRasterLayer(parameters, self.INPUT_A, context)
if layer_a is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_A))

def all_equal(iterator):
Expand Down Expand Up @@ -263,7 +263,7 @@ def all_equal(iterator):
if extent != 'ignore':
arguments.append(f'--extent={extent}')

bbox = self.parameterAsExtent(parameters, self.EXTENT, context, layer.crs())
bbox = self.parameterAsExtent(parameters, self.EXTENT, context, layer_a.crs())
if not bbox.isNull():
arguments.append('--projwin')
arguments.append(str(bbox.xMinimum()))
Expand All @@ -272,52 +272,52 @@ def all_equal(iterator):
arguments.append(str(bbox.yMinimum()))

arguments.append('-A')
arguments.append(layer.source())
arguments.append(layer_a.source())
if self.parameterAsString(parameters, self.BAND_A, context):
arguments.append('--A_band ' + self.parameterAsString(parameters, self.BAND_A, context))

if self.INPUT_B in parameters and parameters[self.INPUT_B] is not None:
layer = self.parameterAsRasterLayer(parameters, self.INPUT_B, context)
if layer is None:
layer_b = self.parameterAsRasterLayer(parameters, self.INPUT_B, context)
if layer_b is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_B))
arguments.append('-B')
arguments.append(layer.source())
arguments.append(layer_b.source())
if self.parameterAsString(parameters, self.BAND_B, context):
arguments.append('--B_band ' + self.parameterAsString(parameters, self.BAND_B, context))

if self.INPUT_C in parameters and parameters[self.INPUT_C] is not None:
layer = self.parameterAsRasterLayer(parameters, self.INPUT_C, context)
if layer is None:
layer_c = self.parameterAsRasterLayer(parameters, self.INPUT_C, context)
if layer_c is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_C))
arguments.append('-C')
arguments.append(layer.source())
arguments.append(layer_c.source())
if self.parameterAsString(parameters, self.BAND_C, context):
arguments.append('--C_band ' + self.parameterAsString(parameters, self.BAND_C, context))

if self.INPUT_D in parameters and parameters[self.INPUT_D] is not None:
layer = self.parameterAsRasterLayer(parameters, self.INPUT_D, context)
if layer is None:
layer_d = self.parameterAsRasterLayer(parameters, self.INPUT_D, context)
if layer_d is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_D))
arguments.append('-D')
arguments.append(layer.source())
arguments.append(layer_d.source())
if self.parameterAsString(parameters, self.BAND_D, context):
arguments.append('--D_band ' + self.parameterAsString(parameters, self.BAND_D, context))

if self.INPUT_E in parameters and parameters[self.INPUT_E] is not None:
layer = self.parameterAsRasterLayer(parameters, self.INPUT_E, context)
if layer is None:
layer_e = self.parameterAsRasterLayer(parameters, self.INPUT_E, context)
if layer_e is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_E))
arguments.append('-E')
arguments.append(layer.source())
arguments.append(layer_e.source())
if self.parameterAsString(parameters, self.BAND_E, context):
arguments.append('--E_band ' + self.parameterAsString(parameters, self.BAND_E, context))

if self.INPUT_F in parameters and parameters[self.INPUT_F] is not None:
layer = self.parameterAsRasterLayer(parameters, self.INPUT_F, context)
if layer is None:
layer_f = self.parameterAsRasterLayer(parameters, self.INPUT_F, context)
if layer_f is None:
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_F))
arguments.append('-F')
arguments.append(layer.source())
arguments.append(layer_f.source())
if self.parameterAsString(parameters, self.BAND_F, context):
arguments.append('--F_band ' + self.parameterAsString(parameters, self.BAND_F, context))

Expand Down

0 comments on commit 8ca06ea

Please sign in to comment.