[Dune] [Dune-Commit] dune-common r6651 - branches/cmake/cmake/modules

Martin Nolte nolte at mathematik.uni-freiburg.de
Mon Apr 23 20:41:56 CEST 2012


Hi Markus,

does this mean using cmake will be a step backwards? Or is there a good 
alternative to passing CXXFLAGS="-g" to make in order to quickly do a debug build?

Best,

Martin

On 04/23/2012 07:18 PM, Markus Blatt wrote:
> On Mon, Apr 23, 2012 at 05:31:58PM +0200, Christian Engwer wrote:
>>> Cmake works different in this regard. Passing flags to make directly
>>> does not work. One has to pass them to cmake configure or change the
>>> cache and then reconfigure. In both cases the -std flags gets added to
>>> the compiler flags in the configure stage.
>>>
>>> CMake distinguishes the variables by type. The compiler is a file
>>> path. It seems unnatural to put a flag there. (I think I even tried
>>> that and it did not work.)
>>
>> OK, but it really confuses me. How does cmake prevent me from
>> overwriting variables on the command line?
>>
>> usually I can call
>>
>> make CXXFLAGS="-g -Wall -O0"
>>
>> what would cmake do in this case? Doesn't it just generate
>> Makefiles?
>
> As I said: these get ignored.
>
> The Makefiles in the subdirectory read something like
>
> subDirTarget:
>      cd topleveldir&&  ${MAKE} -f subdir/cmakeSpecific/build.make    subdir/cmakeSpecific/subdirTarget
>
> Therefore the actual makefile does not see your variables.
>
> Markus
>

-- 
Dr. Martin Nolte <nolte at mathematik.uni-freiburg.de>

Universität Freiburg                                   phone: +49-761-203-5630
Abteilung für angewandte Mathematik                    fax:   +49-761-203-5632
Hermann-Herder-Straße 10
79104 Freiburg, Germany




More information about the Dune mailing list