Skip to content

Commit

Permalink
merged changes in from svn/trunk using :
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosfield committed Aug 5, 2008
1 parent 822fec0 commit 46afd39
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/osg/Notify.cpp
Expand Up @@ -93,10 +93,22 @@ class NullStreamBuffer : public std::streambuf
}
};

struct NullStream : public std::ostream
{
NullStream():
std::ostream(new NullStreamBuffer) {}

virtual ~NullStream()
{
delete rdbuf();
rdbuf(0);
}
};

std::ostream& osg::notify(const osg::NotifySeverity severity)
{
// set up global notify null stream for inline notify
static std::ostream s_NotifyNulStream(new NullStreamBuffer());
static NullStream s_NotifyNulStream;

static bool initialized = false;
if (!initialized)
Expand Down
21 changes: 20 additions & 1 deletion src/osgViewer/CMakeLists.txt
Expand Up @@ -35,6 +35,7 @@ SET(LIB_COMMON_FILES
ViewerEventHandlers.cpp
)

SET(LIB_EXTRA_LIBS)

IF(WIN32)

Expand Down Expand Up @@ -89,9 +90,26 @@ ELSE(WIN32)
PKG_CHECK_MODULES(XRANDR REQUIRED xrandr)
ADD_DEFINITIONS(-DOSGVIEWER_USE_XRANDR)
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} ${XRANDR_INCLUDE_DIRS})
LINK_LIBRARIES(Xrandr)
LINK_LIBRARIES(Xrandr)
ENDIF(OSGVIEWER_USE_XRANDR)

# X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
IF(APPLE)
# Find GL/glx.h
IF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11/include)
SET(OPENGL_LIBRARIES /usr/X11/lib/libGL.dylib)
ELSEIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11R6/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11R6/include)
SET(OPENGL_LIBRARIES /usr/X11R6/lib/libGL.dylib)
ENDIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OPENGL_INCLUDE_DIR})

SET(LIB_EXTRA_LIBS ${X11_X11_LIB} ${OPENGL_LIBRARIES} ${LIB_EXTRA_LIBS})
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
ENDIF(APPLE)


ENDIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")

ENDIF(WIN32)
Expand All @@ -112,6 +130,7 @@ LINK_INTERNAL(${LIB_NAME}
osgUtil
osg
OpenThreads
${LIB_EXTRA_LIBS}
)

LINK_CORELIB_DEFAULT(${LIB_NAME})
Expand Down

0 comments on commit 46afd39

Please sign in to comment.