From 92c0f41251a26bb90577e582337cc438af4d6a74 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 18 May 2007 11:36:23 -0400 Subject: ENH: Use CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES from platform files to block link directories. --- Modules/Platform/UnixPaths.cmake | 6 ++++++ Source/cmLocalGenerator.cxx | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake index d710efc..cc1a9cd 100644 --- a/Modules/Platform/UnixPaths.cmake +++ b/Modules/Platform/UnixPaths.cmake @@ -31,3 +31,9 @@ SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH} /bin /usr/bin /usr/local/bin /usr/pkg/bin /sbin ) + +SET(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES} + /lib /usr/lib /usr/lib32 /usr/lib64 + ) + diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index fce1dcd..110c60f 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1512,9 +1512,17 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout, // Some search paths should never be emitted emitted.insert(""); - emitted.insert("/usr/lib"); - emitted.insert("/usr/lib32"); - emitted.insert("/usr/lib64"); + if(const char* implicitLinks = + (this->Makefile->GetDefinition + ("CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES"))) + { + std::vector implicitLinkVec; + cmSystemTools::ExpandListArgument(implicitLinks, implicitLinkVec); + for(unsigned int k = 0; k < implicitLinkVec.size(); ++k) + { + emitted.insert(implicitLinkVec[k]); + } + } std::string libPathFlag = this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG"); std::string libLinkFlag = -- cgit v0.12