From 3c1c3358005ebfb1afc8b97a3356d99a9f5cf7fd Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 2 Jul 2007 12:46:55 -0400 Subject: BUG: with MS Visual Studio currently there is no compiler id, so check the generator too Alex --- Modules/CMakeFindBinUtils.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake index 0527397..47ac5c3 100644 --- a/Modules/CMakeFindBinUtils.cmake +++ b/Modules/CMakeFindBinUtils.cmake @@ -18,7 +18,10 @@ # if it's the MS C/CXX compiler, search for link -IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC") +IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" + OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" + OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") + FIND_PROGRAM(CMAKE_LINKER NAMES link PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) FIND_PROGRAM(CMAKE_LINKER NAMES link) @@ -29,7 +32,9 @@ IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES MARK_AS_ADVANCED(CMAKE_LINKER) # in all other cases search for ar, ranlib, etc. -ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC") +ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" + OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" + OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH) FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar) @@ -47,7 +52,9 @@ ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCH FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld) MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER) -ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC") +ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" + OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" + OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") # on Apple there really should be install_name_tool -- cgit v0.12