blob: 8e5546a851f2fbd23ee614fd390d7fd66bc7a8ac [file] [log] [blame]
Carlos Hernandez7faaa9f2014-08-05 17:53:32 -07001include(CMakeDetermineVSServicePack)
2
3# The code is almost identical to the CMake version. The only difference is that we remove
4# _DetermineVSServicePack_FastCheckVersionWithCompiler which lead to errors on some systems.
5function(EigenDetermineVSServicePack _pack)
6 if(NOT DETERMINED_VS_SERVICE_PACK OR NOT ${_pack})
7
8 if(NOT DETERMINED_VS_SERVICE_PACK)
9 _DetermineVSServicePack_CheckVersionWithTryCompile(DETERMINED_VS_SERVICE_PACK _cl_version)
10 if(NOT DETERMINED_VS_SERVICE_PACK)
11 _DetermineVSServicePack_CheckVersionWithTryRun(DETERMINED_VS_SERVICE_PACK _cl_version)
12 endif()
13 endif()
14
15 if(DETERMINED_VS_SERVICE_PACK)
16
17 if(_cl_version)
18 # Call helper function to determine VS version
19 _DetermineVSServicePackFromCompiler(_sp "${_cl_version}")
20 if(_sp)
21 set(${_pack} ${_sp} CACHE INTERNAL
22 "The Visual Studio Release with Service Pack")
23 endif()
24 endif()
25 endif()
26 endif()
27endfunction()