summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-27 21:28:15 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-09-27 21:28:15 (GMT)
commit780a9bbda7142773dfa479a5fe3c231a173943fc (patch)
tree78e55144bbe22f6e19ed8923ff1aab621efdc70a /Source/cmake.cxx
parentc310600df56e7896cb0b996eb0dd9d24203d94fb (diff)
downloadCMake-780a9bbda7142773dfa479a5fe3c231a173943fc.zip
CMake-780a9bbda7142773dfa479a5fe3c231a173943fc.tar.gz
CMake-780a9bbda7142773dfa479a5fe3c231a173943fc.tar.bz2
Add two cmake commands -E echo for echoing strings and -E comspec for workaround of bug of windows 9x; add another implementation of run command on windows which should work...
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx35
1 files changed, 33 insertions, 2 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 684116a..887091e 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -28,6 +28,7 @@
#include "cmGlobalVisualStudio7Generator.h"
#include "cmGlobalBorlandMakefileGenerator.h"
#include "cmGlobalNMakeMakefileGenerator.h"
+#include "cmWin32ProcessExecution.h"
#else
#include "cmGlobalUnixMakefileGenerator.h"
#endif
@@ -430,6 +431,11 @@ int cmake::AddCMakePaths(const char *arg0)
this->m_CacheManager->AddCacheEntry
("CMAKE_ROOT", cMakeRoot.c_str(),
"Path to CMake installation.", cmCacheManager::INTERNAL);
+
+#ifdef _WIN32
+ cmSystemTools::SetWindows9xComspecSubstitute(
+ (cMakeSelf + " -E comspec").c_str());
+#endif
return 1;
}
@@ -448,12 +454,14 @@ void CMakeCommandUsage(const char* program)
<< "Available commands: \n"
<< " chdir dir cmd [args]... - run command in a given directory\n"
<< " copy file destination - copy file to destination (either file or directory)\n"
+ << " echo [string]... - displays arguments as text\n"
<< " remove file1 file2 ... - remove the file(s)\n"
<< " time command [args] ... - run command and return elapsed time\n";
#if defined(_WIN32) && !defined(__CYGWIN__)
errorStream
<< " write_regv key value - write registry value\n"
- << " delete_regv key - delete registry value\n";
+ << " delete_regv key - delete registry value\n"
+ << " comspec - on windows 9x use this for RunCommand\n";
#endif
cmSystemTools::Error(errorStream.str().c_str());
@@ -470,6 +478,18 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
return cmSystemTools::GetErrorOccuredFlag();
}
+ // Echo string
+ else if (args[1] == "echo" )
+ {
+ int cc;
+ for ( cc = 2; cc < args.size(); cc ++ )
+ {
+ std::cout << args[cc] << " ";
+ }
+ std::cout << std::endl;
+ return 0;
+ }
+
// Remove file
else if (args[1] == "remove" && args.size() > 2)
{
@@ -522,7 +542,7 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
}
// Clock command
- else if (args[1] == "chdir" && args.size() > 2)
+ else if (args[1] == "chdir" && args.size() == 4)
{
std::string directory = args[2];
std::string command = args[3];
@@ -557,6 +577,17 @@ int cmake::CMakeCommand(std::vector<std::string>& args)
{
return cmSystemTools::DeleteRegistryValue(args[2].c_str()) ? 0 : 1;
}
+ // Remove file
+ else if (args[1] == "comspec" && args.size() > 2)
+ {
+ int cc;
+ std::string command = args[2];
+ for ( cc = 3; cc < args.size(); cc ++ )
+ {
+ command += " " + args[cc];
+ }
+ return cmWin32ProcessExecution::Windows9xHack(command.c_str());
+ }
#endif
}