[cmake-commits] king committed cmDependsFortran.cxx 1.23 1.24
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Oct 12 09:51:31 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv13938
Modified Files:
cmDependsFortran.cxx
Log Message:
ENH: When an object file requires a module add the file-level dependency between the object file and the module timestamp file. Create a dummy timestamp file in case nothing in the project actually creates the module. See bug#5809.
Index: cmDependsFortran.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDependsFortran.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- cmDependsFortran.cxx 10 Oct 2007 13:07:10 -0000 1.23
+++ cmDependsFortran.cxx 12 Oct 2007 13:51:28 -0000 1.24
@@ -17,6 +17,8 @@
#include "cmDependsFortran.h"
#include "cmSystemTools.h"
+#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
#include "cmDependsFortranParser.h" /* Interface to parser object. */
@@ -119,6 +121,10 @@
return false;
}
+ // Get the directory in which stamp files will be stored.
+ std::string stamp_dir =
+ this->LocalGenerator->GetMakefile()->GetCurrentOutputDirectory();
+
// Create the parser object.
cmDependsFortranParser parser(this);
@@ -157,6 +163,38 @@
// create an empty proxy in case no other source provides it
makeDepends << i->c_str() << ".mod.proxy:" << std::endl;
+
+ // The object file should depend on timestamped files for the
+ // modules it uses.
+ std::string m = cmSystemTools::LowerCase(*i);
+ makeDepends << obj << ": " << m.c_str() << ".mod.stamp\n";
+
+ // Create a dummy timestamp file for the module.
+ std::string fullPath = stamp_dir;
+ fullPath += "/";
+ fullPath += m;
+ fullPath += ".mod.stamp";
+ if(!cmSystemTools::FileExists(fullPath.c_str()))
+ {
+ std::ofstream dummy(fullPath.c_str());
+ dummy
+ << "This is a fake module timestamp file created by CMake because\n"
+ << " " << src << "\n"
+ << "requires the module and\n"
+ << " " << obj << "\n"
+ << "depends on this timestamp file.\n"
+ << "\n"
+ << "If another source in the same directory provides the module\n"
+ << "this file will be overwritten with a real module timestamp that\n"
+ << "is updated when the module is rebuilt.\n"
+ << "\n"
+ << "If no source in the directory provides the module at least the\n"
+ << "project will build without failing to find the module timestamp.\n"
+ << "\n"
+ << "In the future CMake may be able to locate modules in other directories\n"
+ << "or outside the project and update this timestamp file as necessary.\n"
+ ;
+ }
}
}
More information about the Cmake-commits
mailing list