1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
5 InstallRequiredSystemLibraries
6 ------------------------------
8 Include this module to search for compiler-provided system runtime
9 libraries and add install rules for them. Some optional variables
10 may be set prior to including the module to adjust behavior:
12 ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
13 Specify additional runtime libraries that may not be detected.
14 After inclusion any detected libraries will be appended to this.
16 ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
17 Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
18 allow the includer to specify its own install rule, using the value of
19 ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
21 ``CMAKE_INSTALL_DEBUG_LIBRARIES``
22 Set to TRUE to install the debug runtime libraries when available
25 ``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
26 Set to TRUE to install only the debug runtime libraries with MSVC
27 tools even if the release runtime libraries are also available.
29 ``CMAKE_INSTALL_UCRT_LIBRARIES``
32 Set to TRUE to install the Windows Universal CRT libraries for
33 app-local deployment (e.g. to Windows XP). This is meaningful
34 only with MSVC from Visual Studio 2015 or higher.
37 One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
38 to an absolute path to tell CMake to look for Windows 10 SDKs in
39 a custom location. The specified directory is expected to contain
40 ``Redist/ucrt/DLLs/*`` directories.
42 ``CMAKE_INSTALL_MFC_LIBRARIES``
43 Set to TRUE to install the MSVC MFC runtime libraries.
45 ``CMAKE_INSTALL_OPENMP_LIBRARIES``
46 Set to TRUE to install the MSVC OpenMP runtime libraries
48 ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
49 Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
50 option. If not specified, the default is ``bin`` on Windows
51 and ``lib`` elsewhere.
53 ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
54 Set to TRUE to disable warnings about required library files that
55 do not exist. (For example, Visual Studio Express editions may
56 not provide the redistributable files.)
58 ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
61 Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
62 option. If not specified, no such option will be used.
64 .. versionadded:: 3.10
65 Support for installing Intel compiler runtimes.
66 #]=======================================================================]
68 set(_IRSL_HAVE_Intel FALSE)
69 set(_IRSL_HAVE_MSVC FALSE)
70 foreach(LANG IN ITEMS C CXX Fortran)
71 if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "Intel")
72 if(NOT _IRSL_HAVE_Intel)
73 # The oneAPI icx/ifx compilers are under ${os}/bin.
74 # The classic icc/icpc/icl/ifort compilers may be under ${os}/bin/intel64.
75 get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
76 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
77 set(_Intel_archdir intel64)
79 set(_Intel_archdir ia32)
81 set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
83 set(_Intel_possible_redistdirs
84 "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler"
85 "${_Intel_basedir}/../redist/${_Intel_archdir}/compiler"
86 "${_Intel_basedir}/../../redist/${_Intel_archdir}_win/compiler"
87 "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler"
90 set(_Intel_possible_redistdirs
91 "${_Intel_basedir}/../../compiler/lib"
94 set(_Intel_possible_redistdirs
95 "${_Intel_basedir}/../lib/${_Intel_archdir}"
96 "${_Intel_basedir}/../compiler/lib/${_Intel_archdir}_lin"
97 "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin"
101 set(_Intel_redistdir NOT-FOUND)
102 foreach(dir IN LISTS _Intel_possible_redistdirs)
104 set(_Intel_redistdir "${dir}")
108 # Fall back to last dir
109 if(NOT _Intel_redistdir)
110 list(POP_BACK _Intel_possible_redistdirs _Intel_redistdir)
112 unset(_Intel_possible_redistdirs)
113 set(_IRSL_HAVE_Intel TRUE)
115 elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
116 set(_IRSL_HAVE_MSVC TRUE)
121 file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
123 if(MSVC_C_ARCHITECTURE_ID)
124 string(TOLOWER "${MSVC_C_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH)
125 elseif(MSVC_CXX_ARCHITECTURE_ID)
126 string(TOLOWER "${MSVC_CXX_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH)
128 set(CMAKE_MSVC_ARCH x86)
130 if(CMAKE_MSVC_ARCH STREQUAL "x64")
131 if(MSVC_VERSION LESS 1600)
133 set(CMAKE_MSVC_ARCH amd64)
137 get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
138 get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
140 if(MSVC_VERSION EQUAL 1300)
142 "${SYSTEMROOT}/system32/msvcp70.dll"
143 "${SYSTEMROOT}/system32/msvcr70.dll"
147 if(MSVC_VERSION EQUAL 1310)
149 "${SYSTEMROOT}/system32/msvcp71.dll"
150 "${SYSTEMROOT}/system32/msvcr71.dll"
154 if(MSVC_TOOLSET_VERSION EQUAL 80)
155 # Find the runtime library redistribution directory.
156 get_filename_component(msvc_install_dir
157 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
158 if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
159 set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
161 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
163 "${msvc_install_dir}/../../VC/redist"
164 "${base_dir}/VC/redist"
166 mark_as_advanced(MSVC_REDIST_DIR)
167 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
169 # Install the manifest that allows DLLs to be loaded from the
170 # directory containing the executable.
171 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
173 "${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
174 "${MSVC_CRT_DIR}/msvcm80.dll"
175 "${MSVC_CRT_DIR}/msvcp80.dll"
176 "${MSVC_CRT_DIR}/msvcr80.dll"
182 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
184 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
185 set(__install__libs ${__install__libs}
186 "${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
187 "${MSVC_CRT_DIR}/msvcm80d.dll"
188 "${MSVC_CRT_DIR}/msvcp80d.dll"
189 "${MSVC_CRT_DIR}/msvcr80d.dll"
194 if(MSVC_TOOLSET_VERSION EQUAL 90)
195 # Find the runtime library redistribution directory.
196 get_filename_component(msvc_install_dir
197 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
198 get_filename_component(msvc_express_install_dir
199 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
200 if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
201 set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
203 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
205 "${msvc_install_dir}/../../VC/redist"
206 "${msvc_express_install_dir}/../../VC/redist"
207 "${base_dir}/VC/redist"
209 mark_as_advanced(MSVC_REDIST_DIR)
210 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
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)
216 "${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
217 "${MSVC_CRT_DIR}/msvcm90.dll"
218 "${MSVC_CRT_DIR}/msvcp90.dll"
219 "${MSVC_CRT_DIR}/msvcr90.dll"
225 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
227 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
228 set(__install__libs ${__install__libs}
229 "${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
230 "${MSVC_CRT_DIR}/msvcm90d.dll"
231 "${MSVC_CRT_DIR}/msvcp90d.dll"
232 "${MSVC_CRT_DIR}/msvcr90d.dll"
237 set(MSVC_REDIST_NAME "")
238 set(_MSVC_DLL_VERSION "")
239 set(_MSVC_IDE_VERSION "")
240 if(MSVC_VERSION GREATER_EQUAL 2000)
241 message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
242 elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 144)
243 message(WARNING "MSVC toolset v${MSVC_TOOLSET_VERSION} not yet supported.")
244 elseif(MSVC_TOOLSET_VERSION EQUAL 143)
245 set(MSVC_REDIST_NAME VC143)
246 set(_MSVC_DLL_VERSION 140)
247 set(_MSVC_IDE_VERSION 17)
248 elseif(MSVC_TOOLSET_VERSION EQUAL 142)
249 set(MSVC_REDIST_NAME VC142)
250 set(_MSVC_DLL_VERSION 140)
251 set(_MSVC_IDE_VERSION 16)
252 if(MSVC_VERSION EQUAL 1920)
253 # VS2019 named this differently prior to update 1.
254 set(MSVC_REDIST_NAME VC141)
256 elseif(MSVC_TOOLSET_VERSION EQUAL 141)
257 set(MSVC_REDIST_NAME VC141)
258 set(_MSVC_DLL_VERSION 140)
259 set(_MSVC_IDE_VERSION 15)
260 if(MSVC_VERSION EQUAL 1910)
261 # VS2017 named this differently prior to update 3.
262 set(MSVC_REDIST_NAME VC150)
264 elseif(MSVC_TOOLSET_VERSION)
265 set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION})
266 math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10")
267 math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10")
270 set(_MSVCRT_DLL_VERSION "")
271 set(_MSVCRT_IDE_VERSION "")
272 if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
273 set(_MSVCRT_DLL_VERSION "${_MSVC_DLL_VERSION}")
274 set(_MSVCRT_IDE_VERSION "${_MSVC_IDE_VERSION}")
277 if(_MSVCRT_DLL_VERSION)
278 set(v "${_MSVCRT_DLL_VERSION}")
279 set(vs "${_MSVCRT_IDE_VERSION}")
281 # Find the runtime library redistribution directory.
282 if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
283 set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
285 if(NOT vs VERSION_LESS 15)
286 set(_vs_redist_paths "")
287 # The toolset and its redistributables may come with any VS version 15 or newer.
288 set(_MSVC_IDE_VERSIONS 17 16 15)
289 foreach(_vs_ver ${_MSVC_IDE_VERSIONS})
290 set(_vs_glob_redist_paths "")
291 cmake_host_system_information(RESULT _vs_dir QUERY VS_${_vs_ver}_DIR) # undocumented query
292 if(IS_DIRECTORY "${_vs_dir}")
293 file(GLOB _vs_glob_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
294 list(REVERSE _vs_glob_redist_paths)
295 list(APPEND _vs_redist_paths ${_vs_glob_redist_paths})
297 unset(_vs_glob_redist_paths)
299 unset(_MSVC_IDE_VERSIONS)
302 get_filename_component(_vs_dir
303 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
304 set(programfilesx86 "ProgramFiles(x86)")
306 "${_vs_dir}/../../VC/redist"
307 "${base_dir}/VC/redist"
308 "$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
309 "$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
312 unset(programfilesx86)
314 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
315 unset(_vs_redist_paths)
316 mark_as_advanced(MSVC_REDIST_DIR)
317 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
319 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
321 "${MSVC_CRT_DIR}/msvcp${v}.dll"
323 if(NOT vs VERSION_LESS 14)
325 "${MSVC_CRT_DIR}/msvcp${v}_1.dll"
326 "${MSVC_CRT_DIR}/msvcp${v}_2.dll"
327 "${MSVC_CRT_DIR}/msvcp${v}_atomic_wait.dll"
328 "${MSVC_CRT_DIR}/msvcp${v}_codecvt_ids.dll"
329 "${MSVC_CRT_DIR}/vcruntime${v}_1.dll"
332 list(APPEND __install__libs "${crt}")
335 list(APPEND __install__libs
336 "${MSVC_CRT_DIR}/vcruntime${v}.dll"
337 "${MSVC_CRT_DIR}/concrt${v}.dll"
340 list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
346 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
348 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
349 set(__install__libs ${__install__libs}
350 "${MSVC_CRT_DIR}/msvcp${v}d.dll"
352 if(NOT vs VERSION_LESS 14)
354 "${MSVC_CRT_DIR}/msvcp${v}_1d.dll"
355 "${MSVC_CRT_DIR}/msvcp${v}_2d.dll"
356 "${MSVC_CRT_DIR}/msvcp${v}d_atomic_wait.dll"
357 "${MSVC_CRT_DIR}/msvcp${v}d_codecvt_ids.dll"
358 "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll"
361 list(APPEND __install__libs "${crt}")
364 list(APPEND __install__libs
365 "${MSVC_CRT_DIR}/vcruntime${v}d.dll"
366 "${MSVC_CRT_DIR}/concrt${v}d.dll"
369 list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
373 if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
374 # Find the Windows Kits directory.
375 get_filename_component(windows_kits_dir
376 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
377 set(programfilesx86 "ProgramFiles(x86)")
378 if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=])
379 set(__ucrt_version "${CMAKE_MATCH_1}/")
381 set(__ucrt_version "")
383 find_path(WINDOWS_KITS_DIR
385 Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
386 Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
388 $ENV{CMAKE_WINDOWS_KITS_10_DIR}
389 "${windows_kits_dir}"
390 "$ENV{ProgramFiles}/Windows Kits/10"
391 "$ENV{${programfilesx86}}/Windows Kits/10"
393 mark_as_advanced(WINDOWS_KITS_DIR)
395 # Glob the list of UCRT DLLs.
396 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
397 if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll")
398 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
400 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
402 list(APPEND __install__libs ${__ucrt_dlls})
404 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
405 if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll")
406 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll")
408 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
410 list(APPEND __install__libs ${__ucrt_dlls})
415 if(CMAKE_INSTALL_MFC_LIBRARIES)
416 if(MSVC_VERSION EQUAL 1300)
417 set(__install__libs ${__install__libs}
418 "${SYSTEMROOT}/system32/mfc70.dll"
422 if(MSVC_VERSION EQUAL 1310)
423 set(__install__libs ${__install__libs}
424 "${SYSTEMROOT}/system32/mfc71.dll"
428 if(MSVC_VERSION EQUAL 1400)
429 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
431 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
432 set(__install__libs ${__install__libs}
433 "${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
434 "${MSVC_MFC_DIR}/mfc80d.dll"
435 "${MSVC_MFC_DIR}/mfc80ud.dll"
436 "${MSVC_MFC_DIR}/mfcm80d.dll"
437 "${MSVC_MFC_DIR}/mfcm80ud.dll"
441 set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
442 # Install the manifest that allows DLLs to be loaded from the
443 # directory containing the executable.
444 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
445 set(__install__libs ${__install__libs}
446 "${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
447 "${MSVC_MFC_DIR}/mfc80.dll"
448 "${MSVC_MFC_DIR}/mfc80u.dll"
449 "${MSVC_MFC_DIR}/mfcm80.dll"
450 "${MSVC_MFC_DIR}/mfcm80u.dll"
454 # include the language dll's for vs8 as well as the actual dll's
455 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
456 # Install the manifest that allows DLLs to be loaded from the
457 # directory containing the executable.
458 set(__install__libs ${__install__libs}
459 "${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
460 "${MSVC_MFCLOC_DIR}/mfc80chs.dll"
461 "${MSVC_MFCLOC_DIR}/mfc80cht.dll"
462 "${MSVC_MFCLOC_DIR}/mfc80enu.dll"
463 "${MSVC_MFCLOC_DIR}/mfc80esp.dll"
464 "${MSVC_MFCLOC_DIR}/mfc80deu.dll"
465 "${MSVC_MFCLOC_DIR}/mfc80fra.dll"
466 "${MSVC_MFCLOC_DIR}/mfc80ita.dll"
467 "${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
468 "${MSVC_MFCLOC_DIR}/mfc80kor.dll"
472 if(MSVC_VERSION EQUAL 1500)
473 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
475 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
476 set(__install__libs ${__install__libs}
477 "${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
478 "${MSVC_MFC_DIR}/mfc90d.dll"
479 "${MSVC_MFC_DIR}/mfc90ud.dll"
480 "${MSVC_MFC_DIR}/mfcm90d.dll"
481 "${MSVC_MFC_DIR}/mfcm90ud.dll"
485 set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
486 # Install the manifest that allows DLLs to be loaded from the
487 # directory containing the executable.
488 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
489 set(__install__libs ${__install__libs}
490 "${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
491 "${MSVC_MFC_DIR}/mfc90.dll"
492 "${MSVC_MFC_DIR}/mfc90u.dll"
493 "${MSVC_MFC_DIR}/mfcm90.dll"
494 "${MSVC_MFC_DIR}/mfcm90u.dll"
498 # include the language dll's for vs9 as well as the actual dll's
499 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
500 # Install the manifest that allows DLLs to be loaded from the
501 # directory containing the executable.
502 set(__install__libs ${__install__libs}
503 "${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
504 "${MSVC_MFCLOC_DIR}/mfc90chs.dll"
505 "${MSVC_MFCLOC_DIR}/mfc90cht.dll"
506 "${MSVC_MFCLOC_DIR}/mfc90enu.dll"
507 "${MSVC_MFCLOC_DIR}/mfc90esp.dll"
508 "${MSVC_MFCLOC_DIR}/mfc90deu.dll"
509 "${MSVC_MFCLOC_DIR}/mfc90fra.dll"
510 "${MSVC_MFCLOC_DIR}/mfc90ita.dll"
511 "${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
512 "${MSVC_MFCLOC_DIR}/mfc90kor.dll"
516 set(_MFC_DLL_VERSION "")
517 set(_MFC_IDE_VERSION "")
518 if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
519 set(_MFC_DLL_VERSION ${_MSVC_DLL_VERSION})
520 set(_MFC_IDE_VERSION ${_MSVC_IDE_VERSION})
524 set(v "${_MFC_DLL_VERSION}")
525 set(vs "${_MFC_IDE_VERSION}")
527 # Starting with VS 15 the MFC DLLs may be in a different directory.
528 if (NOT vs VERSION_LESS 15)
529 file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
530 find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
531 PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
532 mark_as_advanced(MSVC_REDIST_MFC_DIR)
533 unset(_MSVC_REDIST_DIRS)
535 set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
538 # Multi-Byte Character Set versions of MFC are available as optional
539 # addon since Visual Studio 12. So for version 12 or higher, check
540 # whether they are available and exclude them if they are not.
542 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
544 "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
545 set(__install__libs ${__install__libs}
546 "${MSVC_MFC_DIR}/mfc${v}ud.dll"
547 "${MSVC_MFC_DIR}/mfcm${v}ud.dll"
549 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
550 set(__install__libs ${__install__libs}
551 "${MSVC_MFC_DIR}/mfc${v}d.dll"
554 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll")
555 set(__install__libs ${__install__libs}
556 "${MSVC_MFC_DIR}/mfcm${v}d.dll"
561 set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
562 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
563 set(__install__libs ${__install__libs}
564 "${MSVC_MFC_DIR}/mfc${v}u.dll"
565 "${MSVC_MFC_DIR}/mfcm${v}u.dll"
567 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
568 set(__install__libs ${__install__libs}
569 "${MSVC_MFC_DIR}/mfc${v}.dll"
572 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll")
573 set(__install__libs ${__install__libs}
574 "${MSVC_MFC_DIR}/mfcm${v}.dll"
579 # include the language dll's as well as the actual dll's
580 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
581 set(__install__libs ${__install__libs}
582 "${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
583 "${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
584 "${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
585 "${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
586 "${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
587 "${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
588 "${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
589 "${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
590 "${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
591 "${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
596 # MSVC 8 was the first version with OpenMP
597 # Furthermore, there is no debug version of this
598 if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC)
599 set(_MSOMP_DLL_VERSION ${_MSVC_DLL_VERSION})
600 set(_MSOMP_IDE_VERSION ${_MSVC_IDE_VERSION})
602 if(_MSOMP_DLL_VERSION)
603 set(v "${_MSOMP_DLL_VERSION}")
604 set(vs "${_MSOMP_IDE_VERSION}")
605 set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
607 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
608 set(__install__libs ${__install__libs}
609 "${MSVC_OPENMP_DIR}/vcomp${v}.dll")
618 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
619 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
621 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
622 message(WARNING "system runtime library file does not exist: '${lib}'")
623 # This warning indicates an incomplete Visual Studio installation
624 # or a bug somewhere above here in this file.
625 # If you would like to avoid this warning, fix the real problem, or
626 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
634 unset(__install_libs)
635 if(CMAKE_INSTALL_OPENMP_LIBRARIES)
637 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll")
639 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib")
641 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so")
642 if(_Intel_compiler_ver VERSION_LESS 17)
643 list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so")
645 if(_Intel_compiler_ver VERSION_LESS 13)
646 list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so")
651 set(__install_dirs "${_Intel_redistdir}/1033")
652 if(EXISTS "${_Intel_redistdir}/1041")
653 list(APPEND __install_dirs "${_Intel_redistdir}/1041")
655 if(_Intel_compiler_ver VERSION_LESS 18)
656 list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c")
658 foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll
659 libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll)
661 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
663 if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel)
664 list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll")
666 if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
667 foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll)
669 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
673 foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib)
674 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
676 if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel)
677 if(_Intel_compiler_ver VERSION_LESS 17)
678 list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib")
681 if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
682 foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib)
684 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
688 foreach(__Intel_lib IN ITEMS libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so)
690 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
692 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13)
693 foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5)
695 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
698 if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel)
699 set(__install_dirs "${_Intel_redistdir}/irml")
700 list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so")
701 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15)
702 list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so")
705 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16)
706 foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main)
708 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
711 if(_Intel_compiler_ver VERSION_LESS 15)
712 foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5)
714 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
717 if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
718 foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5)
720 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
725 foreach(lib IN LISTS __install_libs)
727 list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
729 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
730 message(WARNING "system runtime library file does not exist: '${lib}'")
735 foreach(dir IN LISTS __install_dirs)
737 list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir})
739 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
740 message(WARNING "system runtime library file does not exist: '${dir}'")
747 get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
748 if(CMAKE_C_COMPILER_VERSION)
749 set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
751 set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
753 string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
754 list(GET _watcom_version_list 0 _watcom_major)
755 list(GET _watcom_version_list 1 _watcom_minor)
757 ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
758 ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
759 ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
764 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
765 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
767 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
768 message(WARNING "system runtime library file does not exist: '${lib}'")
769 # This warning indicates an incomplete Watcom installation
770 # or a bug somewhere above here in this file.
771 # If you would like to avoid this warning, fix the real problem, or
772 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
780 # Include system runtime libraries in the installation if any are
781 # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
782 if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
783 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
784 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
786 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
788 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
791 if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
792 set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
793 COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
795 install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
796 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
797 ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
800 install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES}
801 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
802 ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}