[cmake-commits] alex committed cmake.cxx 1.310 1.311 cmakemain.cxx 1.63 1.64

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jul 17 12:01:41 EDT 2007


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

Modified Files:
	cmake.cxx cmakemain.cxx 
Log Message:

COMP: fix build on Windows, where GetCurrentDirecty() is redefined to
GetCurrentDirectoryA()
-correct return value for md5sum

Alex


Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- cmakemain.cxx	17 Jul 2007 14:44:09 -0000	1.63
+++ cmakemain.cxx	17 Jul 2007 16:01:39 -0000	1.64
@@ -14,6 +14,13 @@
      PURPOSE.  See the above copyright notices for more information.
 
 =========================================================================*/
+// include these first, otherwise there will be problems on Windows 
+// with GetCurrentDirectory() being redefined 
+#ifdef CMAKE_BUILD_WITH_CMAKE
+#include "cmDynamicLoader.h"
+#include "cmDocumentation.h"
+#endif
+
 #include "cmake.h"
 #include "cmCacheManager.h"
 #include "cmListFileCache.h"
@@ -24,9 +31,6 @@
 #include "cmMakefile.h"
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
-#include "cmDynamicLoader.h"
-#include "cmDocumentation.h"
-
 //----------------------------------------------------------------------------
 static const cmDocumentationEntry cmDocumentationName[] =
 {

Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -d -r1.310 -r1.311
--- cmake.cxx	17 Jul 2007 14:44:09 -0000	1.310
+++ cmake.cxx	17 Jul 2007 16:01:39 -0000	1.311
@@ -1063,6 +1063,7 @@
     else if (args[1] == "md5sum" && args.size() >= 3)
       {
       char md5out[32];
+      int retval = 0;
       for (std::string::size_type cc = 2; cc < args.size(); cc ++)
         {
         const char *filename = args[cc].c_str();
@@ -1070,18 +1071,20 @@
         if(cmSystemTools::FileIsDirectory(filename))
           {
           std::cerr << "Error: " << filename << " is a directory" << std::endl;
+          retval++;
           }
         else if(!cmSystemTools::ComputeFileMD5(filename, md5out))
           {
           // To mimic md5sum behavior in a shell:
           std::cerr << filename << ": No such file or directory" << std::endl;
+          retval++;
           }
         else
           {
           std::cout << std::string(md5out,32) << "  " << filename << std::endl;
           }
         }
-      return 1;
+      return retval;
       }
 
     // Command to change directory and run a program.



More information about the Cmake-commits mailing list