bug fix in finding CMAKE_ROOT

This commit is contained in:
Ken Martin 2001-05-21 11:13:56 -04:00
parent 92d59accce
commit d7976058e4

View File

@ -180,21 +180,25 @@ void cmake::AddCMakePaths(char **av)
{ {
// try exe/../share/cmake // try exe/../share/cmake
modules = cMakeRoot + "/share/CMake/Modules"; modules = cMakeRoot + "/share/CMake/Modules";
#if !defined(_WIN32) || defined(__CYGWIN__)
if (!cmSystemTools::FileIsDirectory(modules.c_str())) if (!cmSystemTools::FileIsDirectory(modules.c_str()))
{ {
#if !defined(_WIN32) || defined(__CYGWIN__)
// try compiled in value on UNIX // try compiled in value on UNIX
std::string cMakeRoot = CMAKE_ROOT_DIR; cMakeRoot = CMAKE_ROOT_DIR;
modules = cMakeRoot + "/Modules"; modules = cMakeRoot + "/Modules";
}
#endif #endif
if (!cmSystemTools::FileIsDirectory(modules.c_str())) if (!cmSystemTools::FileIsDirectory(modules.c_str()))
{ {
// couldn't find modules // couldn't find modules
cmSystemTools::Error("Could nto find CMAKE_ROOT !!!"); cmSystemTools::Error("Could not find CMAKE_ROOT !!!");
return; return;
} }
} }
else
{
cMakeRoot = cMakeRoot + "/share/CMake";
}
}
} }
cmCacheManager::GetInstance()->AddCacheEntry cmCacheManager::GetInstance()->AddCacheEntry