From 5bd38eb630250ac3a69c6c9dfe0e62cd41dce0c0 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 16 Jul 2007 09:08:45 -0400 Subject: [PATCH] ENH: also add the install base dir of the running cmake to the search directories for the FIND_XXX() commands, for the case that somebody has its own install tree Alex --- Modules/Platform/UnixPaths.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake index c0814077b..8089badb5 100644 --- a/Modules/Platform/UnixPaths.cmake +++ b/Modules/Platform/UnixPaths.cmake @@ -1,3 +1,8 @@ +# also add the install directory of the running cmake to the search directories +# CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up +GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH) +GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH) + SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} # Standard /include /usr/include /usr/local/include @@ -11,6 +16,7 @@ SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} # Other /opt/local/include /usr/pkg/include /opt/csw/include /opt/include + "${_CMAKE_INSTALL_DIR}/include" ) SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} @@ -26,10 +32,12 @@ SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} # Other /opt/local/lib /usr/pkg/lib /opt/csw/lib /opt/lib + "${_CMAKE_INSTALL_DIR}/lib" ) SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH} /bin /usr/bin /usr/local/bin /usr/pkg/bin /sbin + "${_CMAKE_INSTALL_DIR}/bin" ) SET(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES