diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-03-01 15:53:09 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-03-01 15:53:09 (GMT) |
commit | c733ab2701a0915b3ec1728d341fae5bb850f7b5 (patch) | |
tree | 0f872295a4a90ac4cbdff85512728601041cace0 /Source/cmake.cxx | |
parent | c931d330c96e50732ed76a9136c09f735ea8fe70 (diff) | |
download | CMake-c733ab2701a0915b3ec1728d341fae5bb850f7b5.zip CMake-c733ab2701a0915b3ec1728d341fae5bb850f7b5.tar.gz CMake-c733ab2701a0915b3ec1728d341fae5bb850f7b5.tar.bz2 |
BUG: a couple bugs in system informaiton
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 59e81cb..6517d15 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2928,6 +2928,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& 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<std::string>& 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<std::string>& args) // now run cmake on the CMakeLists file cmSystemTools::ChangeDirectory(destPath.c_str()); - cmake cm; std::vector<std::string> 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<std::string>& 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) |