<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
O/H Bob Paddock έγραψε:
<blockquote cite="mid:200806280858.05667.bob.paddock@gmail.com"
type="cite">
<pre wrap="">On Sunday 22 June 2008 03:25:21 pm Bill Hoffman wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Don't use add_definitions for compiler flags. Use CMAKE_CXX_FLAGS or
CMAKE_C_FLAGS.
</pre>
</blockquote>
<pre wrap=""><!---->
Can you show an example please?
When I try these:
SET (CMAKE_CXX_FLAGS_DEBUG "-Wall" )
SET (CMAKE_CXX_FLAGS_RELEASE "-Wall" )
SET (CMAKE_C_FLAGS_DEBUG "-Wall" )
SET (CMAKE_C_FLAGS_RELEASE "-Wall" )
I do not find "-Wall" in the resultant Makefile (Actually 'Wall' doesn't
appear *anyplace* in the build directory???),
for that mater I don't find the default values in
the Makefile either. What am I doing wrong?
This after doing a rm -rf Build;mkdir Build... to remove any potential of a
cached file being found.
I'm using this to show the values, which do show what I expect to see:
MESSAGE("c init = ${CMAKE_C_FLAGS_INIT}")
MESSAGE("c debug init = ${CMAKE_C_FLAGS_DEBUG_INIT}")
MESSAGE("c release = ${CMAKE_C_FLAGS_RELEASE}")
MESSAGE("c debug = ${CMAKE_C_FLAGS_DEBUG}")
MESSAGE("c++ init = ${CMAKE_CXX_FLAGS_INIT}")
MESSAGE("c++ debug init = ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
MESSAGE("c++ release = ${CMAKE_CXX_FLAGS_RELEASE}")
MESSAGE("c++ debug = ${CMAKE_CXX_FLAGS_DEBUG}")
Also if I try to this:
SET (CMAKE_C_FLAGS_RELEASE "-Wall" ${CMAKE_C_FLAGS_RELEASE} )
I get this:
c release = -Wall;-O3 -DNDEBUG
Note the added ";". Where did that come from?
This is with under Linux with CMake 2.4 patch 8,
with GCC as the target compiler.
</pre>
</blockquote>
Try:<br>
<br>
<pre wrap="">SET (CMAKE_C_FLAGS_RELEASE "-Wall ${CMAKE_C_FLAGS_RELEASE}" )
George
</pre>
<br>
</body>
</html>