1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmSystemTools.h"
13 #include "cmWin32ProcessExecution.h"
15 // this is a test driver program for cmake.
16 int main (int argc, char *argv[])
18 cmSystemTools::EnableMSVCDebugHook();
21 std::cerr << "Usage: " << argv[0] << " executable" << std::endl;
24 std::string arg = argv[1];
25 if ( (arg.find_first_of(" ") != arg.npos) &&
26 (arg.find_first_of("\"") == arg.npos) )
28 arg = "\"" + arg + "\"";
30 std::string command = arg;
32 for ( cc = 2; cc < argc; cc ++ )
34 std::string nextArg = argv[cc];
35 if ( (nextArg.find_first_of(" ") != nextArg.npos) &&
36 (nextArg.find_first_of("\"") == nextArg.npos) )
38 nextArg = "\"" + nextArg + "\"";
44 return cmWin32ProcessExecution::Windows9xHack(command.c_str());