node-cmake
Advanced tools
Comparing version 2.0.3 to 2.1.0
@@ -15,2 +15,3 @@ # ncmake Manual | ||
| `rebuild` | Runs clean, configure and build | ||
| `update` | Copies the NodeJS.cmake from the installed module | ||
| `install` | Deprecated `node-gyp` command (no-op) | ||
@@ -17,0 +18,0 @@ | `list` | Deprecated `node-gyp` command (no-op) |
@@ -18,4 +18,4 @@ { | ||
"devDependencies": { | ||
"node-cmake": "^2.0.0" | ||
"node-cmake": "2.x" | ||
} | ||
} |
@@ -36,3 +36,4 @@ #!/usr/bin/env node | ||
.command('configure', 'Runs CMake to generate the project configuration') | ||
.command('rebuild', 'Runs clean, configure and build'); | ||
.command('rebuild', 'Runs clean, configure and build') | ||
.command('update', 'Copies the NodeJS.cmake from the installed module'); | ||
@@ -219,2 +220,30 @@ // Deprecated commands from node-gyp | ||
}, | ||
update: function (argv, cmake) { | ||
return new Promise(function (resolve, reject) { | ||
// The CMake script is relative to this utility when installed | ||
var source = path.resolve(path.join(__dirname, '..', 'NodeJS.cmake')); | ||
var output = path.resolve('NodeJS.cmake'); | ||
var rd = fs.createReadStream(source); | ||
rd.on('error', function (err) { | ||
var err = new Error('Unable to read NodeJS.cmake'); | ||
err.code = 9; | ||
reject(err); | ||
}); | ||
var wr = fs.createWriteStream(output); | ||
wr.on('error', function (err) { | ||
var err = new Error('Unable to write NodeJS.cmake'); | ||
err.code = 9; | ||
reject(err); | ||
}); | ||
wr.on('close', function (err) { | ||
if(err) { | ||
var err = new Error('Unknown I/O error'); | ||
err.code = 9; | ||
reject(err); | ||
} | ||
resolve(); | ||
}); | ||
rd.pipe(wr); | ||
}); | ||
}, | ||
install: deprecated, | ||
@@ -221,0 +250,0 @@ list: deprecated, |
{ | ||
"name": "node-cmake", | ||
"author": "Colin Taylor <cjntaylor@gmail.com>", | ||
"version": "2.0.3", | ||
"version": "2.1.0", | ||
"description": "A CMake-based build system for node.js native modules", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -18,3 +18,3 @@ Node CMake | ||
* `find_package` support. The module loading technique used in 1.0 was flawed for specific module structures and setup (deeply nested native dependencies). The new technique is to copy the now single configuration script into your project. This means that projects will not stay in sync with updates automatically. Be sure to copy the script again when updating `node-cmake` to a new version. | ||
* `find_package` support. The module loading technique used in 1.0 was flawed for specific module structures and setup (deeply nested native dependencies). The new technique is to run `ncmake update` to copy the configuration script into your project. This means that projects will not stay in sync with updates automatically. Be sure to run `ncmake update` when updating `node-cmake` to a new version. | ||
* `ncmake` command line arguments. `ncmake` now follows and extends the `node-gyp` command line interface. Please update your build files to use the new syntax (`ncmake --build` => `ncmake rebuild`). For more info, see the [manual](docs/NcmakeManual.md). | ||
@@ -29,3 +29,3 @@ * Support for NW.js - The NW.js release server is not compliant to the Node.js release server structure. Workaround for the NW.js naming conventions have been included in the update, but the server SHA file does not include checksums for all resources, leaving no way to validate downloads. The SHASUMS256.txt file on the server needs to be updated to include these entries to be used with this tool. | ||
Copy the file `NodeJS.cmake` from this module into your project. Then add a `CMakeLists.txt` file to the root of your module that contains at least the following (\<REPLACE\> with your own definitions): | ||
Run `ncmake update` to copy the file `NodeJS.cmake` from this module into your project. Then add a `CMakeLists.txt` file to the root of your module that contains at least the following (\<REPLACE\> with your own definitions): | ||
@@ -32,0 +32,0 @@ ```CMake |
54231
321