InstallRequiredSystemLibraries.cmake 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. #.rst:
  2. # InstallRequiredSystemLibraries
  3. # ------------------------------
  4. #
  5. # Include this module to search for compiler-provided system runtime
  6. # libraries and add install rules for them. Some optional variables
  7. # may be set prior to including the module to adjust behavior:
  8. #
  9. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
  10. # Specify additional runtime libraries that may not be detected.
  11. # After inclusion any detected libraries will be appended to this.
  12. #
  13. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
  14. # Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
  15. # allow the includer to specify its own install rule, using the value of
  16. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
  17. #
  18. # ``CMAKE_INSTALL_DEBUG_LIBRARIES``
  19. # Set to TRUE to install the debug runtime libraries when available
  20. # with MSVC tools.
  21. #
  22. # ``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
  23. # Set to TRUE to install only the debug runtime libraries with MSVC
  24. # tools even if the release runtime libraries are also available.
  25. #
  26. # ``CMAKE_INSTALL_MFC_LIBRARIES``
  27. # Set to TRUE to install the MSVC MFC runtime libraries.
  28. #
  29. # ``CMAKE_INSTALL_OPENMP_LIBRARIES``
  30. # Set to TRUE to install the MSVC OpenMP runtime libraries
  31. #
  32. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
  33. # Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
  34. # option. If not specified, the default is ``bin`` on Windows
  35. # and ``lib`` elsewhere.
  36. #
  37. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
  38. # Set to TRUE to disable warnings about required library files that
  39. # do not exist. (For example, Visual Studio Express editions may
  40. # not provide the redistributable files.)
  41. #
  42. # ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
  43. # Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
  44. # option. If not specified, no such option will be used.
  45. #=============================================================================
  46. # Copyright 2006-2015 Kitware, Inc.
  47. #
  48. # Distributed under the OSI-approved BSD License (the "License");
  49. # see accompanying file Copyright.txt for details.
  50. #
  51. # This software is distributed WITHOUT ANY WARRANTY; without even the
  52. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  53. # See the License for more information.
  54. #=============================================================================
  55. # (To distribute this file outside of CMake, substitute the full
  56. # License text for the above reference.)
  57. if(MSVC)
  58. file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  59. if(CMAKE_CL_64)
  60. if(MSVC_VERSION GREATER 1599)
  61. # VS 10 and later:
  62. set(CMAKE_MSVC_ARCH x64)
  63. else()
  64. # VS 9 and earlier:
  65. set(CMAKE_MSVC_ARCH amd64)
  66. endif()
  67. else()
  68. set(CMAKE_MSVC_ARCH x86)
  69. endif()
  70. get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
  71. get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
  72. if(MSVC70)
  73. set(__install__libs
  74. "${SYSTEMROOT}/system32/msvcp70.dll"
  75. "${SYSTEMROOT}/system32/msvcr70.dll"
  76. )
  77. endif()
  78. if(MSVC71)
  79. set(__install__libs
  80. "${SYSTEMROOT}/system32/msvcp71.dll"
  81. "${SYSTEMROOT}/system32/msvcr71.dll"
  82. )
  83. endif()
  84. if(MSVC80)
  85. # Find the runtime library redistribution directory.
  86. get_filename_component(msvc_install_dir
  87. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
  88. find_path(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  89. PATHS
  90. "${msvc_install_dir}/../../VC/redist"
  91. "${base_dir}/VC/redist"
  92. )
  93. mark_as_advanced(MSVC80_REDIST_DIR)
  94. set(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  95. # Install the manifest that allows DLLs to be loaded from the
  96. # directory containing the executable.
  97. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  98. set(__install__libs
  99. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  100. "${MSVC80_CRT_DIR}/msvcm80.dll"
  101. "${MSVC80_CRT_DIR}/msvcp80.dll"
  102. "${MSVC80_CRT_DIR}/msvcr80.dll"
  103. )
  104. else()
  105. set(__install__libs)
  106. endif()
  107. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  108. set(MSVC80_CRT_DIR
  109. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  110. set(__install__libs ${__install__libs}
  111. "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  112. "${MSVC80_CRT_DIR}/msvcm80d.dll"
  113. "${MSVC80_CRT_DIR}/msvcp80d.dll"
  114. "${MSVC80_CRT_DIR}/msvcr80d.dll"
  115. )
  116. endif()
  117. endif()
  118. if(MSVC90)
  119. # Find the runtime library redistribution directory.
  120. get_filename_component(msvc_install_dir
  121. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
  122. get_filename_component(msvc_express_install_dir
  123. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
  124. find_path(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  125. PATHS
  126. "${msvc_install_dir}/../../VC/redist"
  127. "${msvc_express_install_dir}/../../VC/redist"
  128. "${base_dir}/VC/redist"
  129. )
  130. mark_as_advanced(MSVC90_REDIST_DIR)
  131. set(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  132. # Install the manifest that allows DLLs to be loaded from the
  133. # directory containing the executable.
  134. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  135. set(__install__libs
  136. "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  137. "${MSVC90_CRT_DIR}/msvcm90.dll"
  138. "${MSVC90_CRT_DIR}/msvcp90.dll"
  139. "${MSVC90_CRT_DIR}/msvcr90.dll"
  140. )
  141. else()
  142. set(__install__libs)
  143. endif()
  144. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  145. set(MSVC90_CRT_DIR
  146. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  147. set(__install__libs ${__install__libs}
  148. "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  149. "${MSVC90_CRT_DIR}/msvcm90d.dll"
  150. "${MSVC90_CRT_DIR}/msvcp90d.dll"
  151. "${MSVC90_CRT_DIR}/msvcr90d.dll"
  152. )
  153. endif()
  154. endif()
  155. macro(MSVCRT_FILES_FOR_VERSION version)
  156. set(v "${version}")
  157. # Find the runtime library redistribution directory.
  158. get_filename_component(msvc_install_dir
  159. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${v}.0;InstallDir]" ABSOLUTE)
  160. find_path(MSVC${v}_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT
  161. PATHS
  162. "${msvc_install_dir}/../../VC/redist"
  163. "${base_dir}/VC/redist"
  164. "$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
  165. set(programfilesx86 "ProgramFiles(x86)")
  166. "$ENV{${programfilesx86}}/Microsoft Visual Studio ${v}.0/VC/redist"
  167. )
  168. mark_as_advanced(MSVC${v}_REDIST_DIR)
  169. set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
  170. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  171. set(__install__libs
  172. "${MSVC${v}_CRT_DIR}/msvcp${v}0.dll"
  173. "${MSVC${v}_CRT_DIR}/msvcr${v}0.dll"
  174. )
  175. else()
  176. set(__install__libs)
  177. endif()
  178. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  179. set(MSVC${v}_CRT_DIR
  180. "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugCRT")
  181. set(__install__libs ${__install__libs}
  182. "${MSVC${v}_CRT_DIR}/msvcp${v}0d.dll"
  183. "${MSVC${v}_CRT_DIR}/msvcr${v}0d.dll"
  184. )
  185. endif()
  186. endmacro()
  187. if(MSVC10)
  188. MSVCRT_FILES_FOR_VERSION(10)
  189. endif()
  190. if(MSVC11)
  191. MSVCRT_FILES_FOR_VERSION(11)
  192. endif()
  193. if(MSVC12)
  194. MSVCRT_FILES_FOR_VERSION(12)
  195. endif()
  196. if(MSVC14)
  197. MSVCRT_FILES_FOR_VERSION(14)
  198. endif()
  199. if(CMAKE_INSTALL_MFC_LIBRARIES)
  200. if(MSVC70)
  201. set(__install__libs ${__install__libs}
  202. "${SYSTEMROOT}/system32/mfc70.dll"
  203. )
  204. endif()
  205. if(MSVC71)
  206. set(__install__libs ${__install__libs}
  207. "${SYSTEMROOT}/system32/mfc71.dll"
  208. )
  209. endif()
  210. if(MSVC80)
  211. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  212. set(MSVC80_MFC_DIR
  213. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  214. set(__install__libs ${__install__libs}
  215. "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  216. "${MSVC80_MFC_DIR}/mfc80d.dll"
  217. "${MSVC80_MFC_DIR}/mfc80ud.dll"
  218. "${MSVC80_MFC_DIR}/mfcm80d.dll"
  219. "${MSVC80_MFC_DIR}/mfcm80ud.dll"
  220. )
  221. endif()
  222. set(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  223. # Install the manifest that allows DLLs to be loaded from the
  224. # directory containing the executable.
  225. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  226. set(__install__libs ${__install__libs}
  227. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  228. "${MSVC80_MFC_DIR}/mfc80.dll"
  229. "${MSVC80_MFC_DIR}/mfc80u.dll"
  230. "${MSVC80_MFC_DIR}/mfcm80.dll"
  231. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  232. )
  233. endif()
  234. # include the language dll's for vs8 as well as the actuall dll's
  235. set(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  236. # Install the manifest that allows DLLs to be loaded from the
  237. # directory containing the executable.
  238. set(__install__libs ${__install__libs}
  239. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  240. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  241. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  242. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  243. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  244. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  245. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  246. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  247. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  248. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  249. )
  250. endif()
  251. if(MSVC90)
  252. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  253. set(MSVC90_MFC_DIR
  254. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  255. set(__install__libs ${__install__libs}
  256. "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  257. "${MSVC90_MFC_DIR}/mfc90d.dll"
  258. "${MSVC90_MFC_DIR}/mfc90ud.dll"
  259. "${MSVC90_MFC_DIR}/mfcm90d.dll"
  260. "${MSVC90_MFC_DIR}/mfcm90ud.dll"
  261. )
  262. endif()
  263. set(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  264. # Install the manifest that allows DLLs to be loaded from the
  265. # directory containing the executable.
  266. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  267. set(__install__libs ${__install__libs}
  268. "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  269. "${MSVC90_MFC_DIR}/mfc90.dll"
  270. "${MSVC90_MFC_DIR}/mfc90u.dll"
  271. "${MSVC90_MFC_DIR}/mfcm90.dll"
  272. "${MSVC90_MFC_DIR}/mfcm90u.dll"
  273. )
  274. endif()
  275. # include the language dll's for vs9 as well as the actuall dll's
  276. set(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  277. # Install the manifest that allows DLLs to be loaded from the
  278. # directory containing the executable.
  279. set(__install__libs ${__install__libs}
  280. "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  281. "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
  282. "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
  283. "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
  284. "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
  285. "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
  286. "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
  287. "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
  288. "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
  289. "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
  290. )
  291. endif()
  292. macro(MFC_FILES_FOR_VERSION version)
  293. set(v "${version}")
  294. # Multi-Byte Character Set versions of MFC are available as optional
  295. # addon since Visual Studio 12. So for version 12 or higher, check
  296. # whether they are available and exclude them if they are not.
  297. if(CMAKE_INSTALL_DEBUG_LIBRARIES)
  298. set(MSVC${v}_MFC_DIR
  299. "${MSVC${v}_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.DebugMFC")
  300. set(__install__libs ${__install__libs}
  301. "${MSVC${v}_MFC_DIR}/mfc${v}0ud.dll"
  302. "${MSVC${v}_MFC_DIR}/mfcm${v}0ud.dll"
  303. )
  304. if("${v}" LESS 12 OR EXISTS "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll")
  305. set(__install__libs ${__install__libs}
  306. "${MSVC${v}_MFC_DIR}/mfc${v}0d.dll"
  307. "${MSVC${v}_MFC_DIR}/mfcm${v}0d.dll"
  308. )
  309. endif()
  310. endif()
  311. set(MSVC${v}_MFC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFC")
  312. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  313. set(__install__libs ${__install__libs}
  314. "${MSVC${v}_MFC_DIR}/mfc${v}0u.dll"
  315. "${MSVC${v}_MFC_DIR}/mfcm${v}0u.dll"
  316. )
  317. if("${v}" LESS 12 OR EXISTS "${MSVC${v}_MFC_DIR}/mfc${v}0.dll")
  318. set(__install__libs ${__install__libs}
  319. "${MSVC${v}_MFC_DIR}/mfc${v}0.dll"
  320. "${MSVC${v}_MFC_DIR}/mfcm${v}0.dll"
  321. )
  322. endif()
  323. endif()
  324. # include the language dll's as well as the actuall dll's
  325. set(MSVC${v}_MFCLOC_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.MFCLOC")
  326. set(__install__libs ${__install__libs}
  327. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0chs.dll"
  328. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0cht.dll"
  329. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0deu.dll"
  330. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
  331. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esn.dll"
  332. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0fra.dll"
  333. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0ita.dll"
  334. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll"
  335. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.dll"
  336. "${MSVC${v}_MFCLOC_DIR}/mfc${v}0rus.dll"
  337. )
  338. endmacro()
  339. if(MSVC10)
  340. MFC_FILES_FOR_VERSION(10)
  341. endif()
  342. if(MSVC11)
  343. MFC_FILES_FOR_VERSION(11)
  344. endif()
  345. if(MSVC12)
  346. MFC_FILES_FOR_VERSION(12)
  347. endif()
  348. if(MSVC14)
  349. MFC_FILES_FOR_VERSION(14)
  350. endif()
  351. endif()
  352. # MSVC 8 was the first version with OpenMP
  353. # Furthermore, there is no debug version of this
  354. if(CMAKE_INSTALL_OPENMP_LIBRARIES)
  355. macro(OPENMP_FILES_FOR_VERSION version_a version_b)
  356. set(va "${version_a}")
  357. set(vb "${version_b}")
  358. set(MSVC${va}_OPENMP_DIR "${MSVC${va}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${vb}.OPENMP")
  359. if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  360. set(__install__libs ${__install__libs}
  361. "${MSVC${va}_OPENMP_DIR}/vcomp${vb}.dll")
  362. endif()
  363. endmacro()
  364. if(MSVC80)
  365. OPENMP_FILES_FOR_VERSION(80 80)
  366. endif()
  367. if(MSVC90)
  368. OPENMP_FILES_FOR_VERSION(90 90)
  369. endif()
  370. if(MSVC10)
  371. OPENMP_FILES_FOR_VERSION(10 100)
  372. endif()
  373. if(MSVC11)
  374. OPENMP_FILES_FOR_VERSION(11 110)
  375. endif()
  376. if(MSVC12)
  377. OPENMP_FILES_FOR_VERSION(12 120)
  378. endif()
  379. if(MSVC14)
  380. OPENMP_FILES_FOR_VERSION(14 140)
  381. endif()
  382. endif()
  383. foreach(lib
  384. ${__install__libs}
  385. )
  386. if(EXISTS ${lib})
  387. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  388. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  389. else()
  390. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  391. message(WARNING "system runtime library file does not exist: '${lib}'")
  392. # This warning indicates an incomplete Visual Studio installation
  393. # or a bug somewhere above here in this file.
  394. # If you would like to avoid this warning, fix the real problem, or
  395. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  396. # this file.
  397. endif()
  398. endif()
  399. endforeach()
  400. endif()
  401. if(WATCOM)
  402. get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
  403. if(CMAKE_C_COMPILER_VERSION)
  404. set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
  405. else()
  406. set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
  407. endif()
  408. string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
  409. list(GET _watcom_version_list 0 _watcom_major)
  410. list(GET _watcom_version_list 1 _watcom_minor)
  411. set( __install__libs
  412. ${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
  413. ${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
  414. ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
  415. foreach(lib
  416. ${__install__libs}
  417. )
  418. if(EXISTS ${lib})
  419. set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  420. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  421. else()
  422. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  423. message(WARNING "system runtime library file does not exist: '${lib}'")
  424. # This warning indicates an incomplete Watcom installation
  425. # or a bug somewhere above here in this file.
  426. # If you would like to avoid this warning, fix the real problem, or
  427. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  428. # this file.
  429. endif()
  430. endif()
  431. endforeach()
  432. endif()
  433. # Include system runtime libraries in the installation if any are
  434. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  435. if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  436. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  437. if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  438. if(WIN32)
  439. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
  440. else()
  441. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
  442. endif()
  443. endif()
  444. if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
  445. set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
  446. COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
  447. endif()
  448. install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
  449. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
  450. ${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
  451. )
  452. endif()
  453. endif()