mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
WIP on moving to gyp
This commit is contained in:
parent
1adb8409b9
commit
5c1243329d
@ -18,7 +18,7 @@ Then:
|
|||||||
Or to build the repo:
|
Or to build the repo:
|
||||||
|
|
||||||
|
|
||||||
node-waf configure && node-waf build
|
node-gyp rebuild
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|||||||
13
binding.gyp
13
binding.gyp
@ -1,14 +1,17 @@
|
|||||||
{
|
{
|
||||||
"targets": [{
|
"targets": [{
|
||||||
"target_name": "opencv"
|
"target_name": "opencv"
|
||||||
, "sources": [
|
, "sources": [
|
||||||
"src/CascadeClassifierWrap.cc"
|
"src/init.cc"
|
||||||
, "src/init.cc"
|
|
||||||
, "src/Matrix.cc"
|
, "src/Matrix.cc"
|
||||||
, "src/OpenCV.cc"
|
, "src/OpenCV.cc"
|
||||||
|
, "src/CascadeClassifierWrap.cc"
|
||||||
, "src/Point.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' ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
build.sh
2
build.sh
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
node-waf configure build &&
|
node-gyp rebuild &&
|
||||||
cd examples &&
|
cd examples &&
|
||||||
#node face_detection.js
|
#node face_detection.js
|
||||||
node $1
|
node $1
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
, "engine": "node >= 0.4.1"
|
, "engine": "node >= 0.4.1"
|
||||||
, "scripts": {
|
, "scripts": {
|
||||||
"preinstall": "node-waf configure build"
|
"preinstall": "node-gyp rebuild"
|
||||||
, "test": "node test/unit.js"
|
, "test": "node test/unit.js"
|
||||||
}
|
}
|
||||||
, "main": "./lib/opencv"
|
, "main": "./lib/opencv"
|
||||||
|
|||||||
2
smoke.sh
2
smoke.sh
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/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 --
|
' && node smoketest.js && echo '-- Smoke Done, running tests --
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,6 @@
|
|||||||
#ifndef __NODE_OPENCV_H__
|
#ifndef __NODE_OPENCV_H__
|
||||||
#define __NODE_OPENCV_H__
|
#define __NODE_OPENCV_H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#import "opencv2/opencv.hpp"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <v8.h>
|
#include <v8.h>
|
||||||
#include <node.h>
|
#include <node.h>
|
||||||
#include <node_object_wrap.h>
|
#include <node_object_wrap.h>
|
||||||
|
|||||||
25
wscript
25
wscript
@ -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']
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user