On Thursday 25 March 2010, Ashwin Chandra wrote:
> I am using a Linux makefile to pass an environment variable into cmake.
> For example, I call
>
>
>
> "MYVAR=test make -f Linux.mak debug-build"
>
>
>
> Then inside my Linux.mak I issue a "cmake ... -DMYCMAKEVAR=$(MYVAR)".
>
>
>
> This defintion works fine the first time I do a build and cmake
> generates all the cmakecache and makefiles.
>
>
>
> But after I build once, let's say I decide to change MYVAR to:
>
>
>
> "MYVAR=test1234 make -f Linux.mak debug-build"
>
>
>
> Then CMake doesn't seem to update the CMakeCache with this new value of
> MYCMAKEVAR.
>
> Something about building a second time when the cache has already been
> created is causing this to fail.

Not sure.
If I do 
$ cmake -DFOO=foo .
then FOO is set to foo in CMakeCache.txt.
If I then do 
$ cmake -DFOO=bar .
then FOO is set to bar in CMakeCache.txt.

Does this work for you ?

Alex
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to