ENH: Convert Modules/Platform specification of system search paths to use CMAKE_SYSTEM_PREFIX_PATH when possible.

This commit is contained in:
Brad King 2008-01-16 09:51:57 -05:00
parent 34c04bbc24
commit 2a78288064
4 changed files with 44 additions and 33 deletions

View File

@ -149,5 +149,4 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH
/Developer/Applications)
INCLUDE(Platform/UnixPaths)
SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /sw/include)
SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /sw/lib)
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /sw)

View File

@ -5,10 +5,21 @@ SET(UNIX 1)
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}
# List common installation prefixes. These will be used for all
# search types.
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
# Standard
/include /usr/include /usr/local/include
/ /usr /usr/local
# CMake install location
"${_CMAKE_INSTALL_DIR}"
# Project install destination.
"${CMAKE_INSTALL_PREFIX}"
)
# List common include file locations not under the common prefixes.
LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
# Windows API on Cygwin
/usr/include/w32api
@ -19,14 +30,9 @@ SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
/opt/local/include /usr/pkg/include
/opt/csw/include /opt/include
/usr/openwin/include
"${_CMAKE_INSTALL_DIR}/include"
"${CMAKE_INSTALL_PREFIX}/include"
)
SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
# Standard
/lib /usr/lib /usr/local/lib
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
# Windows API on Cygwin
/usr/lib/w32api
@ -37,18 +43,13 @@ SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
/opt/local/lib /usr/pkg/lib
/opt/csw/lib /opt/lib
/usr/openwin/lib
"${_CMAKE_INSTALL_DIR}/lib"
"${CMAKE_INSTALL_PREFIX}/lib"
)
SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
/bin /usr/bin /usr/local/bin /usr/pkg/bin /sbin
"${_CMAKE_INSTALL_DIR}/bin"
"${CMAKE_INSTALL_PREFIX}/bin"
LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
/usr/pkg/bin
)
SET(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}
LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/lib /usr/lib /usr/lib32 /usr/lib64
)

View File

@ -1,17 +1,31 @@
GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
# the /bin, /lib and /include dirs are mainly for mingw cross compiler users
# under Linux who use CMAKE_FIND_ROOT_PATH
SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
"$ENV{ProgramFiles}" "${CMAKE_INSTALL_PREFIX}/include" "${_CMAKE_INSTALL_DIR}/include" /include)
# List common installation prefixes. These will be used for all
# search types.
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
# Standard
"$ENV{ProgramFiles}"
# CMake install location
"${_CMAKE_INSTALL_DIR}"
# Project install destination.
"${CMAKE_INSTALL_PREFIX}"
# MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
/
)
LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
)
# mingw can also link against dlls which can also be in /bin, so list this too
SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
"$ENV{ProgramFiles}"
"${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_INSTALL_PREFIX}/bin"
"${_CMAKE_INSTALL_DIR}/lib" "${_CMAKE_INSTALL_DIR}/bin"
/lib /bin )
LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
"${CMAKE_INSTALL_PREFIX}/bin"
"${_CMAKE_INSTALL_DIR}/bin"
/bin
)
SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
"$ENV{ProgramFiles}" "${CMAKE_INSTALL_PREFIX}/bin" "${_CMAKE_INSTALL_DIR}/bin" /bin)
LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
)

View File

@ -30,7 +30,4 @@ ENDFOREACH(type)
INCLUDE(Platform/UnixPaths)
# these are Syllable specific:
SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/indexes/include )
SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/indexes/lib )
SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH} /usr/indexes/bin )
LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /usr/indexes)