InstallRequiredSystemLibraries.cmake 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #.rst:
  4. # InstallRequiredSystemLibraries
  5. # ------------------------------
  6. #
  7. # Include this module to search for compiler-provided system runtime
  8. # libraries and add install rules for them. Some optional variables
  9. # may be set prior to including the module to adjust behavior:
  10. #
  11. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
  12. # Specify additional runtime libraries that may not be detected.
  13. # After inclusion any detected libraries will be appended to this.
  14. #
  15. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
  16. # Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
  17. # allow the includer to specify its own install rule, using the value of
  18. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
  19. #
  20. # ``CMAKE_INSTALL_DEBUG_LIBRARIES``
  21. # Set to TRUE to install the debug runtime libraries when available
  22. # with MSVC tools.
  23. #
  24. # ``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
  25. # Set to TRUE to install only the debug runtime libraries with MSVC
  26. # tools even if the release runtime libraries are also available.
  27. #
  28. # ``CMAKE_INSTALL_UCRT_LIBRARIES``
  29. # Set to TRUE to install the Windows Universal CRT libraries for
  30. # app-local deployment (e.g. to Windows XP). This is meaningful
  31. # only with MSVC from Visual Studio 2015 or higher.
  32. #
  33. # One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
  34. # to an absolute path to tell CMake to look for Windows 10 SDKs in
  35. # a custom location. The specified directory is expected to contain
  36. # ``Redist/ucrt/DLLs/*`` directories.
  37. #
  38. # ``CMAKE_INSTALL_MFC_LIBRARIES``
  39. # Set to TRUE to install the MSVC MFC runtime libraries.
  40. #
  41. # ``CMAKE_INSTALL_OPENMP_LIBRARIES``
  42. # Set to TRUE to install the MSVC OpenMP runtime libraries
  43. #
  44. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
  45. # Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
  46. # option. If not specified, the default is ``bin`` on Windows
  47. # and ``lib`` elsewhere.
  48. #
  49. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
  50. # Set to TRUE to disable warnings about required library files that
  51. # do not exist. (For example, Visual Studio Express editions may
  52. # not provide the redistributable files.)
  53. #
  54. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
  55. # Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
  56. # option. If not specified, no such option will be used.
  57. set(_IRSL_HAVE_Intel FALSE)
  58. set(_IRSL_HAVE_MSVC FALSE)
  59. foreach(LANG IN ITEMS C CXX Fortran)
  60. if(CMAKE_${LANG}_COMPILER_ID STREQUAL Intel)
  61. if(NOT _IRSL_HAVE_Intel)
  62. get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
  63. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  64. set(_Intel_archdir intel64)
  65. else()
  66. set(_Intel_archdir x86)
  67. endif()
  68. set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
  69. if(WIN32)
  70. get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
  71. elseif(APPLE)
  72. get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
  73. else()
  74. if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin")
  75. get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
  76. else()
  77. get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
  78. endif()
  79. endif()
  80. set(_IRSL_HAVE_Intel TRUE)
  81. endif()
  82. elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL MSVC)
  83. set(_IRSL_HAVE_MSVC TRUE)
  84. endif()
  85. endforeach()
  86. if(MSVC)
  87. file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  88. if(CMAKE_CL_64)
  89. if(MSVC_VERSION GREATER 1599)
  90. # VS 10 and later:
  91. set(CMAKE_MSVC_ARCH x64)
  92. else()
  93. # VS 9 and earlier:
  94. set(CMAKE_MSVC_ARCH amd64)
  95. endif()
  96. else()
  97. set(CMAKE_MSVC_ARCH x86)
  98. endif()
  99. get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
  100. get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
  101. if(MSVC_VERSION EQUAL 1300)
  102. set(__install__libs
  103. "${SYSTEMROOT}/system32/msvcp70.dll"
  104. "${SYSTEMROOT}/system32/msvcr70.dll"
  105. )
  106. endif()
  107. if(MSVC_VERSION EQUAL 1310)
  108. set(__install__libs
  109. "${SYSTEMROOT}/system32/msvcp71.dll"
  110. "${SYSTEMROOT}/system32/msvcr71.dll"
  111. )
  112. endif()
  113. if(MSVC_VERSION EQUAL 1400)
  114. set(MSVC_REDIST_NAME VC80)
  115. # Find the runtime library redistribution directory.
  116. get_filename_component(msvc_install_dir
  117. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
  118. if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
  119. set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
  120. endif()
  121. find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  122. PATHS
  123. "${msvc_install_dir}/../../VC/redist"
  124. "${base_dir}/VC/redist"
  125. )
  126. mark_as_advanced(MSVC_REDIST_DIR)
  127. set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  128. # Install the manifest that allows DLLs to be loaded from the
  129. # directory containing the executable.
  130. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  131. set(__install__libs
  132. "${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  133. "${MSVC_CRT_DIR}/msvcm80.dll"
  134. "${MSVC_CRT_DIR}/msvcp80.dll"
  135. "${MSVC_CRT_DIR}/msvcr80.dll"
  136. )
  137. else()
  138. set(__install__libs)
  139. endif()
  140. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  141. set(MSVC_CRT_DIR
  142. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  143. set(__install__libs ${__install__libs}
  144. "${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  145. "${MSVC_CRT_DIR}/msvcm80d.dll"
  146. "${MSVC_CRT_DIR}/msvcp80d.dll"
  147. "${MSVC_CRT_DIR}/msvcr80d.dll"
  148. )
  149. endif()
  150. endif()
  151. if(MSVC_VERSION EQUAL 1500)
  152. set(MSVC_REDIST_NAME VC90)
  153. # Find the runtime library redistribution directory.
  154. get_filename_component(msvc_install_dir
  155. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
  156. get_filename_component(msvc_express_install_dir
  157. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
  158. if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
  159. set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
  160. endif()
  161. find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  162. PATHS
  163. "${msvc_install_dir}/../../VC/redist"
  164. "${msvc_express_install_dir}/../../VC/redist"
  165. "${base_dir}/VC/redist"
  166. )
  167. mark_as_advanced(MSVC_REDIST_DIR)
  168. set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.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)
  172. set(__install__libs
  173. "${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  174. "${MSVC_CRT_DIR}/msvcm90.dll"
  175. "${MSVC_CRT_DIR}/msvcp90.dll"
  176. "${MSVC_CRT_DIR}/msvcr90.dll"
  177. )
  178. else()
  179. set(__install__libs)
  180. endif()
  181. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  182. set(MSVC_CRT_DIR
  183. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  184. set(__install__libs ${__install__libs}
  185. "${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  186. "${MSVC_CRT_DIR}/msvcm90d.dll"
  187. "${MSVC_CRT_DIR}/msvcp90d.dll"
  188. "${MSVC_CRT_DIR}/msvcr90d.dll"
  189. )
  190. endif()
  191. endif()
  192. if(MSVC_VERSION EQUAL 1911)
  193. set(MSVC_REDIST_NAME VC141)
  194. set(_MSVCRT_DLL_VERSION 140)
  195. set(_MSVCRT_IDE_VERSION 15)
  196. elseif(MSVC_VERSION EQUAL 1910)
  197. set(MSVC_REDIST_NAME VC150)
  198. set(_MSVCRT_DLL_VERSION 140)
  199. set(_MSVCRT_IDE_VERSION 15)
  200. elseif(MSVC_VERSION EQUAL 1900)
  201. set(MSVC_REDIST_NAME VC140)
  202. set(_MSVCRT_DLL_VERSION 140)
  203. set(_MSVCRT_IDE_VERSION 14)
  204. elseif(MSVC_VERSION EQUAL 1800)
  205. set(MSVC_REDIST_NAME VC120)
  206. set(_MSVCRT_DLL_VERSION 120)
  207. set(_MSVCRT_IDE_VERSION 12)
  208. elseif(MSVC_VERSION EQUAL 1700)
  209. set(MSVC_REDIST_NAME VC110)
  210. set(_MSVCRT_DLL_VERSION 110)
  211. set(_MSVCRT_IDE_VERSION 11)
  212. elseif(MSVC_VERSION EQUAL 1600)
  213. set(MSVC_REDIST_NAME VC100)
  214. set(_MSVCRT_DLL_VERSION 100)
  215. set(_MSVCRT_IDE_VERSION 10)
  216. else()
  217. set(MSVC_REDIST_NAME "")
  218. set(_MSVCRT_DLL_VERSION "")
  219. set(_MSVCRT_IDE_VERSION "")
  220. endif()
  221. if(_MSVCRT_DLL_VERSION)
  222. set(v "${_MSVCRT_DLL_VERSION}")
  223. set(vs "${_MSVCRT_IDE_VERSION}")
  224. # Find the runtime library redistribution directory.
  225. if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
  226. set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
  227. endif()
  228. if(NOT vs VERSION_LESS 15)
  229. set(_vs_redist_paths "")
  230. cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs}_DIR) # undocumented query
  231. if(IS_DIRECTORY "${_vs_dir}")
  232. file(GLOB _vs_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
  233. endif()
  234. unset(_vs_dir)
  235. else()
  236. get_filename_component(_vs_dir
  237. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
  238. set(programfilesx86 "ProgramFiles(x86)")
  239. set(_vs_redist_paths
  240. "${_vs_dir}/../../VC/redist"
  241. "${base_dir}/VC/redist"
  242. "$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
  243. "$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
  244. )
  245. unset(_vs_dir)
  246. unset(programfilesx86)
  247. endif()
  248. find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
  249. unset(_vs_redist_paths)
  250. mark_as_advanced(MSVC_REDIST_DIR)
  251. set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
  252. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  253. set(__install__libs
  254. "${MSVC_CRT_DIR}/msvcp${v}.dll"
  255. )
  256. if(NOT vs VERSION_LESS 14)
  257. list(APPEND __install__libs
  258. "${MSVC_CRT_DIR}/vcruntime${v}.dll"
  259. "${MSVC_CRT_DIR}/concrt${v}.dll"
  260. )
  261. else()
  262. list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
  263. endif()
  264. else()
  265. set(__install__libs)
  266. endif()
  267. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  268. set(MSVC_CRT_DIR
  269. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
  270. set(__install__libs ${__install__libs}
  271. "${MSVC_CRT_DIR}/msvcp${v}d.dll"
  272. )
  273. if(NOT vs VERSION_LESS 14)
  274. list(APPEND __install__libs
  275. "${MSVC_CRT_DIR}/vcruntime${v}d.dll"
  276. "${MSVC_CRT_DIR}/concrt${v}d.dll"
  277. )
  278. else()
  279. list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
  280. endif()
  281. endif()
  282. if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
  283. # Find the Windows Kits directory.
  284. get_filename_component(windows_kits_dir
  285. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
  286. set(programfilesx86 "ProgramFiles(x86)")
  287. find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
  288. PATHS
  289. $ENV{CMAKE_WINDOWS_KITS_10_DIR}
  290. "${windows_kits_dir}"
  291. "$ENV{ProgramFiles}/Windows Kits/10"
  292. "$ENV{${programfilesx86}}/Windows Kits/10"
  293. )
  294. mark_as_advanced(WINDOWS_KITS_DIR)
  295. # Glob the list of UCRT DLLs.
  296. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  297. file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
  298. list(APPEND __install__libs ${__ucrt_dlls})
  299. endif()
  300. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  301. file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
  302. list(APPEND __install__libs ${__ucrt_dlls})
  303. endif()
  304. endif()
  305. endif()
  306. if(CMAKE_INSTALL_MFC_LIBRARIES)
  307. if(MSVC_VERSION EQUAL 1300)
  308. set(__install__libs ${__install__libs}
  309. "${SYSTEMROOT}/system32/mfc70.dll"
  310. )
  311. endif()
  312. if(MSVC_VERSION EQUAL 1310)
  313. set(__install__libs ${__install__libs}
  314. "${SYSTEMROOT}/system32/mfc71.dll"
  315. )
  316. endif()
  317. if(MSVC_VERSION EQUAL 1400)
  318. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  319. set(MSVC_MFC_DIR
  320. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  321. set(__install__libs ${__install__libs}
  322. "${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  323. "${MSVC_MFC_DIR}/mfc80d.dll"
  324. "${MSVC_MFC_DIR}/mfc80ud.dll"
  325. "${MSVC_MFC_DIR}/mfcm80d.dll"
  326. "${MSVC_MFC_DIR}/mfcm80ud.dll"
  327. )
  328. endif()
  329. set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  330. # Install the manifest that allows DLLs to be loaded from the
  331. # directory containing the executable.
  332. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  333. set(__install__libs ${__install__libs}
  334. "${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  335. "${MSVC_MFC_DIR}/mfc80.dll"
  336. "${MSVC_MFC_DIR}/mfc80u.dll"
  337. "${MSVC_MFC_DIR}/mfcm80.dll"
  338. "${MSVC_MFC_DIR}/mfcm80u.dll"
  339. )
  340. endif()
  341. # include the language dll's for vs8 as well as the actuall dll's
  342. set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  343. # Install the manifest that allows DLLs to be loaded from the
  344. # directory containing the executable.
  345. set(__install__libs ${__install__libs}
  346. "${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  347. "${MSVC_MFCLOC_DIR}/mfc80chs.dll"
  348. "${MSVC_MFCLOC_DIR}/mfc80cht.dll"
  349. "${MSVC_MFCLOC_DIR}/mfc80enu.dll"
  350. "${MSVC_MFCLOC_DIR}/mfc80esp.dll"
  351. "${MSVC_MFCLOC_DIR}/mfc80deu.dll"
  352. "${MSVC_MFCLOC_DIR}/mfc80fra.dll"
  353. "${MSVC_MFCLOC_DIR}/mfc80ita.dll"
  354. "${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
  355. "${MSVC_MFCLOC_DIR}/mfc80kor.dll"
  356. )
  357. endif()
  358. if(MSVC_VERSION EQUAL 1500)
  359. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  360. set(MSVC_MFC_DIR
  361. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  362. set(__install__libs ${__install__libs}
  363. "${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  364. "${MSVC_MFC_DIR}/mfc90d.dll"
  365. "${MSVC_MFC_DIR}/mfc90ud.dll"
  366. "${MSVC_MFC_DIR}/mfcm90d.dll"
  367. "${MSVC_MFC_DIR}/mfcm90ud.dll"
  368. )
  369. endif()
  370. set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  371. # Install the manifest that allows DLLs to be loaded from the
  372. # directory containing the executable.
  373. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  374. set(__install__libs ${__install__libs}
  375. "${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  376. "${MSVC_MFC_DIR}/mfc90.dll"
  377. "${MSVC_MFC_DIR}/mfc90u.dll"
  378. "${MSVC_MFC_DIR}/mfcm90.dll"
  379. "${MSVC_MFC_DIR}/mfcm90u.dll"
  380. )
  381. endif()
  382. # include the language dll's for vs9 as well as the actuall dll's
  383. set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  384. # Install the manifest that allows DLLs to be loaded from the
  385. # directory containing the executable.
  386. set(__install__libs ${__install__libs}
  387. "${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  388. "${MSVC_MFCLOC_DIR}/mfc90chs.dll"
  389. "${MSVC_MFCLOC_DIR}/mfc90cht.dll"
  390. "${MSVC_MFCLOC_DIR}/mfc90enu.dll"
  391. "${MSVC_MFCLOC_DIR}/mfc90esp.dll"
  392. "${MSVC_MFCLOC_DIR}/mfc90deu.dll"
  393. "${MSVC_MFCLOC_DIR}/mfc90fra.dll"
  394. "${MSVC_MFCLOC_DIR}/mfc90ita.dll"
  395. "${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
  396. "${MSVC_MFCLOC_DIR}/mfc90kor.dll"
  397. )
  398. endif()
  399. if(MSVC_VERSION EQUAL 1911)
  400. set(_MFC_DLL_VERSION 140)
  401. set(_MFC_IDE_VERSION 15)
  402. elseif(MSVC_VERSION EQUAL 1910)
  403. set(_MFC_DLL_VERSION 140)
  404. set(_MFC_IDE_VERSION 15)
  405. elseif(MSVC_VERSION EQUAL 1900)
  406. set(_MFC_DLL_VERSION 140)
  407. set(_MFC_IDE_VERSION 14)
  408. elseif(MSVC_VERSION EQUAL 1800)
  409. set(_MFC_DLL_VERSION 120)
  410. set(_MFC_IDE_VERSION 12)
  411. elseif(MSVC_VERSION EQUAL 1700)
  412. set(_MFC_DLL_VERSION 110)
  413. set(_MFC_IDE_VERSION 11)
  414. elseif(MSVC_VERSION EQUAL 1600)
  415. set(_MFC_DLL_VERSION 100)
  416. set(_MFC_IDE_VERSION 10)
  417. else()
  418. set(_MFC_DLL_VERSION "")
  419. set(_MFC_IDE_VERSION "")
  420. endif()
  421. if(_MFC_DLL_VERSION)
  422. set(v "${_MFC_DLL_VERSION}")
  423. set(vs "${_MFC_IDE_VERSION}")
  424. # Starting with VS 15 the MFC DLLs may be in a different directory.
  425. if (NOT vs VERSION_LESS 15)
  426. file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
  427. find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
  428. PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
  429. mark_as_advanced(MSVC_REDIST_MFC_DIR)
  430. unset(_MSVC_REDIST_DIRS)
  431. else()
  432. set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
  433. endif()
  434. # Multi-Byte Character Set versions of MFC are available as optional
  435. # addon since Visual Studio 12. So for version 12 or higher, check
  436. # whether they are available and exclude them if they are not.
  437. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  438. set(MSVC_MFC_DIR
  439. "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
  440. set(__install__libs ${__install__libs}
  441. "${MSVC_MFC_DIR}/mfc${v}ud.dll"
  442. "${MSVC_MFC_DIR}/mfcm${v}ud.dll"
  443. )
  444. if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
  445. set(__install__libs ${__install__libs}
  446. "${MSVC_MFC_DIR}/mfc${v}d.dll"
  447. "${MSVC_MFC_DIR}/mfcm${v}d.dll"
  448. )
  449. endif()
  450. endif()
  451. set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
  452. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  453. set(__install__libs ${__install__libs}
  454. "${MSVC_MFC_DIR}/mfc${v}u.dll"
  455. "${MSVC_MFC_DIR}/mfcm${v}u.dll"
  456. )
  457. if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
  458. set(__install__libs ${__install__libs}
  459. "${MSVC_MFC_DIR}/mfc${v}.dll"
  460. "${MSVC_MFC_DIR}/mfcm${v}.dll"
  461. )
  462. endif()
  463. endif()
  464. # include the language dll's as well as the actuall dll's
  465. set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
  466. set(__install__libs ${__install__libs}
  467. "${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
  468. "${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
  469. "${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
  470. "${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
  471. "${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
  472. "${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
  473. "${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
  474. "${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
  475. "${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
  476. "${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
  477. )
  478. endif()
  479. endif()
  480. # MSVC 8 was the first version with OpenMP
  481. # Furthermore, there is no debug version of this
  482. if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC)
  483. if(MSVC_VERSION EQUAL 1911)
  484. set(_MSOMP_DLL_VERSION 140)
  485. set(_MSOMP_IDE_VERSION 15)
  486. elseif(MSVC_VERSION EQUAL 1910)
  487. set(_MSOMP_DLL_VERSION 140)
  488. set(_MSOMP_IDE_VERSION 15)
  489. elseif(MSVC_VERSION EQUAL 1900)
  490. set(_MSOMP_DLL_VERSION 140)
  491. set(_MSOMP_IDE_VERSION 14)
  492. elseif(MSVC_VERSION EQUAL 1800)
  493. set(_MSOMP_DLL_VERSION 120)
  494. set(_MSOMP_IDE_VERSION 12)
  495. elseif(MSVC_VERSION EQUAL 1700)
  496. set(_MSOMP_DLL_VERSION 110)
  497. set(_MSOMP_IDE_VERSION 11)
  498. elseif(MSVC_VERSION EQUAL 1600)
  499. set(_MSOMP_DLL_VERSION 100)
  500. set(_MSOMP_IDE_VERSION 10)
  501. elseif(MSVC_VERSION EQUAL 1500)
  502. set(_MSOMP_DLL_VERSION 90)
  503. set(_MSOMP_IDE_VERSION 9)
  504. elseif(MSVC_VERSION EQUAL 1400)
  505. set(_MSOMP_DLL_VERSION 80)
  506. set(_MSOMP_IDE_VERSION 8)
  507. else()
  508. set(_MSOMP_DLL_VERSION "")
  509. set(_MSOMP_IDE_VERSION "")
  510. endif()
  511. if(_MSOMP_DLL_VERSION)
  512. set(v "${_MSOMP_DLL_VERSION}")
  513. set(vs "${_MSOMP_IDE_VERSION}")
  514. set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
  515. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  516. set(__install__libs ${__install__libs}
  517. "${MSVC_OPENMP_DIR}/vcomp${v}.dll")
  518. endif()
  519. endif()
  520. endif()
  521. foreach(lib
  522. ${__install__libs}
  523. )
  524. if(EXISTS ${lib})
  525. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  526. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  527. else()
  528. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  529. message(WARNING "system runtime library file does not exist: '${lib}'")
  530. # This warning indicates an incomplete Visual Studio installation
  531. # or a bug somewhere above here in this file.
  532. # If you would like to avoid this warning, fix the real problem, or
  533. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  534. # this file.
  535. endif()
  536. endif()
  537. endforeach()
  538. endif()
  539. if(_IRSL_HAVE_Intel)
  540. unset(__install_libs)
  541. if(CMAKE_INSTALL_OPENMP_LIBRARIES)
  542. if(WIN32)
  543. list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll")
  544. elseif(APPLE)
  545. list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib")
  546. else()
  547. list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so")
  548. if(_Intel_compiler_ver VERSION_LESS 17)
  549. list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so")
  550. endif()
  551. if(_Intel_compiler_ver VERSION_LESS 13)
  552. list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so")
  553. endif()
  554. endif()
  555. endif()
  556. if(WIN32)
  557. set(__install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c"
  558. "${_Intel_redistdir}/1033" "${_Intel_redistdir}/1041")
  559. foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libgfxoffload.dll libioffload_host.dll libirngmd.dll
  560. libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll)
  561. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  562. endforeach()
  563. if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
  564. foreach(__Intel_lib IN ITEMS libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll)
  565. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  566. endforeach()
  567. endif()
  568. elseif(APPLE)
  569. foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib)
  570. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  571. endforeach()
  572. if(_Intel_compiler_ver VERSION_LESS 17)
  573. list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib")
  574. endif()
  575. if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
  576. foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib)
  577. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  578. endforeach()
  579. endif()
  580. else()
  581. set(__install_dirs "${_Intel_redistdir}/irml")
  582. foreach(__Intel_lib IN ITEMS cilk_db.so libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so)
  583. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  584. endforeach()
  585. if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13)
  586. foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5)
  587. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  588. endforeach()
  589. endif()
  590. if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15)
  591. foreach(__Intel_lib IN ITEMS libgfxoffload.so libistrconv.so)
  592. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  593. endforeach()
  594. endif()
  595. if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16)
  596. foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main)
  597. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  598. endforeach()
  599. endif()
  600. if(_Intel_compiler_ver VERSION_LESS 15)
  601. foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5)
  602. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  603. endforeach()
  604. endif()
  605. if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
  606. foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5)
  607. list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
  608. endforeach()
  609. endif()
  610. endif()
  611. foreach(lib IN LISTS __install_libs)
  612. if(EXISTS ${lib})
  613. list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
  614. else()
  615. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  616. message(WARNING "system runtime library file does not exist: '${lib}'")
  617. endif()
  618. endif()
  619. endforeach()
  620. foreach(dir IN LISTS __install_dirs)
  621. if(EXISTS ${dir})
  622. list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir})
  623. else()
  624. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  625. message(WARNING "system runtime library file does not exist: '${dir}'")
  626. endif()
  627. endif()
  628. endforeach()
  629. endif()
  630. if(WATCOM)
  631. get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
  632. if(CMAKE_C_COMPILER_VERSION)
  633. set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
  634. else()
  635. set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
  636. endif()
  637. string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
  638. list(GET _watcom_version_list 0 _watcom_major)
  639. list(GET _watcom_version_list 1 _watcom_minor)
  640. set( __install__libs
  641. ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
  642. ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
  643. ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
  644. foreach(lib
  645. ${__install__libs}
  646. )
  647. if(EXISTS ${lib})
  648. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  649. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  650. else()
  651. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  652. message(WARNING "system runtime library file does not exist: '${lib}'")
  653. # This warning indicates an incomplete Watcom installation
  654. # or a bug somewhere above here in this file.
  655. # If you would like to avoid this warning, fix the real problem, or
  656. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  657. # this file.
  658. endif()
  659. endif()
  660. endforeach()
  661. endif()
  662. # Include system runtime libraries in the installation if any are
  663. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  664. if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  665. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  666. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  667. if(WIN32)
  668. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
  669. else()
  670. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
  671. endif()
  672. endif()
  673. if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
  674. set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
  675. COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
  676. endif()
  677. install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
  678. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
  679. ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
  680. )
  681. install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES}
  682. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
  683. ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
  684. )
  685. endif()
  686. endif()