aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/FindKDE4Internal.cmake14
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)