{

    '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('native-opencv').include_dirs()\")"
            ],

            'conditions': [
            
                ['OS=="mac"', {
                
                    'defines': [
                        'TARGET_PLATFORM_MAC',
                    ],
                    
                    'libraries': [
                        "<!(node -e \"require('native-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',
                    ],

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

                    "cflags": [
                        "-std=gnu++11 -fexceptions"
                    ],
                    
                    'libraries': [
                    ]
                }]       
            ]
        }
    ]
}

@@ -3653,21 +3653,45 @@
     
-%22
+'
 cflags
-%22: %5B%0A 
+_cc!': %5B '-fno-exceptions' %5D,%0A
     
@@ -3706,20 +3706,29 @@
         
-   %22
+%22cflags%22: %5B '
 -std=gnu
@@ -3731,17 +3731,20 @@
 =gnu++11
- 
+', '
 -fexcept
@@ -3747,37 +3747,17 @@
 ceptions
-%22%0A                   
+'
  %5D,%0A    

Negate 'no-exceptions'