[CMake] problems with cache and findvtk
Dominik Szczerba
dominik at itis.ethz.ch
Thu Jul 23 14:10:58 EDT 2009
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...?
>
well because 1) I do not think "cmake ." should invalidate it 2) more
seriously, modifications to CMakeLists.txt should not kill my build tree
(so far I must delete the tree to proceed)
> 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.
>
No I dont (will test), but the error comes from FindVTK....
>
> I think your main problem is running with -C on subsequent configures
> beyond the initial one, though.
>
The 3 steps to reproduce were the simplest ones. The REAL problem is
that after modifications to CMakeLists.txt (or some other circumstances)
the compilations fails: it (apparently) re-runs cmake to generate the
error I reported. I strongly disbelieve I should re-generate my project
here.
-- Dominik
>
>
>
> 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
> >
> >
>
>
>
>
More information about the CMake
mailing list