InstallRequiredSystemLibraries.cmake 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. # By including this file, all files in the CMAKE_INSTALL_DEBUG_LIBRARIES,
  2. # will be installed with INSTALL_PROGRAMS into /bin for WIN32 and /lib
  3. # for non-win32. If CMAKE_SKIP_INSTALL_RULES is set to TRUE before including
  4. # this file, then the INSTALL command is not called. The use can use
  5. # the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a custom install
  6. # command and install them into any directory they want.
  7. # If it is the MSVC compiler, then the microsoft run
  8. # time libraries will be found add automatically added to the
  9. # CMAKE_INSTALL_DEBUG_LIBRARIES, and installed.
  10. # If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
  11. # compiler, then the debug libraries are installed when available.
  12. # If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
  13. # libraries are installed as well as the CRT run time libraries.
  14. IF(MSVC)
  15. FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  16. IF(MSVC70)
  17. SET(__install__libs
  18. "${SYSTEMROOT}/system32/msvcp70.dll"
  19. "${SYSTEMROOT}/system32/msvcr70.dll"
  20. )
  21. ENDIF(MSVC70)
  22. IF(MSVC71)
  23. SET(__install__libs
  24. "${SYSTEMROOT}/system32/msvcp71.dll"
  25. "${SYSTEMROOT}/system32/msvcr71.dll"
  26. )
  27. ENDIF(MSVC71)
  28. IF(CMAKE_CL_64)
  29. SET(CMAKE_MSVC_ARCH amd64)
  30. ELSE(CMAKE_CL_64)
  31. SET(CMAKE_MSVC_ARCH x86)
  32. ENDIF(CMAKE_CL_64)
  33. GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
  34. GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
  35. IF(MSVC80)
  36. # Find the runtime library redistribution directory.
  37. FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  38. PATHS
  39. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
  40. "${base_dir}/VC/redist"
  41. )
  42. MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
  43. SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  44. # Install the manifest that allows DLLs to be loaded from the
  45. # directory containing the executable.
  46. SET(__install__libs
  47. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  48. "${MSVC80_CRT_DIR}/msvcm80.dll"
  49. "${MSVC80_CRT_DIR}/msvcp80.dll"
  50. "${MSVC80_CRT_DIR}/msvcr80.dll"
  51. )
  52. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  53. SET(MSVC80_CRT_DIR
  54. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  55. SET(__install__libs ${__install__libs}
  56. "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  57. "${MSVC80_CRT_DIR}/msvcm80d.dll"
  58. "${MSVC80_CRT_DIR}/msvcp80d.dll"
  59. "${MSVC80_CRT_DIR}/msvcr80d.dll"
  60. )
  61. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  62. ENDIF(MSVC80)
  63. IF(MSVC90)
  64. # Find the runtime library redistribution directory.
  65. FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  66. PATHS
  67. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
  68. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
  69. "${base_dir}/VC/redist"
  70. )
  71. MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
  72. SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  73. # Install the manifest that allows DLLs to be loaded from the
  74. # directory containing the executable.
  75. SET(__install__libs
  76. "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  77. "${MSVC90_CRT_DIR}/msvcm90.dll"
  78. "${MSVC90_CRT_DIR}/msvcp90.dll"
  79. "${MSVC90_CRT_DIR}/msvcr90.dll"
  80. )
  81. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  82. SET(MSVC90_CRT_DIR
  83. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  84. SET(__install__libs ${__install__libs}
  85. "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  86. "${MSVC90_CRT_DIR}/msvcm90d.dll"
  87. "${MSVC90_CRT_DIR}/msvcp90d.dll"
  88. "${MSVC90_CRT_DIR}/msvcr90d.dll"
  89. )
  90. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  91. ENDIF(MSVC90)
  92. IF(CMAKE_INSTALL_MFC_LIBRARIES)
  93. IF(MSVC70)
  94. SET(__install__libs ${__install__libs}
  95. "${SYSTEMROOT}/system32/mfc70.dll"
  96. )
  97. ENDIF(MSVC70)
  98. IF(MSVC71)
  99. SET(__install__libs ${__install__libs}
  100. "${SYSTEMROOT}/system32/mfc71.dll"
  101. )
  102. ENDIF(MSVC71)
  103. IF(MSVC80)
  104. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  105. SET(MSVC80_MFC_DIR
  106. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  107. SET(__install__libs ${__install__libs}
  108. "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  109. "${MSVC80_MFC_DIR}/mfc80d.dll"
  110. "${MSVC80_MFC_DIR}/mfc80ud.dll"
  111. "${MSVC80_MFC_DIR}/mfcm80d.dll"
  112. "${MSVC80_MFC_DIR}/mfcm80ud.dll"
  113. )
  114. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  115. SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  116. # Install the manifest that allows DLLs to be loaded from the
  117. # directory containing the executable.
  118. SET(__install__libs ${__install__libs}
  119. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  120. "${MSVC80_MFC_DIR}/mfc80.dll"
  121. "${MSVC80_MFC_DIR}/mfc80u.dll"
  122. "${MSVC80_MFC_DIR}/mfcm80.dll"
  123. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  124. )
  125. # include the language dll's for vs8 as well as the actuall dll's
  126. SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  127. # Install the manifest that allows DLLs to be loaded from the
  128. # directory containing the executable.
  129. SET(__install__libs ${__install__libs}
  130. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  131. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  132. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  133. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  134. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  135. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  136. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  137. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  138. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  139. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  140. )
  141. ENDIF(MSVC80)
  142. IF(MSVC90)
  143. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  144. SET(MSVC90_MFC_DIR
  145. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  146. SET(__install__libs ${__install__libs}
  147. "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  148. "${MSVC90_MFC_DIR}/mfc90d.dll"
  149. "${MSVC90_MFC_DIR}/mfc90ud.dll"
  150. "${MSVC90_MFC_DIR}/mfcm90d.dll"
  151. "${MSVC90_MFC_DIR}/mfcm90ud.dll"
  152. )
  153. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  154. SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  155. # Install the manifest that allows DLLs to be loaded from the
  156. # directory containing the executable.
  157. SET(__install__libs ${__install__libs}
  158. "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  159. "${MSVC90_MFC_DIR}/mfc90.dll"
  160. "${MSVC90_MFC_DIR}/mfc90u.dll"
  161. "${MSVC90_MFC_DIR}/mfcm90.dll"
  162. "${MSVC90_MFC_DIR}/mfcm90u.dll"
  163. )
  164. # include the language dll's for vs9 as well as the actuall dll's
  165. SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  166. # Install the manifest that allows DLLs to be loaded from the
  167. # directory containing the executable.
  168. SET(__install__libs ${__install__libs}
  169. "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  170. "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
  171. "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
  172. "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
  173. "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
  174. "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
  175. "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
  176. "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
  177. "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
  178. "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
  179. )
  180. ENDIF(MSVC90)
  181. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  182. FOREACH(lib
  183. ${__install__libs}
  184. )
  185. IF(EXISTS ${lib})
  186. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  187. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  188. ENDIF(EXISTS ${lib})
  189. ENDFOREACH(lib)
  190. ENDIF(MSVC)
  191. # Include system runtime libraries in the installation if any are
  192. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  193. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  194. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  195. IF(WIN32)
  196. INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  197. ELSE(WIN32)
  198. INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  199. ENDIF(WIN32)
  200. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  201. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)