Re: [AD] 4.9 on OSX

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Right, I've taken that diff, changed the file list a bit and done a
couple of other things that I suspect aren't right(!). New diff is
pasted below.
1. I put in "set(WANT_X11 off)" whenever ALLEGRO_MACOSX is defined. In
theory it should be possible to do an X11 build of Allegro on a Mac,
just treat it as a Unix box and don't use any Cocoa code at all. I
don't know how one would specify that in CMake terms.
2. UNIX vs ALLEGRO_UNIX. As you point out, CMake defines UNIX on OS X.
We are using some of the files from src/unix but not all. Therefore I
don't want all the files from ALLEGRO_SRC_UNIX_FILES, just the ones I
listed in ALLEGRO_SRC_MACOSX_FILES. So I changed a UNIX to
ALLEGRO_UNIX.

Now it will compile but not link the dynamic library - it fails with
ld: common symbols not allowed with MH_DYLIB output format with the
-multi_module option
I've not investigated that error yet.

Pete


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 10011)
+++ CMakeLists.txt      (working copy)
@@ -133,14 +133,21 @@
     set(CMAKE_INSTALL_PREFIX ${MINGDIR})
 endif(MINGW)

-if(UNIX)
-    set(ALLEGRO_UNIX 1)
-endif(UNIX)
-
 if(COMPILER_MSVC)
     set(ALLEGRO_MSVC 1)
 endif(COMPILER_MSVC)

+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    set(MACOSX 1)
+    set(ALLEGRO_MACOSX 1)
+    set(WANT_X11 off)
+else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    # Note: UNIX includes MacOS X, but ALLEGRO_UNIX doesn't.
+    if(UNIX)
+        set(ALLEGRO_UNIX 1)
+    endif(UNIX)
+endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
 # Begin tests.

 include(TestBigEndian)
@@ -560,13 +567,13 @@
 # e.g. -lm on Unix.
 set(PLATFORM_LIBS)

-if(UNIX)
+if(ALLEGRO_UNIX)
     list(APPEND LIBRARY_SOURCES ${ALLEGRO_SRC_UNIX_FILES})
     list(APPEND PLATFORM_LIBS m pthread)
     if(NOT SUPPORT_MODULES)
         list(APPEND PLATFORM_LIBS "${DRIVER_LIBS_STATIC}")
     endif(NOT SUPPORT_MODULES)
-endif(UNIX)
+endif(ALLEGRO_UNIX)

 if(SUPPORT_LINUX_CONSOLE)
     list(APPEND LIBRARY_SOURCES ${ALLEGRO_SRC_LINUX_FILES})
@@ -592,6 +599,10 @@
     endif(SUPPORT_D3D)
 endif(WIN32)

+if(MACOSX)
+    list(APPEND LIBRARY_SOURCES ${ALLEGRO_SRC_MACOSX_FILES})
+endif(MACOSX)
+
 #-----------------------------------------------------------------------------#

 if(STRICT_WARN)
Index: cmake/FileList.cmake
===================================================================
--- cmake/FileList.cmake        (revision 10011)
+++ cmake/FileList.cmake        (working copy)
@@ -379,15 +379,10 @@
     src/macosx/hidman.m
     src/macosx/keybd.m
     src/macosx/pcpu.m
-    src/macosx/qtmidi.m
-    src/macosx/quartz.m
-    src/macosx/qzfull.m
     src/macosx/qzmouse.m
-    src/macosx/qzwindow.m
-    src/macosx/soundman.m
     src/macosx/system.m
+    src/macosx/osxgl.m
     src/unix/ufile.c
-    src/unix/usystem.c
     src/unix/uthreads.c
     src/unix/utime.c
     src/unix/uxthread.c


On Feb 19, 2008 11:31 AM, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> On 2008-02-19, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > On 2008-02-18, Peter Hull <peterhull90@xxxxxxxxxx> wrote:
> > > I would like to get CMake working if someone can help me with it.
> >
> > If you didn't know, pretty much everything is in the top-level
> > CMakeFiles.txt file.  I will try to answer any questions about it.
> >
> > Hmm, I also have remote access to a Mac.  I could probably test a CMake
> > build on that using the makefile generator.
>
> I hope this is enough to get you started.  You probably need to manually
> deselect WANT_X11.  The build breaks at qtmidi.m.
>
> Peter
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers
>




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/