summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-16 14:51:57 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-16 14:51:57 (GMT)
commit2a782880645ad366e724fa0d1657ab233bfe6676 (patch)
tree444791872299ba8ef88e74357817366d2569d787 /Modules
parent34c04bbc245381b83941a2126296ef0973e0642c (diff)
downloadCMake-2a782880645ad366e724fa0d1657ab233bfe6676.zip
CMake-2a782880645ad366e724fa0d1657ab233bfe6676.tar.gz
CMake-2a782880645ad366e724fa0d1657ab233bfe6676.tar.bz2
ENH: Convert Modules/Platform specification of system search paths to use CMAKE_SYSTEM_PREFIX_PATH when possible.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Darwin.cmake3
-rw-r--r--Modules/Platform/UnixPaths.cmake33
-rw-r--r--Modules/Platform/WindowsPaths.cmake36
-rw-r--r--Modules/Platform/syllable.cmake5
4 files changed, 44 insertions, 33 deletions
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 7ba6c56..4641269 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -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)
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 22c9a86..b7f060d 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -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
)
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index 11fc630..45ed479 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -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
+ )
diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake
index 32b6197..2bcaf8c 100644
--- a/Modules/Platform/syllable.cmake
+++ b/Modules/Platform/syllable.cmake
@@ -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)