Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Modules / Platform / WindowsPaths.cmake
blob00e3afa1241e41ecff6869d556aa112a9cab4264
1 # Add the program-files folder(s) to the list of installation
2 # prefixes.
4 # Windows 64-bit Binary:
5 #   ENV{ProgramFiles(x86)} = [C:\Program Files (x86)]
6 #   ENV{ProgramFiles} = [C:\Program Files]
7 #   ENV{ProgramW6432} = <not set>
8 # (executed from cygwin):
9 #   ENV{ProgramFiles(x86)} = <not set>
10 #   ENV{ProgramFiles} = [C:\Program Files]
11 #   ENV{ProgramW6432} = <not set>
13 # Windows 32-bit Binary:
14 #   ENV{ProgramFiles(x86)} = [C:\Program Files (x86)]
15 #   ENV{ProgramFiles} = [C:\Program Files (x86)]
16 #   ENV{ProgramW6432} = [C:\Program Files]
17 # (executed from cygwin):
18 #   ENV{ProgramFiles(x86)} = <not set>
19 #   ENV{ProgramFiles} = [C:\Program Files (x86)]
20 #   ENV{ProgramW6432} = [C:\Program Files]
21 IF(DEFINED "ENV{ProgramW6432}")
22   # 32-bit binary on 64-bit windows.
23   # The 64-bit program files are in ProgramW6432.
24   LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramW6432}")
26   # The 32-bit program files are in ProgramFiles.
27   IF(DEFINED "ENV{ProgramFiles}")
28     LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
29   ENDIF()
30 ELSE()
31   # 64-bit binary, or 32-bit binary on 32-bit windows.
32   IF(DEFINED "ENV{ProgramFiles}")
33     LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
34   ENDIF()
35   IF(DEFINED "ENV{ProgramFiles(x86)}")
36     # 64-bit binary.  32-bit program files are in ProgramFiles(x86).
37     LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
38   ELSEIF(DEFINED "ENV{SystemDrive}")
39     # Guess the 32-bit program files location.
40     IF(EXISTS "$ENV{SystemDrive}/Program Files (x86)")
41       LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
42         "$ENV{SystemDrive}/Program Files (x86)")
43     ENDIF()
44   ENDIF()
45 ENDIF()
47 # Add the CMake install location.
48 GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
49 GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
50 LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH "${_CMAKE_INSTALL_DIR}")
52 # Add other locations.
53 LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
54   # Project install destination.
55   "${CMAKE_INSTALL_PREFIX}"
57   # MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
58   /
59   )
61 LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
62   )
64 # mingw can also link against dlls which can also be in /bin, so list this too
65 LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
66   "${CMAKE_INSTALL_PREFIX}/bin"
67   "${_CMAKE_INSTALL_DIR}/bin"
68   /bin
69   )
71 LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
72   )