forked from bitshares/bitshares1-qtwallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenerateHtDocs.cmake.in
23 lines (19 loc) · 1.04 KB
/
GenerateHtDocs.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
IF(EXISTS "@CMAKE_CURRENT_SOURCE_DIR@/htdocs" AND IS_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/htdocs")
MESSAGE (STATUS "Target htdocs directory already exists, exiting...")
ELSE()
MESSAGE (STATUS "Spawning lineman build...")
IF(UNIX)
EXECUTE_PROCESS(COMMAND "@BITSHARES_ROOT@/node_modules/lineman/cli.js" build WORKING_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/../web_wallet"
RESULT_VARIABLE execStatus OUTPUT_VARIABLE _output ERROR_VARIABLE _output)
ELSEIF(WIN32)
EXECUTE_PROCESS(COMMAND cmd.exe /C lineman build WORKING_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/../web_wallet"
RESULT_VARIABLE execStatus OUTPUT_VARIABLE _output ERROR_VARIABLE _output)
ENDIF()
IF(NOT "${execStatus}" STREQUAL "0")
# do something here about the failed "process" call...
message(FATAL_ERROR "lineman build spawn failed: '${execStatus}'")
ENDIF()
MESSAGE(STATUS "Process output: ${_output}")
EXECUTE_PROCESS(COMMAND "@CMAKE_COMMAND@" -E copy_directory "@CMAKE_CURRENT_SOURCE_DIR@/../web_wallet/dist"
"@CMAKE_CURRENT_SOURCE_DIR@/htdocs")
ENDIF()