Browse Source

compiling ethereum.js is part of the cmake

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
eaa4312f3f
  1. 9
      cmake/EthDependencies.cmake
  2. 10
      libjsqrc/CMakeLists.txt
  3. 7
      libjsqrc/compilejs.sh

9
cmake/EthDependencies.cmake

@ -113,6 +113,15 @@ if (NOT HEADLESS)
message(" - macdeployqt path: ${MACDEPLOYQT_APP}") message(" - macdeployqt path: ${MACDEPLOYQT_APP}")
endif() endif()
# TODO check node && npm version
find_program(ETH_NODE node)
string(REGEX REPLACE "node" "" ETH_NODE_DIRECTORY ${ETH_NODE})
message(" - nodejs location : ${ETH_NODE}")
find_program(ETH_NPM npm)
message(" - npm location : ${ETH_NPM}")
string(REGEX REPLACE "npm" "" ETH_NPM_DIRECTORY ${ETH_NPM})
endif() #HEADLESS endif() #HEADLESS
# use multithreaded boost libraries, with -mt suffix # use multithreaded boost libraries, with -mt suffix

10
libjsqrc/CMakeLists.txt

@ -12,4 +12,14 @@ qt5_add_resources(JSQRC js.qrc)
add_library(jsqrc STATIC ${JSQRC}) add_library(jsqrc STATIC ${JSQRC})
target_link_libraries(jsqrc Qt5::Core) target_link_libraries(jsqrc Qt5::Core)
if (ETH_NODE AND ETH_NPM)
add_custom_target(ethereumjs)
add_custom_command(TARGET ethereumjs
POST_BUILD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND bash compilejs.sh ${ETH_NPM_DIRECTORY} ${ETH_NODE_DIRECTORY}
)
add_dependencies(jsqrc ethereumjs)
endif()
install( TARGETS jsqrc ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( TARGETS jsqrc ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )

7
libjsqrc/compilejs.sh

@ -0,0 +1,7 @@
#!/bin/bash
cd ethereumjs
export PATH=$PATH:$1:$2
npm install
npm run-script build
Loading…
Cancel
Save