InstallRequiredSystemLibraries.cmake 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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. # ``CMAKE_INSTALL_MFC_LIBRARIES``
  34. # Set to TRUE to install the MSVC MFC runtime libraries.
  35. #
  36. # ``CMAKE_INSTALL_OPENMP_LIBRARIES``
  37. # Set to TRUE to install the MSVC OpenMP runtime libraries
  38. #
  39. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
  40. # Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
  41. # option. If not specified, the default is ``bin`` on Windows
  42. # and ``lib`` elsewhere.
  43. #
  44. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
  45. # Set to TRUE to disable warnings about required library files that
  46. # do not exist. (For example, Visual Studio Express editions may
  47. # not provide the redistributable files.)
  48. #
  49. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
  50. # Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
  51. # option. If not specified, no such option will be used.
  52. if(MSVC)
  53. file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  54. if(CMAKE_CL_64)
  55. if(MSVC_VERSION GREATER 1599)
  56. # VS 10 and later:
  57. set(CMAKE_MSVC_ARCH x64)
  58. else()
  59. # VS 9 and earlier:
  60. set(CMAKE_MSVC_ARCH amd64)
  61. endif()
  62. else()
  63. set(CMAKE_MSVC_ARCH x86)
  64. endif()
  65. get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
  66. get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
  67. if(MSVC_VERSION EQUAL 1300)
  68. set(__install__libs
  69. "${SYSTEMROOT}/system32/msvcp70.dll"
  70. "${SYSTEMROOT}/system32/msvcr70.dll"
  71. )
  72. endif()
  73. if(MSVC_VERSION EQUAL 1310)
  74. set(__install__libs
  75. "${SYSTEMROOT}/system32/msvcp71.dll"
  76. "${SYSTEMROOT}/system32/msvcr71.dll"
  77. )
  78. endif()
  79. if(MSVC_VERSION EQUAL 1400)
  80. # Find the runtime library redistribution directory.
  81. get_filename_component(msvc_install_dir
  82. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
  83. if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
  84. set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
  85. endif()
  86. find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  87. PATHS
  88. "${msvc_install_dir}/../../VC/redist"
  89. "${base_dir}/VC/redist"
  90. )
  91. mark_as_advanced(MSVC_REDIST_DIR)
  92. set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  93. # Install the manifest that allows DLLs to be loaded from the
  94. # directory containing the executable.
  95. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  96. set(__install__libs
  97. "${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  98. "${MSVC_CRT_DIR}/msvcm80.dll"
  99. "${MSVC_CRT_DIR}/msvcp80.dll"
  100. "${MSVC_CRT_DIR}/msvcr80.dll"
  101. )
  102. else()
  103. set(__install__libs)
  104. endif()
  105. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  106. set(MSVC_CRT_DIR
  107. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  108. set(__install__libs ${__install__libs}
  109. "${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  110. "${MSVC_CRT_DIR}/msvcm80d.dll"
  111. "${MSVC_CRT_DIR}/msvcp80d.dll"
  112. "${MSVC_CRT_DIR}/msvcr80d.dll"
  113. )
  114. endif()
  115. endif()
  116. if(MSVC_VERSION EQUAL 1500)
  117. # Find the runtime library redistribution directory.
  118. get_filename_component(msvc_install_dir
  119. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
  120. get_filename_component(msvc_express_install_dir
  121. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
  122. if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
  123. set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
  124. endif()
  125. find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  126. PATHS
  127. "${msvc_install_dir}/../../VC/redist"
  128. "${msvc_express_install_dir}/../../VC/redist"
  129. "${base_dir}/VC/redist"
  130. )
  131. mark_as_advanced(MSVC_REDIST_DIR)
  132. set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  133. # Install the manifest that allows DLLs to be loaded from the
  134. # directory containing the executable.
  135. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  136. set(__install__libs
  137. "${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  138. "${MSVC_CRT_DIR}/msvcm90.dll"
  139. "${MSVC_CRT_DIR}/msvcp90.dll"
  140. "${MSVC_CRT_DIR}/msvcr90.dll"
  141. )
  142. else()
  143. set(__install__libs)
  144. endif()
  145. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  146. set(MSVC_CRT_DIR
  147. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  148. set(__install__libs ${__install__libs}
  149. "${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  150. "${MSVC_CRT_DIR}/msvcm90d.dll"
  151. "${MSVC_CRT_DIR}/msvcp90d.dll"
  152. "${MSVC_CRT_DIR}/msvcr90d.dll"
  153. )
  154. endif()
  155. endif()
  156. if(MSVC_VERSION EQUAL 1910)
  157. set(_MSVCRT_DLL_VERSION 140)
  158. set(_MSVCRT_IDE_VERSION 15)
  159. elseif(MSVC_VERSION EQUAL 1900)
  160. set(_MSVCRT_DLL_VERSION 140)
  161. set(_MSVCRT_IDE_VERSION 14)
  162. elseif(MSVC_VERSION EQUAL 1800)
  163. set(_MSVCRT_DLL_VERSION 120)
  164. set(_MSVCRT_IDE_VERSION 12)
  165. elseif(MSVC_VERSION EQUAL 1700)
  166. set(_MSVCRT_DLL_VERSION 110)
  167. set(_MSVCRT_IDE_VERSION 11)
  168. elseif(MSVC_VERSION EQUAL 1600)
  169. set(_MSVCRT_DLL_VERSION 100)
  170. set(_MSVCRT_IDE_VERSION 10)
  171. else()
  172. set(_MSVCRT_DLL_VERSION "")
  173. set(_MSVCRT_IDE_VERSION "")
  174. endif()
  175. if(_MSVCRT_DLL_VERSION)
  176. set(v "${_MSVCRT_DLL_VERSION}")
  177. set(vs "${_MSVCRT_IDE_VERSION}")
  178. # Find the runtime library redistribution directory.
  179. get_filename_component(msvc_install_dir
  180. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
  181. set(programfilesx86 "ProgramFiles(x86)")
  182. if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
  183. set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
  184. endif()
  185. find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT
  186. PATHS
  187. "${msvc_install_dir}/../../VC/redist"
  188. "${base_dir}/VC/redist"
  189. "$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
  190. "$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
  191. )
  192. mark_as_advanced(MSVC_REDIST_DIR)
  193. set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.CRT")
  194. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  195. set(__install__libs
  196. "${MSVC_CRT_DIR}/msvcp${v}.dll"
  197. )
  198. if(NOT vs VERSION_LESS 14)
  199. list(APPEND __install__libs
  200. "${MSVC_CRT_DIR}/vcruntime${v}.dll"
  201. "${MSVC_CRT_DIR}/concrt${v}.dll"
  202. )
  203. else()
  204. list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
  205. endif()
  206. else()
  207. set(__install__libs)
  208. endif()
  209. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  210. set(MSVC_CRT_DIR
  211. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.DebugCRT")
  212. set(__install__libs ${__install__libs}
  213. "${MSVC_CRT_DIR}/msvcp${v}d.dll"
  214. )
  215. if(NOT vs VERSION_LESS 14)
  216. list(APPEND __install__libs
  217. "${MSVC_CRT_DIR}/vcruntime${v}d.dll"
  218. "${MSVC_CRT_DIR}/concrt${v}d.dll"
  219. )
  220. else()
  221. list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
  222. endif()
  223. endif()
  224. if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
  225. # Find the Windows Kits directory.
  226. get_filename_component(windows_kits_dir
  227. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
  228. set(programfilesx86 "ProgramFiles(x86)")
  229. find_path(WINDOWS_KITS_DIR NAMES Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
  230. PATHS
  231. "${windows_kits_dir}"
  232. "$ENV{ProgramFiles}/Windows Kits/10"
  233. "$ENV{${programfilesx86}}/Windows Kits/10"
  234. )
  235. mark_as_advanced(WINDOWS_KITS_DIR)
  236. # Glob the list of UCRT DLLs.
  237. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  238. file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
  239. list(APPEND __install__libs ${__ucrt_dlls})
  240. endif()
  241. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  242. file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
  243. list(APPEND __install__libs ${__ucrt_dlls})
  244. endif()
  245. endif()
  246. endif()
  247. if(CMAKE_INSTALL_MFC_LIBRARIES)
  248. if(MSVC_VERSION EQUAL 1300)
  249. set(__install__libs ${__install__libs}
  250. "${SYSTEMROOT}/system32/mfc70.dll"
  251. )
  252. endif()
  253. if(MSVC_VERSION EQUAL 1310)
  254. set(__install__libs ${__install__libs}
  255. "${SYSTEMROOT}/system32/mfc71.dll"
  256. )
  257. endif()
  258. if(MSVC_VERSION EQUAL 1400)
  259. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  260. set(MSVC_MFC_DIR
  261. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  262. set(__install__libs ${__install__libs}
  263. "${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  264. "${MSVC_MFC_DIR}/mfc80d.dll"
  265. "${MSVC_MFC_DIR}/mfc80ud.dll"
  266. "${MSVC_MFC_DIR}/mfcm80d.dll"
  267. "${MSVC_MFC_DIR}/mfcm80ud.dll"
  268. )
  269. endif()
  270. set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  271. # Install the manifest that allows DLLs to be loaded from the
  272. # directory containing the executable.
  273. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  274. set(__install__libs ${__install__libs}
  275. "${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  276. "${MSVC_MFC_DIR}/mfc80.dll"
  277. "${MSVC_MFC_DIR}/mfc80u.dll"
  278. "${MSVC_MFC_DIR}/mfcm80.dll"
  279. "${MSVC_MFC_DIR}/mfcm80u.dll"
  280. )
  281. endif()
  282. # include the language dll's for vs8 as well as the actuall dll's
  283. set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  284. # Install the manifest that allows DLLs to be loaded from the
  285. # directory containing the executable.
  286. set(__install__libs ${__install__libs}
  287. "${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  288. "${MSVC_MFCLOC_DIR}/mfc80chs.dll"
  289. "${MSVC_MFCLOC_DIR}/mfc80cht.dll"
  290. "${MSVC_MFCLOC_DIR}/mfc80enu.dll"
  291. "${MSVC_MFCLOC_DIR}/mfc80esp.dll"
  292. "${MSVC_MFCLOC_DIR}/mfc80deu.dll"
  293. "${MSVC_MFCLOC_DIR}/mfc80fra.dll"
  294. "${MSVC_MFCLOC_DIR}/mfc80ita.dll"
  295. "${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
  296. "${MSVC_MFCLOC_DIR}/mfc80kor.dll"
  297. )
  298. endif()
  299. if(MSVC_VERSION EQUAL 1500)
  300. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  301. set(MSVC_MFC_DIR
  302. "${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  303. set(__install__libs ${__install__libs}
  304. "${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  305. "${MSVC_MFC_DIR}/mfc90d.dll"
  306. "${MSVC_MFC_DIR}/mfc90ud.dll"
  307. "${MSVC_MFC_DIR}/mfcm90d.dll"
  308. "${MSVC_MFC_DIR}/mfcm90ud.dll"
  309. )
  310. endif()
  311. set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  312. # Install the manifest that allows DLLs to be loaded from the
  313. # directory containing the executable.
  314. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  315. set(__install__libs ${__install__libs}
  316. "${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  317. "${MSVC_MFC_DIR}/mfc90.dll"
  318. "${MSVC_MFC_DIR}/mfc90u.dll"
  319. "${MSVC_MFC_DIR}/mfcm90.dll"
  320. "${MSVC_MFC_DIR}/mfcm90u.dll"
  321. )
  322. endif()
  323. # include the language dll's for vs9 as well as the actuall dll's
  324. set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  325. # Install the manifest that allows DLLs to be loaded from the
  326. # directory containing the executable.
  327. set(__install__libs ${__install__libs}
  328. "${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  329. "${MSVC_MFCLOC_DIR}/mfc90chs.dll"
  330. "${MSVC_MFCLOC_DIR}/mfc90cht.dll"
  331. "${MSVC_MFCLOC_DIR}/mfc90enu.dll"
  332. "${MSVC_MFCLOC_DIR}/mfc90esp.dll"
  333. "${MSVC_MFCLOC_DIR}/mfc90deu.dll"
  334. "${MSVC_MFCLOC_DIR}/mfc90fra.dll"
  335. "${MSVC_MFCLOC_DIR}/mfc90ita.dll"
  336. "${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
  337. "${MSVC_MFCLOC_DIR}/mfc90kor.dll"
  338. )
  339. endif()
  340. if(MSVC_VERSION EQUAL 1910)
  341. set(_MFC_DLL_VERSION 140)
  342. set(_MFC_IDE_VERSION 15)
  343. elseif(MSVC_VERSION EQUAL 1900)
  344. set(_MFC_DLL_VERSION 140)
  345. set(_MFC_IDE_VERSION 14)
  346. elseif(MSVC_VERSION EQUAL 1800)
  347. set(_MFC_DLL_VERSION 120)
  348. set(_MFC_IDE_VERSION 12)
  349. elseif(MSVC_VERSION EQUAL 1700)
  350. set(_MFC_DLL_VERSION 110)
  351. set(_MFC_IDE_VERSION 11)
  352. elseif(MSVC_VERSION EQUAL 1600)
  353. set(_MFC_DLL_VERSION 100)
  354. set(_MFC_IDE_VERSION 10)
  355. else()
  356. set(_MFC_DLL_VERSION "")
  357. set(_MFC_IDE_VERSION "")
  358. endif()
  359. if(_MFC_DLL_VERSION)
  360. set(v "${_MFC_DLL_VERSION}")
  361. set(vs "${_MFC_IDE_VERSION}")
  362. # Starting with VS 15 the MFC DLLs may be in a different directory.
  363. if (NOT vs VERSION_LESS 15)
  364. file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
  365. find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFC
  366. PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
  367. mark_as_advanced(MSVC_REDIST_MFC_DIR)
  368. unset(_MSVC_REDIST_DIRS)
  369. else()
  370. set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
  371. endif()
  372. # Multi-Byte Character Set versions of MFC are available as optional
  373. # addon since Visual Studio 12. So for version 12 or higher, check
  374. # whether they are available and exclude them if they are not.
  375. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  376. set(MSVC_MFC_DIR
  377. "${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.DebugMFC")
  378. set(__install__libs ${__install__libs}
  379. "${MSVC_MFC_DIR}/mfc${v}ud.dll"
  380. "${MSVC_MFC_DIR}/mfcm${v}ud.dll"
  381. )
  382. if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
  383. set(__install__libs ${__install__libs}
  384. "${MSVC_MFC_DIR}/mfc${v}d.dll"
  385. "${MSVC_MFC_DIR}/mfcm${v}d.dll"
  386. )
  387. endif()
  388. endif()
  389. set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFC")
  390. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  391. set(__install__libs ${__install__libs}
  392. "${MSVC_MFC_DIR}/mfc${v}u.dll"
  393. "${MSVC_MFC_DIR}/mfcm${v}u.dll"
  394. )
  395. if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
  396. set(__install__libs ${__install__libs}
  397. "${MSVC_MFC_DIR}/mfc${v}.dll"
  398. "${MSVC_MFC_DIR}/mfcm${v}.dll"
  399. )
  400. endif()
  401. endif()
  402. # include the language dll's as well as the actuall dll's
  403. set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.MFCLOC")
  404. set(__install__libs ${__install__libs}
  405. "${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
  406. "${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
  407. "${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
  408. "${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
  409. "${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
  410. "${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
  411. "${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
  412. "${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
  413. "${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
  414. "${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
  415. )
  416. endif()
  417. endif()
  418. # MSVC 8 was the first version with OpenMP
  419. # Furthermore, there is no debug version of this
  420. if(CMAKE_INSTALL_OPENMP_LIBRARIES)
  421. if(MSVC_VERSION EQUAL 1910)
  422. set(_MSOMP_DLL_VERSION 140)
  423. set(_MSOMP_IDE_VERSION 15)
  424. elseif(MSVC_VERSION EQUAL 1900)
  425. set(_MSOMP_DLL_VERSION 140)
  426. set(_MSOMP_IDE_VERSION 14)
  427. elseif(MSVC_VERSION EQUAL 1800)
  428. set(_MSOMP_DLL_VERSION 120)
  429. set(_MSOMP_IDE_VERSION 12)
  430. elseif(MSVC_VERSION EQUAL 1700)
  431. set(_MSOMP_DLL_VERSION 110)
  432. set(_MSOMP_IDE_VERSION 11)
  433. elseif(MSVC_VERSION EQUAL 1600)
  434. set(_MSOMP_DLL_VERSION 100)
  435. set(_MSOMP_IDE_VERSION 10)
  436. elseif(MSVC_VERSION EQUAL 1500)
  437. set(_MSOMP_DLL_VERSION 90)
  438. set(_MSOMP_IDE_VERSION 9)
  439. elseif(MSVC_VERSION EQUAL 1400)
  440. set(_MSOMP_DLL_VERSION 80)
  441. set(_MSOMP_IDE_VERSION 8)
  442. else()
  443. set(_MSOMP_DLL_VERSION "")
  444. set(_MSOMP_IDE_VERSION "")
  445. endif()
  446. if(_MSOMP_DLL_VERSION)
  447. set(v "${_MSOMP_DLL_VERSION}")
  448. set(vs "${_MSOMP_IDE_VERSION}")
  449. set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vs}0.OPENMP")
  450. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  451. set(__install__libs ${__install__libs}
  452. "${MSVC_OPENMP_DIR}/vcomp${v}.dll")
  453. endif()
  454. endif()
  455. endif()
  456. foreach(lib
  457. ${__install__libs}
  458. )
  459. if(EXISTS ${lib})
  460. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  461. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  462. else()
  463. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  464. message(WARNING "system runtime library file does not exist: '${lib}'")
  465. # This warning indicates an incomplete Visual Studio installation
  466. # or a bug somewhere above here in this file.
  467. # If you would like to avoid this warning, fix the real problem, or
  468. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  469. # this file.
  470. endif()
  471. endif()
  472. endforeach()
  473. endif()
  474. if(WATCOM)
  475. get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
  476. if(CMAKE_C_COMPILER_VERSION)
  477. set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
  478. else()
  479. set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
  480. endif()
  481. string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
  482. list(GET _watcom_version_list 0 _watcom_major)
  483. list(GET _watcom_version_list 1 _watcom_minor)
  484. set( __install__libs
  485. ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
  486. ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
  487. ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
  488. foreach(lib
  489. ${__install__libs}
  490. )
  491. if(EXISTS ${lib})
  492. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  493. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  494. else()
  495. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  496. message(WARNING "system runtime library file does not exist: '${lib}'")
  497. # This warning indicates an incomplete Watcom installation
  498. # or a bug somewhere above here in this file.
  499. # If you would like to avoid this warning, fix the real problem, or
  500. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  501. # this file.
  502. endif()
  503. endif()
  504. endforeach()
  505. endif()
  506. # Include system runtime libraries in the installation if any are
  507. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  508. if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  509. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  510. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  511. if(WIN32)
  512. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
  513. else()
  514. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
  515. endif()
  516. endif()
  517. if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
  518. set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
  519. COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
  520. endif()
  521. install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
  522. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
  523. ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
  524. )
  525. endif()
  526. endif()