From 5966bee90f094f50c5b471ef6a0bb9f071ff2272 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Tue, 6 Dec 2011 11:36:50 +0000 Subject: [PATCH] Patch from Benjamin Piwowarski set the compiler to gcc for Xcode (based on Xcode version) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40393 a592a061-630c-0410-9148-cb99ea01b6c8 --- CMakeLists.txt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bdf7ae0aad..ae43c8933d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,7 +443,7 @@ if(LYX_HUNSPELL) endif() if(LYX_NLS) - FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python HINTS ${GNUWIN32_DIR}/python) + FIND_PROGRAM(LYX_PYTHON_EXECUTABLE python2 python HINTS ${GNUWIN32_DIR}/python) if(${LYX_PYTHON_EXECUTABLE} MATCHES "-NOTFOUND") message(FATAL_ERROR "Python 2.6 needed!") endif() @@ -625,6 +625,21 @@ if(LYX_DEBUG_GLIBC_PEDANTIC) set(_GLIBCXX_DEBUG_PEDANTIC ON) endif() +# Xcode compiler +if (CMAKE_GENERATOR MATCHES Xcode) + # Automatically select the Xcode compiler if not set + if (NOT DEFINED CMAKE_XCODE_ATTRIBUTE_GCC_VERSION) + # XCode >= 3.1 has gcc 4.2 (up to actual Xcode) + if (XCODE_VERSION VERSION_GREATER "3.1") + SET(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") + ENDIF(XCODE_VERSION VERSION_GREATER "3.1") + ENDIF(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_GCC_VERSION) + + # Print the selected compiler version + MESSAGE(STATUS "---- Using XCode compiler CMAKE_XCODE_ATTRIBUTE_GCC_VERSION=${CMAKE_XCODE_ATTRIBUTE_GCC_VERSION}") +ENDIF(CMAKE_GENERATOR MATCHES Xcode) + + # compiler tests, config.h generation if(MSVC AND NOT LYX_CONFIGURE_CHECKS) configure_file(${LYX_CMAKE_DIR}/configCompiler.h.msvc ${TOP_BINARY_DIR}/configCompiler.h)