Update to 2.0.0 tree from current Fremantle build
[opencv] / OpenCVInstallRequiredSystemLibraries.cmake
1 # By including this file, all files in the CMAKE_INSTALL_DEBUG_LIBRARIES,
2 # will be installed with INSTALL_PROGRAMS into /bin for WIN32 and /lib
3 # for non-win32. If CMAKE_SKIP_INSTALL_RULES is set to TRUE before including
4 # this file, then the INSTALL command is not called.  The use can use 
5 # the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a custom install 
6 # command and install them into any directory they want.
7 # If it is the MSVC compiler, then the microsoft run
8 # time libraries will be found add automatically added to the
9 # CMAKE_INSTALL_DEBUG_LIBRARIES, and installed.  
10 # If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
11 # compiler, then the debug libraries are installed when available.
12 # If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
13 # libraries are installed as well as the CRT run time libraries.
14
15 IF(MSVC)
16   FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
17
18   IF(MSVC70)
19     SET(__install__libs
20       "${SYSTEMROOT}/system32/msvcp70.dll"
21       "${SYSTEMROOT}/system32/msvcr70.dll"
22       )
23   ENDIF(MSVC70)
24
25   IF(MSVC71)
26     SET(__install__libs
27       "${SYSTEMROOT}/system32/msvcp71.dll"
28       "${SYSTEMROOT}/system32/msvcr71.dll"
29       )
30   ENDIF(MSVC71)
31
32   IF(CMAKE_CL_64)
33     SET(CMAKE_MSVC_ARCH amd64)
34   ELSE(CMAKE_CL_64)
35     SET(CMAKE_MSVC_ARCH x86)
36   ENDIF(CMAKE_CL_64)
37
38   GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
39   GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
40
41   IF(MSVC80)
42     # Find the runtime library redistribution directory.
43     FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
44       PATHS
45         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
46         "${base_dir}/VC/redist"
47       )
48     MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
49     SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
50
51     # Install the manifest that allows DLLs to be loaded from the
52     # directory containing the executable.
53     SET(__install__libs
54       "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
55       "${MSVC80_CRT_DIR}/msvcm80.dll"
56       "${MSVC80_CRT_DIR}/msvcp80.dll"
57       "${MSVC80_CRT_DIR}/msvcr80.dll"
58       )
59
60     IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
61       SET(MSVC80_CRT_DIR
62         "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
63       SET(__install__libs ${__install__libs}
64         "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
65         "${MSVC80_CRT_DIR}/msvcm80d.dll"
66         "${MSVC80_CRT_DIR}/msvcp80d.dll"
67         "${MSVC80_CRT_DIR}/msvcr80d.dll"
68         )
69     ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
70
71   ENDIF(MSVC80)
72
73   IF(MSVC90)
74     # Find the runtime library redistribution directory.
75     FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
76       PATHS
77         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
78         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
79         "${base_dir}/VC/redist"
80       )
81     MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
82     SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
83
84     # Install the manifest that allows DLLs to be loaded from the
85     # directory containing the executable.
86     SET(__install__libs
87       "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
88       "${MSVC90_CRT_DIR}/msvcm90.dll"
89       "${MSVC90_CRT_DIR}/msvcp90.dll"
90       "${MSVC90_CRT_DIR}/msvcr90.dll"
91       ) 
92     IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
93       SET(MSVC90_CRT_DIR
94         "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
95       SET(__install__libs ${__install__libs}
96         "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
97         "${MSVC90_CRT_DIR}/msvcm90d.dll"
98         "${MSVC90_CRT_DIR}/msvcp90d.dll"
99         "${MSVC90_CRT_DIR}/msvcr90d.dll"
100         )
101     ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
102
103     IF(CMAKE_INSTALL_OPENMP_LIBRARIES)      
104       SET(MSVC90_OPENMP_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.OPENMP")
105       SET(__install__libs ${__install__libs}
106         "${MSVC90_OPENMP_DIR}/Microsoft.VC90.OpenMP.manifest"
107         "${MSVC90_OPENMP_DIR}/vcomp90.dll"
108         )
109       IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
110         SET(MSVC90_OPENMP_DIR
111           "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugOPENMP")
112         SET(__install__libs ${__install__libs}
113           "${MSVC90_OPENMP_DIR}/Microsoft.VC90.DebugOpenMP.manifest"
114           "${MSVC90_OPENMP_DIR}/vcomp90d.dll"
115           )
116       ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
117     ENDIF(CMAKE_INSTALL_OPENMP_LIBRARIES) 
118   ENDIF(MSVC90) 
119
120   IF(CMAKE_INSTALL_MFC_LIBRARIES)
121     IF(MSVC70)
122       SET(__install__libs ${__install__libs}
123         "${SYSTEMROOT}/system32/mfc70.dll"
124         )
125     ENDIF(MSVC70)
126     IF(MSVC71)
127       SET(__install__libs ${__install__libs}
128         "${SYSTEMROOT}/system32/mfc71.dll"
129         )
130     ENDIF(MSVC71)
131     IF(MSVC80)
132       IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
133         SET(MSVC80_MFC_DIR
134           "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
135         SET(__install__libs ${__install__libs}
136           "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
137           "${MSVC80_MFC_DIR}/mfc80d.dll"
138           "${MSVC80_MFC_DIR}/mfc80ud.dll"
139           "${MSVC80_MFC_DIR}/mfcm80d.dll"
140           "${MSVC80_MFC_DIR}/mfcm80ud.dll"
141           )
142       ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
143         
144       SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
145       # Install the manifest that allows DLLs to be loaded from the
146       # directory containing the executable.
147       SET(__install__libs ${__install__libs}
148         "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
149         "${MSVC80_MFC_DIR}/mfc80.dll"
150         "${MSVC80_MFC_DIR}/mfc80u.dll"
151         "${MSVC80_MFC_DIR}/mfcm80.dll"
152         "${MSVC80_MFC_DIR}/mfcm80u.dll"
153         )
154       # include the language dll's for vs8 as well as the actuall dll's
155       SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
156       # Install the manifest that allows DLLs to be loaded from the
157       # directory containing the executable.
158       SET(__install__libs ${__install__libs}
159         "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
160         "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
161         "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
162         "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
163         "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
164         "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
165         "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
166         "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
167         "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
168         "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
169         )
170     ENDIF(MSVC80)
171
172     IF(MSVC90)
173       IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
174         SET(MSVC90_MFC_DIR
175           "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
176         SET(__install__libs ${__install__libs}
177           "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
178           "${MSVC90_MFC_DIR}/mfc90d.dll"
179           "${MSVC90_MFC_DIR}/mfc90ud.dll"
180           "${MSVC90_MFC_DIR}/mfcm90d.dll"
181           "${MSVC90_MFC_DIR}/mfcm90ud.dll"
182           )
183       ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
184         
185       SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
186       # Install the manifest that allows DLLs to be loaded from the
187       # directory containing the executable.
188       SET(__install__libs ${__install__libs}
189         "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
190         "${MSVC90_MFC_DIR}/mfc90.dll"
191         "${MSVC90_MFC_DIR}/mfc90u.dll"
192         "${MSVC90_MFC_DIR}/mfcm90.dll"
193         "${MSVC90_MFC_DIR}/mfcm90u.dll"
194         )
195       # include the language dll's for vs9 as well as the actuall dll's
196       SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
197       # Install the manifest that allows DLLs to be loaded from the
198       # directory containing the executable.
199       SET(__install__libs ${__install__libs}
200         "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
201         "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
202         "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
203         "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
204         "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
205         "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
206         "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
207         "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
208         "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
209         "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
210         )
211     ENDIF(MSVC90)
212
213   ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
214
215   FOREACH(lib
216       ${__install__libs}
217       )
218     IF(EXISTS ${lib})
219       SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
220         ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
221     ENDIF(EXISTS ${lib})
222   ENDFOREACH(lib)
223 ENDIF(MSVC)
224
225 # Include system runtime libraries in the installation if any are
226 # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
227 IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
228   IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
229     IF(WIN32)
230       INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
231     ELSE(WIN32)
232       INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
233     ENDIF(WIN32)
234   ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
235 ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)