Now we're getting somewhere...<br>
<br>
Which 2.4 are you on?<br><br>
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:<br>
<br>
cmake -G "MSYS Makefiles" -DCMAKE_SYSTEM:STRING=Generic
-DCMAKE_C_COMPILER_WORKS:STRING=1<br>
-DCMAKE_CXX_COMPILER_WORKS:STRING=1
-DCMAKE_COMPILER_IS_GNUCC:STRING=1<br>
-DCMAKE_COMPILER_IS_GNUCXX:STRING=1 -DTARGET:STRING=nios2 ../<br>
<br>
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.<br>
<br>
<br>
HTH,<br>
David<br>
<br>
<br>
<br>
<br><div><span class="gmail_quote">On 8/28/08, <b class="gmail_sendername">Vandenbroucke Sander</b> <<a href="mailto:Sander.Vandenbroucke@vandewiele.com">Sander.Vandenbroucke@vandewiele.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> > > > Vandenbroucke Sander wrote:<br> > > > Hi,<br> > > ><br> > > > Sometimes CMake re-configures my build tree when running make.<br> > > > Unfortunately CMake uses wrong options, I normally set those on the<br>
> > > command line. This forces me to re-config & rebuild my entire source<br> > > > tree. This is a bit annoying since, in most cases, this is not<br> > necessary<br> > > > and takes a long time.<br>
> > ><br> > > > So here is my question: can I prevent the automatic reconfiguration<br> > and<br> > > > throw an error/warning so the user can do a manual reconfig?<br> > > ><br> > ><br>
> > CMake should use the same options. Your options should have been<br> > stored<br> > > in the cache.<br> > You are right, those options are not cached.<br> ><br>
> 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...?<br> <br>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.<br> <br><br> > What version of CMake are you running?<br> > (Send output of 'which cmake' and 'cmake --version'...)<br> <br>I'm still on 2.4. Upgrading is planned some time in the future.<br>
<br><br> > What is your exact original command line for running CMake?<br> <br>set CC=distcc nios2-elf-gcc<br> set CXX=distcc nios2-elf-g++<br>
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<br> <br><br> Sander.<br> _______________________________________________<br> CMake mailing list<br> <a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br> </blockquote></div><br>