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

2013-01-28 Thread Kent Williams
Thanks for all your help. It does seem like you can spend a long time working with CMake (nearly 10 years for me) and still learn new things! On Sat, Jan 26, 2013 at 8:48 AM, Cory Quammen cquam...@cs.unc.edu wrote: Oops, I didn't know about that command. I tried it out, and it works like a

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

2013-01-26 Thread Alexander Neundorf
On Saturday 26 January 2013, Cory Quammen wrote: Kent, I have a CMake function that may be of interest to you (see attached file). For your purposes, use it as follows: GetCMakeCacheValue( ${ABC_BUILD_DIR} ABC_SOURCE_DIR ) where the project against which you want to build is named

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

2013-01-26 Thread Cory Quammen
Oops, I didn't know about that command. I tried it out, and it works like a charm. Thanks for pointing it out, Alex! Cory On Sat, Jan 26, 2013 at 3:25 AM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Saturday 26 January 2013, Cory Quammen wrote: Kent, I have a CMake function that

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

2013-01-25 Thread Kent Williams
I'm trying to write a Findpackage.cmake file for a library that doesn't generate a proper packageConfig.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

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

2013-01-25 Thread Jean-Christophe Fillion-Robin
Hi Kent, On all the platform, the build tree contains a CMakeCache.txt that will systematically contain the following text: FOO_SOURCE_DIR:STATIC=/path/to/foosource where FOO is the name of the project. You could simply check for the existence of CMakeCache.txt, and extact the value using

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

2013-01-25 Thread Cory Quammen
Kent, I have a CMake function that may be of interest to you (see attached file). For your purposes, use it as follows: GetCMakeCacheValue( ${ABC_BUILD_DIR} ABC_SOURCE_DIR ) where the project against which you want to build is named ABC. The first argument must always be the build directory