<div dir="ltr">Hi Kent, <div><br></div><div style>On all the platform, the build tree contains a CMakeCache.txt that will systematically contain the following text:</div><div style><br></div><div style> FOO_SOURCE_DIR:STATIC=/path/to/foosource <br>
</div><div style><br></div><div style>where FOO is the name of the project.</div><div style><br></div><div style>You could simply check for the existence of "CMakeCache.txt", and extact the value using a regex.</div>
<div style><br></div><div style>Hth</div><div style>Jc</div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 5:41 PM, Kent Williams <span dir="ltr"><<a href="mailto:nkwmailinglists@gmail.com" target="_blank">nkwmailinglists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>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><br></div><div>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>
<br></div><div>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>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>+1 919 869 8849<br>
</div>