CMakeLists.txt
changeset 2406 2e757b32991e
parent 2401 2a694ea2a437
child 2413 d921d13a8546
--- a/CMakeLists.txt	Sat Oct 03 12:38:56 2009 +0000
+++ b/CMakeLists.txt	Tue Oct 06 16:30:08 2009 +0000
@@ -20,14 +20,35 @@
 set(DATA_INSTALL_DIR "../Resources/")
 set(target_dir ".")
 
-if(CMAKE_OSX_ARCHITECTURES MATCHES "i386;ppc7400" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc7400;i386" OR CMAKE_OSX_ARCHITECTURES MATCHES "i386;ppc" OR CMAKE_OSX_ARCHITECTURES MATCHES "ppc;i386")
+if(UNIVERSAL)
+	set(CMAKE_OSX_ARCHITECTURES "i386;ppc7400")
 	set(universal_build true)
 	message(STATUS "Building a Universal Application")
-endif()
+else(UNIVERSAL)
+	if(UNIVERSAL64)
+		set(CMAKE_OSX_ARCHITECTURES "i386;ppc7400;x86_64")
+		set(universal_build true)
+		message(STATUS "Building a Universal 64 bits Application")
+	endif(UNIVERSAL64)
+endif(UNIVERSAL)
+
 else(APPLE)
 set(target_dir "bin")
 endif(APPLE)
 
+
+if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "Release")
+	set(CMAKE_BUILD_TYPE "Release")
+	set(OPTIMIZATIONS true)
+	message(STATUS "Building Release")
+else()
+	set(CMAKE_BUILD_TYPE "Debug")
+	set(OPTIMIZATIONS false)
+	set(CMAKE_VERBOSE_MAKEFILE true)
+	message(STATUS "Building Debug")	
+endif()
+
+
 if(DEFINED DATA_INSTALL_DIR)
 	set(SHAREPATH ${DATA_INSTALL_DIR}/hedgewars/)
 else(DEFINED DATA_INSTALL_DIR)
@@ -49,6 +70,9 @@
 set(CMAKE_C_FLAGS "-Wall -pipe")
 set(CMAKE_C_FLAGS_RELEASE "-w -O2 -fomit-frame-pointer")
 set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
+if(APPLE AND NOT universal_build)
+	set(CMAKE_C_FLAGS_RELEASE "-sse2 ${CMAKE_C_FLAGS_RELEASE}")
+endif()
 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})