From d2749d18574b1c30ef80bfed776d9d1cf5a2e125 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 27 Sep 2013 11:05:52 +0200 Subject: [PATCH] Changed: Detect Express versions --- code/CMakeModules/FindMSVC.cmake | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index cc41ccbac..16455b02d 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -19,8 +19,13 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION) IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") SET(VC${_VERSION}_FOUND ON) + DETECT_EXPRESS_VERSION(${_VERSION}) IF(NOT MSVC_FIND_QUIETLY) - MESSAGE(STATUS "Found Visual C++ ${_VERSION} in ${VC${_VERSION}_DIR}") + SET(_VERSION_STR ${_VERSION}) + IF(MSVC_EXPRESS) + SET(_VERSION_STR "${_VERSION_STR} Express") + ENDIF(MSVC_EXPRESS) + MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}") ENDIF(NOT MSVC_FIND_QUIETLY) ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") SET(VC${_VERSION}_FOUND OFF) @@ -42,7 +47,22 @@ MACRO(DETECT_VC_VERSION _VERSION) ENDIF(VC${_VERSION}_FOUND) ENDMACRO(DETECT_VC_VERSION) -IF(MSVC11) +MACRO(DETECT_EXPRESS_VERSION _VERSION) + GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE) + + IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") + SET(MSVC_EXPRESS ON) + ENDIF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") +ENDMACRO(DETECT_EXPRESS_VERSION) + +IF(MSVC12) + DETECT_VC_VERSION("12.0") + + IF(NOT MSVC12_REDIST_DIR) + # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist + SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist") + ENDIF(NOT MSVC11_REDIST_DIR) +ELSEIF(MSVC11) DETECT_VC_VERSION("11.0") IF(NOT MSVC11_REDIST_DIR) @@ -60,7 +80,7 @@ ELSEIF(MSVC90) DETECT_VC_VERSION("9.0") ELSEIF(MSVC80) DETECT_VC_VERSION("8.0") -ENDIF(MSVC11) +ENDIF(MSVC12) # If you plan to use VC++ compilers with WINE, set VC_DIR environment variable IF(NOT VC_DIR)