[CMake] Setting CMAKE_CXX_FLAGS_<> in CMakeLists.txt

Michael Hammer michael.hammer at tugraz.at
Sun Jun 24 15:52:59 EDT 2007


Am 24.06.2007 um 19:24 schrieb David Cole:

> A variable is not cached (in CMakeCache.txt) by a SET command  
> unless CACHE is specified. A cached variable is not changed by a  
> SET command unless FORCE is used...
>

Ups - I should already know that ;)

> See "cmake --help-command SET" for more info....
>

[...]

> Setting the CMAKE_CXX_FLAGS_DEBUG even without getting it cached  
> should have the effect you want however. If you build a .o file  
> with "make VERBOSE=1" you should see the flags you set being used  
> for the compile...
>

You are fully right (of course). I was to fast with asking - but my  
level of confusion was so high - I couldn't see the forrest for all  
of those trees. I was so focused on finding those variables in the  
cache I just didn't try it out.

But there remains a question for me: Do I have any (smart)  
possibility to debug those flags, resp. debug variables which aren't  
set in the cache? The point is, these variables have to be registered  
in some Makefile (or something similar) after the configure process ...

Thank a lot for your really fast response - YMMD!

Michael

----------------------------------------------------------------------
                                                                  __
Dipl.-Ing. (MSc) Michael Hammer (Scientific Assistant)     __  _|  |_
Institute for Strength of Materials /                     |  ||      |
            Graz University of Technology                  |_    _||__|
phone: +43 (0) 316 873 / 7667                               |__|
fax:   +43 (0) 316 873 / 7169
http://www.fest.TUGraz.at/                    michael.hammer at tugraz.at
----------------------------------------------------------------------



More information about the CMake mailing list