indra/cmake/CopyWinLibs.cmake

changeset 1628
907de988cd77
parent 1074
92ab44e2e9f9
child 1636
893faacf26ea
     1.1 --- a/indra/cmake/CopyWinLibs.cmake	Mon Jul 11 19:31:04 2011 -0700
     1.2 +++ b/indra/cmake/CopyWinLibs.cmake	Thu Jul 14 17:34:37 2011 -0700
     1.3 @@ -5,6 +5,20 @@
     1.4  # VisualStudio. 
     1.5  
     1.6  include(CMakeCopyIfDifferent)
     1.7 +# Provide compiler version awareness
     1.8 +   if (MSVC71)
     1.9 +        set(MSVC_DIR 7.1)
    1.10 +        set(MSVC_SUFFIX 71)
    1.11 +    elseif (MSVC80)
    1.12 +        set(MSVC_DIR 8.0)
    1.13 +        set(MSVC_SUFFIX 80)
    1.14 +    elseif (MSVC90)
    1.15 +        set(MSVC_DIR 9.0)
    1.16 +        set(MSVC_SUFFIX 90)
    1.17 +    elseif (MSVC10)
    1.18 +        set(MSVC_DIR 10.0)
    1.19 +        set(MSVC_SUFFIX 100)
    1.20 +    endif (MSVC71)
    1.21  
    1.22  set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-win32")
    1.23  set(vivox_files
    1.24 @@ -331,26 +345,26 @@
    1.25  
    1.26  # Copy MS C runtime dlls, required for packaging.
    1.27  # *TODO - Adapt this to support VC9
    1.28 -if (MSVC80)
    1.29 -    FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
    1.30 +    FIND_PATH(debug_msvc_redist_path msvcr${MSVC_SUFFIX}d.dll
    1.31          PATHS
    1.32 -         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
    1.33 +        ${MSVC_DEBUG_REDIST_PATH}
    1.34 +         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSCV_DIR}\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
    1.35          NO_DEFAULT_PATH
    1.36          NO_DEFAULT_PATH
    1.37          )
    1.38  
    1.39 -    if(EXISTS ${debug_msvc8_redist_path})
    1.40 -        set(debug_msvc8_files
    1.41 -            msvcr80d.dll
    1.42 -            msvcp80d.dll
    1.43 -            Microsoft.VC80.DebugCRT.manifest
    1.44 +    if(EXISTS ${debug_msvc_redist_path})
    1.45 +        set(debug_msvc${MSVC_SUFFIX}_files
    1.46 +            msvcr${MSVC_SUFFIX}d.dll
    1.47 +            msvcp${MSVC_SUFFIX}d.dll
    1.48 +            Microsoft.VC${MSVC_SUFFIX}.DebugCRT.manifest
    1.49              )
    1.50  
    1.51          copy_if_different(
    1.52 -            ${debug_msvc8_redist_path} 
    1.53 +            ${debug_msvc_redist_path} 
    1.54              "${CMAKE_CURRENT_BINARY_DIR}/Debug"
    1.55              out_targets 
    1.56 -            ${debug_msvc8_files}
    1.57 +            ${debug_msvc_files}
    1.58              )
    1.59          set(all_targets ${all_targets} ${out_targets})
    1.60  
    1.61 @@ -360,42 +374,43 @@
    1.62              COMMAND ${PYTHON_EXECUTABLE}
    1.63              ARGS
    1.64                ${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
    1.65 -              ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
    1.66 +              ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC${MSVC_SUFFIX}.DebugCRT.manifest
    1.67                ${CMAKE_CURRENT_SOURCE_DIR}/SecondLifeDebug.exe.config
    1.68                ${debug_appconfig_file}
    1.69 -            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC80.DebugCRT.manifest
    1.70 +            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Debug/Microsoft.VC${MSVC_SUFFIX}.DebugCRT.manifest
    1.71              COMMENT "Creating debug app config file"
    1.72              )
    1.73  
    1.74 -    endif (EXISTS ${debug_msvc8_redist_path})
    1.75 +    endif (EXISTS ${debug_msvc_redist_path})
    1.76  
    1.77 -    FIND_PATH(release_msvc8_redist_path msvcr80.dll
    1.78 +    FIND_PATH(release_msvc_redist_path msvcr${MSVC_SUFFIX}.dll
    1.79          PATHS
    1.80 -         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
    1.81 +        ${MSVC_REDIST_PATH}
    1.82 +         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${MSVC_DIR}\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC${MSVC_SUFFIX}.CRT
    1.83          NO_DEFAULT_PATH
    1.84          NO_DEFAULT_PATH
    1.85          )
    1.86  
    1.87 -    if(EXISTS ${release_msvc8_redist_path})
    1.88 +    if(EXISTS ${release_msvc_redist_path})
    1.89          set(release_msvc8_files
    1.90 -            msvcr80.dll
    1.91 -            msvcp80.dll
    1.92 -            Microsoft.VC80.CRT.manifest
    1.93 +            msvcr${MSVC_SUFFIX}.dll
    1.94 +            msvcp${MSVC_SUFFIX}.dll
    1.95 +            Microsoft.VC${MSVC_SUFFIX}.CRT.manifest
    1.96              )
    1.97  
    1.98          copy_if_different(
    1.99 -            ${release_msvc8_redist_path} 
   1.100 +            ${release_msvc_redist_path} 
   1.101              "${CMAKE_CURRENT_BINARY_DIR}/Release"
   1.102              out_targets 
   1.103 -            ${release_msvc8_files}
   1.104 +            ${release_msvc_files}
   1.105              )
   1.106          set(all_targets ${all_targets} ${out_targets})
   1.107  
   1.108          copy_if_different(
   1.109 -            ${release_msvc8_redist_path} 
   1.110 +            ${release_msvc_redist_path} 
   1.111              "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
   1.112              out_targets 
   1.113 -            ${release_msvc8_files}
   1.114 +            ${release_msvc_files}
   1.115              )
   1.116          set(all_targets ${all_targets} ${out_targets})
   1.117  
   1.118 @@ -405,10 +420,10 @@
   1.119              COMMAND ${PYTHON_EXECUTABLE}
   1.120              ARGS
   1.121                ${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
   1.122 -              ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
   1.123 +              ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC${MSVC_SUFFIX}.CRT.manifest
   1.124                ${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
   1.125                ${release_appconfig_file}
   1.126 -            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
   1.127 +            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC${MSVC_SUFFIX}.CRT.manifest
   1.128              COMMENT "Creating release app config file"
   1.129              )
   1.130  
   1.131 @@ -418,15 +433,14 @@
   1.132              COMMAND ${PYTHON_EXECUTABLE}
   1.133              ARGS
   1.134                ${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
   1.135 -              ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
   1.136 +              ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC${MSVC_SUFFIX}.CRT.manifest
   1.137                ${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
   1.138                ${relwithdebinfo_appconfig_file}
   1.139 -            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC80.CRT.manifest
   1.140 +            DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/Microsoft.VC${MSVC_SUFFIX}.CRT.manifest
   1.141              COMMENT "Creating relwithdebinfo app config file"
   1.142              )
   1.143            
   1.144 -    endif (EXISTS ${release_msvc8_redist_path})
   1.145 -endif (MSVC80)
   1.146 +    endif (EXISTS ${release_msvc_redist_path})
   1.147  
   1.148  add_custom_target(copy_win_libs ALL
   1.149    DEPENDS 

mercurial