From e3245d12a05533cdb87e6eec8ee3e600a010784b Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 21 Jul 2021 10:46:51 +0800 Subject: [PATCH] cmake: s/NPM/NPM_EXECUTABLE/ so the naming is more consistent with other executables found by find_program(). Signed-off-by: Kefu Chai --- CMakeLists.txt | 4 ++-- src/pybind/mgr/dashboard/frontend/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb269c0e3e8..65f78777764 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -630,8 +630,8 @@ include_directories(BEFORE SYSTEM ${Boost_INCLUDE_DIRS}) option(WITH_MGR_DASHBOARD_FRONTEND "Build the mgr/dashboard frontend using `npm`" ON) option(WITH_SYSTEM_NPM "Assume that dashboard build tools already installed through packages" OFF) if(WITH_SYSTEM_NPM) - find_program(NPM npm) - if(NOT NPM) + find_program(NPM_EXECUTABLE npm) + if(NOT NPM_EXECUTABLE) message(FATAL_ERROR "Can't find npm.") endif() endif() diff --git a/src/pybind/mgr/dashboard/frontend/CMakeLists.txt b/src/pybind/mgr/dashboard/frontend/CMakeLists.txt index 9928c0e7198..bce59d07dd8 100644 --- a/src/pybind/mgr/dashboard/frontend/CMakeLists.txt +++ b/src/pybind/mgr/dashboard/frontend/CMakeLists.txt @@ -13,7 +13,7 @@ function(add_npm_command) else() string(REGEX REPLACE "^([^ ]=[^ ] )*npm (.*)$" - "\\1${NPM} \\2" + "\\1${NPM_EXECUTABLE} \\2" command ${command}) endif() string(REPLACE " " ";" command "${command}")