<div dir="ltr">I'm trying to write a Find<package>.cmake file for a library that doesn't generate a proper <package>Config.cmake file.<div><br></div><div style>The problem I'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't work on Windows with Visual Studio build system, and probably won'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'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>