]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: use specified python for running node-gyp 33921/head
authorKefu Chai <kchai@redhat.com>
Thu, 12 Mar 2020 13:51:55 +0000 (21:51 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 12 Mar 2020 14:45:44 +0000 (22:45 +0800)
to make sure node-gyp is able to find a compatible python3

see also
https://github.com/nodejs/node-gyp#configuring-python-dependency

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/CMakeLists.txt

index 9a8a03f0a8fa9060ffa72507e976985f362179ff..7d871f986db3bf310ff64d27f802347e5c366364 100644 (file)
@@ -37,6 +37,7 @@ else()
     COMMENT "dashboard nodeenv is being installed"
   )
   add_custom_target(mgr-dashboard-nodeenv
+    COMMAND . ${mgr-dashboard-nodeenv-dir}/bin/activate && npm config set python ${MGR_PYTHON_EXECUTABLE} && deactivate
     DEPENDS ${mgr-dashboard-nodeenv-dir}/bin/npm
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   )