From 3eb888457c5169d0b66aaf85193e0351016c17a2 Mon Sep 17 00:00:00 2001 From: pathmapper Date: Thu, 6 Jan 2022 08:28:05 +0100 Subject: [PATCH] Add dedicated cmake boolean option for server landingpage webapp --- .docker/docker-qgis-build.sh | 1 + .docker/qgis3-qt5-build-deps.dockerfile | 2 +- .github/workflows/mingw64.yml | 2 +- CMakeLists.txt | 2 ++ INSTALL.md | 10 ++++++++-- ms-windows/mingw/build.sh | 1 + resources/CMakeLists.txt | 5 +++-- 7 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.docker/docker-qgis-build.sh b/.docker/docker-qgis-build.sh index 26a2f541cd6..4345bac777d 100755 --- a/.docker/docker-qgis-build.sh +++ b/.docker/docker-qgis-build.sh @@ -80,6 +80,7 @@ cmake \ -DWITH_ASTYLE=OFF \ -DWITH_BINDINGS=${WITH_QT5} \ -DWITH_SERVER=${WITH_QT5} \ + -DWITH_SERVER_LANDINGPAGE_WEBAPP=${WITH_QT5} \ -DWITH_ORACLE=${WITH_QT5} \ -DWITH_PDAL=${WITH_QT5} \ -DWITH_QT5SERIALPORT=${WITH_QT5} \ diff --git a/.docker/qgis3-qt5-build-deps.dockerfile b/.docker/qgis3-qt5-build-deps.dockerfile index 0af8abb81d1..a7f5d66c108 100644 --- a/.docker/qgis3-qt5-build-deps.dockerfile +++ b/.docker/qgis3-qt5-build-deps.dockerfile @@ -102,7 +102,7 @@ RUN apt-get update \ hdbcli \ && apt-get clean -# Node.js and Yarn for server landingpage +# Node.js and Yarn for server landingpage webapp RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - RUN apt-get install -y nodejs RUN corepack enable diff --git a/.github/workflows/mingw64.yml b/.github/workflows/mingw64.yml index 635c4dd4e21..c0d6f79ec87 100644 --- a/.github/workflows/mingw64.yml +++ b/.github/workflows/mingw64.yml @@ -39,7 +39,7 @@ jobs: - name: Install build dependencies run: ./ms-windows/mingw/mingwdeps.sh - # Node.js and Yarn for server landingpage + # Node.js and Yarn for server landingpage webapp - uses: actions/setup-node@v2 with: node-version: '17' diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f387547837..26998f49ae7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,8 @@ if(WITH_CORE) # server disabled default because it needs FastCGI (which is optional dependency) set (WITH_SERVER FALSE CACHE BOOL "Determines whether QGIS server should be built") if(WITH_SERVER) + set (WITH_SERVER_LANDINGPAGE_WEBAPP FALSE CACHE BOOL "Determines whether QGIS server landingpage webapp should be built (building webapp disabled by default because it needs nodejs and yarn (which are optional dependencies)") + 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") diff --git a/INSTALL.md b/INSTALL.md index 85cba01e57a..3eba8ac7fc1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -192,7 +192,7 @@ See [debian-ubuntu](https://qgis.org/en/site/forusers/alldownloads.html#debian-u currently supported distributions (plain xenial's GDAL for instance is too old and we build with GDAL2 from ubuntugis). -To build QGIS server additional dependencies are required for building the server landingpage: +To build QGIS server landingpage webapp additional dependencies are required: Node.js (current LTS recommended): https://nodejs.org/en/download/
Yarn Package Manager: https://yarnpkg.com/getting-started/install @@ -438,7 +438,13 @@ new subdirectory called `build` or `build-qt5` in it. To build QGIS server additional dependencies are required: ```bash -dnf install fcgi-devel nodejs yarnpkg +dnf install fcgi-devel +``` + +And for building QGIS server landingpage webapp: + +```bash +dnf install nodejs yarnpkg ``` Make sure that your build directory is completely empty when you enter the diff --git a/ms-windows/mingw/build.sh b/ms-windows/mingw/build.sh index fa0e9b00bd3..115b1e4b29b 100755 --- a/ms-windows/mingw/build.sh +++ b/ms-windows/mingw/build.sh @@ -95,6 +95,7 @@ mkdir -p "$BUILDDIR" -DBINDINGS_GLOBAL_INSTALL=ON \ -DSIP_GLOBAL_INSTALL=ON \ -DWITH_SERVER=ON \ + -DWITH_SERVER_LANDINGPAGE_WEBAPP=ON \ -DTXT2TAGS_EXECUTABLE= \ .. ) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 0a9cb1d4ecf..5ee0b6de1b8 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -32,8 +32,10 @@ endif() if (WITH_SERVER) file(GLOB_RECURSE SERVER_RESOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} server/*) set(RESOURCES_FILES ${RESOURCES_FILES} ${SERVER_RESOURCE_FILES}) +endif() - # Landingpage +# Server landingpage webapp +if (WITH_SERVER_LANDINGPAGE_WEBAPP) file(GLOB_RECURSE LANDINGPAGE_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} server/src/landingpage/*) set(LANDINGPAGE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/output/data/resources/server/src/landingpage) @@ -49,7 +51,6 @@ if (WITH_SERVER) COMMAND ${CMAKE_COMMAND} -E touch ${LANDINGPAGE_OUTPUT_PATH}/landingpage.stamp COMMAND cd ${LANDINGPAGE_OUTPUT_PATH} && yarn install --frozen-lockfile && yarn build ) - endif() # Apple specific handling