diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-07-06 20:49:19 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-07-06 20:49:19 +0000 |
commit | 76583391c09f168a8ef4b16ccf4eb19ab50693aa (patch) | |
tree | 520e5e3672e03e48ba6e5645b8178f2e2e249fc7 | |
parent | 36b0012e90b8e1e4f974e368177557065750c147 (diff) | |
download | extra-cmake-modules-76583391c09f168a8ef4b16ccf4eb19ab50693aa.tar.gz extra-cmake-modules-76583391c09f168a8ef4b16ccf4eb19ab50693aa.tar.bz2 |
-fix gcc version detection on Mac
CCMAIL: rangerrick@gmail.com
Can you please check that this works now for you ?
svn path=/trunk/KDE/kdelibs/; revision=559236
-rw-r--r-- | modules/FindKDE4Internal.cmake | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index cf7c502a..7941df0f 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -593,14 +593,20 @@ if (CMAKE_COMPILER_IS_GNUCXX) # visibility support check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY) -# get information about gcc - exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_info) + # get the gcc version + exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) - string (REGEX MATCH " [34]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_info}") + string (REGEX MATCH " [34]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") + # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here: + if (NOT _gcc_version) + string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}") + endif (NOT _gcc_version) + macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1) if (GCC_IS_NEWER_THAN_4_1) - string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_info}") + exec_program(${CMAKE_C_COMPILER} ARGS -v OUTPUT_VARIABLE _gcc_alloc_info) + string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}") else (GCC_IS_NEWER_THAN_4_1) set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE) endif (GCC_IS_NEWER_THAN_4_1) |