Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Copy first and build in build directory
  • Loading branch information
pathmapper committed Dec 30, 2021
1 parent 00f727b commit b4391e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions resources/CMakeLists.txt
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion resources/server/src/landingpage/README.md
Expand Up @@ -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
```
Expand Down

0 comments on commit b4391e0

Please sign in to comment.