{

    'target_defaults': {
        'default_configuration': 'Release',
    },

    'targets': [
        {
            'target_name': "cloudcv",

            'sources': [ 
                "src/cloudcv.cpp", 
                "src/cloudcv.hpp",

                "src/framework/marshal/marshal.hpp",                
                "src/framework/marshal/marshal.cpp",

                "src/framework/marshal/stl.hpp",                
                "src/framework/marshal/stl.cpp",
                
                "src/framework/marshal/opencv.hpp",                
                "src/framework/marshal/opencv.cpp",
                
                "src/framework/marshal/primitives.hpp",                
                "src/framework/marshal/primitives.cpp",

                "src/framework/marshal/node_object_builder.hpp",
                "src/framework/marshal/node_object_builder.cpp",
                
                "src/framework/Image.hpp",                
                "src/framework/Image.cpp",

                "src/framework/ImageSource.hpp",                
                "src/framework/ImageSource.cpp",

                "src/framework/Job.hpp",                
                "src/framework/Job.cpp",

                "src/framework/Async.hpp",
                "src/framework/Async.cpp",
                    
                "src/framework/NanCheck.hpp",
                "src/framework/NanCheck.cpp",
                
                "src/modules/common/Numeric.cpp", 
                "src/modules/common/Numeric.hpp",                 

                "src/modules/common/Color.hpp", 
                "src/modules/common/ScopedTimer.hpp", 

                "src/modules/common/ImageUtils.hpp", 
                "src/modules/common/ImageUtils.cpp", 

                "src/modules/analyze/analyze.cpp", 
                "src/modules/analyze/analyze.hpp", 
                "src/modules/analyze/binding.cpp", 
                "src/modules/analyze/dominantColors.hpp", 
                "src/modules/analyze/dominantColors.cpp", 

                "src/modules/buildInformation/buildInformation.cpp", 

                "src/modules/cameraCalibration/CameraCalibrationBinding.cpp", 
                "src/modules/cameraCalibration/CameraCalibrationAlgorithm.hpp", 
                "src/modules/cameraCalibration/CameraCalibrationAlgorithm.cpp", 
            ],

            'include_dirs': [
              'src/',
              "<!(node -e \"require('nan')\")",
              "<!(node -e \"require('opencv').include_dirs()\")"
            ],

            'conditions': [
            
                ['OS=="mac"', {
                
                    'defines': [
                        'TARGET_PLATFORM_MAC',
                    ],

                    'include_dirs': [
                    ],
                    
                    'libraries': [
                        "<!(node -e \"require('opencv').libraries()\")"
                    ],

                    'xcode_settings': {
                        'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
                        'OTHER_CFLAGS': [ '-g', '-mmacosx-version-min=10.7', '-std=c++11', '-stdlib=libc++', '-O3', '-Wall' ],
                        'OTHER_CPLUSPLUSFLAGS': [ '-g', '-mmacosx-version-min=10.7', '-std=c++11', '-stdlib=libc++', '-O3', '-Wall' ]
                    }
                }],

                
                ['OS=="linux"', {
                
                    'defines': [
                        'TARGET_PLATFORM_LINUX',
                    ],

                    'include_dirs': [
                        '/usr/local/include'
                    ],

                    "cflags": [
                        "-std=c++11", "-stdlib=libc++"
                    ],
                    
                    'libraries': [
                    ]
                }]       
            ]
        }
    ]
}

@@ -2502,32 +2502,39 @@
 e -e %5C%22require('
+native-
 opencv').include
@@ -2757,70 +2757,8 @@
   %5D,
-%0A%0A                    'include_dirs': %5B%0A                    %5D,
 %0A   
@@ -2857,16 +2857,23 @@
 equire('
+native-
 opencv')
@@ -3508,35 +3508,32 @@
            '
-include_dir
+librarie
 s': %5B%0A      
@@ -3554,28 +3554,62 @@
     
-'/usr/local/include'
+%22%3C!(node -e %5C%22require('native-opencv').libraries()%5C%22)%22
 %0A   
@@ -3620,32 +3620,52 @@
              %5D,%0A
+                    
 %0A               

Fix build script