You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.8 KiB

  1. include(CMakeDetermineVSServicePack)
  2. # The code is almost identical to the CMake version. The only difference is that we remove
  3. # _DetermineVSServicePack_FastCheckVersionWithCompiler which lead to errors on some systems.
  4. function(EigenDetermineVSServicePack _pack)
  5. if(NOT DETERMINED_VS_SERVICE_PACK OR NOT ${_pack})
  6. if(NOT DETERMINED_VS_SERVICE_PACK)
  7. _DetermineVSServicePack_CheckVersionWithTryCompile(DETERMINED_VS_SERVICE_PACK _cl_version)
  8. if(NOT DETERMINED_VS_SERVICE_PACK)
  9. _DetermineVSServicePack_CheckVersionWithTryRun(DETERMINED_VS_SERVICE_PACK _cl_version)
  10. endif()
  11. endif()
  12. if(DETERMINED_VS_SERVICE_PACK)
  13. if(_cl_version)
  14. # Call helper function to determine VS version
  15. _DetermineVSServicePackFromCompiler(_sp "${_cl_version}")
  16. # temporary fix, until CMake catches up
  17. if (NOT _sp)
  18. if(${_cl_version} VERSION_EQUAL "17.00.50727.1")
  19. set(_sp "vc110")
  20. elseif(${_cl_version} VERSION_EQUAL "17.00.51106.1")
  21. set(_sp "vc110sp1")
  22. elseif(${_cl_version} VERSION_EQUAL "17.00.60315.1")
  23. set(_sp "vc110sp2")
  24. elseif(${_cl_version} VERSION_EQUAL "17.00.60610.1")
  25. set(_sp "vc110sp3")
  26. else()
  27. set(_sp ${CMAKE_CXX_COMPILER_VERSION})
  28. endif()
  29. endif()
  30. if(_sp)
  31. set(${_pack} ${_sp} CACHE INTERNAL
  32. "The Visual Studio Release with Service Pack")
  33. endif()
  34. endif()
  35. endif()
  36. endif()
  37. endfunction()