diff --git a/src/actions/vstudio/vs2010_vcxproj.lua b/src/actions/vstudio/vs2010_vcxproj.lua index 9d08315f..0d32112a 100644 --- a/src/actions/vstudio/vs2010_vcxproj.lua +++ b/src/actions/vstudio/vs2010_vcxproj.lua @@ -1875,6 +1875,12 @@ function m.executablePath(cfg) local dirs = vstudio.path(cfg, cfg.bindirs) if #dirs > 0 then + dirs = table.translate(dirs, function(dir) + if path.isabsolute(dir) then + return dir + end + return "$(ProjectDir)" .. dir + end) m.element("ExecutablePath", nil, "%s;$(ExecutablePath)", table.concat(dirs, ";")) end end diff --git a/tests/actions/vstudio/vc2010/test_output_props.lua b/tests/actions/vstudio/vc2010/test_output_props.lua index 1b2edf6f..5ec306e9 100755 --- a/tests/actions/vstudio/vc2010/test_output_props.lua +++ b/tests/actions/vstudio/vc2010/test_output_props.lua @@ -289,3 +289,37 @@ ]] end + +-- +-- Check the handling of the VC++ ExecutablePath. +-- + + function suite.onBinDirsRelative() + bindirs { "../Include" } + prepare() + test.capture [[ + + true + bin\Debug\ + obj\Debug\ + MyProject + .exe + $(ProjectDir)..\Include;$(ExecutablePath) + + ]] + end + + function suite.onBinDirsAbsolute() + bindirs { "C:\\Include" } + prepare() + test.capture [[ + + true + bin\Debug\ + obj\Debug\ + MyProject + .exe + C:\Include;$(ExecutablePath) + + ]] + end