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