Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkFunctionGetMSVCVersion.cmake
Go to the documentation of this file.
1 #! \brief Get diverse visual studio ids not directly provided by CMake
2 #!
3 #! Sets the following variables in the parent scope
4 #! VISUAL_STUDIO_VERSION_MAJOR - The Visual Studio Version
5 #! VISUAL_STUDIO_PRODUCT_NAME - The Visual Studio Product Name
6 
8 
9 if(MSVC)
10  if(MSVC_VERSION EQUAL 1600)
11  set(VISUAL_STUDIO_VERSION_MAJOR "10" PARENT_SCOPE)
12  set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2010" PARENT_SCOPE)
13  elseif(MSVC_VERSION EQUAL 1700)
14  set(VISUAL_STUDIO_VERSION_MAJOR "11" PARENT_SCOPE)
15  set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2012" PARENT_SCOPE)
16  elseif(MSVC_VERSION EQUAL 1800)
17  set(VISUAL_STUDIO_VERSION_MAJOR "12" PARENT_SCOPE)
18  set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2013" PARENT_SCOPE)
19  elseif(MSVC_VERSION EQUAL 1900)
20  set(VISUAL_STUDIO_VERSION_MAJOR "14" PARENT_SCOPE)
21  set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2015" PARENT_SCOPE)
22  else()
23  message(WARNING "Unknown Visual Studio version, some functionality might not be available. Please update mitkFunctionGetMSVCVersion.cmake.")
24  endif()
25 
26  if("${CMAKE_GENERATOR}" MATCHES ".*Win64")
27  set(CMAKE_LIBRARY_ARCHITECTURE x64 PARENT_SCOPE)
28  else()
29  set(CMAKE_LIBRARY_ARCHITECTURE x86 PARENT_SCOPE)
30  endif()
31 endif()
32 
33 endfunction()
mitkFunctionGetMSVCVersion()
Get diverse visual studio ids not directly provided by CMake.