[Cmake-commits] [cmake-commits] alex committed FindKDE3.cmake 1.18 1.19
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Jun 18 19:02:23 EDT 2008
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv27853
Modified Files:
FindKDE3.cmake
Log Message:
BUG: modify the compiler flags only if KDE3 has actually been found
Alex
Index: FindKDE3.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindKDE3.cmake,v
retrieving revision 1.18
retrieving revision 1.19
diff -C 2 -d -r1.18 -r1.19
*** FindKDE3.cmake 18 Jun 2008 22:57:21 -0000 1.18
--- FindKDE3.cmake 18 Jun 2008 23:02:20 -0000 1.19
***************
*** 81,122 ****
- # 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 gcc 2.96 does not work with flags
- # I guess 2.95 also doesn't then
- IF("${out}" MATCHES "2.9[56]")
- SET(_KDE3_USE_FLAGS FALSE)
- ENDIF("${out}" out MATCHES "2.9[56]")
- ENDIF(CMAKE_COMPILER_IS_GNUCXX)
-
- #only on linux, but NOT e.g. on FreeBSD:
- IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_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 _KDE3_USE_FLAGS)
-
- # works on FreeBSD, NOT tested on NetBSD and OpenBSD
- IF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_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 _KDE3_USE_FLAGS)
-
- # if no special buildtype is selected, add -O2 as default optimization
- IF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
- SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
- SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
- ENDIF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
-
-
- #SET(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
- #SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
- #SET(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-
#now try to find some kde stuff
FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config
--- 81,84 ----
***************
*** 207,213 ****
)
- # KDE3Macros.cmake contains all the KDE specific macros
- INCLUDE(KDE3Macros)
-
#SET KDE3_FOUND
--- 169,172 ----
***************
*** 218,221 ****
--- 177,225 ----
ENDIF (KDE3_INCLUDE_DIR AND KDE3_LIB_DIR AND KDE3_DCOPIDL_EXECUTABLE AND KDE3_DCOPIDL2CPP_EXECUTABLE AND KDE3_KCFGC_EXECUTABLE)
+ # add some KDE specific stuff
+ SET(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
+
+ # set compiler flags only if KDE3 has actually been found
+ IF(KDE3_FOUND)
+ 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 gcc 2.96 does not work with flags
+ # I guess 2.95 also doesn't then
+ IF("${out}" MATCHES "2.9[56]")
+ SET(_KDE3_USE_FLAGS FALSE)
+ ENDIF("${out}" out MATCHES "2.9[56]")
+ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
+
+ #only on linux, but NOT e.g. on FreeBSD:
+ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND _KDE3_USE_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 _KDE3_USE_FLAGS)
+
+ # works on FreeBSD, NOT tested on NetBSD and OpenBSD
+ IF (CMAKE_SYSTEM_NAME MATCHES BSD AND _KDE3_USE_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 _KDE3_USE_FLAGS)
+
+ # if no special buildtype is selected, add -O2 as default optimization
+ IF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+ SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
+ SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+ ENDIF (NOT CMAKE_BUILD_TYPE AND _KDE3_USE_FLAGS)
+
+ #SET(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
+ #SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
+ #SET(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
+ ENDIF(KDE3_FOUND)
+
+
+ # KDE3Macros.cmake contains all the KDE specific macros
+ INCLUDE(KDE3Macros)
+
MACRO (KDE3_PRINT_RESULTS)
More information about the Cmake-commits
mailing list