diff --git a/CMakeLists.txt b/CMakeLists.txt index d1b448ca3a..63b4ea20d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -260,7 +260,7 @@ if(NOT CXX11COMPILER_FOUND) endif() set(LYX_GCC11_MODE) if(UNIX OR MINGW) - if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$") + if (CMAKE_CXX_COMPILER_ID MATCHES "^([cC]lang|AppleClang)$") # ignore the GCC_VERSION for clang # and use the resulting CXX11_STD_REGEX found in FindCXX11Compiler.cmake message(STATUS "Using clang") diff --git a/development/cmake/modules/FindCXX11Compiler.cmake b/development/cmake/modules/FindCXX11Compiler.cmake index 5c7b69866e..739d267bf0 100644 --- a/development/cmake/modules/FindCXX11Compiler.cmake +++ b/development/cmake/modules/FindCXX11Compiler.cmake @@ -34,7 +34,7 @@ INCLUDE(CheckCXXSourceCompiles) INCLUDE(FindPackageHandleStandardArgs) -if (CMAKE_CXX_COMPILER_ID MATCHES "^[cC]lang$") +if (CMAKE_CXX_COMPILER_ID MATCHES "^([cC]lang|AppleClang)$") set(CXX11_FLAG_CANDIDATES "--std=c++11 -Wno-deprecated-register") else() if (CYGWIN)