From: Kefu Chai Date: Wed, 21 Jul 2021 02:44:21 +0000 (+0800) Subject: cmake: use ${NPM} instead of npm X-Git-Tag: v17.1.0~1313^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6d17e684ecbc2fda7ca22eb92798d1df80a2012c;p=ceph.git cmake: use ${NPM} instead of npm so it is more explicit that ${NPM} is used when NODEENV is not specified. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/dashboard/frontend/CMakeLists.txt b/src/pybind/mgr/dashboard/frontend/CMakeLists.txt index 3d9995b7c5d4..9928c0e71983 100644 --- a/src/pybind/mgr/dashboard/frontend/CMakeLists.txt +++ b/src/pybind/mgr/dashboard/frontend/CMakeLists.txt @@ -6,7 +6,15 @@ function(add_npm_command) 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(