1
0

InstallRequiredSystemLibraries.cmake 19 KB

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