[Cmake] LOAD_CACHE automatic exclude

Andy Cedilnik andy.cedilnik at kitware.com
Thu, 05 Feb 2004 12:16:37 -0500


Hi Julien,

Yes. Instead of using LOAD_CACHE, you use simple IMPORT.

So, here is what you do. In project A you configure file with the
following content:

SET(OPTION1 " at OPTION1 at ")
SET(OPTION2 " at OPTION2 at ")
...

Then you import this file in project B, and you are all set. Since all
the options are sets, you can overwrite them.

Look also chapter 6.7 in Mastering CMake.

				Andy

On Thu, 2004-02-05 at 11:59, Julien Jomier wrote:
> Hi,
> 
> I'm having a problem using the LOAD_CACHE command.
> I've one program which is setting some options (like GLUT_INCLUDE_DIR) but
> these options are not required. Another program is using the first one so
> I'm using the LOAD_CACHE command to avoid setting directories and libraries
> again. 
> The problem comes when the option has not been set in the first program
> (GLUT_INCLUDE_DIR:PATH=GLUT_INCLUDE_DIR-NOTFOUND) then it's impossible to
> set the same option in the second program because it always refers to the
> cache of the first one. Of course if I exclude the option everything is
> working well except the fact that I've to set the option in my second
> program even if it's defined in the first one.
> 
> Is there any way to avoid this?