From eec9a0662a87a0db77a350c3e392e380887c08f1 Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Thu, 9 Jan 2014 19:42:01 +0100 Subject: [PATCH] continued : further correction on mac The issue was the detection of clang version on mac, depends if packaged by Apple or not... --- cmake/FindCompilerCheck.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmake/FindCompilerCheck.cmake b/cmake/FindCompilerCheck.cmake index 0c514d15..bdc9daba 100644 --- a/cmake/FindCompilerCheck.cmake +++ b/cmake/FindCompilerCheck.cmake @@ -34,8 +34,12 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Apple which does not has the official clang version number ... string(REGEX REPLACE ".*LLVM ([2-5]\\.[0-9]).*" "\\1" compiler_version ${_compiler_output}) + # but this does not work if clang is not from Apple (compiled manually on the mac) + if (NOT ${compiler_version}) + string(REGEX REPLACE ".* version ([2-5]\\.[0-9]).*" "\\1" compiler_version ${_compiler_output}) + endif() else() - string(REGEX REPLACE ".*([2-5]\\.[0-9]).*" "\\1" compiler_version ${_compiler_output}) + string(REGEX REPLACE ".* version ([2-5]\\.[0-9]).*" "\\1" compiler_version ${_compiler_output}) endif() #message(STATUS "Compiler --version output = ${_compiler_output}") message(STATUS "Compiler version = ${compiler_version}")