{
	'variables': {
		'rm'             : '<!(node -e "require(\'addon-tools-raub\').rm()")',
		'cp'             : '<!(node -e "require(\'addon-tools-raub\').cp()")',
		'mkdir'          : '<!(node -e "require(\'addon-tools-raub\').mkdir()")',
		'binary'         : '<!(node -e "require(\'addon-tools-raub\').bin()")',
		'qmlui_include'  : '<!(node -e "require(\'deps-qmlui-raub\').include()")',
		'qmlui_bin'      : '<!(node -e "require(\'deps-qmlui-raub\').bin()")',
	},
	'targets': [
		{
			'target_name'  : 'qml',
			'sources'      : [ 'cpp/bindings.cpp', 'cpp/view.cpp' ],
			'libraries'    : [ '-lqmlui' ],
			'include_dirs' : [
				'<!@(node -e "require(\'addon-tools-raub\').include()")',
				'<(qmlui_include)',
			],
			'library_dirs' : [ '<(qmlui_bin)' ],
			'conditions'   : [
				[
					'OS=="linux" or OS=="mac"', {
						'libraries': ['-Wl,-rpath,<(qmlui_bin)'],
					}
				],
				[
					'OS=="win"',
					{
						'msvs_settings' : {
							'VCCLCompilerTool' : {
								'AdditionalOptions' : [
									'/O2','/Oy','/GL','/GF','/Gm-', '/Fm-',
									'/EHsc','/MT','/GS','/Gy','/GR-','/Gd',
								]
							},
							'VCLinkerTool' : {
								'AdditionalOptions' : ['/RELEASE','/OPT:REF','/OPT:ICF','/LTCG']
							},
						},
					},
				],
			],
		},
		{
			'target_name'  : 'make_directory',
			'type'         : 'none',
			'dependencies' : ['qml'],
			'actions'      : [{
				'action_name' : 'Directory created.',
				'inputs'      : [],
				'outputs'     : ['build'],
				'action': ['<(mkdir)', '-p', '<(binary)']
			}],
		},
		{
			'target_name'  : 'copy_binary',
			'type'         : 'none',
			'dependencies' : ['make_directory'],
			'actions'      : [{
				'action_name' : 'Module copied.',
				'inputs'      : [],
				'outputs'     : ['binary'],
				'action'      : ['<(cp)', 'build/Release/qml.node', '<(binary)/qml.node'],
			}],
		},
		{
			'target_name'  : 'remove_extras',
			'type'         : 'none',
			'dependencies' : ['copy_binary'],
			'actions'      : [{
				'action_name' : 'Build intermediates removed.',
				'inputs'      : [],
				'outputs'     : ['cpp'],
				'conditions'  : [
					[ 'OS=="linux"', { 'action' : [
						'rm',
						'<(module_root_dir)/build/Release/obj.target/qml/cpp/qml.o',
						'<(module_root_dir)/build/Release/obj.target/qml.node',
						'<(module_root_dir)/build/Release/qml.node'
					] } ],
					[ 'OS=="mac"', { 'action' : [
						'rm',
						'<(module_root_dir)/build/Release/obj.target/qml/cpp/bindings.o',
						'<(module_root_dir)/build/Release/obj.target/qml/cpp/qml.o',
						'<(module_root_dir)/build/Release/qml.node'
					] } ],
					[ 'OS=="win"', { 'action' : [
						'<(rm)',
						'<(module_root_dir)/build/Release/qml.*',
						'<(module_root_dir)/build/Release/obj/qml/*.*'
					] } ],
				],
			}],
		},
	]
}

@@ -457,16 +457,247 @@
 n()%22)',%0A
+%09%09'qt_core_bin'    : '%3C!(node -e %22require(%5C'deps-qt-qml-raub%5C').core.bin()%22)',%0A%09%09'qt_gui_bin'     : '%3C!(node -e %22require(%5C'deps-qt-qml-raub%5C').gui.bin()%22)',%0A%09%09'qt_qml_bin'     : '%3C!(node -e %22require(%5C'deps-qt-qml-raub%5C').bin()%22)',%0A
 %09%7D,%0A%09'ta
@@ -1069,16 +1069,24 @@
 ries': %5B
+%0A%09%09%09%09%09%09%09
 '-Wl,-rp
@@ -1101,17 +1101,69 @@
 lui_bin)
-'
+,%3C(qt_core_bin),%3C(qt_gui_bin),%3C(qt_core_gui)',%0A%09%09%09%09%09%09
 %5D,%0A%09%09%09%09%09

Add Linux rpath