diff --git a/CMakeLists.txt b/CMakeLists.txt index 4603bb898..778f7dafe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ function(createDefaultCacheConfig) set(FATDB OFF CACHE BOOL "Build with ability to list entries in the Trie. Doubles DB size, slows everything down, but good for looking at state diffs and trie contents.") set(JUSTTESTS OFF CACHE BOOL "Build only for tests.") set(SOLIDITY ON CACHE BOOL "Build the Solidity language components (requried unless HEADLESS)") + set(USENPM OFF CACHE BOOL "Use npm to recompile ethereum.js if it was changed") endfunction() @@ -125,7 +126,7 @@ configureProject() set (ETH_HAVE_WEBENGINE 1) message(STATUS "CMAKE_VERSION: ${CMAKE_VERSION}") -message("-- VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}; JSONRPC: ${JSONRPC}; EVMJIT: ${EVMJIT}; FATDB: ${FATDB}; CHROMIUM: ${ETH_HAVE_WEBENGINE}") +message("-- VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}; JSONRPC: ${JSONRPC}; EVMJIT: ${EVMJIT}; FATDB: ${FATDB}; CHROMIUM: ${ETH_HAVE_WEBENGINE}; USENPM: ${USENPM}") # Default TARGET_PLATFORM to "linux". diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake index 645942998..ea272da56 100644 --- a/cmake/EthDependencies.cmake +++ b/cmake/EthDependencies.cmake @@ -134,14 +134,24 @@ if (NOT HEADLESS) message(" - windeployqt path: ${WINDEPLOYQT_APP}") 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) - string(REGEX REPLACE "npm" "" ETH_NPM_DIRECTORY ${ETH_NPM}) - message(" - npm location : ${ETH_NPM}") + if (USENPM) + + # 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) + string(REGEX REPLACE "npm" "" ETH_NPM_DIRECTORY ${ETH_NPM}) + message(" - npm location : ${ETH_NPM}") + + if (NOT ETH_NODE) + message(FATAL_ERROR "node not found!") + endif() + if (NOT ETH_NPM) + message(FATAL_ERROR "npm not found!") + endif() + endif() endif() #HEADLESS diff --git a/libjsqrc/CMakeLists.txt b/libjsqrc/CMakeLists.txt index 68500ada6..6554e523d 100644 --- a/libjsqrc/CMakeLists.txt +++ b/libjsqrc/CMakeLists.txt @@ -12,7 +12,7 @@ qt5_add_resources(JSQRC js.qrc) add_library(jsqrc STATIC ${JSQRC}) target_link_libraries(jsqrc Qt5::Core) -if (ETH_NODE AND ETH_NPM) +if (USENPM) add_custom_target(ethereumjs) add_custom_command(TARGET ethereumjs POST_BUILD