[CMake] Any portable way in CMake build tree to find Source tree path?

Kent Williams nkwmailinglists at gmail.com
Fri Jan 25 17:41:24 EST 2013


I'm trying to write a Find<package>.cmake file for a library that doesn't
generate a proper <package>Config.cmake file.

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.

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.

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130125/62750724/attachment-0001.htm>


More information about the CMake mailing list