View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006167CMakeCMakepublic2007-12-16 19:322008-04-21 13:22
ReporterRodolfo Schulz de Lima 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006167: [Patch] empty CMAKE_<LANG>_FLAGS gets initialized with space
DescriptionCMake 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.
Additional InformationIf 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.
TagsNo tags attached.
Attached Filesdiff file icon spaces_lang_flags.diff [^] (1,579 bytes) 2007-12-16 19:33 [Show Content]

 Relationships

  Notes
(0009950)
Bill Hoffman (manager)
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 (manager)
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.

 Issue History
Date Modified Username Field Change
2007-12-16 19:32 Rodolfo Schulz de Lima New Issue
2007-12-16 19:33 Rodolfo Schulz de Lima File Added: spaces_lang_flags.diff
2007-12-17 12:04 Bill Hoffman Note Added: 0009950
2007-12-17 12:04 Bill Hoffman Status new => closed
2007-12-17 12:04 Bill Hoffman Resolution open => fixed
2008-04-21 13:22 Bill Hoffman Note Added: 0011460


Copyright © 2000 - 2018 MantisBT Team