MantisBT - CMake
View Issue Details
0006167CMakeCMakepublic2007-12-16 19:322008-04-21 13:22
Rodolfo Schulz de Lima 
 
normalminoralways
closedfixed 
 
 
0006167: [Patch] empty CMAKE_<LANG>_FLAGS gets initialized with space
CMake initializes CMAKE_CXX_FLAGS (and CMAKE_C_FLAGS) with a space even if it's empty. This could surprise someone that might think that if(CMAKE_CXX_FLAGS) should be false.

I've traced down the bug and have created a patch, which is attached to this bug report.
If you run the following CMakeLists.txt:

message(X ${CMAKE_CXX_FLAGS} X)

cmake outputs:
X X

instead of:
XX

even if environment's CXXFLAGS is empty.
No tags attached.
diff spaces_lang_flags.diff (1,579) 2007-12-16 19:33
https://public.kitware.com/Bug/file/1258/spaces_lang_flags.diff
Issue History
2007-12-16 19:32Rodolfo Schulz de LimaNew Issue
2007-12-16 19:33Rodolfo Schulz de LimaFile Added: spaces_lang_flags.diff
2007-12-17 12:04Bill HoffmanNote Added: 0009950
2007-12-17 12:04Bill HoffmanStatusnew => closed
2007-12-17 12:04Bill HoffmanResolutionopen => fixed
2008-04-21 13:22Bill HoffmanNote Added: 0011460

Notes
(0009950)
Bill Hoffman   
2007-12-17 12:04   
Thanks!

$ cvs commit -m "BUG: fix for bug 6167 get rid of extra space in flags"

/cvsroot/CMake/CMake/Modules/CMakeCInformation.cmake,v <-- CMakeCInformation.cmake
new revision: 1.17; previous revision: 1.16
/cvsroot/CMake/CMake/Modules/CMakeCXXInformation.cmake,v <-- CMakeCXXInformation.cmake
new revision: 1.20; previous revision: 1.19
/cvsroot/CMake/CMake/Modules/CMakeFortranInformation.cmake,v <-- CMakeFortranInformation.cmake
new revision: 1.15; previous revision: 1.14

(0011460)
Bill Hoffman   
2008-04-21 13:22   
I should have looked closer at this one... The patch as applied made the _INIT values always used. I have made a new patch that should fix the problem in CVS CMake.