fixes & co.
authorkoda
Fri, 02 Oct 2009 18:44:37 +0000
changeset 2401 2a694ea2a437
parent 2400 2422ea85d100
child 2402 edd12b259e7c
fixes & co.
CMakeLists.txt
QTfrontend/CMakeLists.txt
QTfrontend/gameuiconfig.h
QTfrontend/hwform.h
cmake_modules/FindGMP.cmake
gameServer/CMakeLists.txt
hedgewars/CMakeLists.txt
share/Info.plist.in
share/hedgewars/Data/Locale/it.txt
tools/CMakeLists.txt
tools/CreateMacBundle.cmake.in
--- a/CMakeLists.txt	Fri Oct 02 16:49:31 2009 +0000
+++ b/CMakeLists.txt	Fri Oct 02 18:44:37 2009 +0000
@@ -22,7 +22,7 @@
 
 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")
 	set(universal_build true)
-	message("-- Building a Universal Application")
+	message(STATUS "Building a Universal Application")
 endif()
 else(APPLE)
 set(target_dir "bin")
--- a/QTfrontend/CMakeLists.txt	Fri Oct 02 16:49:31 2009 +0000
+++ b/QTfrontend/CMakeLists.txt	Fri Oct 02 18:44:37 2009 +0000
@@ -194,17 +194,14 @@
 		)
         if (SPARKLE_FOUND)
                 set(HW_LINK_LIBS ${HW_LINK_LIBS} ${SPARKLE_LIBRARY})
-                set(CMAKE_CXX_FLAGS -DSPARKLE_ENABLED)
+                add_definitions(-DSPARKLE_ENABLED)
         endif()
 endif()
 
 
 if(WIN32 AND NOT UNIX)
 	if(NOT SDL_LIBRARY)
-		set(HW_LINK_LIBS 
-			${HW_LINK_LIBS}
-			SDL
-			)
+		set(HW_LINK_LIBS ${HW_LINK_LIBS} SDL)
 	endif(NOT SDL_LIBRARY)
 
 	set(HW_LINK_LIBS 
--- a/QTfrontend/gameuiconfig.h	Fri Oct 02 16:49:31 2009 +0000
+++ b/QTfrontend/gameuiconfig.h	Fri Oct 02 18:44:37 2009 +0000
@@ -50,8 +50,10 @@
 	bool isFrontendFullscreen() const;
 	void resizeToConfigValues();
 
-#ifdef __APPLE__ and SPARKLE_ENABLED
-    bool isAutoUpdateEnabled();
+#ifdef __APPLE__
+#ifdef SPARKLE_ENABLED
+	bool isAutoUpdateEnabled();
+#endif
 #endif
 
  signals:
--- a/QTfrontend/hwform.h	Fri Oct 02 16:49:31 2009 +0000
+++ b/QTfrontend/hwform.h	Fri Oct 02 18:44:37 2009 +0000
@@ -29,7 +29,7 @@
 #include "SDLs.h"
 #include "bgwidget.h"
 
-#ifdef __APPLE
+#ifdef __APPLE__
 #include "InstallController.h"
 #endif
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake_modules/FindGMP.cmake	Fri Oct 02 18:44:37 2009 +0000
@@ -0,0 +1,17 @@
+FIND_PATH(GMP_INCLUDE_DIR gmp.h)
+
+FIND_LIBRARY(GMP_LIBRARY NAMES GMP gmp)
+
+IF (GMP_INCLUDE_DIR AND GMP_LIBRARY)
+   SET(GMP_FOUND TRUE)
+   ENDIF (GMP_INCLUDE_DIR AND GMP_LIBRARY)
+
+   IF (GMP_FOUND)
+      IF (NOT GMP_FIND_QUIETLY)
+            MESSAGE(STATUS "Found GMP: ${GMP_LIBRARY}")
+      ENDIF (NOT GMP_FIND_QUIETLY)
+   ELSE (GMP_FOUND)
+   IF (GMP_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Could not find GMP")
+   ENDIF (GMP_FIND_REQUIRED)
+ENDIF (GMP_FOUND)
--- a/gameServer/CMakeLists.txt	Fri Oct 02 16:49:31 2009 +0000
+++ b/gameServer/CMakeLists.txt	Fri Oct 02 18:44:37 2009 +0000
@@ -1,9 +1,13 @@
 find_program(ghc_executable ghc)
 
-if (NOT ghc_executable)
+if(NOT ghc_executable)
 	message(FATAL_ERROR "Cannot find GHC")
 endif(NOT ghc_executable)
 
+if(APPLE)
+	find_package(GMP REQUIRED)
+endif(APPLE)
+
 set(hwserver_sources
 	OfficialServer/DBInteraction.hs
 	Actions.hs
@@ -29,7 +33,7 @@
 	-odir ${CMAKE_CURRENT_BINARY_DIR}
 	-hidir ${CMAKE_CURRENT_BINARY_DIR})
 
-if( NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "Release")
+if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "Release")
 set(ghc_flags
 	-w
 	-O2
--- a/hedgewars/CMakeLists.txt	Fri Oct 02 16:49:31 2009 +0000
+++ b/hedgewars/CMakeLists.txt	Fri Oct 02 18:44:37 2009 +0000
@@ -1,5 +1,10 @@
 configure_file(${hedgewars_SOURCE_DIR}/hedgewars/proto.inc.in ${CMAKE_CURRENT_BINARY_DIR}/proto.inc)
 
+find_package(SDL REQUIRED)
+find_package(SDL_IMAGE REQUIRED)
+find_package(SDL_NET REQUIRED)
+find_package(SDL_TTF REQUIRED)
+
 set(fpc_tryexe fpc)
 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwengine.pas)
 
@@ -64,28 +69,24 @@
 endif (${testnoexecstack})
 
 IF(APPLE)
-	FIND_PACKAGE(SDL)
+#let's build sdlmain, which is absent from the framework
+	set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
+	include_directories(${SDL_INCLUDE_DIR})
+	link_libraries(${SDL_LIBRARY})
 
-	if (SDL_FOUND)
-		set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH})
-		include_directories(${SDL_INCLUDE_DIR})
-		link_libraries(${SDL_LIBRARY})
-
-		add_library (SDLmain STATIC SDLMain.m)
-		set(engine_sources SDLmain ${engine_sources})
-	else (SDL_FOUND)
-		message(FATAL_ERROR "No SDL framework found!")
-	endif (SDL_FOUND)
+	add_library (SDLmain STATIC SDLMain.m)
+	set(engine_sources SDLmain ${engine_sources})
 ENDIF(APPLE)
 
 string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" fpc_version "${fpc_output}")
+
 if (fpc_version)
 	string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" fpc_vers_major "${fpc_version}")
-	string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
+	string(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" fpc_vers_minor "${fpc_version}")
 	string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" fpc_vers_patch "${fpc_version}")
 	math(EXPR fpc_ver "${fpc_vers_major}*10000 + ${fpc_vers_minor}*100 + ${fpc_vers_patch}")
 	if (fpc_ver LESS "020200")
-		message("Minimum required version of FreePascal is 2.2.0")
+		message(STATUS "Minimum required version of FreePascal is 2.2.0")
 	else (fpc_ver LESS "020200")
 		set(pascal_compiler ${fpc_executable})
 		if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "Release")
--- a/share/Info.plist.in	Fri Oct 02 16:49:31 2009 +0000
+++ b/share/Info.plist.in	Fri Oct 02 18:44:37 2009 +0000
@@ -2,6 +2,8 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>CFBundleName</key>
+	<string>Hedgewars</string>
 	<key>CFBundleExecutable</key>
 	<string>hedgewars</string>
 	<key>CFBundleGetInfoString</key>
@@ -25,8 +27,8 @@
 	<key>LSMinimumSystemVersion</key>
 	<string>10.4.0</string>
 	<key>LSRequiresNativeExecution</key>
-	<string>SUPublicDSAKeyFile</string>
-	<key>dsa_pub.pem</key>
         <true/>
+	<key>SUPublicDSAKeyFile</key>
+	<string>dsa_pub.pem</string>
 </dict>
 </plist>
--- a/share/hedgewars/Data/Locale/it.txt	Fri Oct 02 16:49:31 2009 +0000
+++ b/share/hedgewars/Data/Locale/it.txt	Fri Oct 02 18:44:37 2009 +0000
@@ -50,6 +50,7 @@
 01:06=Sudden death!
 01:07=Rimanenti
 01:08=Carburante
+01:09=Sincronizzo...
 
 ; Event messages
 ; Hog (%1) died
--- a/tools/CMakeLists.txt	Fri Oct 02 16:49:31 2009 +0000
+++ b/tools/CMakeLists.txt	Fri Oct 02 18:44:37 2009 +0000
@@ -13,6 +13,8 @@
 
 set(frameworks_dir ${bundle_name}/Contents/Frameworks/)
 
+string(REGEX REPLACE "(.*);-.*" "\\1" sdl_dir "${SDL_LIBRARY}")
+
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/CreateMacBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CreateMacBundle.cmake)
 
-endif()
+endif(APPLE AND BUNDLE)
--- a/tools/CreateMacBundle.cmake.in	Fri Oct 02 16:49:31 2009 +0000
+++ b/tools/CreateMacBundle.cmake.in	Fri Oct 02 18:44:37 2009 +0000
@@ -1,13 +1,18 @@
+execute_process(COMMAND mkdir -p ${frameworks_dir})
+
 execute_process(COMMAND ${macdeployqt_EXE} ${CMAKE_BINARY_DIR}/${bundle_name} OUTPUT_QUIET ERROR_QUIET)
 
-execute_process(COMMAND cp -pPR /Library/Frameworks/SDL.framework/	  ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL.framework)
-execute_process(COMMAND cp -pPR /Library/Frameworks/SDL_image.framework/  ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_image.framework)
-execute_process(COMMAND cp -pPR /Library/Frameworks/SDL_net.framework/    ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_net.framework)
-execute_process(COMMAND cp -pPR /Library/Frameworks/SDL_ttf.framework/    ${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_ttf.framework)
-execute_process(COMMAND cp -pPR /Library/Frameworks/Ogg.framework/  	  ${CMAKE_BINARY_DIR}/${frameworks_dir}/Ogg.framework)
-execute_process(COMMAND cp -pPR /Library/Frameworks/Vorbis.framework/	  ${CMAKE_BINARY_DIR}/${frameworks_dir}/Vorbis.framework)
-execute_process(COMMAND cp -pPR /Library/Frameworks/Sparkle.framework/	  ${CMAKE_BINARY_DIR}/${frameworks_dir}/Sparkle.framework)
+execute_process(COMMAND cp -pPR ${sdl_dir}		${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL.framework)
+execute_process(COMMAND cp -pPR ${SDLIMAGE_LIBRARY}	${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_image.framework)
+execute_process(COMMAND cp -pPR ${SDLNET_LIBRARY}	${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_net.framework)
+execute_process(COMMAND cp -pPR ${SDLTTF_LIBRARY}	${CMAKE_BINARY_DIR}/${frameworks_dir}/SDL_ttf.framework)
+execute_process(COMMAND cp -pPR ${OGG_LIBRARY}	 	${CMAKE_BINARY_DIR}/${frameworks_dir}/Ogg.framework)
+execute_process(COMMAND cp -pPR ${VORBIS_LIBRARY}	${CMAKE_BINARY_DIR}/${frameworks_dir}/Vorbis.framework)
+
+if(SPARKLE_FOUND)
+execute_process(COMMAND cp -pPR ${SPARKLE_LIBRARY}	${CMAKE_BINARY_DIR}/${frameworks_dir}/Sparkle.framework)
+endif()
 
 if(${HAVE_NETSERVER})
-execute_process(COMMAND cp -pPR /Library/Frameworks/GMP.framework/ ${CMAKE_BINARY_DIR}/${frameworks_dir}/GMP.framework)
+execute_process(COMMAND cp -pPR ${GMP_LIBRARY} 		${CMAKE_BINARY_DIR}/${frameworks_dir}/GMP.framework)
 endif()