Add dedicated cmake boolean option for server landingpage webapp

This commit is contained in:
pathmapper 2022-01-06 08:28:05 +01:00
parent 0d9f82b7e3
commit 3eb888457c
7 changed files with 17 additions and 6 deletions

View File

@ -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} \

View File

@ -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

View File

@ -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'

View File

@ -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")

View File

@ -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/<br>
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

View File

@ -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= \
..
)

View File

@ -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