[Tux4kids-commits] r463 - in tuxmath/trunk: . macosx src

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Sun Apr 20 03:22:37 UTC 2008


Author: tholy-guest
Date: 2008-04-20 03:22:37 +0000 (Sun, 20 Apr 2008)
New Revision: 463

Modified:
   tuxmath/trunk/CMakeLists.txt
   tuxmath/trunk/macosx/SDLMain.m
   tuxmath/trunk/src/CMakeLists.txt
   tuxmath/trunk/src/SDL_extras.h
   tuxmath/trunk/src/credits.c
   tuxmath/trunk/src/fileops.c
   tuxmath/trunk/src/game.c
   tuxmath/trunk/src/options.c
   tuxmath/trunk/src/setup.c
   tuxmath/trunk/src/titlescreen.h
   tuxmath/trunk/src/tuxmath.h
Log:
Get building sort-of working on Mac OS X. Ended up reverting the
changes to the header syntax! (I had read some outdated advice.) The
big pain was the fact that libSDLmain is absent from MacOSX.

Still not creating the .dmg yet, though.


Modified: tuxmath/trunk/CMakeLists.txt
===================================================================
--- tuxmath/trunk/CMakeLists.txt	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/CMakeLists.txt	2008-04-20 03:22:37 UTC (rev 463)
@@ -11,9 +11,16 @@
 set (PO_TUXMATH ${tuxmath_SOURCE_DIR}/po)
 
 ## Set up OS-specific path information
+set (EXTRA_INCLUDE)
+set (EXTRA_SRC)
 if (APPLE)
-  set(DATA_PREFIX TuxMath.app/Contents/Resources/data)
-  set(LOCALEDIR TuxMath.app/Contents/Resources/locale)
+  set(DATA_PREFIX tuxmath.app/Contents/Resources/data)
+  set(LOCALEDIR tuxmath.app/Contents/Resources/locale)
+  # OS X does not have a pre-build libSDLmain, so we instead include
+  # SDLmain as a source
+  set (EXTRA_INCLUDE ${tuxmath_SOURCE_DIR}/macosx)
+  set (EXTRA_SRC ${tuxmath_SOURCE_DIR}/macosx/SDLMain.m)
+  #include (CMakeFindFrameworks)
   set_source_files_properties (
     ${DATA_TUXMATH}
     PROPERTIES

Modified: tuxmath/trunk/macosx/SDLMain.m
===================================================================
--- tuxmath/trunk/macosx/SDLMain.m	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/macosx/SDLMain.m	2008-04-20 03:22:37 UTC (rev 463)
@@ -18,10 +18,10 @@
 @end
 
 /* Use this flag to determine whether we use SDLMain.nib or not */
-#define	SDL_USE_NIB_FILE	0
+#define		SDL_USE_NIB_FILE	0
 
 /* Use this flag to determine whether we use CPS (docking) or not */
-#define SDL_USE_CPS		1
+#define		SDL_USE_CPS		1
 #ifdef SDL_USE_CPS
 /* Portions of CPS.h */
 typedef struct CPSProcessSerNum
@@ -381,3 +381,4 @@
 #endif
     return 0;
 }
+

Modified: tuxmath/trunk/src/CMakeLists.txt
===================================================================
--- tuxmath/trunk/src/CMakeLists.txt	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/CMakeLists.txt	2008-04-20 03:22:37 UTC (rev 463)
@@ -19,6 +19,7 @@
   setup.c
   titlescreen.c
   tuxmath.c
+  ${EXTRA_SRC}
   )
 
 # tuxmathadmin
@@ -38,10 +39,11 @@
   message (FATAL_ERROR "SDL not found!")
 endif (NOT SDL_FOUND)
 
+
 # Other library functionality
 check_symbol_exists(scandir dirent.h HAVE_SCANDIR)
 
-include (CheckIncludeFiles)
+include (CheckIncludeFile)
 check_include_file (error.h HAVE_ERROR_H)
 
 link_libraries (
@@ -49,12 +51,15 @@
   ${SDLIMAGE_LIBRARY}
   ${SDLTTF_LIBRARY}
   ${SDLMIXER_LIBRARY}
-  SDLmain
   )
 
+if (NOT APPLE)
+  link_libraries (SDLmain)
+endif (NOT APPLE)
+
 ## Include files
-#set (CMAKE_INCLUDE_PATH /usr/include/SDL)
 configure_file(${tuxmath_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR} ${EXTRA_INCLUDES})
 
 ## OSX
 # Build universal binaries on OSX
@@ -81,6 +86,13 @@
   "-DDATA_PREFIX=\\\"${DATA_PREFIX}\\\" -DVERSION=\\\"${TUXMATH_VERSION}\\\" -DLOCALEDIR=\\\"${LOCALEDIR}\\\" -DPACKAGE=\\\"tuxmath\\\""
   )
 
+if (APPLE)
+  # The following seems to be needed to compile under 10.5
+  set_target_properties(tuxmath tuxmathadmin
+    PROPERTIES
+    LINK_FLAGS "-mmacosx-version-min=10.4")
+endif(APPLE)
+
 set_target_properties (
   tuxmathadmin
   PROPERTIES COMPILE_FLAGS 

Modified: tuxmath/trunk/src/SDL_extras.h
===================================================================
--- tuxmath/trunk/src/SDL_extras.h	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/SDL_extras.h	2008-04-20 03:22:37 UTC (rev 463)
@@ -13,8 +13,8 @@
 #ifndef SDL_EXTRAS_H
 #define SDL_EXTRAS_H
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_ttf.h>
+#include "SDL.h"
+#include "SDL_ttf.h"
 
 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
 #define rmask 0xff000000

Modified: tuxmath/trunk/src/credits.c
===================================================================
--- tuxmath/trunk/src/credits.c	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/credits.c	2008-04-20 03:22:37 UTC (rev 463)
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <SDL/SDL.h>
+#include "SDL.h"
 
 #include "tuxmath.h"
 #include "options.h"

Modified: tuxmath/trunk/src/fileops.c
===================================================================
--- tuxmath/trunk/src/fileops.c	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/fileops.c	2008-04-20 03:22:37 UTC (rev 463)
@@ -49,13 +49,13 @@
 
 
 /* SDL includes: */
-#include <SDL/SDL.h>
+#include "SDL.h"
 
 #ifndef NOSOUND
-#include <SDL/SDL_mixer.h>
+#include "SDL_mixer.h"
 #endif
 
-#include <SDL/SDL_image.h>
+#include "SDL_image.h"
 
 /* OS includes - NOTE: these may not be very portable */
 #include <dirent.h>  /* for opendir() */

Modified: tuxmath/trunk/src/game.c
===================================================================
--- tuxmath/trunk/src/game.c	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/game.c	2008-04-20 03:22:37 UTC (rev 463)
@@ -25,11 +25,11 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <SDL/SDL.h>
+#include "SDL.h"
 #ifndef NOSOUND
-#include <SDL/SDL_mixer.h>
+#include "SDL_mixer.h"
 #endif
-#include <SDL/SDL_image.h>
+#include "SDL_image.h"
 
 #include "game.h"
 #include "fileops.h"

Modified: tuxmath/trunk/src/options.c
===================================================================
--- tuxmath/trunk/src/options.c	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/options.c	2008-04-20 03:22:37 UTC (rev 463)
@@ -22,7 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <SDL/SDL.h>
+#include "SDL.h"
 
 #include "mathcards.h"
 

Modified: tuxmath/trunk/src/setup.c
===================================================================
--- tuxmath/trunk/src/setup.c	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/setup.c	2008-04-20 03:22:37 UTC (rev 463)
@@ -30,14 +30,14 @@
 /* FIXME maybe unistd.h not needed, even less sure about portability */
 //#include <unistd.h>
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_ttf.h>
+#include "SDL.h"
+#include "SDL_ttf.h"
 
 #ifndef NOSOUND
-#include <SDL/SDL_mixer.h>
+#include "SDL_mixer.h"
 #endif
 
-#include <SDL/SDL_image.h>
+#include "SDL_image.h"
 
 #include "options.h"
 #include "tuxmath.h"

Modified: tuxmath/trunk/src/titlescreen.h
===================================================================
--- tuxmath/trunk/src/titlescreen.h	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/titlescreen.h	2008-04-20 03:22:37 UTC (rev 463)
@@ -38,10 +38,10 @@
 #include <sys/stat.h>
 #include <dirent.h>
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_image.h>
-#include <SDL/SDL_mixer.h>
-#include <SDL/SDL_ttf.h>
+#include "SDL.h"
+#include "SDL_image.h"
+#include "SDL_mixer.h"
+#include "SDL_ttf.h"
 
 #ifndef MACOSX
 #include "config.h"

Modified: tuxmath/trunk/src/tuxmath.h
===================================================================
--- tuxmath/trunk/src/tuxmath.h	2008-04-19 12:10:43 UTC (rev 462)
+++ tuxmath/trunk/src/tuxmath.h	2008-04-20 03:22:37 UTC (rev 463)
@@ -33,11 +33,11 @@
 
 #include <wchar.h>
 
-#include <SDL/SDL.h>
-#include <SDL/SDL_ttf.h>
+#include "SDL.h"
+#include "SDL_ttf.h"
 
 #ifndef NOSOUND
-#include <SDL/SDL_mixer.h>
+#include "SDL_mixer.h"
 #endif
 
 //#define NOSOUND




More information about the Tux4kids-commits mailing list