Static lib and source location in debug info with VS builds

When you build some code with MS visual studio debug info (if was enabled during build) stores location of the source files. If you build a static lib with debug info, debug info will contain paths of files at the time when they were built.

Now, I want to be able to build a static lib with debug symbols and make it work on other developer machines where they may have source checked out in some other location. How can I build static lib so that it would know where to look for source files when debugging?

In short, MS CRT seems to be doing just that: no matter where you install VS when you debug it will show sources from VS location. I've seen other projects also do something similar (I think binary install of QT and maybe others). There's something that needs to be done with these libs to make them work with relative path of source files or something like that.