Browse Source

ENH: clean up

Bill Hoffman 24 years ago
parent
commit
18b2449ca2
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Source/cmake.cxx

+ 5 - 3
Source/cmake.cxx

@@ -188,7 +188,7 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args)
 #ifdef CMAKE_ROOT_DIR
 #ifdef CMAKE_ROOT_DIR
   else if (!cmSystemTools::FileExists(modules.c_str()))
   else if (!cmSystemTools::FileExists(modules.c_str()))
     {
     {
-    // try compiled in value on UNIX
+    // try compiled in root directory
     cMakeRoot = CMAKE_ROOT_DIR;
     cMakeRoot = CMAKE_ROOT_DIR;
     modules = cMakeRoot + "/Modules/FindVTK.cmake";
     modules = cMakeRoot + "/Modules/FindVTK.cmake";
     }
     }
@@ -196,14 +196,16 @@ void cmake::AddCMakePaths(const std::vector<std::string>& args)
 #ifdef CMAKE_PREFIX
 #ifdef CMAKE_PREFIX
   else if (!cmSystemTools::FileExists(modules.c_str()))
   else if (!cmSystemTools::FileExists(modules.c_str()))
     {
     {
-    // try compiled in value on UNIX
+    // try compiled in install prefix
     cMakeRoot = CMAKE_PREFIX "/share/CMake";
     cMakeRoot = CMAKE_PREFIX "/share/CMake";
     modules = cMakeRoot + "/Modules/FindVTK.cmake";
     modules = cMakeRoot + "/Modules/FindVTK.cmake";
     }
     }
 #endif
 #endif
   else if (!cmSystemTools::FileExists(modules.c_str()))
   else if (!cmSystemTools::FileExists(modules.c_str()))
     {
     {
-    cMakeRoot = cMakeRoot + "/share/CMake";
+    // try 
+    cMakeRoot  = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
+    cMakeRoot += "/share/CMake";
     modules = cMakeRoot +  "/Modules/FindVTK.cmake";
     modules = cMakeRoot +  "/Modules/FindVTK.cmake";
     }
     }
   else if (!cmSystemTools::FileExists(modules.c_str()))
   else if (!cmSystemTools::FileExists(modules.c_str()))