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}")