How to use cmake-js - 3 common examples

To help you get started, we’ve selected a few cmake-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RSATom / WebChimera.js / rebuild.js View on Github external
function build() {
    var cmakeJS = require("cmake-js");

    var defaultRuntime = "nw";
    var defaultRuntimeVersion = "0.12.3";
    var defaultWinArch = "ia32";

    var options = {
        runtime: process.env.npm_config_wcjs_runtime || undefined,
        runtimeVersion: process.env.npm_config_wcjs_runtime_version || undefined,
        arch: process.env.npm_config_wcjs_arch || undefined
    };

    var buildSystem = new cmakeJS.BuildSystem(options);

    if (buildSystem.options.runtime == undefined) {
        buildSystem.options.runtime = defaultRuntime;
    }

    if (buildSystem.options.runtimeVersion == undefined) {
        buildSystem.options.runtimeVersion = defaultRuntimeVersion;
    }

    if (buildSystem.options.arch == undefined && process.platform == "win32") {
        buildSystem.options.arch = defaultWinArch;
    }

    buildSystem.rebuild().catch( function() { process.exit(1); } );
}
github cmake-js / boost-lib / lib / boostDownloader.js View on Github external
var _ = require("lodash");
var cmakejs = require("cmake-js");
var CMLog = cmakejs.CMLog;
var Bluebird = require("bluebird");
var fs = Bluebird.promisifyAll(require("fs-extra"));
var semver = require("semver");
var path = require("path");
var environment = cmakejs.environment;
var zlib = require("zlib");
var tar = require("tar");
var request = require("request");
var exec = require('child_process').exec;

function downloadTo(url, result) {
    return new Bluebird(function (resolve, reject) {
        request
            .get(url)
            .on('error', function (err) { reject(err); })
            .pipe(result);
github cmake-js / boost-lib / lib / boostDownloader.js View on Github external
var _ = require("lodash");
var cmakejs = require("cmake-js");
var CMLog = cmakejs.CMLog;
var Bluebird = require("bluebird");
var fs = Bluebird.promisifyAll(require("fs-extra"));
var semver = require("semver");
var path = require("path");
var environment = cmakejs.environment;
var zlib = require("zlib");
var tar = require("tar");
var request = require("request");
var exec = require('child_process').exec;

function downloadTo(url, result) {
    return new Bluebird(function (resolve, reject) {
        request
            .get(url)
            .on('error', function (err) { reject(err); })
            .pipe(result);

        result.once("finish", function () { resolve(); });
    });
}

cmake-js

CMake.js - a Node.js native addon build tool

MIT
Latest version published 3 months ago

Package Health Score

82 / 100
Full package analysis