Skip to content

Commit

Permalink
Merge pull request #46643 from pathmapper/lp_cmake
Browse files Browse the repository at this point in the history
[server] Integrate landingpage build process with cmake
  • Loading branch information
elpaso committed Jan 10, 2022
2 parents fd1b819 + 4f41405 commit ecdc190
Show file tree
Hide file tree
Showing 36 changed files with 4,304 additions and 7,283 deletions.
1 change: 1 addition & 0 deletions .docker/docker-qgis-build.sh
Expand Up @@ -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} \
Expand Down
5 changes: 5 additions & 0 deletions .docker/qgis3-qt5-build-deps.dockerfile
Expand Up @@ -102,6 +102,11 @@ RUN apt-get update \
hdbcli \
&& apt-get clean

# 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

# Oracle : client side
RUN curl https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-basic-linux.x64-19.9.0.0.0dbru.zip > instantclient-basic-linux.x64-19.9.0.0.0dbru.zip
RUN curl https://download.oracle.com/otn_software/linux/instantclient/199000/instantclient-sdk-linux.x64-19.9.0.0.0dbru.zip > instantclient-sdk-linux.x64-19.9.0.0.0dbru.zip
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/mingw64.yml
Expand Up @@ -39,6 +39,14 @@ jobs:
- name: Install build dependencies
run: ./ms-windows/mingw/mingwdeps.sh

# Node.js and Yarn for server landingpage webapp
- uses: actions/setup-node@v2
with:
node-version: '17'

- name: Make yarn available
run: corepack enable

- name: Create ccache dir
run: mkdir -p /w/.ccache/QGIS

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -56,6 +56,8 @@ qgis.kdev4
qgis.supp
qgis-test.ctest
qtcreator-build/
resources/server/api/ogc/static/landingpage
resources/server/src/landingpage/node_modules
resources/themes/*/style.qss.auto
scripts/astyle.exe
scripts/Debug
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -198,6 +198,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 (requires nodejs and yarn)")

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")
Expand Down
12 changes: 12 additions & 0 deletions INSTALL.md
Expand Up @@ -192,6 +192,12 @@ 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 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


## 3.4. Setup ccache (Optional, but recommended)

You should also setup ccache to speed up compile times:
Expand Down Expand Up @@ -435,6 +441,12 @@ To build QGIS server additional dependencies are required:
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
following command. Do never try to "re-use" an existing Qt5 build directory.
If you want to use `ccmake` or other interactive tools, run the following
Expand Down
1 change: 1 addition & 0 deletions ms-windows/mingw/build.sh
Expand Up @@ -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= \
..
)
Expand Down
21 changes: 21 additions & 0 deletions resources/CMakeLists.txt
Expand Up @@ -34,6 +34,27 @@ if (WITH_SERVER)
set(RESOURCES_FILES ${RESOURCES_FILES} ${SERVER_RESOURCE_FILES})
endif()

# Server landingpage webapp
if (WITH_SERVER_LANDINGPAGE_WEBAPP)
find_program(YARN yarn REQUIRED)

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)

add_custom_target (server_landingpage ALL DEPENDS ${LANDINGPAGE_OUTPUT_PATH}/landingpage.stamp)

add_custom_command(
POST_BUILD
OUTPUT ${LANDINGPAGE_OUTPUT_PATH}/landingpage.stamp
DEPENDS ${LANDINGPAGE_SOURCE_FILES}
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/server/src/landingpage/
${LANDINGPAGE_OUTPUT_PATH}/
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
if (APPLE)
# ASN.1 definition files of PKIX elements
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion resources/server/api/ogc/static/landingpage/index.html

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ecdc190

Please sign in to comment.