[CMake] re-config on make all

Vandenbroucke Sander Sander.Vandenbroucke at vandewiele.com
Thu Aug 28 10:40:11 EDT 2008


That would be 2.4 patch 7... :-( So I try the update first before adding the :STRING.

Thanks!
________________________________________
From: David Cole [mailto:david.cole at kitware.com] 
Sent: donderdag 28 augustus 2008 16:03
To: Vandenbroucke Sander
Cc: cmake at cmake.org
Subject: Re: [CMake] re-config on make all

Now we're getting somewhere...

Which 2.4 are you on?

To force caching of "-D" variables with older cmake versions, specify a type for each one (the ":STRING" in the modified version below). Also, I would put the -D values before naming the source directory:

  cmake -G "MSYS Makefiles" -DCMAKE_SYSTEM:STRING=Generic -DCMAKE_C_COMPILER_WORKS:STRING=1
    -DCMAKE_CXX_COMPILER_WORKS:STRING=1 -DCMAKE_COMPILER_IS_GNUCC:STRING=1
    -DCMAKE_COMPILER_IS_GNUCXX:STRING=1 -DTARGET:STRING=nios2 ../

The reason we are all confused trying to answer your question is that you can do this without the ":STRING" in CMake 2.6. (In fact, I think the caching behavior changed in one of the 2.4.x patch releases because people were mainly confused about why ":STRING=" values were cached but simple "=" values were not.) I think 2.4.8 works the same as 2.6 in this regard.


HTH,
David



On 8/28/08, Vandenbroucke Sander <Sander.Vandenbroucke at vandewiele.com> wrote:

> > > Vandenbroucke Sander wrote:
> > > Hi,
> > >
> > > Sometimes CMake re-configures my build tree when running make.
> > > Unfortunately CMake uses wrong options, I normally set those on the
> > > command line. This forces me to re-config & rebuild my entire source
> > > tree. This is a bit annoying since, in most cases, this is not
> necessary
> > > and takes a long time.
> > >
> > > So here is my question: can I prevent the automatic reconfiguration
> and
> > > throw an error/warning so the user can do a manual reconfig?
> > >
> >
> > CMake should use the same options.  Your options should have been
> stored
> > in the cache.
> You are right, those options are not cached.
>
> But Bill's point was that they *should* be cached. So the question is: why > are your original command line -D options not saved in CMakeCache.txt...?

They are my project specific options to define a target architecture. I have not cached them my self. So to fix this 'problem' I should cache all my -D options.


> What version of CMake are you running?
> (Send output of 'which cmake' and 'cmake --version'...)

I'm still on 2.4. Upgrading is planned some time in the future.


> What is your exact original command line for running CMake?

set CC=distcc nios2-elf-gcc
set CXX=distcc nios2-elf-g++
cmake -G "MSYS Makefiles" ../ -DCMAKE_SYSTEM=Generic -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1 -DCMAKE_COMPILER_IS_GNUCC=1 -DCMAKE_COMPILER_IS_GNUCXX=1 -DTARGET=nios2


Sander.
_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake


______________________________________________________________________
This email has been scanned by the Email Security System.
______________________________________________________________________


More information about the CMake mailing list