InstallRequiredSystemLibraries.cmake 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. IF(MSVC80)
  34. # Find the runtime library redistribution directory.
  35. FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  36. PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
  37. )
  38. MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
  39. SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
  40. # Install the manifest that allows DLLs to be loaded from the
  41. # directory containing the executable.
  42. SET(__install__libs
  43. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  44. "${MSVC80_CRT_DIR}/msvcm80.dll"
  45. "${MSVC80_CRT_DIR}/msvcp80.dll"
  46. "${MSVC80_CRT_DIR}/msvcr80.dll"
  47. )
  48. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  49. SET(MSVC80_CRT_DIR
  50. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
  51. SET(__install__libs ${__install__libs}
  52. "${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
  53. "${MSVC80_CRT_DIR}/msvcm80d.dll"
  54. "${MSVC80_CRT_DIR}/msvcp80d.dll"
  55. "${MSVC80_CRT_DIR}/msvcr80d.dll"
  56. )
  57. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  58. ENDIF(MSVC80)
  59. IF(MSVC90)
  60. # Find the runtime library redistribution directory.
  61. FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
  62. PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
  63. "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
  64. )
  65. MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
  66. SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
  67. # Install the manifest that allows DLLs to be loaded from the
  68. # directory containing the executable.
  69. SET(__install__libs
  70. "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
  71. "${MSVC90_CRT_DIR}/msvcm90.dll"
  72. "${MSVC90_CRT_DIR}/msvcp90.dll"
  73. "${MSVC90_CRT_DIR}/msvcr90.dll"
  74. )
  75. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  76. SET(MSVC90_CRT_DIR
  77. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
  78. SET(__install__libs ${__install__libs}
  79. "${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
  80. "${MSVC90_CRT_DIR}/msvcm90d.dll"
  81. "${MSVC90_CRT_DIR}/msvcp90d.dll"
  82. "${MSVC90_CRT_DIR}/msvcr90d.dll"
  83. )
  84. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  85. ENDIF(MSVC90)
  86. IF(CMAKE_INSTALL_MFC_LIBRARIES)
  87. IF(MSVC70)
  88. SET(__install__libs ${__install__libs}
  89. "${SYSTEMROOT}/system32/mfc70.dll"
  90. )
  91. ENDIF(MSVC70)
  92. IF(MSVC71)
  93. SET(__install__libs ${__install__libs}
  94. "${SYSTEMROOT}/system32/mfc71.dll"
  95. )
  96. ENDIF(MSVC71)
  97. IF(MSVC80)
  98. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  99. SET(MSVC80_MFC_DIR
  100. "${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
  101. SET(__install__libs ${__install__libs}
  102. "${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
  103. "${MSVC80_MFC_DIR}/mfc80d.dll"
  104. "${MSVC80_MFC_DIR}/mfc80ud.dll"
  105. "${MSVC80_MFC_DIR}/mfcm80d.dll"
  106. "${MSVC80_MFC_DIR}/mfcm80ud.dll"
  107. )
  108. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  109. SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
  110. # Install the manifest that allows DLLs to be loaded from the
  111. # directory containing the executable.
  112. SET(__install__libs ${__install__libs}
  113. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  114. "${MSVC80_MFC_DIR}/mfc80.dll"
  115. "${MSVC80_MFC_DIR}/mfc80u.dll"
  116. "${MSVC80_MFC_DIR}/mfcm80.dll"
  117. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  118. )
  119. # include the language dll's for vs8 as well as the actuall dll's
  120. SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
  121. # Install the manifest that allows DLLs to be loaded from the
  122. # directory containing the executable.
  123. SET(__install__libs ${__install__libs}
  124. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  125. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  126. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  127. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  128. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  129. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  130. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  131. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  132. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  133. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  134. )
  135. ENDIF(MSVC80)
  136. IF(MSVC90)
  137. IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  138. SET(MSVC90_MFC_DIR
  139. "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
  140. SET(__install__libs ${__install__libs}
  141. "${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
  142. "${MSVC90_MFC_DIR}/mfc90d.dll"
  143. "${MSVC90_MFC_DIR}/mfc90ud.dll"
  144. "${MSVC90_MFC_DIR}/mfcm90d.dll"
  145. "${MSVC90_MFC_DIR}/mfcm90ud.dll"
  146. )
  147. ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
  148. SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
  149. # Install the manifest that allows DLLs to be loaded from the
  150. # directory containing the executable.
  151. SET(__install__libs ${__install__libs}
  152. "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
  153. "${MSVC90_MFC_DIR}/mfc90.dll"
  154. "${MSVC90_MFC_DIR}/mfc90u.dll"
  155. "${MSVC90_MFC_DIR}/mfcm90.dll"
  156. "${MSVC90_MFC_DIR}/mfcm90u.dll"
  157. )
  158. # include the language dll's for vs9 as well as the actuall dll's
  159. SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
  160. # Install the manifest that allows DLLs to be loaded from the
  161. # directory containing the executable.
  162. SET(__install__libs ${__install__libs}
  163. "${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
  164. "${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
  165. "${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
  166. "${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
  167. "${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
  168. "${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
  169. "${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
  170. "${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
  171. "${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
  172. "${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
  173. )
  174. ENDIF(MSVC90)
  175. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  176. FOREACH(lib
  177. ${__install__libs}
  178. )
  179. IF(EXISTS ${lib})
  180. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  181. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  182. ENDIF(EXISTS ${lib})
  183. ENDFOREACH(lib)
  184. ENDIF(MSVC)
  185. # Include system runtime libraries in the installation if any are
  186. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  187. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  188. IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  189. IF(WIN32)
  190. INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  191. ELSE(WIN32)
  192. INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  193. ENDIF(WIN32)
  194. ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
  195. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)