[Cmake-commits] CMake branch, next, updated. v2.8.3-1005-ge3881de

Ben Boeckel ben.boeckel at kitware.com
Fri Dec 17 12:37:27 EST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e3881deec56f6a18ec73b879be359c29b54c395f (commit)
       via  96309fc6e2439ede2604fc18ad04e82ffc54b606 (commit)
      from  82eb4672029c424bba3ef53b1d9896321efabd03 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3881deec56f6a18ec73b879be359c29b54c395f
commit e3881deec56f6a18ec73b879be359c29b54c395f
Merge: 82eb467 96309fc
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Dec 17 12:37:24 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Dec 17 12:37:24 2010 -0500

    Merge topic 'dev/add_test-working-directory' into next
    
    96309fc Make TestsWorkingDirectory test a C file


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=96309fc6e2439ede2604fc18ad04e82ffc54b606
commit 96309fc6e2439ede2604fc18ad04e82ffc54b606
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Dec 17 12:28:33 2010 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Fri Dec 17 12:34:20 2010 -0500

    Make TestsWorkingDirectory test a C file

diff --git a/Tests/TestsWorkingDirectory/CMakeLists.txt b/Tests/TestsWorkingDirectory/CMakeLists.txt
index 24dc5e6..01e6650 100644
--- a/Tests/TestsWorkingDirectory/CMakeLists.txt
+++ b/Tests/TestsWorkingDirectory/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 2.6)
 project(TestsWorkingDirectoryProj)
 
-add_executable(WorkingDirectory main.cxx)
+add_executable(WorkingDirectory main.c)
 
 enable_testing()
 
diff --git a/Tests/TestsWorkingDirectory/main.cxx b/Tests/TestsWorkingDirectory/main.c
similarity index 68%
rename from Tests/TestsWorkingDirectory/main.cxx
rename to Tests/TestsWorkingDirectory/main.c
index 42c3d34..ad5eb30 100644
--- a/Tests/TestsWorkingDirectory/main.cxx
+++ b/Tests/TestsWorkingDirectory/main.c
@@ -1,8 +1,7 @@
-#include <cstdlib>
-#include <cstring>
 #include <ctype.h>
-
-#include <iostream>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
 
@@ -14,12 +13,13 @@
 #define _getcwd getcwd
 #endif
 
-inline const char* Getcwd(char* buf, unsigned int len)
+static const char* Getcwd(char* buf, unsigned int len)
 {
   const char* ret = _getcwd(buf, len);
+  char* p = NULL;
   if(!ret)
     {
-    std::cerr << "No current working directory." << std::endl;
+    fprintf(stderr, "No current working directory.\n");
     abort();
     }
   // make sure the drive letter is capital
@@ -27,7 +27,7 @@ inline const char* Getcwd(char* buf, unsigned int len)
     {
     buf[0] = toupper(buf[0]);
     }
-  for(char* p = buf; *p; ++p)
+  for(p = buf; *p; ++p)
     {
     if(*p == '\\')
       {
@@ -42,12 +42,12 @@ inline const char* Getcwd(char* buf, unsigned int len)
 #include <fcntl.h>
 #include <unistd.h>
 
-inline const char* Getcwd(char* buf, unsigned int len)
+static const char* Getcwd(char* buf, unsigned int len)
 {
   const char* ret = getcwd(buf, len);
   if(!ret)
     {
-    std::cerr << "No current working directory" << std::endl;
+    fprintf(stderr, "No current working directory\n");
     abort();
     }
   return ret;
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
   char buf[2048];
   const char *cwd = Getcwd(buf, sizeof(buf));
 
-  std::cout << "Working directory: -->" << cwd << "<--";
+  fprintf(stdout, "Working directory: -->%s<--", cwd);
 
   return 0;
 }

-----------------------------------------------------------------------

Summary of changes:
 Tests/TestsWorkingDirectory/CMakeLists.txt       |    2 +-
 Tests/TestsWorkingDirectory/{main.cxx => main.c} |   20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)
 rename Tests/TestsWorkingDirectory/{main.cxx => main.c} (68%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list