[cmake-commits] alex committed FindKDE3.cmake 1.7 1.8

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Oct 23 19:04:55 EDT 2006


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv20498

Modified Files:
	FindKDE3.cmake 
Log Message:
BUG: fix #3955: add -O2 by default but only if no special buildtype is set

Alex


Index: FindKDE3.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindKDE3.cmake,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- FindKDE3.cmake	27 Aug 2006 19:34:24 -0000	1.7
+++ FindKDE3.cmake	23 Oct 2006 23:04:52 -0000	1.8
@@ -83,16 +83,22 @@
 #only on linux, but NOT e.g. on FreeBSD:
 IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
    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 -O2 -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 -O2 -Wformat-security -fno-exceptions -fno-check-new -fno-common")
+   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")
 
 # works on FreeBSD, NOT tested on NetBSD and OpenBSD
 IF (CMAKE_SYSTEM_NAME MATCHES BSD)
-   SET ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -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 -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
+   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)
 
+# if no special buildtype is selected, add -O2 as default optimization
+IF (NOT CMAKE_BUILD_TYPE)
+   SET ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -O2")
+   SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+ENDIF (NOT CMAKE_BUILD_TYPE)
+
 
 #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")



More information about the Cmake-commits mailing list