Browse Source

Merge pull request #11643 from GordonSmith/HPCC-19319-Node_Test_CPack

HPCC-19319 Move node version testing into CPack instructions

Reviewed-By: Xiaoming Wang <xiaoming.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 6 years ago
parent
commit
740f3ef4a3
1 changed files with 14 additions and 14 deletions
  1. 14 14
      esp/src/CMakeLists.txt

+ 14 - 14
esp/src/CMakeLists.txt

@@ -21,20 +21,6 @@ if ( "${ECLWATCH_BUILD_STRATEGY}" STREQUAL "SKIP" )
     message ( "-- ECL Watch:  Skipping..." )
 else ()
     message ( "-- ECL Watch:  Packaging Optimized/Built Sources..." )
-    set (NODE_ERROR "")
-    execute_process(COMMAND node --version
-                    OUTPUT_VARIABLE _VERSION
-                    RESULT_VARIABLE _NODE_VERSION_RESULT)
-    if (NOT _NODE_VERSION_RESULT)
-        string (REPLACE "v" "" NODE_VERSION_STRING "${_VERSION}")
-        string (REPLACE "." ";" _VERSION_LIST "${NODE_VERSION_STRING}")
-        list (GET _VERSION_LIST 0 NODE_VERSION_MAJOR)
-        if (${NODE_VERSION_MAJOR} LESS 8)
-            set (NODE_ERROR "Node version ${NODE_VERSION_MAJOR} is too old, please install NodeJS as per https://github.com/hpcc-systems/HPCC-Platform/wiki/Building-HPCC#prerequisites" )
-        endif ()
-    else ()
-        set (NODE_ERROR "Unable to locate node/npm, please install NodeJS as per https://github.com/hpcc-systems/HPCC-Platform/wiki/Building-HPCC#prerequisites" )
-    endif ()
 
     set ( ECLWATCH_BUILD_TMP "${CMAKE_CURRENT_BINARY_DIR}/tmp" )
     set ( ECLWATCH_BUILD_DEST "${CMAKE_CURRENT_BINARY_DIR}/build" )
@@ -45,6 +31,20 @@ else ()
 
     install ( CODE "
         if ( ( NOT \"${ECLWATCH_BUILD_STRATEGY}\" STREQUAL \"IF_MISSING\" ) OR ( NOT EXISTS \"${ECLWATCH_BUILD_DEST}\" ) )
+
+            set (NODE_ERROR \"\")
+            execute_process(COMMAND node --version OUTPUT_VARIABLE _VERSION RESULT_VARIABLE _NODE_VERSION_RESULT)
+            if (NOT _NODE_VERSION_RESULT)
+                string (REPLACE \"v\" \"\" NODE_VERSION_STRING \"\${_VERSION}\")
+                string (REPLACE \".\" \";\" _VERSION_LIST \"\${NODE_VERSION_STRING}\")
+                list (GET _VERSION_LIST 0 NODE_VERSION_MAJOR)
+                if (NODE_VERSION_MAJOR LESS 8)
+                    set (NODE_ERROR \"Node version \${NODE_VERSION_MAJOR} is too old, please install NodeJS as per https://github.com/hpcc-systems/HPCC-Platform/wiki/Building-HPCC#prerequisites\" )
+                endif ()
+            else ()
+                set (NODE_ERROR \"Unable to locate node/npm, please install NodeJS as per https://github.com/hpcc-systems/HPCC-Platform/wiki/Building-HPCC#prerequisites\" )
+            endif ()
+
             if ( NOT \"${NODE_ERROR}\" STREQUAL \"\")
                 message ( WARNING \"${NODE_ERROR}\" )
             else ()