View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004772CMakeCMakepublic2007-04-03 11:392008-10-01 13:25
Reporterirwin 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0004772: CMAKE_BUILD_TYPE does not work correctly for language enabled with ENABLE_LANGUAGE
DescriptionThe combination

PROJECT(free_eos CXX)
ENABLE_LANGUAGE(C)

defines the correct CXX flags, but blanks the C flags in the cache rather than defining them properly, e.g.,

//C compiler.
CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc

//Flags for C compiler.
CMAKE_C_FLAGS:STRING=' '

//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=

//Flags used by the compiler during release minsize builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=

//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_C_FLAGS_RELEASE:STRING=

//Flags used by the compiler during Release with Debug Info builds.
//
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=

With these compile flags blanked, it turns, e.g., CMAKE_BUILD_TYPE=Debug into a no-op for the C language.

If I try, instead

PROJECT(free_eos C)
ENABLE_LANGUAGE(CXX)

then the C flags are defined correctly, but the CXX flags are blanked turning, e.g., CMAKE_BUILD_TYPE=Debug into a no-op for the C++ language.

I don't know a fix for this bug in ENABLE_LANGUAGE for Linux, and the only workaround is never to use it, and always specify required languages with the PROJECT command (which is awkward if you want to have language support at the user's option).
TagsNo tags attached.
Attached Files

 Relationships
related to 0009656closedBrad King Enabling C adds duplicates in CMAKE_SYSTEM_{PREFIX,INCLUDE}_PATH 

  Notes
(0013144)
Bill Hoffman (manager)
2008-08-21 16:01

Seems to be working now.
(0013145)
Bill Hoffman (manager)
2008-08-21 17:00

Does not work on linux, but works on windows.
(0013654)
Bill Hoffman (manager)
2008-10-01 13:25

cvs commit -m "BUG: fix for bug 4772, enable_language should now work on linux with correct flags"
cvs commit: Examining .
cvs commit: Examining Platform
Committer: Bill Hoffman <bill.hoffman@kitware.com>
Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Modules/CMakeCInformation.cmake,v <-- CMakeCInformation.cmake
new revision: 1.23; previous revision: 1.22
/cvsroot/CMake/CMake/Modules/Platform/Linux.cmake,v <-- Platform/Linux.cmake
new revision: 1.19; previous revision: 1.18

 Issue History
Date Modified Username Field Change
2008-08-21 16:01 Bill Hoffman Status assigned => closed
2008-08-21 16:01 Bill Hoffman Note Added: 0013144
2008-08-21 16:01 Bill Hoffman Resolution open => fixed
2008-08-21 17:00 Bill Hoffman Note Added: 0013145
2008-08-21 17:00 Bill Hoffman Status closed => assigned
2008-08-21 17:01 Bill Hoffman Resolution fixed => reopened
2008-10-01 13:25 Bill Hoffman Status assigned => closed
2008-10-01 13:25 Bill Hoffman Note Added: 0013654
2008-10-01 13:25 Bill Hoffman Resolution reopened => fixed
2009-10-05 11:22 Brad King Relationship added related to 0009656


Copyright © 2000 - 2018 MantisBT Team