From 82e7204004beb52b84e30a757b2ce926b9ecda71 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 26 Jan 2016 22:43:58 +0100 Subject: [PATCH] Changed: Works for C compilers too --- code/CMakeModules/FindMSVC.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index 5c433f429..6a8bdd33a 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -93,8 +93,13 @@ IF(NOT VC_DIR) ENDIF() IF(NOT VC_DIR) - STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${CMAKE_CXX_COMPILER}) -ENDIF(NOT VC_DIR) + IF(CMAKE_CXX_COMPILER) + SET(_COMPILER ${CMAKE_CXX_COMPILER}) + ELSE() + SET(_COMPILER ${CMAKE_C_COMPILER}) + ENDIF() + STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER}) +ENDIF() SET(VC_INCLUDE_DIR "${VC_DIR}/include") SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})