InstallRequiredSystemLibraries.cmake 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. # By including this file, all library files listed in the variable
  2. # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with
  3. # INSTALL(PROGRAMS ...) into bin for WIN32 and lib
  4. # for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE
  5. # before including this file, then the INSTALL command is not called.
  6. # The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a
  7. # custom install command and install them however they want.
  8. # If it is the MSVC compiler, then the microsoft run
  9. # time libraries will be found and automatically added to the
  10. # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed.
  11. # If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
  12. # compiler, then the debug libraries are installed when available.
  13. # If CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug
  14. # libraries are installed when both debug and release are available.
  15. # If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
  16. # libraries are installed as well as the CRT run time libraries.
  17. # If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are
  18. # installed to that directory rather than the default.
  19. # If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS is NOT set, then this file
  20. # warns about required files that do not exist. You can set this variable to
  21. # ON before including this file to avoid the warning. For example, the Visual
  22. # Studio Express editions do not include the redistributable files, so if you
  23. # include this file on a machine with only VS Express installed, you'll get
  24. # the warning.
  25. #=============================================================================
  26. # Copyright 2006-2009 Kitware, Inc.
  27. #
  28. # Distributed under the OSI-approved BSD License (the "License");
  29. # see accompanying file Copyright.txt for details.
  30. #
  31. # This software is distributed WITHOUT ANY WARRANTY; without even the
  32. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  33. # See the License for more information.
  34. #=============================================================================
  35. # (To distribute this file outside of CMake, substitute the full
  36. # License text for the above reference.)
  37. IF(MSVC)
  38. FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  39. IF(CMAKE_CL_64)
  40. IF(MSVC_VERSION GREATER 1599)
  41. # VS 10 and later:
  42. SET(CMAKE_MSVC_ARCH x64)
  43. ELSE()
  44. # VS 9 and earlier:
  45. SET(CMAKE_MSVC_ARCH amd64)
  46. ENDIF()
  47. ELSE(CMAKE_CL_64)
  48. SET(CMAKE_MSVC_ARCH x86)
  49. ENDIF(CMAKE_CL_64)
  50. GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
  51. GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
  52. IF(MSVC70)
  53. SET(__install__libs
  54. "${SYSTEMROOT}/system32/msvcp70.dll"
  55. "${SYSTEMROOT}/system32/msvcr70.dll"
  56. )
  57. ENDIF(MSVC70)
  58. IF(MSVC71)
  59. SET(__install__libs
  60. "${SYSTEMROOT}/system32/msvcp71.dll"
  61. "${SYSTEMROOT}/system32/msvcr71.dll"
  62. )
  63. ENDIF(MSVC71)
  64. IF(MSVC80)
  65. # Find the runtime library redistribution directory.
  66. GET_FILENAME_COMPONENT(msvc_install_dir
  67. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
  68. FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  69. PATHS
  70. "${msvc_install_dir}/../../VC/redist"
  71. "${base_dir}/VC/redist"
  72. )
  73. MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
  74. SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  75. # Install the manifest that allows DLLs to be loaded from the
  76. # directory containing the executable.
  77. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  78. SET(__install__libs
  79. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  80. "${MSVC80_CRT_DIR}/msvcm80.dll"
  81. "${MSVC80_CRT_DIR}/msvcp80.dll"
  82. "${MSVC80_CRT_DIR}/msvcr80.dll"
  83. )
  84. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  85. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  86. SET(MSVC80_CRT_DIR
  87. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  88. SET(__install__libs ${__install__libs}
  89. "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  90. "${MSVC80_CRT_DIR}/msvcm80d.dll"
  91. "${MSVC80_CRT_DIR}/msvcp80d.dll"
  92. "${MSVC80_CRT_DIR}/msvcr80d.dll"
  93. )
  94. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  95. ENDIF(MSVC80)
  96. IF(MSVC90)
  97. # Find the runtime library redistribution directory.
  98. GET_FILENAME_COMPONENT(msvc_install_dir
  99. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
  100. GET_FILENAME_COMPONENT(msvc_express_install_dir
  101. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
  102. FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  103. PATHS
  104. "${msvc_install_dir}/../../VC/redist"
  105. "${msvc_express_install_dir}/../../VC/redist"
  106. "${base_dir}/VC/redist"
  107. )
  108. MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
  109. SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  110. # Install the manifest that allows DLLs to be loaded from the
  111. # directory containing the executable.
  112. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  113. SET(__install__libs
  114. "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  115. "${MSVC90_CRT_DIR}/msvcm90.dll"
  116. "${MSVC90_CRT_DIR}/msvcp90.dll"
  117. "${MSVC90_CRT_DIR}/msvcr90.dll"
  118. )
  119. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  120. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  121. SET(MSVC90_CRT_DIR
  122. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  123. SET(__install__libs ${__install__libs}
  124. "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  125. "${MSVC90_CRT_DIR}/msvcm90d.dll"
  126. "${MSVC90_CRT_DIR}/msvcp90d.dll"
  127. "${MSVC90_CRT_DIR}/msvcr90d.dll"
  128. )
  129. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  130. ENDIF(MSVC90)
  131. IF(MSVC10)
  132. # Find the runtime library redistribution directory.
  133. GET_FILENAME_COMPONENT(msvc_install_dir
  134. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]" ABSOLUTE)
  135. FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
  136. PATHS
  137. "${msvc_install_dir}/../../VC/redist"
  138. "${base_dir}/VC/redist"
  139. "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/VC/redist"
  140. "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/VC/redist"
  141. )
  142. MARK_AS_ADVANCED(MSVC10_REDIST_DIR)
  143. SET(MSVC10_CRT_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT")
  144. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  145. SET(__install__libs
  146. "${MSVC10_CRT_DIR}/msvcp100.dll"
  147. "${MSVC10_CRT_DIR}/msvcr100.dll"
  148. )
  149. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  150. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  151. SET(MSVC10_CRT_DIR
  152. "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugCRT")
  153. SET(__install__libs ${__install__libs}
  154. "${MSVC10_CRT_DIR}/msvcp100d.dll"
  155. "${MSVC10_CRT_DIR}/msvcr100d.dll"
  156. )
  157. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  158. ENDIF(MSVC10)
  159. IF(CMAKE_INSTALL_MFC_LIBRARIES)
  160. IF(MSVC70)
  161. SET(__install__libs ${__install__libs}
  162. "${SYSTEMROOT}/system32/mfc70.dll"
  163. )
  164. ENDIF(MSVC70)
  165. IF(MSVC71)
  166. SET(__install__libs ${__install__libs}
  167. "${SYSTEMROOT}/system32/mfc71.dll"
  168. )
  169. ENDIF(MSVC71)
  170. IF(MSVC80)
  171. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  172. SET(MSVC80_MFC_DIR
  173. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  174. SET(__install__libs ${__install__libs}
  175. "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  176. "${MSVC80_MFC_DIR}/mfc80d.dll"
  177. "${MSVC80_MFC_DIR}/mfc80ud.dll"
  178. "${MSVC80_MFC_DIR}/mfcm80d.dll"
  179. "${MSVC80_MFC_DIR}/mfcm80ud.dll"
  180. )
  181. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  182. SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  183. # Install the manifest that allows DLLs to be loaded from the
  184. # directory containing the executable.
  185. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  186. SET(__install__libs ${__install__libs}
  187. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  188. "${MSVC80_MFC_DIR}/mfc80.dll"
  189. "${MSVC80_MFC_DIR}/mfc80u.dll"
  190. "${MSVC80_MFC_DIR}/mfcm80.dll"
  191. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  192. )
  193. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  194. # include the language dll's for vs8 as well as the actuall dll's
  195. SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  196. # Install the manifest that allows DLLs to be loaded from the
  197. # directory containing the executable.
  198. SET(__install__libs ${__install__libs}
  199. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  200. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  201. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  202. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  203. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  204. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  205. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  206. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  207. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  208. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  209. )
  210. ENDIF(MSVC80)
  211. IF(MSVC90)
  212. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  213. SET(MSVC90_MFC_DIR
  214. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  215. SET(__install__libs ${__install__libs}
  216. "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  217. "${MSVC90_MFC_DIR}/mfc90d.dll"
  218. "${MSVC90_MFC_DIR}/mfc90ud.dll"
  219. "${MSVC90_MFC_DIR}/mfcm90d.dll"
  220. "${MSVC90_MFC_DIR}/mfcm90ud.dll"
  221. )
  222. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  223. SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  224. # Install the manifest that allows DLLs to be loaded from the
  225. # directory containing the executable.
  226. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  227. SET(__install__libs ${__install__libs}
  228. "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  229. "${MSVC90_MFC_DIR}/mfc90.dll"
  230. "${MSVC90_MFC_DIR}/mfc90u.dll"
  231. "${MSVC90_MFC_DIR}/mfcm90.dll"
  232. "${MSVC90_MFC_DIR}/mfcm90u.dll"
  233. )
  234. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  235. # include the language dll's for vs9 as well as the actuall dll's
  236. SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  237. # Install the manifest that allows DLLs to be loaded from the
  238. # directory containing the executable.
  239. SET(__install__libs ${__install__libs}
  240. "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  241. "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
  242. "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
  243. "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
  244. "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
  245. "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
  246. "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
  247. "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
  248. "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
  249. "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
  250. )
  251. ENDIF(MSVC90)
  252. IF(MSVC10)
  253. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  254. SET(MSVC10_MFC_DIR
  255. "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugMFC")
  256. SET(__install__libs ${__install__libs}
  257. "${MSVC10_MFC_DIR}/mfc100d.dll"
  258. "${MSVC10_MFC_DIR}/mfc100ud.dll"
  259. "${MSVC10_MFC_DIR}/mfcm100d.dll"
  260. "${MSVC10_MFC_DIR}/mfcm100ud.dll"
  261. )
  262. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  263. SET(MSVC10_MFC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFC")
  264. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  265. SET(__install__libs ${__install__libs}
  266. "${MSVC10_MFC_DIR}/mfc100.dll"
  267. "${MSVC10_MFC_DIR}/mfc100u.dll"
  268. "${MSVC10_MFC_DIR}/mfcm100.dll"
  269. "${MSVC10_MFC_DIR}/mfcm100u.dll"
  270. )
  271. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  272. # include the language dll's for vs10 as well as the actuall dll's
  273. SET(MSVC10_MFCLOC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFCLOC")
  274. SET(__install__libs ${__install__libs}
  275. "${MSVC10_MFCLOC_DIR}/mfc100chs.dll"
  276. "${MSVC10_MFCLOC_DIR}/mfc100cht.dll"
  277. "${MSVC10_MFCLOC_DIR}/mfc100enu.dll"
  278. "${MSVC10_MFCLOC_DIR}/mfc100esp.dll"
  279. "${MSVC10_MFCLOC_DIR}/mfc100deu.dll"
  280. "${MSVC10_MFCLOC_DIR}/mfc100fra.dll"
  281. "${MSVC10_MFCLOC_DIR}/mfc100ita.dll"
  282. "${MSVC10_MFCLOC_DIR}/mfc100jpn.dll"
  283. "${MSVC10_MFCLOC_DIR}/mfc100kor.dll"
  284. )
  285. ENDIF(MSVC10)
  286. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  287. FOREACH(lib
  288. ${__install__libs}
  289. )
  290. IF(EXISTS ${lib})
  291. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  292. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  293. ELSE(EXISTS ${lib})
  294. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  295. MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
  296. # This warning indicates an incomplete Visual Studio installation
  297. # or a bug somewhere above here in this file.
  298. # If you would like to avoid this warning, fix the real problem, or
  299. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  300. # this file.
  301. ENDIF()
  302. ENDIF(EXISTS ${lib})
  303. ENDFOREACH(lib)
  304. ENDIF(MSVC)
  305. # Include system runtime libraries in the installation if any are
  306. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  307. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  308. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  309. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  310. IF(WIN32)
  311. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
  312. ELSE(WIN32)
  313. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
  314. ENDIF(WIN32)
  315. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  316. INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
  317. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
  318. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  319. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)