From 96e8cd82c7e5232d85cf94e1f1ce04ed48c96801 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 9 Oct 2003 15:52:29 -0400 Subject: ENH: put the system path after the paths specified on to the FIND command --- Modules/CMakeDetermineCCompiler.cmake | 4 ++-- Source/kwsys/SystemTools.cxx | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 230c132..9c61efe 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -38,9 +38,9 @@ IF(NOT CMAKE_C_COMPILER) ENDIF(NOT CMAKE_C_COMPILER) MARK_AS_ADVANCED(CMAKE_C_COMPILER) -FIND_PROGRAM(CMAKE_AR NAMES ar PATHS /bin /usr/bin /usr/local/bin) +FIND_PROGRAM(CMAKE_AR NAMES ar ) -FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib PATHS /bin /usr/bin /usr/local/bin) +FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib) IF(NOT CMAKE_RANLIB) SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") ENDIF(NOT CMAKE_RANLIB) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 285f792..1af2243 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1016,10 +1016,12 @@ bool SystemTools::RemoveFile(const char* source) kwsys_std::string SystemTools::FindFile(const char* name, const kwsys_std::vector& userPaths) { - // Add the system search path to our path. - kwsys_std::vector path = userPaths; + // Add the system search path to our path first + kwsys_std::vector path; SystemTools::GetPath(path); - + // now add the additional paths + path.insert(path.end(), userPaths.begin(), userPaths.end()); + // now look for the file kwsys_std::string tryPath; for(kwsys_std::vector::const_iterator p = path.begin(); p != path.end(); ++p) @@ -1065,12 +1067,14 @@ kwsys_std::string SystemTools::FindProgram(const char* name, } // Add the system search path to our path. - kwsys_std::vector path = userPaths; + kwsys_std::vector path; if (!no_system_path) { SystemTools::GetPath(path); } - + // now add the additional paths + path.insert(path.end(), userPaths.begin(), userPaths.end()); + for(kwsys_std::vector::const_iterator p = path.begin(); p != path.end(); ++p) { @@ -1122,9 +1126,10 @@ kwsys_std::string SystemTools::FindLibrary(const char* name, } // Add the system search path to our path. - kwsys_std::vector path = userPaths; + kwsys_std::vector path; SystemTools::GetPath(path); - + // now add the additional paths + path.insert(path.end(), userPaths.begin(), userPaths.end()); kwsys_std::string tryPath; for(kwsys_std::vector::const_iterator p = path.begin(); p != path.end(); ++p) -- cgit v0.12