1
0

InstallRequiredSystemLibraries.cmake 18 KB

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