On Wednesday 03 March 2010, Brad King wrote: > Alexander Neundorf wrote: > > This sees the variable is already in the cache, but without meta info and > > adds it using AddCacheDefinition(). > > After this call, makefile->GetDefinition("FOO") returns an empty string, > > before this call it still returns "foo". > > It's not the empty string in find_program()'s call to AddCacheDefinition > that raises this problem. It's the bottom of cmMakefile's implementation > of the method: > > // if there was a definition then remove it > this->Internal->VarStack.top().Set(name, 0); > > > I didn't figure out the correct way how to improve this. > > This is related to the open issue > > http://www.cmake.org/Bug/view.php?id=9008 > > discussed previously.
Yes. > > I think it should end up in the cache as "foo" with the type "FILEPATH", > > but I didn't figure out how to achieve this. > > Issue #9008 basically means you should never mix cache and non-cache > variables with the same name. There are all kinds of historical reasons > behind their interaction and changing anything will lead to subtle breakage > for someone. (The original attempt at CMP0015 for issue 9008 is evidence of > this.) Yes, I remember. Still this issue here is really weird, the variable suddenly becomes empty, although the "normal" variable was set before to a value and the find_program() should have put something (either "foo" or its result) into the cache. But afterwards, the normal variable is gone and the cache is empty. Should I add this testcase to #9008 ? 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