InstallRequiredSystemLibraries.cmake 17 KB

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