InstallRequiredSystemLibraries.cmake 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Hack for Visual Studio support
  2. # Search for system runtime libraries based on the platform. This is
  3. # not complete because it is used only for the release process by the
  4. # developers.
  5. IF(MSVC)
  6. FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
  7. IF(MSVC70)
  8. SET(__install__libs
  9. "${SYSTEMROOT}/system32/msvcp70.dll"
  10. "${SYSTEMROOT}/system32/msvcr70.dll"
  11. )
  12. ENDIF(MSVC70)
  13. IF(MSVC71)
  14. SET(__install__libs
  15. "${SYSTEMROOT}/system32/msvcp71.dll"
  16. "${SYSTEMROOT}/system32/msvcr71.dll"
  17. )
  18. ENDIF(MSVC71)
  19. IF(MSVC80)
  20. # Find the runtime library redistribution directory.
  21. FIND_PATH(MSVC80_REDIST_DIR NAMES x86/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
  22. PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
  23. )
  24. MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
  25. SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/x86/Microsoft.VC80.CRT")
  26. # Install the manifest that allows DLLs to be loaded from the
  27. # directory containing the executable.
  28. SET(__install__libs
  29. "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
  30. "${MSVC80_CRT_DIR}/msvcm80.dll"
  31. "${MSVC80_CRT_DIR}/msvcp80.dll"
  32. "${MSVC80_CRT_DIR}/msvcr80.dll"
  33. )
  34. ENDIF(MSVC80)
  35. IF(CMAKE_INSTALL_MFC_LIBRARIES)
  36. IF(MSVC70)
  37. SET(__install__libs ${__install__libs}
  38. "${SYSTEMROOT}/system32/mfc70.dll"
  39. )
  40. ENDIF(MSVC70)
  41. IF(MSVC71)
  42. SET(__install__libs ${__install__libs}
  43. "${SYSTEMROOT}/system32/mfc71.dll"
  44. )
  45. ENDIF(MSVC71)
  46. IF(MSVC80)
  47. SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/x86/Microsoft.VC80.MFC")
  48. # Install the manifest that allows DLLs to be loaded from the
  49. # directory containing the executable.
  50. SET(__install__libs ${__install__libs}
  51. "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
  52. "${MSVC80_MFC_DIR}/mfc80.dll"
  53. "${MSVC80_MFC_DIR}/mfc80u.dll"
  54. "${MSVC80_MFC_DIR}/mfcm80.dll"
  55. "${MSVC80_MFC_DIR}/mfcm80u.dll"
  56. )
  57. ENDIF(MSVC80)
  58. IF(MSVC80)
  59. # include the language dll's for vs8 as well as the actuall dll's
  60. SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/x86/Microsoft.VC80.MFCLOC")
  61. # Install the manifest that allows DLLs to be loaded from the
  62. # directory containing the executable.
  63. SET(__install__libs ${__install__libs}
  64. "${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
  65. "${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
  66. "${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
  67. "${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
  68. "${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
  69. "${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
  70. "${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
  71. "${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
  72. "${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
  73. "${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
  74. )
  75. ENDIF(MSVC80)
  76. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  77. FOREACH(lib
  78. ${__install__libs}
  79. )
  80. IF(EXISTS ${lib})
  81. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  82. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  83. ENDIF(EXISTS ${lib})
  84. ENDFOREACH(lib)
  85. ENDIF(MSVC)
  86. # Include system runtime libraries in the installation if any are
  87. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  88. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  89. IF(WIN32)
  90. INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  91. ELSE(WIN32)
  92. INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  93. ENDIF(WIN32)
  94. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)