diff --git a/CMakeLists.txt b/CMakeLists.txt index 5898713e393..32cb6cad57a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,9 @@ endif() # don't relink it only the shared object changes set(CMAKE_LINK_DEPENDS_NO_SHARED ON) -set (WITH_BINDINGS TRUE CACHE BOOL "Determines whether Python bindings should be built") +option (WITH_PYTHON "Determines whether Python support should be built (disabling it will in particular disable processing)" ON) +set(WITH_BINDINGS ${WITH_PYTHON} CACHE BOOL "Determines whether Python bindings should be built") + set (WITH_3D TRUE CACHE BOOL "Determines whether QGIS 3D library should be built") set (WITH_QGIS_PROCESS TRUE CACHE BOOL "Determines whether the standalone \"qgis_process\" tool should be built") set (WITH_DESKTOP TRUE CACHE BOOL "Determines whether QGIS desktop should be built") @@ -317,8 +319,11 @@ if(WITH_CORE) # The qgis_desktop target is meant to build a minimal but complete running QGIS during development # This should help to reduce compile time while still having a "complete enough" QGIS for most of the development add_custom_target(qgis_desktop - DEPENDS qgis qgispython pycore pygui pyanalysis provider_postgres staged-plugins pyplugin-installer resources svg doc icons + DEPENDS qgis provider_postgres staged-plugins resources svg doc icons ) + if ( WITH_PYTHON ) + add_dependencies(qgis_desktop qgispython pycore pygui pyanalysis staged-plugins pyplugin-installer ) + endif() endif() # try to configure and build MDAL support @@ -1181,7 +1186,6 @@ if (WITH_CORE AND WITH_BINDINGS) endif() endif() - ############################################################# # create qgsconfig.h # installed with app target diff --git a/INSTALL.md b/INSTALL.md index 99b509038b4..0e1f7431550 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -361,6 +361,7 @@ QGIS build is tunable according to your needs. Many flags are available to activ * `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_PYTHON`: Determines whether Python support should be built (disabling it will in particular disable processing) * `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 diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index d7e1797532d..b042c860811 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -567,12 +567,17 @@ target_include_directories(qgis_app PUBLIC ${CMAKE_SOURCE_DIR}/src/app/tiledscene ${CMAKE_SOURCE_DIR}/src/app/vectortile ${CMAKE_SOURCE_DIR}/src/plugins - ${CMAKE_SOURCE_DIR}/src/python ${CMAKE_SOURCE_DIR}/src/native ${CMAKE_BINARY_DIR}/src/app ) +if (WITH_PYTHON) + target_include_directories(qgis_app PUBLIC + ${CMAKE_SOURCE_DIR}/src/python + ) +endif() + if (WITH_3D) target_include_directories(qgis_app PUBLIC ${CMAKE_SOURCE_DIR}/src/app/3d