[CMake] Re: [cmake 2.5 CVS] CMAKE_${LANG}_FLAGS is initialized with space

Bill Hoffman bill.hoffman at kitware.com
Fri Dec 14 14:34:20 EST 2007


Bill Hoffman wrote:

>> CMakeLists.txt:
>> list(APPEND CMAKE_C_FLAGS -Wall)
>> add_executable(test test.c)
>>
> 
> OK, list append is having the problem.   I will try and figure out why 
> it has the space.  For now, you could try this:
> 
> set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
> 
OK, Dave Cole, just pointed out that list is the wrong thing to use 
here. The CMAKE_C_FLAGS variable is supposed to be a string and not a 
list.   If you used list(APPEND more than once it would always fail. 
So, although odd that it has a space in it, it is benign.  You should 
treat the variable as a string and not a list.

-Bill


More information about the CMake mailing list