1 # By including this file, all library files listed in the variable
2 # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
3 # install(PROGRAMS ...) into bin for WIN32 and lib
4 # for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE
5 # before including this file, then the INSTALL command is not called.
6 # The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a
7 # custom install command and install them however they want.
8 # If it is the MSVC compiler, then the microsoft run
9 # time libraries will be found and automatically added to the
10 # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed.
11 # If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
12 # compiler, then the debug libraries are installed when available.
13 # If CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
14 # libraries are installed when both debug and release are available.
15 # If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
16 # libraries are installed as well as the CRT run time libraries.
17 # If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are
18 # installed to that directory rather than the default.
19 # If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is NOT set, then this file
20 # warns about required files that do not exist. You can set this variable to
21 # ON before including this file to avoid the warning. For example, the Visual
22 # Studio Express editions do not include the redistributable files, so if you
23 # include this file on a machine with only VS Express installed, you'll get
26 #=============================================================================
27 # Copyright 2006-2009 Kitware, Inc.
29 # Distributed under the OSI-approved BSD License (the "License");
30 # see accompanying file Copyright.txt for details.
32 # This software is distributed WITHOUT ANY WARRANTY; without even the
33 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
34 # See the License for more information.
35 #=============================================================================
36 # (To distribute this file outside of CMake, substitute the full
37 # License text for the above reference.)
40 file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
43 if(MSVC_VERSION GREATER 1599)
45 set(CMAKE_MSVC_ARCH x64)
48 set(CMAKE_MSVC_ARCH amd64)
51 set(CMAKE_MSVC_ARCH x86)
54 get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
55 get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
59 "${SYSTEMROOT}/system32/msvcp70.dll"
60 "${SYSTEMROOT}/system32/msvcr70.dll"
66 "${SYSTEMROOT}/system32/msvcp71.dll"
67 "${SYSTEMROOT}/system32/msvcr71.dll"
72 # Find the runtime library redistribution directory.
73 get_filename_component(msvc_install_dir
74 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
75 find_path(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
77 "${msvc_install_dir}/../../VC/redist"
78 "${base_dir}/VC/redist"
80 mark_as_advanced(MSVC80_REDIST_DIR)
81 set(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
83 # Install the manifest that allows DLLs to be loaded from the
84 # directory containing the executable.
85 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
87 "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
88 "${MSVC80_CRT_DIR}/msvcm80.dll"
89 "${MSVC80_CRT_DIR}/msvcp80.dll"
90 "${MSVC80_CRT_DIR}/msvcr80.dll"
94 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
96 "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
97 set(__install__libs ${__install__libs}
98 "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
99 "${MSVC80_CRT_DIR}/msvcm80d.dll"
100 "${MSVC80_CRT_DIR}/msvcp80d.dll"
101 "${MSVC80_CRT_DIR}/msvcr80d.dll"
107 # Find the runtime library redistribution directory.
108 get_filename_component(msvc_install_dir
109 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
110 get_filename_component(msvc_express_install_dir
111 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
112 find_path(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
114 "${msvc_install_dir}/../../VC/redist"
115 "${msvc_express_install_dir}/../../VC/redist"
116 "${base_dir}/VC/redist"
118 mark_as_advanced(MSVC90_REDIST_DIR)
119 set(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
121 # Install the manifest that allows DLLs to be loaded from the
122 # directory containing the executable.
123 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
125 "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
126 "${MSVC90_CRT_DIR}/msvcm90.dll"
127 "${MSVC90_CRT_DIR}/msvcp90.dll"
128 "${MSVC90_CRT_DIR}/msvcr90.dll"
132 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
134 "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
135 set(__install__libs ${__install__libs}
136 "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
137 "${MSVC90_CRT_DIR}/msvcm90d.dll"
138 "${MSVC90_CRT_DIR}/msvcp90d.dll"
139 "${MSVC90_CRT_DIR}/msvcr90d.dll"
144 macro(MSVCRT_FILES_FOR_VERSION version)
147 # Find the runtime library redistribution directory.
148 get_filename_component(msvc_install_dir
149 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${v}.0;InstallDir]" ABSOLUTE)
150 find_path(MSVC${v}_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT
152 "${msvc_install_dir}/../../VC/redist"
153 "${base_dir}/VC/redist"
154 "$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
155 "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio ${v}.0/VC/redist"
157 mark_as_advanced(MSVC${v}_REDIST_DIR)
158 set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
160 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
162 "${MSVC${v}_CRT_DIR}/msvcp${v}0.dll"
163 "${MSVC${v}_CRT_DIR}/msvcr${v}0.dll"
167 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
169 "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugCRT")
170 set(__install__libs ${__install__libs}
171 "${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll"
172 "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll"
178 MSVCRT_FILES_FOR_VERSION(10)
182 MSVCRT_FILES_FOR_VERSION(11)
185 if(CMAKE_INSTALL_MFC_LIBRARIES)
187 set(__install__libs ${__install__libs}
188 "${SYSTEMROOT}/system32/mfc70.dll"
193 set(__install__libs ${__install__libs}
194 "${SYSTEMROOT}/system32/mfc71.dll"
199 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
201 "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
202 set(__install__libs ${__install__libs}
203 "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
204 "${MSVC80_MFC_DIR}/mfc80d.dll"
205 "${MSVC80_MFC_DIR}/mfc80ud.dll"
206 "${MSVC80_MFC_DIR}/mfcm80d.dll"
207 "${MSVC80_MFC_DIR}/mfcm80ud.dll"
211 set(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
212 # Install the manifest that allows DLLs to be loaded from the
213 # directory containing the executable.
214 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
215 set(__install__libs ${__install__libs}
216 "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
217 "${MSVC80_MFC_DIR}/mfc80.dll"
218 "${MSVC80_MFC_DIR}/mfc80u.dll"
219 "${MSVC80_MFC_DIR}/mfcm80.dll"
220 "${MSVC80_MFC_DIR}/mfcm80u.dll"
224 # include the language dll's for vs8 as well as the actuall dll's
225 set(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
226 # Install the manifest that allows DLLs to be loaded from the
227 # directory containing the executable.
228 set(__install__libs ${__install__libs}
229 "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
230 "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
231 "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
232 "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
233 "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
234 "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
235 "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
236 "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
237 "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
238 "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
243 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
245 "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
246 set(__install__libs ${__install__libs}
247 "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
248 "${MSVC90_MFC_DIR}/mfc90d.dll"
249 "${MSVC90_MFC_DIR}/mfc90ud.dll"
250 "${MSVC90_MFC_DIR}/mfcm90d.dll"
251 "${MSVC90_MFC_DIR}/mfcm90ud.dll"
255 set(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
256 # Install the manifest that allows DLLs to be loaded from the
257 # directory containing the executable.
258 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
259 set(__install__libs ${__install__libs}
260 "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
261 "${MSVC90_MFC_DIR}/mfc90.dll"
262 "${MSVC90_MFC_DIR}/mfc90u.dll"
263 "${MSVC90_MFC_DIR}/mfcm90.dll"
264 "${MSVC90_MFC_DIR}/mfcm90u.dll"
268 # include the language dll's for vs9 as well as the actuall dll's
269 set(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
270 # Install the manifest that allows DLLs to be loaded from the
271 # directory containing the executable.
272 set(__install__libs ${__install__libs}
273 "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
274 "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
275 "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
276 "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
277 "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
278 "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
279 "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
280 "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
281 "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
282 "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
286 macro(MFC_FILES_FOR_VERSION version)
289 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
291 "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugMFC")
292 set(__install__libs ${__install__libs}
293 "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll"
294 "${MSVC${v}_MFC_DIR}/mfc${v}0ud.dll"
295 "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
296 "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll"
300 set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
301 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
302 set(__install__libs ${__install__libs}
303 "${MSVC${v}_MFC_DIR}/mfc${v}0.dll"
304 "${MSVC${v}_MFC_DIR}/mfc${v}0u.dll"
305 "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
306 "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll"
310 # include the language dll's as well as the actuall dll's
311 set(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
312 set(__install__libs ${__install__libs}
313 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0chs.dll"
314 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0cht.dll"
315 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0deu.dll"
316 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
317 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esn.dll"
318 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0fra.dll"
319 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0ita.dll"
320 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll"
321 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.dll"
322 "${MSVC${v}_MFCLOC_DIR}/mfc${v}0rus.dll"
327 MFC_FILES_FOR_VERSION(10)
331 MFC_FILES_FOR_VERSION(11)
339 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
340 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
342 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
343 message(WARNING "system runtime library file does not exist: '${lib}'")
344 # This warning indicates an incomplete Visual Studio installation
345 # or a bug somewhere above here in this file.
346 # If you would like to avoid this warning, fix the real problem, or
347 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
355 get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
357 set( __install__libs ${CompilerPath}/clbr17.dll
358 ${CompilerPath}/mt7r17.dll ${CompilerPath}/plbr17.dll )
361 set( __install__libs ${CompilerPath}/clbr18.dll
362 ${CompilerPath}/mt7r18.dll ${CompilerPath}/plbr18.dll )
365 set( __install__libs ${CompilerPath}/clbr19.dll
366 ${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll )
372 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
373 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
375 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
376 message(WARNING "system runtime library file does not exist: '${lib}'")
377 # This warning indicates an incomplete Watcom installation
378 # or a bug somewhere above here in this file.
379 # If you would like to avoid this warning, fix the real problem, or
380 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
388 # Include system runtime libraries in the installation if any are
389 # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
390 if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
391 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
392 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
394 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
396 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
399 install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
400 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})