move C and C++ optimization flags in the main CMakeLists.txt
authorkoda
Tue, 07 Jul 2009 15:24:43 +0000
changeset 2239 d7b5c65f7544
parent 2238 1a0d26408324
child 2240 7ce9e6b7be3b
move C and C++ optimization flags in the main CMakeLists.txt
CMakeLists.txt
QTfrontend/CMakeLists.txt
hedgewars/CMakeLists.txt
openalbridge/CMakeLists.txt
--- a/CMakeLists.txt	Tue Jul 07 11:56:02 2009 +0000
+++ b/CMakeLists.txt	Tue Jul 07 15:24:43 2009 +0000
@@ -45,6 +45,15 @@
 	set(HAVE_NETSERVER false)
 endif(WITH_SERVER)
 
+#set default flags values for all the project
+set(CMAKE_C_FLAGS "-Wall -pipe")
+set(CMAKE_C_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer")
+set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
+set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
+set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+
+
 add_subdirectory(bin)
 add_subdirectory(openalbridge)
 add_subdirectory(QTfrontend)
--- a/QTfrontend/CMakeLists.txt	Tue Jul 07 11:56:02 2009 +0000
+++ b/QTfrontend/CMakeLists.txt	Tue Jul 07 15:24:43 2009 +0000
@@ -18,18 +18,12 @@
 # Configure for SDL
 find_package(SDL REQUIRED)
 
+include_directories(.)
 include_directories(${SDL_INCLUDE_DIR})
-
 if(UNIX)
 	include_directories("/usr/local/include") # HACK: in freebsd cannot find iconv.h included via SDL.h
 endif(UNIX)
 
-# Done
-include_directories(.)
-
-set(CMAKE_CXX_FLAGS "-Wall -pipe")
-set(CMAKE_CXX_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer")
-set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
 
 if(WIN32 AND NOT UNIX)
 	set(HEDGEWARS_BINDIR ".")
@@ -43,6 +37,7 @@
 	endif(DEFINED DATA_INSTALL_DIR)
 endif(WIN32 AND NOT UNIX)
 
+
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hwconsts.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp)
 
 set(hwfr_src
--- a/hedgewars/CMakeLists.txt	Tue Jul 07 11:56:02 2009 +0000
+++ b/hedgewars/CMakeLists.txt	Tue Jul 07 15:24:43 2009 +0000
@@ -67,10 +67,6 @@
 	FIND_PACKAGE(SDL)
 
 	if (SDL_FOUND)
-		set(CMAKE_C_FLAGS "-Wall -pipe")
-		set(CMAKE_C_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer")
-		set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-
 		set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
 		include_directories(${SDL_INCLUDE_DIR})
 		link_libraries(${SDL_LIBRARY})
--- a/openalbridge/CMakeLists.txt	Tue Jul 07 11:56:02 2009 +0000
+++ b/openalbridge/CMakeLists.txt	Tue Jul 07 15:24:43 2009 +0000
@@ -3,11 +3,6 @@
 include_directories(${OPENAL_INCLUDE_DIR})
 include_directories(${OGGVORBIS_INCLUDE_DIRS})
 
-#set flag configuration for build type
-set(CMAKE_C_FLAGS "-Wall -pipe")
-set(CMAKE_C_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer")
-set(CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG")
-
 #set destination directory for library
 set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})