From c733ab2701a0915b3ec1728d341fae5bb850f7b5 Mon Sep 17 00:00:00 2001 From: Ken Martin Date: Thu, 1 Mar 2007 10:53:09 -0500 Subject: [PATCH] BUG: a couple bugs in system informaiton --- Source/cmake.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 59e81cb25..6517d151e 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2928,6 +2928,7 @@ int cmake::GetSystemInformation(std::vector& args) } // process the arguments + bool writeToStdout = true; for(unsigned int i=1; i < args.size(); ++i) { std::string arg = args[i]; @@ -2965,10 +2966,11 @@ int cmake::GetSystemInformation(std::vector& args) { if (!cmSystemTools::FileIsFullPath(arg.c_str())) { - resultFile += cwd; + resultFile = cwd; resultFile += "/"; } - resultFile = arg; + resultFile += arg; + writeToStdout = false; } } @@ -3000,14 +3002,13 @@ int cmake::GetSystemInformation(std::vector& args) // now run cmake on the CMakeLists file cmSystemTools::ChangeDirectory(destPath.c_str()); - cmake cm; std::vector args2; args2.push_back(args[0]); args2.push_back(destPath); std::string resultArg = "-DRESULT_FILE="; resultArg += resultFile; args2.push_back(resultArg); - int res = cm.Run(args2, false); + int res = this->Run(args2, false); if (res != 0) { @@ -3019,7 +3020,7 @@ int cmake::GetSystemInformation(std::vector& args) cmSystemTools::ChangeDirectory(cwd.c_str()); // echo results to stdout if needed - if (args.size() == 1) + if (writeToStdout) { FILE* fin = fopen(resultFile.c_str(), "r"); if(fin)