InstallRequiredSystemLibraries.cmake 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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. #=============================================================================
  20. # Copyright 2006-2009 Kitware, Inc.
  21. #
  22. # Distributed under the OSI-approved BSD License (the "License");
  23. # see accompanying file Copyright.txt for details.
  24. #
  25. # This software is distributed WITHOUT ANY WARRANTY; without even the
  26. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  27. # See the License for more information.
  28. #=============================================================================
  29. # (To distribute this file outside of CMake, substitute the full
  30. # License text for the above reference.)
  31. IF(MSVC)
  32. FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  33. IF(MSVC70)
  34. SET(__install__libs
  35. "${SYSTEMROOT}/system32/msvcp70.dll"
  36. "${SYSTEMROOT}/system32/msvcr70.dll"
  37. )
  38. ENDIF(MSVC70)
  39. IF(MSVC71)
  40. SET(__install__libs
  41. "${SYSTEMROOT}/system32/msvcp71.dll"
  42. "${SYSTEMROOT}/system32/msvcr71.dll"
  43. )
  44. ENDIF(MSVC71)
  45. IF(CMAKE_CL_64)
  46. SET(CMAKE_MSVC_ARCH amd64)
  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(MSVC80)
  53. # Find the runtime library redistribution directory.
  54. FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  55. PATHS
  56. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
  57. "${base_dir}/VC/redist"
  58. )
  59. MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
  60. SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  61. # Install the manifest that allows DLLs to be loaded from the
  62. # directory containing the executable.
  63. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  64. SET(__install__libs
  65. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  66. "${MSVC80_CRT_DIR}/msvcm80.dll"
  67. "${MSVC80_CRT_DIR}/msvcp80.dll"
  68. "${MSVC80_CRT_DIR}/msvcr80.dll"
  69. )
  70. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  71. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  72. SET(MSVC80_CRT_DIR
  73. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  74. SET(__install__libs ${__install__libs}
  75. "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  76. "${MSVC80_CRT_DIR}/msvcm80d.dll"
  77. "${MSVC80_CRT_DIR}/msvcp80d.dll"
  78. "${MSVC80_CRT_DIR}/msvcr80d.dll"
  79. )
  80. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  81. ENDIF(MSVC80)
  82. IF(MSVC90)
  83. # Find the runtime library redistribution directory.
  84. FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  85. PATHS
  86. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
  87. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
  88. "${base_dir}/VC/redist"
  89. )
  90. MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
  91. SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  92. # Install the manifest that allows DLLs to be loaded from the
  93. # directory containing the executable.
  94. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  95. SET(__install__libs
  96. "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  97. "${MSVC90_CRT_DIR}/msvcm90.dll"
  98. "${MSVC90_CRT_DIR}/msvcp90.dll"
  99. "${MSVC90_CRT_DIR}/msvcr90.dll"
  100. )
  101. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  102. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  103. SET(MSVC90_CRT_DIR
  104. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  105. SET(__install__libs ${__install__libs}
  106. "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  107. "${MSVC90_CRT_DIR}/msvcm90d.dll"
  108. "${MSVC90_CRT_DIR}/msvcp90d.dll"
  109. "${MSVC90_CRT_DIR}/msvcr90d.dll"
  110. )
  111. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  112. ENDIF(MSVC90)
  113. IF(MSVC10)
  114. # Find the runtime library redistribution directory.
  115. FIND_PATH(MSVC10_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT
  116. PATHS
  117. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]/../../VC/redist"
  118. "${base_dir}/VC/redist"
  119. )
  120. MARK_AS_ADVANCED(MSVC10_REDIST_DIR)
  121. SET(MSVC10_CRT_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.CRT")
  122. # Install the manifest that allows DLLs to be loaded from the
  123. # directory containing the executable.
  124. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  125. SET(__install__libs
  126. "${MSVC10_CRT_DIR}/Microsoft.VC100.CRT.manifest"
  127. "${MSVC10_CRT_DIR}/msvcp100.dll"
  128. "${MSVC10_CRT_DIR}/msvcr100.dll"
  129. )
  130. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  131. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  132. SET(MSVC10_CRT_DIR
  133. "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  134. SET(__install__libs ${__install__libs}
  135. "${MSVC10_CRT_DIR}/Microsoft.VC100.DebugCRT.manifest"
  136. "${MSVC10_CRT_DIR}/msvcp100d.dll"
  137. "${MSVC10_CRT_DIR}/msvcr100d.dll"
  138. )
  139. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  140. ENDIF(MSVC10)
  141. IF(CMAKE_INSTALL_MFC_LIBRARIES)
  142. IF(MSVC70)
  143. SET(__install__libs ${__install__libs}
  144. "${SYSTEMROOT}/system32/mfc70.dll"
  145. )
  146. ENDIF(MSVC70)
  147. IF(MSVC71)
  148. SET(__install__libs ${__install__libs}
  149. "${SYSTEMROOT}/system32/mfc71.dll"
  150. )
  151. ENDIF(MSVC71)
  152. IF(MSVC80)
  153. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  154. SET(MSVC80_MFC_DIR
  155. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  156. SET(__install__libs ${__install__libs}
  157. "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  158. "${MSVC80_MFC_DIR}/mfc80d.dll"
  159. "${MSVC80_MFC_DIR}/mfc80ud.dll"
  160. "${MSVC80_MFC_DIR}/mfcm80d.dll"
  161. "${MSVC80_MFC_DIR}/mfcm80ud.dll"
  162. )
  163. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  164. SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  165. # Install the manifest that allows DLLs to be loaded from the
  166. # directory containing the executable.
  167. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  168. SET(__install__libs ${__install__libs}
  169. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  170. "${MSVC80_MFC_DIR}/mfc80.dll"
  171. "${MSVC80_MFC_DIR}/mfc80u.dll"
  172. "${MSVC80_MFC_DIR}/mfcm80.dll"
  173. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  174. )
  175. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  176. # include the language dll's for vs8 as well as the actuall dll's
  177. SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  178. # Install the manifest that allows DLLs to be loaded from the
  179. # directory containing the executable.
  180. SET(__install__libs ${__install__libs}
  181. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  182. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  183. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  184. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  185. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  186. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  187. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  188. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  189. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  190. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  191. )
  192. ENDIF(MSVC80)
  193. IF(MSVC90)
  194. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  195. SET(MSVC90_MFC_DIR
  196. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  197. SET(__install__libs ${__install__libs}
  198. "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  199. "${MSVC90_MFC_DIR}/mfc90d.dll"
  200. "${MSVC90_MFC_DIR}/mfc90ud.dll"
  201. "${MSVC90_MFC_DIR}/mfcm90d.dll"
  202. "${MSVC90_MFC_DIR}/mfcm90ud.dll"
  203. )
  204. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  205. SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  206. # Install the manifest that allows DLLs to be loaded from the
  207. # directory containing the executable.
  208. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  209. SET(__install__libs ${__install__libs}
  210. "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  211. "${MSVC90_MFC_DIR}/mfc90.dll"
  212. "${MSVC90_MFC_DIR}/mfc90u.dll"
  213. "${MSVC90_MFC_DIR}/mfcm90.dll"
  214. "${MSVC90_MFC_DIR}/mfcm90u.dll"
  215. )
  216. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  217. # include the language dll's for vs9 as well as the actuall dll's
  218. SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  219. # Install the manifest that allows DLLs to be loaded from the
  220. # directory containing the executable.
  221. SET(__install__libs ${__install__libs}
  222. "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  223. "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
  224. "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
  225. "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
  226. "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
  227. "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
  228. "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
  229. "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
  230. "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
  231. "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
  232. )
  233. ENDIF(MSVC90)
  234. IF(MSVC10)
  235. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  236. SET(MSVC10_MFC_DIR
  237. "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC100.DebugMFC")
  238. SET(__install__libs ${__install__libs}
  239. "${MSVC10_MFC_DIR}/Microsoft.VC100.DebugMFC.manifest"
  240. "${MSVC10_MFC_DIR}/mfc100d.dll"
  241. "${MSVC10_MFC_DIR}/mfc100ud.dll"
  242. "${MSVC10_MFC_DIR}/mfcm100d.dll"
  243. "${MSVC10_MFC_DIR}/mfcm100ud.dll"
  244. )
  245. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  246. SET(MSVC10_MFC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFC")
  247. # Install the manifest that allows DLLs to be loaded from the
  248. # directory containing the executable.
  249. IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  250. SET(__install__libs ${__install__libs}
  251. "${MSVC10_MFC_DIR}/Microsoft.VC100.MFC.manifest"
  252. "${MSVC10_MFC_DIR}/mfc100.dll"
  253. "${MSVC10_MFC_DIR}/mfc100u.dll"
  254. "${MSVC10_MFC_DIR}/mfcm100.dll"
  255. "${MSVC10_MFC_DIR}/mfcm100u.dll"
  256. )
  257. ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
  258. # include the language dll's for vs10 as well as the actuall dll's
  259. SET(MSVC10_MFCLOC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFCLOC")
  260. # Install the manifest that allows DLLs to be loaded from the
  261. # directory containing the executable.
  262. SET(__install__libs ${__install__libs}
  263. "${MSVC10_MFCLOC_DIR}/Microsoft.VC100.MFCLOC.manifest"
  264. "${MSVC10_MFCLOC_DIR}/mfc100chs.dll"
  265. "${MSVC10_MFCLOC_DIR}/mfc100cht.dll"
  266. "${MSVC10_MFCLOC_DIR}/mfc100enu.dll"
  267. "${MSVC10_MFCLOC_DIR}/mfc100esp.dll"
  268. "${MSVC10_MFCLOC_DIR}/mfc100deu.dll"
  269. "${MSVC10_MFCLOC_DIR}/mfc100fra.dll"
  270. "${MSVC10_MFCLOC_DIR}/mfc100ita.dll"
  271. "${MSVC10_MFCLOC_DIR}/mfc100jpn.dll"
  272. "${MSVC10_MFCLOC_DIR}/mfc100kor.dll"
  273. )
  274. ENDIF(MSVC10)
  275. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  276. FOREACH(lib
  277. ${__install__libs}
  278. )
  279. IF(EXISTS ${lib})
  280. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  281. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  282. ENDIF(EXISTS ${lib})
  283. ENDFOREACH(lib)
  284. ENDIF(MSVC)
  285. # Include system runtime libraries in the installation if any are
  286. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  287. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  288. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  289. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  290. IF(WIN32)
  291. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
  292. ELSE(WIN32)
  293. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
  294. ENDIF(WIN32)
  295. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
  296. INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
  297. DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION})
  298. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  299. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)