diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-18 13:22:04 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-06-18 13:22:04 (GMT) |
commit | a2e5cb25e7066eb6c39c627793bdb5b213c0d004 (patch) | |
tree | 74c973f147d4854216f989134aa5c26c2ec1681c /Modules/FindKDE3.cmake | |
parent | bf3598bab440bc1fde01e6ddd3b8377e94758e0c (diff) | |
download | CMake-a2e5cb25e7066eb6c39c627793bdb5b213c0d004.zip CMake-a2e5cb25e7066eb6c39c627793bdb5b213c0d004.tar.gz CMake-a2e5cb25e7066eb6c39c627793bdb5b213c0d004.tar.bz2 |
ENH: fix for findall
Diffstat (limited to 'Modules/FindKDE3.cmake')
-rw-r--r-- | Modules/FindKDE3.cmake | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index aeba824..543ec7d 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -82,25 +82,35 @@ FIND_PACKAGE(X11 ${_REQ_STRING_KDE3}) #add some KDE specific stuff SET(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE) +set(_KDE3_USE_FLAGS FALSE) +if(CMAKE_COMPILER_IS_GNUCXX) + set(_KDE3_USE_FLAGS TRUE) # use flags for gnu compiler + execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version + OUTPUT_VARIABLE out) + # gnu 2.96 does not work with flags + if(out MATCHES 2.96) + set(_KDE3_NO_FLAGS FALSE) + endif(out MATCHES 2.96) +endif(CMAKE_COMPILER_IS_GNUCXX) #only on linux, but NOT e.g. on FreeBSD: -IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCXX) +IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_NO_FLAGS) SET (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common") -ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCXX) +ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_NO_FLAGS) # works on FreeBSD, NOT tested on NetBSD and OpenBSD -IF (CMAKE_SYSTEM_NAME MATCHES BSD AND CMAKE_COMPILER_IS_GNUCXX) +IF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_NO_FLAGS) SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common") SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common") -ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD AND CMAKE_COMPILER_IS_GNUCXX) +ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_NO_FLAGS) # if no special buildtype is selected, add -O2 as default optimization -IF (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) +IF (NOT CMAKE_BUILD_TYPE AND _KDE3_NO_FLAGS) SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") -ENDIF (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) +ENDIF (NOT CMAKE_BUILD_TYPE AND _KDE3_NO_FLAGS) #SET(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined") |