InstallRequiredSystemLibraries.cmake 19 KB

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