ncmake Manual

January 23, 2018 ยท View on GitHub

Usage: ncmake [options] <command> (-- [cmake options])

Only a single command is interpreted. Options should precede the command but can occur in any order.

CommandDescription
helpShows the help dialog
buildBuilds the native addon
cleanCleans the build
distcleanRemoves all build files
configureRuns CMake to generate the project configuration
rebuildRuns clean, configure and build
updateCopies the NodeJS.cmake from the installed module
install(Advanced) Installs the native addon
listDeprecated node-gyp command (no-op)
removeDeprecated node-gyp command (no-op)

Command Options

node-gyp accepts the following command options:

CommandDescription
-d, --debugMake Debug build (default=Release)
-h, --helpShows the help dialog
--versionShows the version of ncmake

Advanced options

CommandDescription
--targetNode version to build for (default="installed")
--dist-urlDownload dependencies from custom URL
--nameThe executable target name (default="node")
-o, --outputThe output directory (default="build")
-g, --generatorThe CMake generator to use
-a, --archThe target architecture (see process.arch)

CMake options

Additional options can be passed to CMake during any configure step by passsing a -- separator followed by any arguments. This is useful to set additional parameters (-D flags) unique to your project.

Ncmake translates several of its own options into -D flags passed to cmake. The default behaviour of cmake is that the last value passed via command line wins. Ncmake uses the flag -DCMAKE_BUILD_TYPE, which is set to ensure the binary output directory matches node-gyp's behaviour. If you override this property, ncmake makes no guarantee of proper execution. To ensure proper execution, use the -d flag to switch between Debug and Release output instead of setting the value directly. YOU HAVE BEEN WARNED.

Deprecated options

All deprecated options are silently ignored

CommandDescription
-j n, --jobs nIgnored
--silly, --loglevel=sillyIgnored
--verbose, --loglevel=verboseIgnored
--silent, --loglevel=silentIgnored
--release, --no-debugDefault
-C $dir, --directory=$dirIgnored
--make=$makeIgnored
--thin=yesIgnored
--tarball=$pathIgnored
--ensureIgnored
--proxy=$urlIgnored
--cafile=$cafileIgnored
--nodedir=$pathIgnored
--python=$pathIgnored
--msvs_version=$versionIgnored
--solution=$solutionIgnored

Examples

ncmake rebuild -d

Build the module in debug mode

ncmake --target v6.2.1 rebuild

Build a module targeting v6.2.1 of Node.js

ncmake rebuild -- -DMY_PROJECT_ARG=10

Build a module, passing additional arguments directly to cmake.