so it is more explicit that ${NPM} is used when NODEENV is not
specified.
Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake_parse_arguments(NC "${options}" "${single_kw}" "${multi_kw}" ${ARGN})
string(REPLACE ";" " " command "${NC_COMMAND}")
if(NC_NODEENV)
- string(REGEX REPLACE "^(.*npm .*)$" ". ${mgr-dashboard-nodeenv-dir}/bin/activate && \\1 && deactivate" command ${command})
+ string(REGEX REPLACE
+ "^(([^ ]+=[^ ]+ )*npm .*)$"
+ ". ${mgr-dashboard-nodeenv-dir}/bin/activate && \\1 && deactivate"
+ command ${command})
+ else()
+ string(REGEX REPLACE
+ "^([^ ]=[^ ] )*npm (.*)$"
+ "\\1${NPM} \\2"
+ command ${command})
endif()
string(REPLACE " " ";" command "${command}")
add_custom_command(