[CMake] CMAKE_CXX_FLAGS [was: Re: CMake Digest, Vol 77, Issue 104]

fatman at crackmonkey.us fatman at crackmonkey.us
Fri Oct 1 05:47:33 EDT 2010


On Fri, 1 Oct 2010 10:23:30 +0100
David Aldrich <David.Aldrich at EU.NEC.COM> wrote:

> > if(CMAKE_BUILD_TYPE EQUAL Debug)
> >    set(CMAKE_CXX_FLAGS -Wno-long-long -Wno-comment -Wwrite-strings
> > -std=c++0x -pedantic-errors -pedantic -Wall -W -g -gdwarf-2 -Weffc++
> > -Wmain -Wextra)
> > else(CMAKE_BUILD_TYPE EQUAL Debug)
> >    set(CMAKE_CXX_FLAGS -s etc)
> > endif(CMAKE_BUILD_TYPE EQUAL Debug)
> 
> As a total non-expert I don't see how this will work because if build
> type is "Debug" then CMake will use CMAKE_CXX_FLAGS_DEBUG not
> CMAKE_CXX_FLAGS.
> 
> Am I right?

Could be. I too am a non-expert. CMake doesn't seem to output the
command lines it executes, or if it does then Buildbot ignores it. This
is the view from Buildbot's IO log:

cd cmake && make all && cd ..
 in dir /home/arichardson/buildbot/Reu2/bin/vostro/build (timeout 1200
secs)
 watching logfiles {}
 argv: cd cmake && make all && cd ..
 environment:
<snip lots of wrappily long env vars>
 closing stdin
 using PTY: False
[  2%] Building CXX object
SmallTestLib/CMakeFiles/SmallTestLib.dir/src/SmallTestLib.cc.o
Linking CXX shared library ../../bin/libSmallTestLib-d.so
[  2%] Built target SmallTestLib
[  5%] Building CXX object Reu2/CMakeFiles/Reu2.dir/src/TrayIcon.cc.o
[  8%] Building CXX object Reu2/CMakeFiles/Reu2.dir/src/Transformer.cc.o
<snip lots of very similar lines, you get the idea I think>
[ 47%] Building CXX object
Reu2/CMakeFiles/Reu2.dir/src/CommonFunctions.cc.o
[ 50%] Building CXX object Reu2/CMakeFiles/Reu2.dir/src/Buffer.cc.o
Linking CXX static library ../../bin/libReu2-d.a
[ 50%] Built target Reu2
[ 52%] Building CXX object
Test-Reu2/CMakeFiles/Test-Reu2.dir/src/Test-TrayIcon.cc.o
[ 55%] Building CXX object
Test-Reu2/CMakeFiles/Test-Reu2.dir/src/Test-Transformer.cc.o
<snip>
[ 94%] Building CXX object
Test-Reu2/CMakeFiles/Test-Reu2.dir/src/Test-Database.cc.o
[ 97%] Building CXX object
Test-Reu2/CMakeFiles/Test-Reu2.dir/src/Test-Converter.cc.o
[100%] Building CXX object
Test-Reu2/CMakeFiles/Test-Reu2.dir/src/Test-Buffer.cc.o
Linking CXX executable ../../bin/Test-Reu2
[100%] Built target Test-Reu2
program finished with exit code 0
elapsedTime=15.055892

Can I make CMake more verbose? The IO log above contains the command
line executed by Buildbot ("cd cmake && make all && cd ..").


More information about the CMake mailing list