[CMake] problems with cache and findvtk

David Cole david.cole at kitware.com
Fri Jul 24 17:05:40 EDT 2009


ccmake . does not erase the cache.
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.

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.


On Fri, Jul 24, 2009 at 4:51 PM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> On Thu, 2009-07-23 at 11:51 -0400, David Cole wrote:
> > "cmake -C initialcache.cmake" is intended to be used once to establish
> > an *initial* cache... Why do you want to do it again later when you
> > already have a cache...?
> >
> > A second call with -C is not the intended use for the -C argument...
> >
> >
> > Also, does your initial cache file set the compiler? It is more
> > typical (and therefore better tested) to set environment variables CC
> > and CXX to specify the compilers before running cmake for the first
> > time.
> >
>
> That was a hint in the right direction. Indeed, I was setting the
> compilers in the initial cache to formally something else than VTK was
> compiled with (me: g++, VTK: c++). Removing this cache entry so far does
> not in the reported annoyances. Will keep an eye though and evntl. come
> back. Still, I definitely think something is not clean here anyway, e.g.
> "ccmake ." with no changes of variables (not even configure or generate)
> should not erase the cache, should it?
>
> with thanks and regards,
> Dominik
>
> >
> > I think your main problem is running with -C on subsequent configures
> > beyond the initial one, though.
> >
> >
> >
> >
> > HTH,
> > David
> >
> >
> >
> > On Thu, Jul 23, 2009 at 7:40 AM, Dominik Szczerba
> > <dominik at itis.ethz.ch> wrote:
> >         No, I do not have any cache files in the whole source tree.
> >
> >         The easiest - and the most suspicious - way to reproduce is:
> >
> >         1) cmake -C ~/src/mesh/CMakeInitialCache-x60.cmake ~/src/mesh
> >         (this configures correctly, values from the cache are taken, I
> >         see them
> >         displayed with MESSAGE. Now "make whatever" would work as
> >         expected.
> >         2) ccmake .
> >         (just this, no reconfigure, no re-generate, just run and quit)
> >         3) cmake -C ~/src/mesh/CMakeInitialCache-x60.cmake ~/src/mesh
> >         This now does not work anymore. Some snippets from the output:
> >
> >         loading initial cache
> >         file /home/domel/src/mesh/CMakeInitialCache-x60.cmake
> >         (...)
> >         -- IDIR_HDF5: /home/domel/pack/hdf5-1.8.3/src (several
> >         variables *ARE*
> >         correctly there
> >         (...)
> >         Warning: CMake is forcing CMAKE_CXX_COMPILER to "/usr/bin/c++"
> >         to match
> >         that imported from VTK.  This is required because C++ projects
> >         must use
> >         the same compiler.  If this message appears for more than one
> >         imported
> >         project, you have conflicting C++ compilers and will have to
> >         re-build
> >         one of those projects. Was set to /usr/bin/g++
> >         (...)
> >         -- IMESH: QT_QMAKE_EXECUTABLE: /usr/bin/qmake (still several
> >         more
> >         variables are OK)
> >         (...)
> >         -- Configuring done
> >         You have changed variables that require your cache to be
> >         deleted.
> >         Configure will be re-run and you may have to reset some
> >         variables.
> >         The following variables have changed:
> >         CMAKE_CXX_COMPILER= /usr/bin/c++
> >         (so the cache is deleted!!! why??? Now the configuration
> >         re-starts and
> >         ALL variables are gone:)
> >         -- IDIR_HDF5: (empty...)
> >
> >         CMake Error
> >         at /usr/local/share/cmake-2.6/Modules/FindVTK.cmake:134
> >         (MESSAGE):
> >          VTK not found.  Set the VTK_DIR cmake cache entry to the
> >         directory
> >          containing VTKConfig.cmake.  This is either the root of the
> >         build
> >         tree, or
> >          PREFIX/lib/vtk for an installation.  For VTK 4.0, this is the
> >         location
> >         of
> >          UseVTK.cmake.  This is either the root of the build tree or
> >          PREFIX/include/vtk for an installation.
> >         Call Stack (most recent call first):
> >          CMakeLists.txt:80 (FIND_PACKAGE)
> >
> >
> >         Any ideas why no action whatsoever causes the failure?
> >         Many thanks!
> >         -- Dominik
> >
> >
> >         On Thu, 2009-07-23 at 06:57 -0400, David Cole wrote:
> >         > Something's not right... This should work.
> >         >
> >         > Is there a CMakeCache.txt file in the source tree? If so,
> >         delete it
> >         > and start with a clean source tree.
> >         >
> >         > Are you getting configure errors?
> >         >
> >         > Steps to reproduce the issue might help to diagnose the
> >         problem.
> >         >
> >         >
> >         >
> >         > On Thu, Jul 23, 2009 at 6:22 AM, Dominik Szczerba
> >         > <dominik at itis.ethz.ch> wrote:
> >         >         Some moredebugging info: cmake versions 2.6.2 and
> >         2.6.4. Re:
> >         >         point 2)
> >         >         running cmake -C path/to/initcache.cmake PATH does
> >         NOT resolve
> >         >         the
> >         >         problem.
> >         >
> >         >         Is it a bug case or expected bahvior?
> >         >
> >         >         Dominik
> >         >
> >         >
> >         >         On Thu, 2009-07-23 at 10:33 +0200, Dominik Szczerba
> >         wrote:
> >         >         > Hi,
> >         >         > I have several frustrating problems using cmake
> >         initial
> >         >         cache file with
> >         >         > some variables in combination with using findvtk
> >         in my
> >         >         CMakeLists.txt.
> >         >         >
> >         >         > 1) ccmake . in the build dir invalidates the whole
> >         dir:
> >         >         findvtk
> >         >         > complains about missing VTK_Dir, which *WAS* in
> >         the initial
> >         >         cache. I
> >         >         > have to delete the whole tree and run cmake -C
> >         >         path/to/initcache.cmake
> >         >         > PATH again
> >         >         >
> >         >         > 2) indentical symptoms are when CMakeLists.txt has
> >         changed:
> >         >         VTK_DIR and
> >         >         > CMAKE_BUILD_TYPE are not there.
> >         >         >
> >         >         > How to resolve it?
> >         >         >
> >         >         > Dominik
> >         >         >
> >         >         > _______________________________________________
> >         >         > 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
> >         >         >
> >         >
> >         >         _______________________________________________
> >         >         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
> >         >
> >         >
> >
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090724/af3c4b3a/attachment.htm>


More information about the CMake mailing list