[cmake-developers] Backward compatbility code

Stephen Kelly steveire at gmail.com
Mon Feb 10 03:41:17 EST 2014


Hi, 

There are some places in cmake code which are commented as being for 
backward compatibility, but which seem to be covered by no policy, and some 
of which have a TODO item for addressing that.

 diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
 index 0fe5f8c..31eb79d 100644
 --- a/Source/QtDialog/QCMake.cxx
 +++ b/Source/QtDialog/QCMake.cxx
 @@ -54,6 +54,7 @@ QCMake::QCMake(QObject* p)
     // The short name is actually only still there since this was the name
     // in CMake 2.4, to keep "command line argument compatibility", but
     // this is not necessary in the GUI.
 +    // TODO: Something to remove somewhere regarding KDevelop3?
     if (*iter == "KDevelop3")
       {
       continue;
 diff --git a/Source/cmAddCustomCommandCommand.cxx 
b/Source/cmAddCustomCommandCommand.cxx
 index 5634849..e967e3c 100644
 --- a/Source/cmAddCustomCommandCommand.cxx
 +++ b/Source/cmAddCustomCommandCommand.cxx
 @@ -164,6 +164,7 @@ bool cmAddCustomCommandCommand
           cmSystemTools::ConvertToUnixSlashes(filename);
           break;
         case doing_source:
 +    // TODO: compatibility code. Should this be an error now?
           // We do not want to convert the argument to SOURCE because
           // that option is only available for backward compatibility.
           // Old-style use of this command may use the SOURCE==TARGET
 @@ -344,6 +345,7 @@ bool cmAddCustomCommandCommand
     }
   else
     {
 +    // Should AddCustomCommandOldStyle be removed?
     // Use the old-style mode for backward compatibility.
     this->Makefile->AddCustomCommandOldStyle(target.c_str(), outputs, 
depends,
                                               source.c_str(), commandLines,
 diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
 index a61cab1..e80b24c 100644
 --- a/Source/cmGlobalGenerator.cxx
 +++ b/Source/cmGlobalGenerator.cxx
 @@ -1261,6 +1261,7 @@ void cmGlobalGenerator::Generate()
 
   this->WriteSummary();
 
 +  std::cout << "EXTRA " << (this->ExtraGenerator ? "YES" : "NO") << 
std::endl;
   if (this->ExtraGenerator != 0)
     {
     this->ExtraGenerator->Generate();
 diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
 index 23422a2..f53bbab 100644
 --- a/Source/cmSourceFile.cxx
 +++ b/Source/cmSourceFile.cxx
 @@ -329,6 +329,7 @@ const char* cmSourceFile::GetPropertyForUser(const char 
*prop)
   // cmSourceFileLocation class to commit to a particular full path to
   // the source file as late as possible.  If the users requests the
   // LOCATION property we must commit now.
 +  // Is there something here that can be dropped?
   if(strcmp(prop, "LOCATION") == 0)
     {
     // Commit to a location.
 diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
 index e51095e..86bab95 100644
 --- a/Source/cmTarget.cxx
 +++ b/Source/cmTarget.cxx
 @@ -317,7 +317,8 @@ void cmTarget::SetMakefile(cmMakefile* mf)
     // variable only for non-executable targets.  This preserves
     // compatibility with previous CMake versions in which executables
     // did not support this variable.  Projects may still specify the
 -    // property directly.  TODO: Make this depend on backwards
 +    // property directly.
 +    // TODO: Make this depend on backwards
     // compatibility setting.
     if(this->TargetTypeValue != cmTarget::EXECUTABLE
         && this->TargetTypeValue != cmTarget::INTERFACE_LIBRARY)
 @@ -589,7 +590,7 @@ cmSourceFile* cmTarget::AddSource(const char* s)
   std::string src = s;
 
   // For backwards compatibility replace varibles in source names.
 -  // This should eventually be removed.
 +  // TODO: This should eventually be removed.
   this->Makefile->ExpandVariablesInString(src);
 
   cmSourceFile* sf = this->Makefile->GetOrCreateSource(src.c_str());



It is important that backward compatibility code be removed. It has caused 
problems several times.

Any thoughts on these ones?

Thanks,

Steve.




More information about the cmake-developers mailing list