Support for alternative build tools (node-cmake)
See original GitHub issueIn an effort to ditch the python dependency of node-gyp, we’ve been experimenting with node-cmake, which is a thin wrapper around cmake.
It’s use is quite straightforward if you’re already using CMake. We just added this:
and we can build our .node binary with:
./node_modules/.bin/ncmake --build
After this is run, all the usual node-pre-gyp package, node-pre-gyp publish commands work as expected.
With a little bit of hackery, I added support for ncmake to node-pre-gyp build by providing an alternative to lib/util/compile.js that calls the appropriate ncmake commands instead of their node-gyp equivalents.
Would it make sense to support alternative build tools like this in node-pre-gyp on a larger scale? The publishing logic is well established and independent of the build tool.
An alternative might be to fork node-pre-gyp into node-pre-cmake.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5

Top Related StackOverflow Question
Current work-a-round we use in
node-osrmfor this is adding the following to the package.json:That way we defer to the makefile in case we need to actually compile code and run our own cmake based toolchain.
@danpat would you consider sharing your changes to
lib/util/compile.js? I am also preferring node-cmake these days (in part, due to CLion’s nice CMake support).