InstallRequiredSystemLibraries.cmake 19 KB

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