InstallRequiredSystemLibraries.cmake 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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. FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  67. PATHS
  68. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
  69. "${base_dir}/VC/redist"
  70. )
  71. MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
  72. SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  73. # Install the manifest that allows DLLs to be loaded from the
  74. # directory containing the executable.
  75. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  76. SET(__install__libs
  77. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  78. "${MSVC80_CRT_DIR}/msvcm80.dll"
  79. "${MSVC80_CRT_DIR}/msvcp80.dll"
  80. "${MSVC80_CRT_DIR}/msvcr80.dll"
  81. )
  82. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  83. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  84. SET(MSVC80_CRT_DIR
  85. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  86. SET(__install__libs ${__install__libs}
  87. "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  88. "${MSVC80_CRT_DIR}/msvcm80d.dll"
  89. "${MSVC80_CRT_DIR}/msvcp80d.dll"
  90. "${MSVC80_CRT_DIR}/msvcr80d.dll"
  91. )
  92. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  93. ENDIF(MSVC80)
  94. IF(MSVC90)
  95. # Find the runtime library redistribution directory.
  96. FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  97. PATHS
  98. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
  99. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
  100. "${base_dir}/VC/redist"
  101. )
  102. MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
  103. SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  104. # Install the manifest that allows DLLs to be loaded from the
  105. # directory containing the executable.
  106. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  107. SET(__install__libs
  108. "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  109. "${MSVC90_CRT_DIR}/msvcm90.dll"
  110. "${MSVC90_CRT_DIR}/msvcp90.dll"
  111. "${MSVC90_CRT_DIR}/msvcr90.dll"
  112. )
  113. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  114. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  115. SET(MSVC90_CRT_DIR
  116. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  117. SET(__install__libs ${__install__libs}
  118. "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  119. "${MSVC90_CRT_DIR}/msvcm90d.dll"
  120. "${MSVC90_CRT_DIR}/msvcp90d.dll"
  121. "${MSVC90_CRT_DIR}/msvcr90d.dll"
  122. )
  123. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  124. ENDIF(MSVC90)
  125. IF(MSVC10)
  126. # Find the runtime library redistribution directory.
  127. FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
  128. PATHS
  129. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"
  130. "${base_dir}/VC/redist"
  131. "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/VC/redist"
  132. "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio 10.0/VC/redist"
  133. )
  134. MARK_AS_ADVANCED(MSVC10_REDIST_DIR)
  135. SET(MSVC10_CRT_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT")
  136. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  137. SET(__install__libs
  138. "${MSVC10_CRT_DIR}/msvcp100.dll"
  139. "${MSVC10_CRT_DIR}/msvcr100.dll"
  140. )
  141. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  142. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  143. SET(MSVC10_CRT_DIR
  144. "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugCRT")
  145. SET(__install__libs ${__install__libs}
  146. "${MSVC10_CRT_DIR}/msvcp100d.dll"
  147. "${MSVC10_CRT_DIR}/msvcr100d.dll"
  148. )
  149. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  150. ENDIF(MSVC10)
  151. IF(CMAKE_INSTALL_MFC_LIBRARIES)
  152. IF(MSVC70)
  153. SET(__install__libs ${__install__libs}
  154. "${SYSTEMROOT}/system32/mfc70.dll"
  155. )
  156. ENDIF(MSVC70)
  157. IF(MSVC71)
  158. SET(__install__libs ${__install__libs}
  159. "${SYSTEMROOT}/system32/mfc71.dll"
  160. )
  161. ENDIF(MSVC71)
  162. IF(MSVC80)
  163. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  164. SET(MSVC80_MFC_DIR
  165. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  166. SET(__install__libs ${__install__libs}
  167. "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  168. "${MSVC80_MFC_DIR}/mfc80d.dll"
  169. "${MSVC80_MFC_DIR}/mfc80ud.dll"
  170. "${MSVC80_MFC_DIR}/mfcm80d.dll"
  171. "${MSVC80_MFC_DIR}/mfcm80ud.dll"
  172. )
  173. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  174. SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  175. # Install the manifest that allows DLLs to be loaded from the
  176. # directory containing the executable.
  177. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  178. SET(__install__libs ${__install__libs}
  179. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  180. "${MSVC80_MFC_DIR}/mfc80.dll"
  181. "${MSVC80_MFC_DIR}/mfc80u.dll"
  182. "${MSVC80_MFC_DIR}/mfcm80.dll"
  183. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  184. )
  185. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  186. # include the language dll's for vs8 as well as the actuall dll's
  187. SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  188. # Install the manifest that allows DLLs to be loaded from the
  189. # directory containing the executable.
  190. SET(__install__libs ${__install__libs}
  191. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  192. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  193. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  194. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  195. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  196. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  197. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  198. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  199. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  200. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  201. )
  202. ENDIF(MSVC80)
  203. IF(MSVC90)
  204. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  205. SET(MSVC90_MFC_DIR
  206. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  207. SET(__install__libs ${__install__libs}
  208. "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  209. "${MSVC90_MFC_DIR}/mfc90d.dll"
  210. "${MSVC90_MFC_DIR}/mfc90ud.dll"
  211. "${MSVC90_MFC_DIR}/mfcm90d.dll"
  212. "${MSVC90_MFC_DIR}/mfcm90ud.dll"
  213. )
  214. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  215. SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  216. # Install the manifest that allows DLLs to be loaded from the
  217. # directory containing the executable.
  218. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  219. SET(__install__libs ${__install__libs}
  220. "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  221. "${MSVC90_MFC_DIR}/mfc90.dll"
  222. "${MSVC90_MFC_DIR}/mfc90u.dll"
  223. "${MSVC90_MFC_DIR}/mfcm90.dll"
  224. "${MSVC90_MFC_DIR}/mfcm90u.dll"
  225. )
  226. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  227. # include the language dll's for vs9 as well as the actuall dll's
  228. SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  229. # Install the manifest that allows DLLs to be loaded from the
  230. # directory containing the executable.
  231. SET(__install__libs ${__install__libs}
  232. "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  233. "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
  234. "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
  235. "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
  236. "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
  237. "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
  238. "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
  239. "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
  240. "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
  241. "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
  242. )
  243. ENDIF(MSVC90)
  244. IF(MSVC10)
  245. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  246. SET(MSVC10_MFC_DIR
  247. "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugMFC")
  248. SET(__install__libs ${__install__libs}
  249. "${MSVC10_MFC_DIR}/mfc100d.dll"
  250. "${MSVC10_MFC_DIR}/mfc100ud.dll"
  251. "${MSVC10_MFC_DIR}/mfcm100d.dll"
  252. "${MSVC10_MFC_DIR}/mfcm100ud.dll"
  253. )
  254. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  255. SET(MSVC10_MFC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFC")
  256. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  257. SET(__install__libs ${__install__libs}
  258. "${MSVC10_MFC_DIR}/mfc100.dll"
  259. "${MSVC10_MFC_DIR}/mfc100u.dll"
  260. "${MSVC10_MFC_DIR}/mfcm100.dll"
  261. "${MSVC10_MFC_DIR}/mfcm100u.dll"
  262. )
  263. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  264. # include the language dll's for vs10 as well as the actuall dll's
  265. SET(MSVC10_MFCLOC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFCLOC")
  266. SET(__install__libs ${__install__libs}
  267. "${MSVC10_MFCLOC_DIR}/mfc100chs.dll"
  268. "${MSVC10_MFCLOC_DIR}/mfc100cht.dll"
  269. "${MSVC10_MFCLOC_DIR}/mfc100enu.dll"
  270. "${MSVC10_MFCLOC_DIR}/mfc100esp.dll"
  271. "${MSVC10_MFCLOC_DIR}/mfc100deu.dll"
  272. "${MSVC10_MFCLOC_DIR}/mfc100fra.dll"
  273. "${MSVC10_MFCLOC_DIR}/mfc100ita.dll"
  274. "${MSVC10_MFCLOC_DIR}/mfc100jpn.dll"
  275. "${MSVC10_MFCLOC_DIR}/mfc100kor.dll"
  276. )
  277. ENDIF(MSVC10)
  278. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  279. FOREACH(lib
  280. ${__install__libs}
  281. )
  282. IF(EXISTS ${lib})
  283. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  284. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  285. ELSE(EXISTS ${lib})
  286. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
  287. MESSAGE(WARNING "system runtime library file does not exist: '${lib}'")
  288. # This warning indicates an incomplete Visual Studio installation
  289. # or a bug somewhere above here in this file.
  290. # If you would like to avoid this warning, fix the real problem, or
  291. # set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
  292. # this file.
  293. ENDIF()
  294. ENDIF(EXISTS ${lib})
  295. ENDFOREACH(lib)
  296. ENDIF(MSVC)
  297. # Include system runtime libraries in the installation if any are
  298. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  299. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  300. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  301. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  302. IF(WIN32)
  303. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
  304. ELSE(WIN32)
  305. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
  306. ENDIF(WIN32)
  307. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  308. INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
  309. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
  310. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  311. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)