cjntaylor / node-cmake

CMake-based build system for node.js native modules
ISC License
78 stars 20 forks source link

CMAKE_MODULE_PATH Windows #60

Closed thejustinwalsh closed 4 years ago

thejustinwalsh commented 4 years ago

In the prependModulePath(args) function when running on windows the paths are not escaped and cmake is choking on the windows \ path that is returned from const MODULE_PATH = path.resolve(__dirname, '..', 'cmake');.

By modifying the function with:

  if (WINDOWS)
    paths = paths.replace(/\\/g, "/");

  out[1] = `CMAKE_MODULE_PATH=${paths}`;

CMake is able to handle the path and work properly.

I am not certain of the proper fix here as it appears that __dirname is working correctly on windows but CMake requires additional escaping or the use of the / to handle the string properly.

cmake version 3.18.2
node v12.18.3
thejustinwalsh commented 4 years ago

Bah. Wrong repo. Was actually looking for cmake-node not confusing at all.