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 #]=======================================================================]
69 cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
71 set(_IRSL_HAVE_Intel FALSE)
72 set(_IRSL_HAVE_MSVC FALSE)
73 foreach(LANG IN ITEMS C CXX Fortran)
74 if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "Intel")
75 if(NOT _IRSL_HAVE_Intel)
76 get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
77 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
78 set(_Intel_archdir intel64)
80 set(_Intel_archdir ia32)
82 set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
83 if(WIN32 AND EXISTS "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler")
84 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../redist/${_Intel_archdir}_win/compiler" ABSOLUTE)
86 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
88 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
90 if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin")
91 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
93 get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
96 set(_IRSL_HAVE_Intel TRUE)
98 elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
99 set(_IRSL_HAVE_MSVC TRUE)
104 file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
106 if(MSVC_C_ARCHITECTURE_ID)
107 string(TOLOWER "${MSVC_C_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH)
108 elseif(MSVC_CXX_ARCHITECTURE_ID)
109 string(TOLOWER "${MSVC_CXX_ARCHITECTURE_ID}" CMAKE_MSVC_ARCH)
111 set(CMAKE_MSVC_ARCH x86)
113 if(CMAKE_MSVC_ARCH STREQUAL "x64")
114 if(MSVC_VERSION LESS 1600)
116 set(CMAKE_MSVC_ARCH amd64)
120 get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
121 get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
123 if(MSVC_VERSION EQUAL 1300)
125 "${SYSTEMROOT}/system32/msvcp70.dll"
126 "${SYSTEMROOT}/system32/msvcr70.dll"
130 if(MSVC_VERSION EQUAL 1310)
132 "${SYSTEMROOT}/system32/msvcp71.dll"
133 "${SYSTEMROOT}/system32/msvcr71.dll"
137 if(MSVC_TOOLSET_VERSION EQUAL 80)
138 # Find the runtime library redistribution directory.
139 get_filename_component(msvc_install_dir
140 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
141 if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
142 set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
144 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
146 "${msvc_install_dir}/../../VC/redist"
147 "${base_dir}/VC/redist"
149 mark_as_advanced(MSVC_REDIST_DIR)
150 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
152 # Install the manifest that allows DLLs to be loaded from the
153 # directory containing the executable.
154 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
156 "${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
157 "${MSVC_CRT_DIR}/msvcm80.dll"
158 "${MSVC_CRT_DIR}/msvcp80.dll"
159 "${MSVC_CRT_DIR}/msvcr80.dll"
165 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
167 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
168 set(__install__libs ${__install__libs}
169 "${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
170 "${MSVC_CRT_DIR}/msvcm80d.dll"
171 "${MSVC_CRT_DIR}/msvcp80d.dll"
172 "${MSVC_CRT_DIR}/msvcr80d.dll"
177 if(MSVC_TOOLSET_VERSION EQUAL 90)
178 # Find the runtime library redistribution directory.
179 get_filename_component(msvc_install_dir
180 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
181 get_filename_component(msvc_express_install_dir
182 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
183 if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
184 set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
186 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
188 "${msvc_install_dir}/../../VC/redist"
189 "${msvc_express_install_dir}/../../VC/redist"
190 "${base_dir}/VC/redist"
192 mark_as_advanced(MSVC_REDIST_DIR)
193 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
195 # Install the manifest that allows DLLs to be loaded from the
196 # directory containing the executable.
197 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
199 "${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
200 "${MSVC_CRT_DIR}/msvcm90.dll"
201 "${MSVC_CRT_DIR}/msvcp90.dll"
202 "${MSVC_CRT_DIR}/msvcr90.dll"
208 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
210 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
211 set(__install__libs ${__install__libs}
212 "${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
213 "${MSVC_CRT_DIR}/msvcm90d.dll"
214 "${MSVC_CRT_DIR}/msvcp90d.dll"
215 "${MSVC_CRT_DIR}/msvcr90d.dll"
220 set(MSVC_REDIST_NAME "")
221 set(_MSVC_DLL_VERSION "")
222 set(_MSVC_IDE_VERSION "")
223 if(MSVC_VERSION GREATER_EQUAL 2000)
224 message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
225 elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 144)
226 message(WARNING "MSVC toolset v${MSVC_TOOLSET_VERSION} not yet supported.")
227 elseif(MSVC_TOOLSET_VERSION EQUAL 143)
228 set(MSVC_REDIST_NAME VC142)
229 set(_MSVC_DLL_VERSION 140)
230 set(_MSVC_IDE_VERSION 17)
231 elseif(MSVC_TOOLSET_VERSION EQUAL 142)
232 set(MSVC_REDIST_NAME VC142)
233 set(_MSVC_DLL_VERSION 140)
234 set(_MSVC_IDE_VERSION 16)
235 if(MSVC_VERSION EQUAL 1920)
236 # VS2019 named this differently prior to update 1.
237 set(MSVC_REDIST_NAME VC141)
239 elseif(MSVC_TOOLSET_VERSION EQUAL 141)
240 set(MSVC_REDIST_NAME VC141)
241 set(_MSVC_DLL_VERSION 140)
242 set(_MSVC_IDE_VERSION 15)
243 if(MSVC_VERSION EQUAL 1910)
244 # VS2017 named this differently prior to update 3.
245 set(MSVC_REDIST_NAME VC150)
247 elseif(MSVC_TOOLSET_VERSION)
248 set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION})
249 math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10")
250 math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10")
253 set(_MSVCRT_DLL_VERSION "")
254 set(_MSVCRT_IDE_VERSION "")
255 if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
256 set(_MSVCRT_DLL_VERSION "${_MSVC_DLL_VERSION}")
257 set(_MSVCRT_IDE_VERSION "${_MSVC_IDE_VERSION}")
260 if(_MSVCRT_DLL_VERSION)
261 set(v "${_MSVCRT_DLL_VERSION}")
262 set(vs "${_MSVCRT_IDE_VERSION}")
264 # Find the runtime library redistribution directory.
265 if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
266 set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
268 if(NOT vs VERSION_LESS 15)
269 set(_vs_redist_paths "")
270 # The toolset and its redistributables may come with any VS version 15 or newer.
271 set(_MSVC_IDE_VERSIONS 17 16 15)
272 foreach(_vs_ver ${_MSVC_IDE_VERSIONS})
273 set(_vs_glob_redist_paths "")
274 cmake_host_system_information(RESULT _vs_dir QUERY VS_${_vs_ver}_DIR) # undocumented query
275 if(IS_DIRECTORY "${_vs_dir}")
276 file(GLOB _vs_glob_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
277 list(REVERSE _vs_glob_redist_paths)
278 list(APPEND _vs_redist_paths ${_vs_glob_redist_paths})
280 unset(_vs_glob_redist_paths)
282 unset(_MSVC_IDE_VERSIONS)
285 get_filename_component(_vs_dir
286 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
287 set(programfilesx86 "ProgramFiles(x86)")
289 "${_vs_dir}/../../VC/redist"
290 "${base_dir}/VC/redist"
291 "$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
292 "$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
295 unset(programfilesx86)
297 find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
298 unset(_vs_redist_paths)
299 mark_as_advanced(MSVC_REDIST_DIR)
300 set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
302 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
304 "${MSVC_CRT_DIR}/msvcp${v}.dll"
306 if(NOT vs VERSION_LESS 14)
308 "${MSVC_CRT_DIR}/msvcp${v}_1.dll"
309 "${MSVC_CRT_DIR}/msvcp${v}_2.dll"
310 "${MSVC_CRT_DIR}/msvcp${v}_atomic_wait.dll"
311 "${MSVC_CRT_DIR}/msvcp${v}_codecvt_ids.dll"
312 "${MSVC_CRT_DIR}/vcruntime${v}_1.dll"
315 list(APPEND __install__libs "${crt}")
318 list(APPEND __install__libs
319 "${MSVC_CRT_DIR}/vcruntime${v}.dll"
320 "${MSVC_CRT_DIR}/concrt${v}.dll"
323 list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
329 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
331 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
332 set(__install__libs ${__install__libs}
333 "${MSVC_CRT_DIR}/msvcp${v}d.dll"
335 if(NOT vs VERSION_LESS 14)
337 "${MSVC_CRT_DIR}/msvcp${v}_1d.dll"
338 "${MSVC_CRT_DIR}/msvcp${v}_2d.dll"
339 "${MSVC_CRT_DIR}/msvcp${v}d_atomic_wait.dll"
340 "${MSVC_CRT_DIR}/msvcp${v}d_codecvt_ids.dll"
341 "${MSVC_CRT_DIR}/vcruntime${v}_1d.dll"
344 list(APPEND __install__libs "${crt}")
347 list(APPEND __install__libs
348 "${MSVC_CRT_DIR}/vcruntime${v}d.dll"
349 "${MSVC_CRT_DIR}/concrt${v}d.dll"
352 list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
356 if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
357 # Find the Windows Kits directory.
358 get_filename_component(windows_kits_dir
359 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
360 set(programfilesx86 "ProgramFiles(x86)")
361 if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=])
362 set(__ucrt_version "${CMAKE_MATCH_1}/")
364 set(__ucrt_version "")
366 find_path(WINDOWS_KITS_DIR
368 Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
369 Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
371 $ENV{CMAKE_WINDOWS_KITS_10_DIR}
372 "${windows_kits_dir}"
373 "$ENV{ProgramFiles}/Windows Kits/10"
374 "$ENV{${programfilesx86}}/Windows Kits/10"
376 mark_as_advanced(WINDOWS_KITS_DIR)
378 # Glob the list of UCRT DLLs.
379 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
380 if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll")
381 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
383 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
385 list(APPEND __install__libs ${__ucrt_dlls})
387 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
388 if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll")
389 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll")
391 file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
393 list(APPEND __install__libs ${__ucrt_dlls})
398 if(CMAKE_INSTALL_MFC_LIBRARIES)
399 if(MSVC_VERSION EQUAL 1300)
400 set(__install__libs ${__install__libs}
401 "${SYSTEMROOT}/system32/mfc70.dll"
405 if(MSVC_VERSION EQUAL 1310)
406 set(__install__libs ${__install__libs}
407 "${SYSTEMROOT}/system32/mfc71.dll"
411 if(MSVC_VERSION EQUAL 1400)
412 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
414 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
415 set(__install__libs ${__install__libs}
416 "${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
417 "${MSVC_MFC_DIR}/mfc80d.dll"
418 "${MSVC_MFC_DIR}/mfc80ud.dll"
419 "${MSVC_MFC_DIR}/mfcm80d.dll"
420 "${MSVC_MFC_DIR}/mfcm80ud.dll"
424 set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
425 # Install the manifest that allows DLLs to be loaded from the
426 # directory containing the executable.
427 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
428 set(__install__libs ${__install__libs}
429 "${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
430 "${MSVC_MFC_DIR}/mfc80.dll"
431 "${MSVC_MFC_DIR}/mfc80u.dll"
432 "${MSVC_MFC_DIR}/mfcm80.dll"
433 "${MSVC_MFC_DIR}/mfcm80u.dll"
437 # include the language dll's for vs8 as well as the actual dll's
438 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
439 # Install the manifest that allows DLLs to be loaded from the
440 # directory containing the executable.
441 set(__install__libs ${__install__libs}
442 "${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
443 "${MSVC_MFCLOC_DIR}/mfc80chs.dll"
444 "${MSVC_MFCLOC_DIR}/mfc80cht.dll"
445 "${MSVC_MFCLOC_DIR}/mfc80enu.dll"
446 "${MSVC_MFCLOC_DIR}/mfc80esp.dll"
447 "${MSVC_MFCLOC_DIR}/mfc80deu.dll"
448 "${MSVC_MFCLOC_DIR}/mfc80fra.dll"
449 "${MSVC_MFCLOC_DIR}/mfc80ita.dll"
450 "${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
451 "${MSVC_MFCLOC_DIR}/mfc80kor.dll"
455 if(MSVC_VERSION EQUAL 1500)
456 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
458 "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
459 set(__install__libs ${__install__libs}
460 "${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
461 "${MSVC_MFC_DIR}/mfc90d.dll"
462 "${MSVC_MFC_DIR}/mfc90ud.dll"
463 "${MSVC_MFC_DIR}/mfcm90d.dll"
464 "${MSVC_MFC_DIR}/mfcm90ud.dll"
468 set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
469 # Install the manifest that allows DLLs to be loaded from the
470 # directory containing the executable.
471 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
472 set(__install__libs ${__install__libs}
473 "${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
474 "${MSVC_MFC_DIR}/mfc90.dll"
475 "${MSVC_MFC_DIR}/mfc90u.dll"
476 "${MSVC_MFC_DIR}/mfcm90.dll"
477 "${MSVC_MFC_DIR}/mfcm90u.dll"
481 # include the language dll's for vs9 as well as the actual dll's
482 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
483 # Install the manifest that allows DLLs to be loaded from the
484 # directory containing the executable.
485 set(__install__libs ${__install__libs}
486 "${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
487 "${MSVC_MFCLOC_DIR}/mfc90chs.dll"
488 "${MSVC_MFCLOC_DIR}/mfc90cht.dll"
489 "${MSVC_MFCLOC_DIR}/mfc90enu.dll"
490 "${MSVC_MFCLOC_DIR}/mfc90esp.dll"
491 "${MSVC_MFCLOC_DIR}/mfc90deu.dll"
492 "${MSVC_MFCLOC_DIR}/mfc90fra.dll"
493 "${MSVC_MFCLOC_DIR}/mfc90ita.dll"
494 "${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
495 "${MSVC_MFCLOC_DIR}/mfc90kor.dll"
499 set(_MFC_DLL_VERSION "")
500 set(_MFC_IDE_VERSION "")
501 if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
502 set(_MFC_DLL_VERSION ${_MSVC_DLL_VERSION})
503 set(_MFC_IDE_VERSION ${_MSVC_IDE_VERSION})
507 set(v "${_MFC_DLL_VERSION}")
508 set(vs "${_MFC_IDE_VERSION}")
510 # Starting with VS 15 the MFC DLLs may be in a different directory.
511 if (NOT vs VERSION_LESS 15)
512 file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
513 find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
514 PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
515 mark_as_advanced(MSVC_REDIST_MFC_DIR)
516 unset(_MSVC_REDIST_DIRS)
518 set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
521 # Multi-Byte Character Set versions of MFC are available as optional
522 # addon since Visual Studio 12. So for version 12 or higher, check
523 # whether they are available and exclude them if they are not.
525 if(CMAKE_INSTALL_DEBUG_LIBRARIES)
527 "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
528 set(__install__libs ${__install__libs}
529 "${MSVC_MFC_DIR}/mfc${v}ud.dll"
530 "${MSVC_MFC_DIR}/mfcm${v}ud.dll"
532 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
533 set(__install__libs ${__install__libs}
534 "${MSVC_MFC_DIR}/mfc${v}d.dll"
537 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll")
538 set(__install__libs ${__install__libs}
539 "${MSVC_MFC_DIR}/mfcm${v}d.dll"
544 set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
545 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
546 set(__install__libs ${__install__libs}
547 "${MSVC_MFC_DIR}/mfc${v}u.dll"
548 "${MSVC_MFC_DIR}/mfcm${v}u.dll"
550 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
551 set(__install__libs ${__install__libs}
552 "${MSVC_MFC_DIR}/mfc${v}.dll"
555 if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll")
556 set(__install__libs ${__install__libs}
557 "${MSVC_MFC_DIR}/mfcm${v}.dll"
562 # include the language dll's as well as the actual dll's
563 set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
564 set(__install__libs ${__install__libs}
565 "${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
566 "${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
567 "${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
568 "${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
569 "${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
570 "${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
571 "${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
572 "${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
573 "${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
574 "${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
579 # MSVC 8 was the first version with OpenMP
580 # Furthermore, there is no debug version of this
581 if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC)
582 set(_MSOMP_DLL_VERSION ${_MSVC_DLL_VERSION})
583 set(_MSOMP_IDE_VERSION ${_MSVC_IDE_VERSION})
585 if(_MSOMP_DLL_VERSION)
586 set(v "${_MSOMP_DLL_VERSION}")
587 set(vs "${_MSOMP_IDE_VERSION}")
588 set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
590 if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
591 set(__install__libs ${__install__libs}
592 "${MSVC_OPENMP_DIR}/vcomp${v}.dll")
601 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
602 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
604 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
605 message(WARNING "system runtime library file does not exist: '${lib}'")
606 # This warning indicates an incomplete Visual Studio installation
607 # or a bug somewhere above here in this file.
608 # If you would like to avoid this warning, fix the real problem, or
609 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
617 unset(__install_libs)
618 if(CMAKE_INSTALL_OPENMP_LIBRARIES)
620 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll")
622 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib")
624 list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so")
625 if(_Intel_compiler_ver VERSION_LESS 17)
626 list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so")
628 if(_Intel_compiler_ver VERSION_LESS 13)
629 list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so")
634 set(__install_dirs "${_Intel_redistdir}/1033")
635 if(EXISTS "${_Intel_redistdir}/1041")
636 list(APPEND __install_dirs "${_Intel_redistdir}/1041")
638 if(_Intel_compiler_ver VERSION_LESS 18)
639 list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c")
641 foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll
642 libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll)
644 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
646 if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel)
647 list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll")
649 if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
650 foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll)
652 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
656 foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib)
657 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
659 if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel)
660 if(_Intel_compiler_ver VERSION_LESS 17)
661 list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib")
664 if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
665 foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib)
667 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
671 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)
673 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
675 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13)
676 foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5)
678 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
681 if(CMAKE_C_COMPILER_ID MATCHES Intel OR CMAKE_CXX_COMPILER_ID MATCHES Intel)
682 set(__install_dirs "${_Intel_redistdir}/irml")
683 list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so")
684 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15)
685 list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so")
688 if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16)
689 foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main)
691 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
694 if(_Intel_compiler_ver VERSION_LESS 15)
695 foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5)
697 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
700 if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
701 foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5)
703 list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
708 foreach(lib IN LISTS __install_libs)
710 list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
712 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
713 message(WARNING "system runtime library file does not exist: '${lib}'")
718 foreach(dir IN LISTS __install_dirs)
720 list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir})
722 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
723 message(WARNING "system runtime library file does not exist: '${dir}'")
730 get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
731 if(CMAKE_C_COMPILER_VERSION)
732 set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
734 set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
736 string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
737 list(GET _watcom_version_list 0 _watcom_major)
738 list(GET _watcom_version_list 1 _watcom_minor)
740 ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
741 ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
742 ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
747 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
748 ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
750 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
751 message(WARNING "system runtime library file does not exist: '${lib}'")
752 # This warning indicates an incomplete Watcom installation
753 # or a bug somewhere above here in this file.
754 # If you would like to avoid this warning, fix the real problem, or
755 # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
763 # Include system runtime libraries in the installation if any are
764 # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
765 if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
766 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
767 if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
769 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
771 set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
774 if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
775 set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
776 COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
778 install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
779 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
780 ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
783 install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES}
784 DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
785 ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}