forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (26 loc) · 1.07 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
find_program (NPM_EXECUTABLE "npm")
if (NOT NPM_EXECUTABLE)
remove_tool (webui "`npm` executable was not found")
else ()
# configure and copy files
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/README.md" "${CMAKE_CURRENT_BINARY_DIR}/README.md")
# find installation path
set (install_directory ${TARGET_TOOL_DATA_FOLDER}/webui)
# install files to destination
install (
DIRECTORY .
DESTINATION ${install_directory}
PATTERN "node_modules" EXCLUDE
PATTERN "build" EXCLUDE)
install (FILES README.md DESTINATION ${install_directory})
install (CODE "message (\"-- Installing: elektra-web > webui\")")
install (
CODE "execute_process (COMMAND npm install --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
)
install (
CODE "execute_process (COMMAND npm run build --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
)
install (
CODE "execute_process (COMMAND npm prune --production --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
)
endif ()