WIP on moving to gyp

This commit is contained in:
Peter Braden 2012-07-04 18:42:38 -07:00
parent 1adb8409b9
commit 5c1243329d
7 changed files with 12 additions and 38 deletions

View File

@ -18,7 +18,7 @@ Then:
Or to build the repo:
node-waf configure && node-waf build
node-gyp rebuild
## Examples

View File

@ -1,14 +1,17 @@
{
"targets": [{
"target_name": "opencv"
"target_name": "opencv"
, "sources": [
"src/CascadeClassifierWrap.cc"
, "src/init.cc"
"src/init.cc"
, "src/Matrix.cc"
, "src/OpenCV.cc"
, "src/CascadeClassifierWrap.cc"
, "src/Point.cc"
, "src/VideoCaptureWrap.cc" ]
, "src/VideoCaptureWrap.cc"
]
, "cflags" : ["-O3", "-Wall", "<!@(pkg-config --cflags opencv]"]
, "libraries" : ["<!@(pkg-config --libs opencv)"]
}]
, "libraries": ['-l/lib/opencv.lib' ]
}

View File

@ -1,6 +1,6 @@
#!/bin/bash
node-waf configure build &&
node-gyp rebuild &&
cd examples &&
#node face_detection.js
node $1

View File

@ -15,7 +15,7 @@
}
, "engine": "node >= 0.4.1"
, "scripts": {
"preinstall": "node-waf configure build"
"preinstall": "node-gyp rebuild"
, "test": "node test/unit.js"
}
, "main": "./lib/opencv"

View File

@ -1,5 +1,5 @@
#!/bin/bash
node-waf configure && node-waf -v build && echo '-- Compiled OK --
node-gyp -d rebuild && echo '-- Compiled OK --
' && node smoketest.js && echo '-- Smoke Done, running tests --

View File

@ -1,10 +1,6 @@
#ifndef __NODE_OPENCV_H__
#define __NODE_OPENCV_H__
#ifdef __cplusplus
#import "opencv2/opencv.hpp"
#endif
#include <v8.h>
#include <node.h>
#include <node_object_wrap.h>

25
wscript
View File

@ -1,25 +0,0 @@
def set_options(opt):
opt.tool_options("compiler_cxx")
def configure(conf):
conf.check_tool('compiler_cxx')
conf.check_tool('node_addon')
conf.check_cfg(package='opencv',
atleast_version='2.3.1',
libpath=[
'/lib', '/usr/lib', '/usr/local/lib','/usr/local/include',
'/opt/local/include', '/opt/local/lib'],
args='--cflags --libs',
uselib_store='OPENCV',
mandatory=True)
def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]
# This is the name of our extension.
obj.target = "opencv"
obj.source = bld.glob('src/*.cc')
obj.uselib = ['OPENCV']