diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-07-17 15:53:07 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2002-07-17 15:53:07 (GMT) |
commit | 42a00c96c17e03829d2b11a092f49d598ba527b0 (patch) | |
tree | b2bd2b5fff0e792e0df950b60df978125ab70b50 /Source/cmake.cxx | |
parent | fcc410de44e59fa4f6145292dc1f13a4498bd8b1 (diff) | |
download | CMake-42a00c96c17e03829d2b11a092f49d598ba527b0.zip CMake-42a00c96c17e03829d2b11a092f49d598ba527b0.tar.gz CMake-42a00c96c17e03829d2b11a092f49d598ba527b0.tar.bz2 |
Fix changing of directories using cmSystemTools RunCommand feature
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index fdfc11f..68efa46 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -631,18 +631,15 @@ int cmake::CMakeCommand(std::vector<std::string>& args) command += args[cc]; } - if ( cmSystemTools::ChangeDirectory( directory.c_str() ) == 0 ) + int retval = 0; + if ( cmSystemTools::RunCommand(command.c_str(), output, retval, + directory.c_str(), true) ) { - std::cout << "Change directory to: " << directory << std::endl; - cmSystemTools::RunCommand(command.c_str(), output, 0, true); std::cout << output.c_str(); - } - else - { - std::cout << "Cannot change directory to: " << directory << std::endl; - } + return retval; + } - return 0; + return 1; } #if defined(_WIN32) && !defined(__CYGWIN__) |