InstallRequiredSystemLibraries.cmake 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. )
  54. ENDIF(MSVC80)
  55. ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
  56. FOREACH(lib
  57. ${__install__libs}
  58. )
  59. IF(EXISTS ${lib})
  60. SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
  61. ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
  62. ENDIF(EXISTS ${lib})
  63. ENDFOREACH(lib)
  64. ENDIF(MSVC)
  65. # Include system runtime libraries in the installation if any are
  66. # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
  67. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
  68. IF(WIN32)
  69. INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  70. ELSE(WIN32)
  71. INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
  72. ENDIF(WIN32)
  73. ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)