ccmake . does not erase the cache.<div><br></div><div>It would not surprise me if a second -C initialcache.cmake call did erase some cache entries... As I said before, I do not think the -C arg is intended to be used more than once in a given build tree. It doesn't make any sense.</div>
<div><br></div><div>Perhaps we should formalize that notion and refuse to honor "-C" or even produce an error if it is given in a build tree with an existing CMakeCache.txt.<br><br></div><div><br><div class="gmail_quote">
On Fri, Jul 24, 2009 at 4:51 PM, Dominik Szczerba <span dir="ltr"><<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, 2009-07-23 at 11:51 -0400, David Cole wrote:<br>
</div><div class="im">> "cmake -C initialcache.cmake" is intended to be used once to establish<br>
> an *initial* cache... Why do you want to do it again later when you<br>
> already have a cache...?<br>
><br>
> A second call with -C is not the intended use for the -C argument...<br>
><br>
><br>
> Also, does your initial cache file set the compiler? It is more<br>
> typical (and therefore better tested) to set environment variables CC<br>
> and CXX to specify the compilers before running cmake for the first<br>
> time.<br>
><br>
<br>
</div>That was a hint in the right direction. Indeed, I was setting the<br>
compilers in the initial cache to formally something else than VTK was<br>
compiled with (me: g++, VTK: c++). Removing this cache entry so far does<br>
not in the reported annoyances. Will keep an eye though and evntl. come<br>
back. Still, I definitely think something is not clean here anyway, e.g.<br>
"ccmake ." with no changes of variables (not even configure or generate)<br>
should not erase the cache, should it?<br>
<br>
with thanks and regards,<br>
<font color="#888888">Dominik<br>
</font><div><div></div><div class="h5"><br>
><br>
> I think your main problem is running with -C on subsequent configures<br>
> beyond the initial one, though.<br>
><br>
><br>
><br>
><br>
> HTH,<br>
> David<br>
><br>
><br>
><br>
> On Thu, Jul 23, 2009 at 7:40 AM, Dominik Szczerba<br>
> <<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>> wrote:<br>
> No, I do not have any cache files in the whole source tree.<br>
><br>
> The easiest - and the most suspicious - way to reproduce is:<br>
><br>
> 1) cmake -C ~/src/mesh/CMakeInitialCache-x60.cmake ~/src/mesh<br>
> (this configures correctly, values from the cache are taken, I<br>
> see them<br>
> displayed with MESSAGE. Now "make whatever" would work as<br>
> expected.<br>
> 2) ccmake .<br>
> (just this, no reconfigure, no re-generate, just run and quit)<br>
> 3) cmake -C ~/src/mesh/CMakeInitialCache-x60.cmake ~/src/mesh<br>
> This now does not work anymore. Some snippets from the output:<br>
><br>
> loading initial cache<br>
> file /home/domel/src/mesh/CMakeInitialCache-x60.cmake<br>
> (...)<br>
> -- IDIR_HDF5: /home/domel/pack/hdf5-1.8.3/src (several<br>
> variables *ARE*<br>
> correctly there<br>
> (...)<br>
> Warning: CMake is forcing CMAKE_CXX_COMPILER to "/usr/bin/c++"<br>
> to match<br>
> that imported from VTK. This is required because C++ projects<br>
> must use<br>
> the same compiler. If this message appears for more than one<br>
> imported<br>
> project, you have conflicting C++ compilers and will have to<br>
> re-build<br>
> one of those projects. Was set to /usr/bin/g++<br>
> (...)<br>
> -- IMESH: QT_QMAKE_EXECUTABLE: /usr/bin/qmake (still several<br>
> more<br>
> variables are OK)<br>
> (...)<br>
> -- Configuring done<br>
> You have changed variables that require your cache to be<br>
> deleted.<br>
> Configure will be re-run and you may have to reset some<br>
> variables.<br>
> The following variables have changed:<br>
> CMAKE_CXX_COMPILER= /usr/bin/c++<br>
> (so the cache is deleted!!! why??? Now the configuration<br>
> re-starts and<br>
> ALL variables are gone:)<br>
> -- IDIR_HDF5: (empty...)<br>
><br>
> CMake Error<br>
> at /usr/local/share/cmake-2.6/Modules/FindVTK.cmake:134<br>
> (MESSAGE):<br>
> VTK not found. Set the VTK_DIR cmake cache entry to the<br>
> directory<br>
> containing VTKConfig.cmake. This is either the root of the<br>
> build<br>
> tree, or<br>
> PREFIX/lib/vtk for an installation. For VTK 4.0, this is the<br>
> location<br>
> of<br>
> UseVTK.cmake. This is either the root of the build tree or<br>
> PREFIX/include/vtk for an installation.<br>
> Call Stack (most recent call first):<br>
> CMakeLists.txt:80 (FIND_PACKAGE)<br>
><br>
><br>
> Any ideas why no action whatsoever causes the failure?<br>
> Many thanks!<br>
> -- Dominik<br>
><br>
><br>
> On Thu, 2009-07-23 at 06:57 -0400, David Cole wrote:<br>
> > Something's not right... This should work.<br>
> ><br>
> > Is there a CMakeCache.txt file in the source tree? If so,<br>
> delete it<br>
> > and start with a clean source tree.<br>
> ><br>
> > Are you getting configure errors?<br>
> ><br>
> > Steps to reproduce the issue might help to diagnose the<br>
> problem.<br>
> ><br>
> ><br>
> ><br>
> > On Thu, Jul 23, 2009 at 6:22 AM, Dominik Szczerba<br>
> > <<a href="mailto:dominik@itis.ethz.ch">dominik@itis.ethz.ch</a>> wrote:<br>
> > Some moredebugging info: cmake versions 2.6.2 and<br>
> 2.6.4. Re:<br>
> > point 2)<br>
> > running cmake -C path/to/initcache.cmake PATH does<br>
> NOT resolve<br>
> > the<br>
> > problem.<br>
> ><br>
> > Is it a bug case or expected bahvior?<br>
> ><br>
> > Dominik<br>
> ><br>
> ><br>
> > On Thu, 2009-07-23 at 10:33 +0200, Dominik Szczerba<br>
> wrote:<br>
> > > Hi,<br>
> > > I have several frustrating problems using cmake<br>
> initial<br>
> > cache file with<br>
> > > some variables in combination with using findvtk<br>
> in my<br>
> > CMakeLists.txt.<br>
> > ><br>
> > > 1) ccmake . in the build dir invalidates the whole<br>
> dir:<br>
> > findvtk<br>
> > > complains about missing VTK_Dir, which *WAS* in<br>
> the initial<br>
> > cache. I<br>
> > > have to delete the whole tree and run cmake -C<br>
> > path/to/initcache.cmake<br>
> > > PATH again<br>
> > ><br>
> > > 2) indentical symptoms are when CMakeLists.txt has<br>
> changed:<br>
> > VTK_DIR and<br>
> > > CMAKE_BUILD_TYPE are not there.<br>
> > ><br>
> > > How to resolve it?<br>
> > ><br>
> > > Dominik<br>
> > ><br>
> > > _______________________________________________<br>
> > > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
> > ><br>
> > > Visit other Kitware open-source projects at<br>
> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> > ><br>
> > > Please keep messages on-topic and check the CMake<br>
> FAQ at:<br>
> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
> > ><br>
> > > Follow this link to subscribe/unsubscribe:<br>
> > > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
> > ><br>
> ><br>
> > _______________________________________________<br>
> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
> ><br>
> > Visit other Kitware open-source projects at<br>
> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> ><br>
> > Please keep messages on-topic and check the CMake<br>
> FAQ at:<br>
> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
> ><br>
> > Follow this link to subscribe/unsubscribe:<br>
> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
> ><br>
> ><br>
><br>
><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>