title: Create Sublime Text build system for build and source in different directories
body: <p>I have a project for which the build and source directories are not the same. I'd like to create a <a href="http://docs.sublimetext.info/en/latest/reference/build_systems.html" rel="nofollow">build system</a> that will build in the <code>build</code> directory while I am editing in the <code>source</code> directory.</p>
  
  <p>Let's say I have this directory structure:</p>
  
  <ul>
  <li>/home/dbw/src <em>The source files.</em></li>
  <li>/home/dbw/bld <em>The build files.</em></li>
  </ul>
  
  <p><em>(shocking and unique naming system, I know - let's hold the applause until the end, shall we?)</em></p>
  
  <p>The build is nested many layers deep, and the directory structures are symmetric.  From a directory in the <code>source</code>, I would like Sublime to start a build in the related <code>build</code> directory.  For instance, if I am editing /home/dbw/src/foo/Makefile, I'd like make to execute in /home/dbw/bld/foo.  I've tried this:</p>
  
  <pre><code>{
    "cmd": ["make"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "/home/dbw/bld/${file_path/$project_path//}",
    "selector": "source.makefile",
  
    "variants":
    [
      {
        "name": "Clean",
        "cmd": ["make", "clean"]
      },
      {
        "name": "Test",
        "cmd": ["make", "test"]
      }
    ]
  }
  </code></pre>
  
  <p>My .sublime-project is in /home/dbw/src</p>
  
  <p>I also tried using <code>"working_dir": "/home/dbw/bld/${file_path/\/home\/dbw\/src//}"</code>.</p>
  
  <p>It looks to me like the problem is that I am not escaping slashes in the replacement expression correctly.  Any suggestions?</p>