InstallRequiredSystemLibraries.cmake 18 KB

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