<div dir="ltr">I&#39;m trying to write a Find&lt;package&gt;.cmake file for a library that doesn&#39;t generate a proper &lt;package&gt;Config.cmake file.<div><br></div><div style>The problem I&#39;m trying to solve is how to build against a build tree instead of an install tree.  On OS X and Windows (well, probably any Makefile generator) CMake helpfully adds CMakeDirectoryInformation.cmake files to the build tree, which makes it straightforward to recover the root of the source tree.</div>
<div style><br></div><div style>Come to find out, that doesn&#39;t work on Windows with Visual Studio build system, and probably won&#39;t work with other build systems besides Makefile on OS X and Linux.</div><div style>
<br></div><div style>So the question is, given that I can&#39;t go in and fix the CMake build system for this package, is there a portable way to find the source tree by looking at the build tree?</div></div>