Kaynağa Gözat

Another attempt on Windows 98

Andy Cedilnik 23 yıl önce
ebeveyn
işleme
9619ee3aa1
4 değiştirilmiş dosya ile 42 ekleme ve 3 silme
  1. 2 0
      Source/CMakeLists.txt
  2. 1 1
      Source/cmSystemTools.cxx
  3. 3 2
      Source/cmake.cxx
  4. 36 0
      Source/cmw9xcom.cxx

+ 2 - 0
Source/CMakeLists.txt

@@ -77,6 +77,8 @@ IF (WIN32)
                     )
     IF(  NOT BORLAND )
       LINK_LIBRARIES( rpcrt4.lib )
+      ADD_EXECUTABLE(cmw9xcom cmw9xcom.cxx)
+      TARGET_LINK_LIBRARIES(cmw9xcom CMakeLib)
       SUBDIRS(MFCDialog)
     ENDIF( NOT BORLAND )
   ENDIF(NOT UNIX)

+ 1 - 1
Source/cmSystemTools.cxx

@@ -1480,7 +1480,7 @@ bool RunCommandViaWin32(const char* command,
                         int& retVal,
                         bool verbose)
 {
-#if (1) // defined(__BORLANDC__)
+#if defined(__BORLANDC__)
   return ::WindowsRunCommand(command, dir, output, retVal, verbose);
 #else // Visual studio
   ::SetLastError(ERROR_SUCCESS);

+ 3 - 2
Source/cmake.cxx

@@ -433,8 +433,9 @@ int cmake::AddCMakePaths(const char *arg0)
      "Path to CMake installation.", cmCacheManager::INTERNAL);
 
 #ifdef _WIN32
-  cmSystemTools::SetWindows9xComspecSubstitute(
-    (cMakeSelf + " -E comspec").c_str());
+  std::string path = cmSystemTools::GetFilenamePath(cMakeSelf);
+  std::string comspec = path + "\\cmw9xcom";
+  cmSystemTools::SetWindows9xComspecSubstitute(comspec.c_str());
 #endif
   return 1;
 }

+ 36 - 0
Source/cmw9xcom.cxx

@@ -0,0 +1,36 @@
+/*=========================================================================
+
+  Program:   Insight Segmentation & Registration Toolkit
+  Module:    $RCSfile$
+  Language:  C++
+  Date:      $Date$
+  Version:   $Revision$
+
+  Copyright (c) 2002 Insight Consortium. All rights reserved.
+  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
+
+     This software is distributed WITHOUT ANY WARRANTY; without even 
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+     PURPOSE.  See the above copyright notices for more information.
+
+=========================================================================*/
+#include "cmSystemTools.h"
+#include "cmWin32ProcessExecution.h"
+
+// this is a test driver program for cmake.
+int main (int argc, char *argv[])
+{
+  if ( argc <= 1 )
+    {
+    std::cerr << "Usage: " << argv[0] << " executable" << std::endl;
+    return 1;
+    }
+  std::string command;
+  int cc;
+  for ( cc = 1; cc < argc; cc ++ )
+    {
+    command += argv[cc];
+    }
+ 
+  return cmWin32ProcessExecution::Windows9xHack(command.c_str());
+}