2009-10-05 19:47:05 +04:00
|
|
|
|
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2006-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-10-05 19:47:05 +04:00
|
|
|
# License text for the above reference.)
|
|
|
|
|
2009-10-05 19:47:25 +04:00
|
|
|
# Block multiple inclusion because "CMakeCInformation.cmake" includes
|
|
|
|
# "Platform/${CMAKE_SYSTEM_NAME}" even though the generic module
|
|
|
|
# "CMakeSystemSpecificInformation.cmake" already included it.
|
|
|
|
# The extra inclusion is a work-around documented next to the include()
|
|
|
|
# call, so this can be removed when the work-around is removed.
|
2012-08-13 21:47:32 +04:00
|
|
|
if(__WINDOWS_PATHS_INCLUDED)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
set(__WINDOWS_PATHS_INCLUDED 1)
|
2009-10-05 19:47:25 +04:00
|
|
|
|
2008-12-17 17:23:30 +03:00
|
|
|
# Add the program-files folder(s) to the list of installation
|
|
|
|
# prefixes.
|
|
|
|
#
|
|
|
|
# Windows 64-bit Binary:
|
|
|
|
# ENV{ProgramFiles(x86)} = [C:\Program Files (x86)]
|
|
|
|
# ENV{ProgramFiles} = [C:\Program Files]
|
2016-01-15 22:04:19 +03:00
|
|
|
# ENV{ProgramW6432} = [C:\Program Files] or <not set>
|
2008-12-17 17:23:30 +03:00
|
|
|
#
|
2016-01-15 22:04:19 +03:00
|
|
|
# Windows 32-bit Binary on 64-bit Windows:
|
2008-12-17 17:23:30 +03:00
|
|
|
# ENV{ProgramFiles(x86)} = [C:\Program Files (x86)]
|
|
|
|
# ENV{ProgramFiles} = [C:\Program Files (x86)]
|
|
|
|
# ENV{ProgramW6432} = [C:\Program Files]
|
2016-01-15 22:04:19 +03:00
|
|
|
set(_programfiles "")
|
|
|
|
foreach(v "ProgramW6432" "ProgramFiles" "ProgramFiles(x86)")
|
|
|
|
if(DEFINED "ENV{${v}}")
|
|
|
|
file(TO_CMAKE_PATH "$ENV{${v}}" _env_programfiles)
|
|
|
|
list(APPEND _programfiles "${_env_programfiles}")
|
|
|
|
unset(_env_programfiles)
|
2012-08-13 21:47:32 +04:00
|
|
|
endif()
|
2016-01-15 22:04:19 +03:00
|
|
|
endforeach()
|
|
|
|
if(DEFINED "ENV{SystemDrive}")
|
|
|
|
foreach(d "Program Files" "Program Files (x86)")
|
|
|
|
if(EXISTS "$ENV{SystemDrive}/${d}")
|
|
|
|
list(APPEND _programfiles "$ENV{SystemDrive}/${d}")
|
2012-08-13 21:47:32 +04:00
|
|
|
endif()
|
2016-01-15 22:04:19 +03:00
|
|
|
endforeach()
|
|
|
|
endif()
|
|
|
|
if(_programfiles)
|
|
|
|
list(REMOVE_DUPLICATES _programfiles)
|
|
|
|
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_programfiles})
|
2012-08-13 21:47:32 +04:00
|
|
|
endif()
|
2016-01-15 22:04:19 +03:00
|
|
|
unset(_programfiles)
|
2008-12-17 17:23:30 +03:00
|
|
|
|
|
|
|
# Add the CMake install location.
|
2012-08-13 21:47:32 +04:00
|
|
|
get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
|
|
|
|
get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
|
|
|
|
list(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
|
2007-07-17 16:51:45 +04:00
|
|
|
|
2013-10-29 13:40:09 +04:00
|
|
|
if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
|
|
|
|
# Add other locations.
|
|
|
|
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
|
|
|
|
# Project install destination.
|
|
|
|
"${CMAKE_INSTALL_PREFIX}"
|
|
|
|
)
|
2013-11-14 15:04:40 +04:00
|
|
|
if (CMAKE_STAGING_PREFIX)
|
|
|
|
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
|
|
|
|
# User-supplied staging prefix.
|
|
|
|
"${CMAKE_STAGING_PREFIX}"
|
|
|
|
)
|
|
|
|
endif()
|
2013-10-29 13:40:09 +04:00
|
|
|
endif()
|
2008-01-16 17:51:57 +03:00
|
|
|
|
2013-04-25 17:07:45 +04:00
|
|
|
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
|
2008-01-16 17:51:57 +03:00
|
|
|
# MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
|
2013-04-25 17:07:45 +04:00
|
|
|
list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
|
|
|
|
endif()
|
2008-01-16 17:51:57 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
|
2008-01-16 17:51:57 +03:00
|
|
|
)
|
2007-07-17 16:51:45 +04:00
|
|
|
|
2007-08-02 19:17:32 +04:00
|
|
|
# mingw can also link against dlls which can also be in /bin, so list this too
|
2013-10-29 13:40:09 +04:00
|
|
|
if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
|
|
|
|
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
|
|
|
|
"${CMAKE_INSTALL_PREFIX}/bin"
|
|
|
|
)
|
2013-11-14 15:04:40 +04:00
|
|
|
if (CMAKE_STAGING_PREFIX)
|
|
|
|
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
|
|
|
|
"${CMAKE_STAGING_PREFIX}/bin"
|
|
|
|
)
|
|
|
|
endif()
|
2013-10-29 13:40:09 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
|
2008-01-16 17:51:57 +03:00
|
|
|
"${_CMAKE_INSTALL_DIR}/bin"
|
|
|
|
/bin
|
|
|
|
)
|
2007-07-17 16:51:45 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
|
2008-01-16 17:51:57 +03:00
|
|
|
)
|