Copy first and build in build directory

This commit is contained in:
pathmapper 2021-12-27 19:02:56 +01:00
parent 00f727bd1c
commit b4391e0a69
3 changed files with 8 additions and 9 deletions

1
.gitignore vendored
View File

@ -57,7 +57,6 @@ qgis.supp
qgis-test.ctest
qtcreator-build/
resources/server/api/ogc/static/landingpage
resources/server/src/landingpage/landingpage.stamp
resources/server/src/landingpage/node_modules
resources/themes/*/style.qss.auto
scripts/astyle.exe

View File

@ -35,19 +35,19 @@ if (WITH_SERVER)
# Landingpage
file(GLOB_RECURSE LANDINGPAGE_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} server/src/landingpage/*)
list(REMOVE_ITEM $(LANDINGPAGE_SOURCE_FILES) "*landingpage.stamp")
set(LANDINGPAGE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../output/data/resources/server/src/landingpage)
add_custom_target (yarn-target ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/server/src/landingpage/landingpage.stamp)
add_custom_target (yarn-target ALL DEPENDS ${LANDINGPAGE_OUTPUT_PATH}/landingpage.stamp)
add_custom_command(
POST_BUILD
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/server/src/landingpage/landingpage.stamp
OUTPUT ${LANDINGPAGE_OUTPUT_PATH}/landingpage.stamp
DEPENDS ${LANDINGPAGE_SOURCE_FILES}
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/server/src/landingpage/landingpage.stamp
COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR}/server/src/landingpage && yarn install --frozen-lockfile && yarn build
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/server/api/ogc/static/landingpage/
${CMAKE_CURRENT_BINARY_DIR}/../output/data/resources/server/api/ogc/static/landingpage/
${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()

View File

@ -17,7 +17,7 @@ yarn serve
yarn build
```
Built files location: `resources/server/api/ogc/static/landingpage`
Built files location: `../../api/ogc/static/landingpage/`
### Lints and fixes files
```