[Cmake-commits] [cmake-commits] king committed cmGlobalUnixMakefileGenerator3.cxx 1.131 1.132 cmake.cxx 1.403 1.404

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Feb 6 11:19:00 EST 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv11672/Source

Modified Files:
	cmGlobalUnixMakefileGenerator3.cxx cmake.cxx 
Log Message:
BUG: Fix OS X AppBundle/FW byproducts dependencies

App Bundle and Framework directories, symlinks, and Info.plist files we
create during generation are byproducts, not outputs.  We should re-run
CMake only when they are missing, not when they are old.
See issue #8465.


Index: cmGlobalUnixMakefileGenerator3.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalUnixMakefileGenerator3.cxx,v
retrieving revision 1.131
retrieving revision 1.132
diff -C 2 -d -r1.131 -r1.132
*** cmGlobalUnixMakefileGenerator3.cxx	3 Jul 2008 13:31:29 -0000	1.131
--- cmGlobalUnixMakefileGenerator3.cxx	6 Feb 2009 16:18:56 -0000	1.132
***************
*** 353,368 ****
        lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() 
                      << "\"\n";
-     const std::vector<std::string>& outfiles = 
-       lg->GetMakefile()->GetOutputFiles();
-     for(std::vector<std::string>::const_iterator k= outfiles.begin();
-         k != outfiles.end(); ++k)
-       {
-       cmakefileStream << "  \"" << 
-         lg->Convert(k->c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() 
-                       << "\"\n";
-       }
      }
    cmakefileStream << "  )\n\n";
  
    this->WriteMainCMakefileLanguageRules(cmakefileStream, 
                                          this->LocalGenerators);
--- 353,376 ----
        lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() 
                      << "\"\n";
      }
    cmakefileStream << "  )\n\n";
  
+   // CMake must rerun if a byproduct is missing.
+   {
+   cmakefileStream
+     << "# Byproducts of CMake generate step:\n"
+     << "SET(CMAKE_MAKEFILE_PRODUCTS\n";
+   const std::vector<std::string>& outfiles =
+     lg->GetMakefile()->GetOutputFiles();
+   for(std::vector<std::string>::const_iterator k = outfiles.begin();
+       k != outfiles.end(); ++k)
+     {
+     cmakefileStream << "  \"" <<
+       lg->Convert(k->c_str(),cmLocalGenerator::HOME_OUTPUT).c_str()
+                     << "\"\n";
+     }
+   cmakefileStream << "  )\n\n";
+   }
+ 
    this->WriteMainCMakefileLanguageRules(cmakefileStream, 
                                          this->LocalGenerators);

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.403
retrieving revision 1.404
diff -C 2 -d -r1.403 -r1.404
*** cmake.cxx	2 Feb 2009 18:27:30 -0000	1.403
--- cmake.cxx	6 Feb 2009 16:18:56 -0000	1.404
***************
*** 2658,2661 ****
--- 2658,2682 ----
      }
  
+   // If any byproduct of makefile generation is missing we must re-run.
+   std::vector<std::string> products;
+   if(const char* productStr = mf->GetDefinition("CMAKE_MAKEFILE_PRODUCTS"))
+     {
+     cmSystemTools::ExpandListArgument(productStr, products);
+     }
+   for(std::vector<std::string>::const_iterator pi = products.begin();
+       pi != products.end(); ++pi)
+     {
+     if(!cmSystemTools::FileExists(pi->c_str()))
+       {
+       if(verbose)
+         {
+         cmOStringStream msg;
+         msg << "Re-run cmake, missing byproduct: " << *pi << "\n";
+         cmSystemTools::Stdout(msg.str().c_str());
+         }
+       return 1;
+       }
+     }
+ 
    // Get the set of dependencies and outputs.
    std::vector<std::string> depends;



More information about the Cmake-commits mailing list