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``
30 Set to TRUE to install the Windows Universal CRT libraries for
31 app-local deployment (e.g. to Windows XP). This is meaningful
32 only with MSVC from Visual Studio 2015 or higher.
34 One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
35 to an absolute path to tell CMake to look for Windows 10 SDKs in
36 a custom location. The specified directory is expected to contain
37 ``Redist/ucrt/DLLs/*`` directories.
39 ``CMAKE_INSTALL_MFC_LIBRARIES``
40 Set to TRUE to install the MSVC MFC runtime libraries.
42 ``CMAKE_INSTALL_OPENMP_LIBRARIES``
43 Set to TRUE to install the MSVC OpenMP runtime libraries
45 ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
46 Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
47 option. If not specified, the default is ``bin`` on Windows
48 and ``lib`` elsewhere.
50 ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
51 Set to TRUE to disable warnings about required library files that
52 do not exist. (For example, Visual Studio Express editions may
53 not provide the redistributable files.)
55 ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
56 Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
57 option. If not specified, no such option will be used.
58 #]=======================================================================]
61 cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
63 set(_IRSL_HAVE_Intel FALSE)
64 set(_IRSL_HAVE_MSVC FALSE)
65 foreach(LANG IN ITEMS C CXX Fortran)
66 if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel")
67 if(NOT _IRSL_HAVE_Intel)
68 get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
69 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
70 set(_Intel_archdir intel64)
72 set(_Intel_archdir ia32)
74 set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
76 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
78 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
80 if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin")
81 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
83 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
86 set(_IRSL_HAVE_Intel TRUE)
88 elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
89 set(_IRSL_HAVE_MSVC TRUE)
94 file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
97 if(MSVC_VERSION GREATER 1599)
99 set(CMAKE_MSVC_ARCH x64)
102 set(CMAKE_MSVC_ARCH amd64)
105 set(CMAKE_MSVC_ARCH x86)
108 get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
109 get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
111 if(MSVC_VERSION EQUAL 1300)
113 "${SYSTEMROOT}/system32/msvcp70.dll"
114 "${SYSTEMROOT}/system32/msvcr70.dll"
118 if(MSVC_VERSION EQUAL 1310)
120 "${SYSTEMROOT}/system32/msvcp71.dll"
121 "${SYSTEMROOT}/system32/msvcr71.dll"
125 if(MSVC_TOOLSET_VERSION EQUAL 80)
126 # Find the runtime library redistribution directory.
127 get_filename_component(msvc_install_dir
128 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
129 if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
130 set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
132 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
134 "${msvc_install_dir}/../../VC/redist"
135 "${base_dir}/VC/redist"
137 mark_as_advanced(MSVC_REDIST_DIR)
138 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
140 # Install the manifest that allows DLLs to be loaded from the
141 # directory containing the executable.
142 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
144 "${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
145 "${MSVC_CRT_DIR}/msvcm80.dll"
146 "${MSVC_CRT_DIR}/msvcp80.dll"
147 "${MSVC_CRT_DIR}/msvcr80.dll"
153 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
155 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
156 set(__install__libs ${__install__libs}
157 "${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
158 "${MSVC_CRT_DIR}/msvcm80d.dll"
159 "${MSVC_CRT_DIR}/msvcp80d.dll"
160 "${MSVC_CRT_DIR}/msvcr80d.dll"
165 if(MSVC_TOOLSET_VERSION EQUAL 90)
166 # Find the runtime library redistribution directory.
167 get_filename_component(msvc_install_dir
168 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
169 get_filename_component(msvc_express_install_dir
170 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
171 if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
172 set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
174 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
176 "${msvc_install_dir}/../../VC/redist"
177 "${msvc_express_install_dir}/../../VC/redist"
178 "${base_dir}/VC/redist"
180 mark_as_advanced(MSVC_REDIST_DIR)
181 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
183 # Install the manifest that allows DLLs to be loaded from the
184 # directory containing the executable.
185 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
187 "${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
188 "${MSVC_CRT_DIR}/msvcm90.dll"
189 "${MSVC_CRT_DIR}/msvcp90.dll"
190 "${MSVC_CRT_DIR}/msvcr90.dll"
196 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
198 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
199 set(__install__libs ${__install__libs}
200 "${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
201 "${MSVC_CRT_DIR}/msvcm90d.dll"
202 "${MSVC_CRT_DIR}/msvcp90d.dll"
203 "${MSVC_CRT_DIR}/msvcr90d.dll"
208 set(MSVC_REDIST_NAME "")
209 set(_MSVC_DLL_VERSION "")
210 set(_MSVC_IDE_VERSION "")
211 if(MSVC_VERSION GREATER_EQUAL 2000)
212 message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
213 elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 143)
214 message(WARNING "MSVC toolset v${MSVC_TOOLSET_VERSION} not yet supported.")
215 elseif(MSVC_TOOLSET_VERSION EQUAL 142)
216 set(MSVC_REDIST_NAME VC142)
217 set(_MSVC_DLL_VERSION 140)
218 set(_MSVC_IDE_VERSION 16)
219 if(MSVC_VERSION EQUAL 1920)
220 # VS2019 named this differently prior to update 1.
221 set(MSVC_REDIST_NAME VC141)
223 elseif(MSVC_TOOLSET_VERSION EQUAL 141)
224 set(MSVC_REDIST_NAME VC141)
225 set(_MSVC_DLL_VERSION 140)
226 set(_MSVC_IDE_VERSION 15)
227 if(MSVC_VERSION EQUAL 1910)
228 # VS2017 named this differently prior to update 3.
229 set(MSVC_REDIST_NAME VC150)
231 elseif(MSVC_TOOLSET_VERSION)
232 set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION})
233 math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10")
234 math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10")
237 set(_MSVCRT_DLL_VERSION "")
238 set(_MSVCRT_IDE_VERSION "")
239 if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
240 set(_MSVCRT_DLL_VERSION "${_MSVC_DLL_VERSION}")
241 set(_MSVCRT_IDE_VERSION "${_MSVC_IDE_VERSION}")
244 if(_MSVCRT_DLL_VERSION)
245 set(v "${_MSVCRT_DLL_VERSION}")
246 set(vs "${_MSVCRT_IDE_VERSION}")
248 # Find the runtime library redistribution directory.
249 if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
250 set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
252 if(NOT vs VERSION_LESS 15)
253 set(_vs_redist_paths "")
254 # The toolset and its redistributables may come with any VS version 15 or newer.
255 set(_MSVC_IDE_VERSIONS 16 15)
256 foreach(_vs_ver ${_MSVC_IDE_VERSIONS})
257 set(_vs_glob_redist_paths "")
258 cmake_host_system_information(RESULT _vs_dir QUERY VS_${_vs_ver}_DIR) # undocumented query
259 if(IS_DIRECTORY "${_vs_dir}")
260 file(GLOB _vs_glob_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
261 list(REVERSE _vs_glob_redist_paths)
262 list(APPEND _vs_redist_paths ${_vs_glob_redist_paths})
264 unset(_vs_glob_redist_paths)
266 unset(_MSVC_IDE_VERSIONS)
269 get_filename_component(_vs_dir
270 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
271 set(programfilesx86 "ProgramFiles(x86)")
273 "${_vs_dir}/../../VC/redist"
274 "${base_dir}/VC/redist"
275 "$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
276 "$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
279 unset(programfilesx86)
281 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
282 unset(_vs_redist_paths)
283 mark_as_advanced(MSVC_REDIST_DIR)
284 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
286 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
288 "${MSVC_CRT_DIR}/msvcp${v}.dll"
290 if(NOT vs VERSION_LESS 14)
292 "${MSVC_CRT_DIR}/msvcp${v}_1.dll"
293 "${MSVC_CRT_DIR}/msvcp${v}_2.dll"
294 "${MSVC_CRT_DIR}/msvcp${v}_atomic_wait.dll"
295 "${MSVC_CRT_DIR}/msvcp${v}_codecvt_ids.dll"
296 "${MSVC_CRT_DIR}/vcruntime${v}_1.dll"
299 list(APPEND __install__libs "${crt}")
302 list(APPEND __install__libs
303 "${MSVC_CRT_DIR}/vcruntime${v}.dll"
304 "${MSVC_CRT_DIR}/concrt${v}.dll"
307 list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
313 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
315 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
316 set(__install__libs ${__install__libs}
317 "${MSVC_CRT_DIR}/msvcp${v}d.dll"
319 if(NOT vs VERSION_LESS 14)
321 "${MSVC_CRT_DIR}/msvcp${v}_1d.dll"
322 "${MSVC_CRT_DIR}/msvcp${v}_2d.dll"
323 "${MSVC_CRT_DIR}/msvcp${v}d_atomic_wait.dll"
324 "${MSVC_CRT_DIR}/msvcp${v}d_codecvt_ids.dll"
325 "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll"
328 list(APPEND __install__libs "${crt}")
331 list(APPEND __install__libs
332 "${MSVC_CRT_DIR}/vcruntime${v}d.dll"
333 "${MSVC_CRT_DIR}/concrt${v}d.dll"
336 list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
340 if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
341 # Find the Windows Kits directory.
342 get_filename_component(windows_kits_dir
343 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
344 set(programfilesx86 "ProgramFiles(x86)")
345 if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=])
346 set(__ucrt_version "${CMAKE_MATCH_1}/")
348 set(__ucrt_version "")
350 find_path(WINDOWS_KITS_DIR
352 Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
353 Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
355 $ENV{CMAKE_WINDOWS_KITS_10_DIR}
356 "${windows_kits_dir}"
357 "$ENV{ProgramFiles}/Windows Kits/10"
358 "$ENV{${programfilesx86}}/Windows Kits/10"
360 mark_as_advanced(WINDOWS_KITS_DIR)
362 # Glob the list of UCRT DLLs.
363 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
364 if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll")
365 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
367 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
369 list(APPEND __install__libs ${__ucrt_dlls})
371 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
372 if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll")
373 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll")
375 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
377 list(APPEND __install__libs ${__ucrt_dlls})
382 if(CMAKE_INSTALL_MFC_LIBRARIES)
383 if(MSVC_VERSION EQUAL 1300)
384 set(__install__libs ${__install__libs}
385 "${SYSTEMROOT}/system32/mfc70.dll"
389 if(MSVC_VERSION EQUAL 1310)
390 set(__install__libs ${__install__libs}
391 "${SYSTEMROOT}/system32/mfc71.dll"
395 if(MSVC_VERSION EQUAL 1400)
396 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
398 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
399 set(__install__libs ${__install__libs}
400 "${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
401 "${MSVC_MFC_DIR}/mfc80d.dll"
402 "${MSVC_MFC_DIR}/mfc80ud.dll"
403 "${MSVC_MFC_DIR}/mfcm80d.dll"
404 "${MSVC_MFC_DIR}/mfcm80ud.dll"
408 set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
409 # Install the manifest that allows DLLs to be loaded from the
410 # directory containing the executable.
411 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
412 set(__install__libs ${__install__libs}
413 "${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
414 "${MSVC_MFC_DIR}/mfc80.dll"
415 "${MSVC_MFC_DIR}/mfc80u.dll"
416 "${MSVC_MFC_DIR}/mfcm80.dll"
417 "${MSVC_MFC_DIR}/mfcm80u.dll"
421 # include the language dll's for vs8 as well as the actual dll's
422 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
423 # Install the manifest that allows DLLs to be loaded from the
424 # directory containing the executable.
425 set(__install__libs ${__install__libs}
426 "${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
427 "${MSVC_MFCLOC_DIR}/mfc80chs.dll"
428 "${MSVC_MFCLOC_DIR}/mfc80cht.dll"
429 "${MSVC_MFCLOC_DIR}/mfc80enu.dll"
430 "${MSVC_MFCLOC_DIR}/mfc80esp.dll"
431 "${MSVC_MFCLOC_DIR}/mfc80deu.dll"
432 "${MSVC_MFCLOC_DIR}/mfc80fra.dll"
433 "${MSVC_MFCLOC_DIR}/mfc80ita.dll"
434 "${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
435 "${MSVC_MFCLOC_DIR}/mfc80kor.dll"
439 if(MSVC_VERSION EQUAL 1500)
440 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
442 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
443 set(__install__libs ${__install__libs}
444 "${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
445 "${MSVC_MFC_DIR}/mfc90d.dll"
446 "${MSVC_MFC_DIR}/mfc90ud.dll"
447 "${MSVC_MFC_DIR}/mfcm90d.dll"
448 "${MSVC_MFC_DIR}/mfcm90ud.dll"
452 set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
453 # Install the manifest that allows DLLs to be loaded from the
454 # directory containing the executable.
455 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
456 set(__install__libs ${__install__libs}
457 "${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
458 "${MSVC_MFC_DIR}/mfc90.dll"
459 "${MSVC_MFC_DIR}/mfc90u.dll"
460 "${MSVC_MFC_DIR}/mfcm90.dll"
461 "${MSVC_MFC_DIR}/mfcm90u.dll"
465 # include the language dll's for vs9 as well as the actual dll's
466 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
467 # Install the manifest that allows DLLs to be loaded from the
468 # directory containing the executable.
469 set(__install__libs ${__install__libs}
470 "${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
471 "${MSVC_MFCLOC_DIR}/mfc90chs.dll"
472 "${MSVC_MFCLOC_DIR}/mfc90cht.dll"
473 "${MSVC_MFCLOC_DIR}/mfc90enu.dll"
474 "${MSVC_MFCLOC_DIR}/mfc90esp.dll"
475 "${MSVC_MFCLOC_DIR}/mfc90deu.dll"
476 "${MSVC_MFCLOC_DIR}/mfc90fra.dll"
477 "${MSVC_MFCLOC_DIR}/mfc90ita.dll"
478 "${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
479 "${MSVC_MFCLOC_DIR}/mfc90kor.dll"
483 set(_MFC_DLL_VERSION "")
484 set(_MFC_IDE_VERSION "")
485 if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
486 set(_MFC_DLL_VERSION ${_MSVC_DLL_VERSION})
487 set(_MFC_IDE_VERSION ${_MSVC_IDE_VERSION})
491 set(v "${_MFC_DLL_VERSION}")
492 set(vs "${_MFC_IDE_VERSION}")
494 # Starting with VS 15 the MFC DLLs may be in a different directory.
495 if (NOT vs VERSION_LESS 15)
496 file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
497 find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
498 PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
499 mark_as_advanced(MSVC_REDIST_MFC_DIR)
500 unset(_MSVC_REDIST_DIRS)
502 set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
505 # Multi-Byte Character Set versions of MFC are available as optional
506 # addon since Visual Studio 12. So for version 12 or higher, check
507 # whether they are available and exclude them if they are not.
509 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
511 "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
512 set(__install__libs ${__install__libs}
513 "${MSVC_MFC_DIR}/mfc${v}ud.dll"
514 "${MSVC_MFC_DIR}/mfcm${v}ud.dll"
516 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
517 set(__install__libs ${__install__libs}
518 "${MSVC_MFC_DIR}/mfc${v}d.dll"
521 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll")
522 set(__install__libs ${__install__libs}
523 "${MSVC_MFC_DIR}/mfcm${v}d.dll"
528 set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
529 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
530 set(__install__libs ${__install__libs}
531 "${MSVC_MFC_DIR}/mfc${v}u.dll"
532 "${MSVC_MFC_DIR}/mfcm${v}u.dll"
534 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
535 set(__install__libs ${__install__libs}
536 "${MSVC_MFC_DIR}/mfc${v}.dll"
539 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll")
540 set(__install__libs ${__install__libs}
541 "${MSVC_MFC_DIR}/mfcm${v}.dll"
546 # include the language dll's as well as the actual dll's
547 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
548 set(__install__libs ${__install__libs}
549 "${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
550 "${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
551 "${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
552 "${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
553 "${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
554 "${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
555 "${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
556 "${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
557 "${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
558 "${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
563 # MSVC 8 was the first version with OpenMP
564 # Furthermore, there is no debug version of this
565 if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC)
566 set(_MSOMP_DLL_VERSION ${_MSVC_DLL_VERSION})
567 set(_MSOMP_IDE_VERSION ${_MSVC_IDE_VERSION})
569 if(_MSOMP_DLL_VERSION)
570 set(v "${_MSOMP_DLL_VERSION}")
571 set(vs "${_MSOMP_IDE_VERSION}")
572 set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
574 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
575 set(__install__libs ${__install__libs}
576 "${MSVC_OPENMP_DIR}/vcomp${v}.dll")
585 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
586 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
588 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
589 message(WARNING "system runtime library file does not exist: '${lib}'")
590 # This warning indicates an incomplete Visual Studio installation
591 # or a bug somewhere above here in this file.
592 # If you would like to avoid this warning, fix the real problem, or
593 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
601 unset(__install_libs)
602 if(CMAKE_INSTALL_OPENMP_LIBRARIES)
604 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll")
606 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib")
608 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so")
609 if(_Intel_compiler_ver VERSION_LESS 17)
610 list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so")
612 if(_Intel_compiler_ver VERSION_LESS 13)
613 list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so")
618 set(__install_dirs "${_Intel_redistdir}/1033")
619 if(EXISTS "${_Intel_redistdir}/1041")
620 list(APPEND __install_dirs "${_Intel_redistdir}/1041")
622 if(_Intel_compiler_ver VERSION_LESS 18)
623 list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c")
625 foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll
626 libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll)
628 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
630 if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
631 list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll")
633 if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
634 foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll)
636 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
640 foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib)
641 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
643 if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
644 if(_Intel_compiler_ver VERSION_LESS 17)
645 list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib")
648 if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
649 foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib)
651 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
655 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)
657 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
659 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13)
660 foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5)
662 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
665 if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
666 set(__install_dirs "${_Intel_redistdir}/irml")
667 list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so")
668 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15)
669 list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so")
672 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16)
673 foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main)
675 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
678 if(_Intel_compiler_ver VERSION_LESS 15)
679 foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5)
681 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
684 if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
685 foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5)
687 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
692 foreach(lib IN LISTS __install_libs)
694 list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
696 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
697 message(WARNING "system runtime library file does not exist: '${lib}'")
702 foreach(dir IN LISTS __install_dirs)
704 list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir})
706 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
707 message(WARNING "system runtime library file does not exist: '${dir}'")
714 get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
715 if(CMAKE_C_COMPILER_VERSION)
716 set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
718 set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
720 string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
721 list(GET _watcom_version_list 0 _watcom_major)
722 list(GET _watcom_version_list 1 _watcom_minor)
724 ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
725 ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
726 ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
731 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
732 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
734 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
735 message(WARNING "system runtime library file does not exist: '${lib}'")
736 # This warning indicates an incomplete Watcom installation
737 # or a bug somewhere above here in this file.
738 # If you would like to avoid this warning, fix the real problem, or
739 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
747 # Include system runtime libraries in the installation if any are
748 # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
749 if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
750 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
751 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
753 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
755 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
758 if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
759 set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
760 COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
762 install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
763 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
764 ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
767 install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES}
768 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
769 ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}