Skip to content
Permalink
Browse files

Closes #123: Build universal libraries even when AGL is enabled.

All libraries are now build in 32 and 64 bit mode, but the AGL window
system is only available in 32 bit mode. Examples are still build 32-bit
only, since I couldn't get the LSArchitecturePriority key to work.
  • Loading branch information...
eile committed May 31, 2012
1 parent 5a62846 commit 34e2aa140d1467077e6e53afd7517fae12f77737
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${VERSION}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>CFBundleSignature</key>
<string>CMak</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>LSArchitecturePriority</key>
<array>
<string>i386</string>
<string>x86_64</string>
<string>ppc</string>
<string>ppc64</string>
</array>
</dict>
</plist>
@@ -5,7 +5,6 @@
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project(Equalizer)

option(EQUALIZER_PREFER_AGL "Prefer AGL over GLX on Mac OS X" ON)
option(EQUALIZER_USE_OPENMP "Test for OpenMP support" ON)
option(EQUALIZER_FORCE_OPENMP "Force usage of buggy OpenMP implementation" OFF)
option(EQUALIZER_USE_GPUSD "Test for GPU-SD support" ON)
@@ -18,7 +17,6 @@ option(EQUALIZER_BUILD_2_0_API

mark_as_advanced(EQUALIZER_INSTALL_SERVER_HEADERS)
mark_as_advanced(EQUALIZER_FORCE_OPENMP)
mark_as_advanced(EQUALIZER_PREFER_AGL)

list(APPEND CMAKE_MODULE_PATH ${Equalizer_SOURCE_DIR}/CMake)

@@ -132,16 +130,8 @@ if(X11_FOUND)
if(APPLE)
set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ") # Disabled by GNU.cmake!?
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${EQ_OSX_VERSION}" )
if(EXISTS /Developer/SDKs/MacOSX10.7.sdk)
set(EQ_AGL_USED 1)
set(EQ_GLX_USED 1)
else()
if(EQUALIZER_PREFER_AGL)
set(EQ_AGL_USED 1)
else(EQUALIZER_PREFER_AGL)
set(EQ_GLX_USED 1)
endif(EQUALIZER_PREFER_AGL)
endif()
set(EQ_AGL_USED 1)
set(EQ_GLX_USED 1)
else(APPLE)
set(EQ_GLX_USED 1)
endif(APPLE)
@@ -164,22 +154,12 @@ if(APPLE)
include_directories(SYSTEM /usr/X11R6/include)
add_definitions(-DDarwin)

if(EQ_AGL_USED)
if(_CMAKE_OSX_MACHINE MATCHES "ppc")
set(EQUALIZER_OSX_ARCHITECTURES "ppc" CACHE STRING
"Equalizer build architectures")
else()
set(EQUALIZER_OSX_ARCHITECTURES "i386" CACHE STRING
"Equalizer build architectures")
endif()
else(EQ_AGL_USED)
if(_CMAKE_OSX_MACHINE MATCHES "ppc")
set(EQUALIZER_OSX_ARCHITECTURES "ppc;ppc64" CACHE STRING
"Equalizer build architectures")
else()
set(EQUALIZER_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING
"Equalizer build architectures")
endif()
if(_CMAKE_OSX_MACHINE MATCHES "ppc")
set(EQUALIZER_OSX_ARCHITECTURES "ppc;ppc64" CACHE STRING
"Equalizer build architectures")
else()
set(EQUALIZER_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING
"Equalizer build architectures")
endif()
mark_as_advanced(EQUALIZER_OSX_ARCHITECTURES)

File renamed without changes.
File renamed without changes.
BIN +232 KB Darwin/Equalizer.icns
Binary file not shown.
File renamed without changes.
@@ -19,19 +19,11 @@ Prerequisites:

Universal Binary Notes

AGL/Carbon does not support 64 bit. When compiling for AGL, the 64 bit
targets are disabled. X11 supports 32 and 64 bit binary formats. When
using GLX alone all these targets are enabled by default.

CMake configures:
- if EQ_PREFER_AGL is true:
- AGL 32 bit on 10.6
- AGL and GLX 32 bit on 10.5
- GLX 32 and 64 bit if EQ_PREFER_AGL is false

At least x86_64 support is buggy in 10.5.0. Resizing a window causes a
crash. Installing the latest X11.app from
<http://trac.macosforge.org/projects/xquartz> solves this issue
(the version tested was 2.3.2.1).

[1] http://www.macports.org/
AGL/Carbon does not support 64 bit. X11 supports 32 and 64 bit binary
formats. All libraries and applications are compiled in universal mode,
but the AGL window system is not available when running Equalizer
applications in 64 bit mode. See examples/CMakeLists.txt on how to set
the preferred architecture to 32 bit to run AGL-based Equalizer
applications.

[1] http://www.macports.org/
@@ -28,12 +28,22 @@ else() # installed examples
if(APPLE)
link_directories(/usr/X11R6/lib)
include_directories(SYSTEM /usr/X11R6/include)
set(CMAKE_OSX_ARCHITECTURES "@EQUALIZER_OSX_ARCHITECTURES@")
set(EQUALIZER_OSX_ARCHITECTURES "@EQUALIZER_OSX_ARCHITECTURES@")
endif(APPLE)
if(EQ_AGL_USED)
find_library(CARBON_LIBRARY Carbon)
endif()
endif()
if(EQ_AGL_USED)
if(EQUALIZER_OSX_ARCHITECTURES MATCHES "ppc")
set(EQ_EXAMPLES_OSX_ARCHITECTURES "ppc" CACHE STRING
"Equalizer examples build architectures")
else()
set(EQ_EXAMPLES_OSX_ARCHITECTURES "i386" CACHE STRING
"Equalizer examples build architectures")
endif()
endif()
set(CMAKE_OSX_ARCHITECTURES ${EQ_EXAMPLES_OSX_ARCHITECTURES})

include(EqStringifyShaders)

@@ -52,6 +62,12 @@ function(EQ_ADD_EXAMPLE NAME)
target_link_libraries(${THIS_TARGET} ${LINK_LIBRARIES} ${OPENGL_gl_LIBRARY})

set_target_properties(${THIS_TARGET} PROPERTIES OUTPUT_NAME ${NAME} FOLDER "Examples")
if(APPLE AND AGL) # set preference to 32 bit if AGL is available
update_file(${CMAKE_SOURCE_DIR}/CMake/MacOSXBundleInfo.plist.in
${CMAKE_CURRENT_BINARY_DIR}/MacOSXBundleInfo.plist)
set_target_properties(${THIS_TARGET} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/MacOSXBundleInfo.plist)
endif()
add_dependencies(${THIS_TARGET} ${EQUALIZER_SERVER_LIBRARY}) # dlopen'ed

install(TARGETS ${THIS_TARGET} DESTINATION bin COMPONENT apps)
@@ -82,10 +82,7 @@ namespace co
};

inline std::ostream& operator << (std::ostream& os, const ObjectVersion& ov)
{
os << "id " << ov.identifier << " v" << ov.version;
return os;
}
{ return os << "id " << ov.identifier << " v" << ov.version; }

}

@@ -1,5 +1,5 @@

/* Copyright (c) 2007-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2007-2012, Stefan Eilemann <eile@equalizergraphics.com>
* 2011, Cedric Stalder <cedric.stalder@gmail.com>
*
* This library is free software; you can redistribute it and/or modify it under
@@ -17,6 +17,7 @@
*/

#include "eventHandler.h"
#ifdef AGL

#include "window.h"
#include "windowEvent.h"
@@ -645,3 +646,4 @@ void EventHandler::exitMagellan( Node* node )

}
}
#endif // AGL
@@ -1,5 +1,5 @@

/* Copyright (c) 2007-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2007-2012, Stefan Eilemann <eile@equalizergraphics.com>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
@@ -18,6 +18,9 @@
#ifndef EQ_AGL_EVENTHANDLER_H
#define EQ_AGL_EVENTHANDLER_H

#include <eq/client/defines.h>
#ifdef AGL

#include <eq/client/agl/types.h>
#include <eq/client/eventHandler.h> // base class

@@ -87,5 +90,5 @@ namespace agl
};
}
}
#endif // AGL
#endif // EQ_AGL_EVENTHANDLER_H

@@ -1,5 +1,5 @@

/* Copyright (c) 2007-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2007-2012, Stefan Eilemann <eile@equalizergraphics.com>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
@@ -16,6 +16,7 @@
*/

#include "messagePump.h"
#ifdef AGL

#include <eq/client/global.h>
#include <eq/client/os.h>
@@ -140,4 +141,4 @@ void MessagePump::dispatchAll()

}
}

#endif // AGL
@@ -1,5 +1,5 @@

/* Copyright (c) 2007-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2007-2012, Stefan Eilemann <eile@equalizergraphics.com>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
@@ -18,6 +18,9 @@
#ifndef EQ_AGL_MESSAGEPUMP_H
#define EQ_AGL_MESSAGEPUMP_H

#include <eq/client/defines.h>
#ifdef AGL

#include <eq/client/agl/types.h>
#include <eq/client/messagePump.h> // base class

@@ -51,4 +54,5 @@ class MessagePump : public eq::MessagePump
};
}
}
#endif //EQ_AGL_MESSAGEPUMP_H
#endif // AGL
#endif // EQ_AGL_MESSAGEPUMP_H
@@ -1,5 +1,5 @@

/* Copyright (c) 2009-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2009-2012, Stefan Eilemann <eile@equalizergraphics.com>
2009, Maxim Makhinya
*
* This library is free software; you can redistribute it and/or modify it under
@@ -17,6 +17,7 @@
*/

#include "pipe.h"
#ifdef AGL

#include <eq/client/global.h>
#include <eq/client/os.h>
@@ -108,3 +109,4 @@ void Pipe::configExit()

}
}
#endif // AGL
@@ -1,5 +1,5 @@

/* Copyright (c) 2009-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2009-2012, Stefan Eilemann <eile@equalizergraphics.com>
2009, Maxim Makhinya
*
* This library is free software; you can redistribute it and/or modify it under
@@ -19,6 +19,9 @@
#ifndef EQ_AGL_PIPE_H
#define EQ_AGL_PIPE_H

#include <eq/client/defines.h>
#ifdef AGL

#include <eq/client/agl/types.h>
#include <eq/client/systemPipe.h> // base class

@@ -86,4 +89,5 @@ namespace agl
};
}
}
#endif // AGL
#endif // EQ_AGL_PIPE_H
@@ -1,5 +1,5 @@

/* Copyright (c) 2011, Stefan Eilemann <eile@eyescale.ch>
/* Copyright (c) 2011-2012, Stefan Eilemann <eile@eyescale.ch>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
@@ -50,5 +50,4 @@ typedef struct OpaqueEventRef* EventRef;
typedef struct OpaqueEventQueueRef* EventQueueRef;
/** @endcond */


#endif // EQ_AGL_TYPES_H
@@ -17,6 +17,7 @@
*/

#include "window.h"
#ifdef AGL

#include "eventHandler.h"
#include "pipe.h"
@@ -620,3 +621,4 @@ void Window::exitEventHandler()

}
}
#endif // AGL
@@ -19,6 +19,9 @@
#ifndef EQ_AGL_WINDOW_H
#define EQ_AGL_WINDOW_H

#include <eq/client/defines.h>
#ifdef AGL

#include <eq/client/agl/types.h>
#include <eq/client/glWindow.h> // base class

@@ -269,5 +272,5 @@ namespace agl
};
}
}
#endif // AGL
#endif // EQ_AGL_WINDOW_H

@@ -1,5 +1,5 @@

/* Copyright (c) 2006-2011, Stefan Eilemann <eile@equalizergraphics.com>
/* Copyright (c) 2006-2012, Stefan Eilemann <eile@equalizergraphics.com>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
@@ -18,6 +18,9 @@
#ifndef EQ_AGL_WINDOWEVENT_H
#define EQ_AGL_WINDOWEVENT_H

#include <eq/client/defines.h>
#ifdef AGL

#include <eq/client/event.h> // base class

namespace eq
@@ -33,4 +36,5 @@ namespace agl
};
}
}
#endif // AGL
#endif // EQ_AGL_WINDOWEVENT_H

0 comments on commit 34e2aa1

Please sign in to comment.
You can’t perform that action at this time.