koda's patch
authorunc0rr
Tue, 14 Apr 2009 19:05:23 +0000
changeset 1997 cd66434351cf
parent 1996 e9ee8f59f16b
child 1998 c22af5e8b636
koda's patch
hedgewars/CMakeLists.txt
hedgewars/SDLh.pas
hedgewars/hwengine.dpr
--- a/hedgewars/CMakeLists.txt	Mon Apr 13 19:42:07 2009 +0000
+++ b/hedgewars/CMakeLists.txt	Tue Apr 14 19:05:23 2009 +0000
@@ -64,6 +64,22 @@
 set (noexecstack_flags "")
 endif (${testnoexecstack})
 
+IF(APPLE)
+	FIND_PACKAGE(SDL)
+	if (SDL_FOUND)
+		exec_program(gcc
+			     ARGS  -c -o ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o  ${hedgewars_SOURCE_DIR}/hedgewars/SDLMain.m -I ${SDL_INCLUDE_DIR})
+		exec_program(${CMAKE_AR} 
+			     ARGS -r ${EXECUTABLE_OUTPUT_PATH}/libSDLmain.a ${EXECUTABLE_OUTPUT_PATH}/SDLMain.o)
+		exec_program(${CMAKE_RANLIB}
+			     ARGS ${EXECUTABLE_OUTPUT_PATH}/libSDLmain.a)
+	else (SDL_FOUND)
+		message(FATAL_ERROR "No SDL framework found!")
+	endif (SDL_FOUND)
+
+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}")
@@ -74,11 +90,7 @@
 		message("Minimum required version of FreePascal is 2.2.0")
 	else (fpc_ver LESS "020200")
 		set(pascal_compiler ${fpc_executable})
-		IF(APPLE)
-			set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Cs2000000" "-vwi" "-O2" "-Fl/opt/local/lib" ${hwengine_project})
-		ELSE(APPLE)
-			set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Cs2000000" "-vwi" "-O2" ${hwengine_project})
-		ENDIF(APPLE)
+		set(pascal_compiler_flags ${noexecstack_flags} "-B" "-FE../bin" "-Fl../bin" "-Cs2000000" "-vwi" "-O2" ${hwengine_project})
 	endif (fpc_ver LESS "020200")
 endif (fpc_version)
 
--- a/hedgewars/SDLh.pas	Mon Apr 13 19:42:07 2009 +0000
+++ b/hedgewars/SDLh.pas	Tue Apr 14 19:05:23 2009 +0000
@@ -51,7 +51,7 @@
 {$ENDIF}
 {$ENDIF}
 
-(*  SDL *)
+(*  SDL  *)
 const {$IFDEF WIN32}
       SDLLibName = 'SDL.dll';
       {$ENDIF}
@@ -315,7 +315,7 @@
 function TTF_OpenFont(const filename: PChar; size: LongInt): PTTF_Font; cdecl; external SDL_TTFLibName;
 procedure TTF_SetFontStyle(font: PTTF_Font; style: LongInt); cdecl; external SDL_TTFLibName;
 
-(*  SDL_mixer *)
+(*  SDL_mixer  *)
 
 const {$IFDEF WIN32}
       SDL_MixerLibName = 'SDL_mixer.dll';
@@ -380,7 +380,7 @@
 function  Mix_ResumeMusic(music: PMixMusic): LongInt; cdecl; external SDL_MixerLibName;
 function  Mix_HaltChannel(channel: LongInt): LongInt; cdecl; external SDL_MixerLibName;
 
-(*  SDL_image *)
+(*  SDL_image  *)
 
 const {$IFDEF WIN32}
       SDL_ImageLibName = 'SDL_image.dll';
@@ -395,7 +395,7 @@
 
 function IMG_Load(const _file: PChar): PSDL_Surface; cdecl; external SDL_ImageLibName;
 
-(*  SDL_net *)
+(*  SDL_net  *)
 
 const {$IFDEF WIN32}
       SDL_NetLibName = 'SDL_net.dll';
--- a/hedgewars/hwengine.dpr	Mon Apr 13 19:42:07 2009 +0000
+++ b/hedgewars/hwengine.dpr	Tue Apr 14 19:05:23 2009 +0000
@@ -26,7 +26,7 @@
 // "cdecl; export;" (see the fpclogo.pas unit for an example), and then add C-declarations for
 // these procedures/functions to the PascalImports.h file (also in the "Pascal Sources" group)
 // to make these functions available in the C/C++/Objective-C source files
-// (add "#include PascalImports.h" near the top of these files if it's not there yet)
+// (add "#include PascalImports.h" near the top of these files if it is not there yet)
 //Library PascalLibrary;
 program hwengine;
 uses