[Cmake] CMake Bug: Support caps ext (.C .H)

Nitin Gupta ngupta at GlobespanVirata . com
Tue, 23 Sep 2003 20:22:32 +0530


PROBLEM: If the extension of any of source file
	   is caps C or H CMake assumes the project
	   contains CXX files. Hence it picks CMAKE_CXX_FLAGS
	   as default compile flags.
DIAGNOSIS: cmTarget::HasCxx() returns true in the file
	   extension of any of the file is caps C or caps H.

FIX :
*** cmTarget.cxx.orig	Tue Sep 23 20:15:33 2003
--- cmTarget.cxx.modi	Tue Sep 23 20:17:52 2003
*************** bool cmTarget::HasCxx() const
*** 244,251 ****
    for(std::vector<cmSourceFile*>::const_iterator i =
m_SourceFiles.begin();
        i != m_SourceFiles.end(); ++i)
      {
!     if((*i)->GetSourceExtension() != "c" &&
!        (*i)->GetSourceExtension() != "h")
        {
        return true;
        }
--- 244,251 ----
    for(std::vector<cmSourceFile*>::const_iterator i =
m_SourceFiles.begin();
        i != m_SourceFiles.end(); ++i)
      {
!     if(cmSystemTools::LowerCase((*i)->GetSourceExtension()) != "c" &&
!        cmSystemTools::LowerCase((*i)->GetSourceExtension()) != "h")
        {
        return true;
        }