Index: /OpenSceneGraph/trunk/src/osgPlugins/png/ReaderWriterPNG.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/png/ReaderWriterPNG.cpp (revision 8578)
+++ /OpenSceneGraph/trunk/src/osgPlugins/png/ReaderWriterPNG.cpp (revision 10763)
@@ -52,5 +52,9 @@
 void user_error_fn(png_structp png_ptr, png_const_charp error_msg)
 {
+#ifdef OSG_CPP_EXCEPTIONS_AVAILABLE
     throw PNGError(error_msg);
+#else
+    osg::notify(osg::WARN) << "PNG lib warning : " << error_msg << std::endl;
+#endif
 }
 
@@ -167,7 +171,8 @@
             png_set_error_fn(png, png_get_error_ptr(png), user_error_fn, user_warning_fn);
 
+            #ifdef OSG_CPP_EXCEPTIONS_AVAILABLE
             try
+            #endif
             {
-
                 info = png_create_info_struct(png);
                 endinfo = png_create_info_struct(png);
@@ -301,5 +306,7 @@
 
                 return pOsgImage;
-            }
+
+            }
+            #ifdef OSG_CPP_EXCEPTIONS_AVAILABLE
             catch (PNGError& err)
             {
@@ -308,4 +315,5 @@
                 return ReadResult::ERROR_IN_READING_FILE;
             }
+            #endif
         }
 
Index: /OpenSceneGraph/trunk/src/osgPlugins/png/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/png/CMakeLists.txt (revision 9998)
+++ /OpenSceneGraph/trunk/src/osgPlugins/png/CMakeLists.txt (revision 10763)
@@ -1,7 +1,12 @@
 INCLUDE_DIRECTORIES( ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
 
+IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
+    ADD_DEFINITIONS(-DOSG_CPP_EXCEPTIONS_AVAILABLE)
+ENDIF()
 
 SET(TARGET_SRC ReaderWriterPNG.cpp )
 SET(TARGET_LIBRARIES_VARS PNG_LIBRARY ZLIB_LIBRARY )
+
+
 #### end var setup  ###
 SETUP_PLUGIN(png)
Index: /OpenSceneGraph/trunk/src/osgPlugins/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/CMakeLists.txt (revision 10611)
+++ /OpenSceneGraph/trunk/src/osgPlugins/CMakeLists.txt (revision 10763)
@@ -165,5 +165,4 @@
 ADD_SUBDIRECTORY(bvh)
 ADD_SUBDIRECTORY(x)
-ADD_SUBDIRECTORY(ply)
 ADD_SUBDIRECTORY(dxf)
 ADD_SUBDIRECTORY(OpenFlight)
@@ -187,5 +186,4 @@
 ADD_SUBDIRECTORY(tgz)
 
-ADD_SUBDIRECTORY(txp)
 ADD_SUBDIRECTORY(shp)
 ADD_SUBDIRECTORY(txf)
@@ -193,4 +191,9 @@
 ADD_SUBDIRECTORY(bsp)
 ADD_SUBDIRECTORY(mdl)
+
+IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
+    ADD_SUBDIRECTORY(ply)
+    ADD_SUBDIRECTORY(txp)
+ENDIF()
 
 IF(XINE_FOUND)
Index: /OpenSceneGraph/trunk/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/CMakeLists.txt (revision 10703)
+++ /OpenSceneGraph/trunk/CMakeLists.txt (revision 10763)
@@ -301,4 +301,6 @@
 OPTION(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." ${OSG_GL1_AVAILABLE})
 OPTION(OSG_GL_FIXED_FUNCTION_AVAILABLE "Set to OFF to disable use of OpenGL fixed function pipeline." ${OSG_GL1_AVAILABLE})
+
+OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
 
 ################################################################################
Index: /OpenSceneGraph/trunk/examples/CMakeLists.txt
===================================================================
--- /OpenSceneGraph/trunk/examples/CMakeLists.txt (revision 10717)
+++ /OpenSceneGraph/trunk/examples/CMakeLists.txt (revision 10763)
@@ -59,5 +59,4 @@
     ADD_SUBDIRECTORY(osglogo)
     ADD_SUBDIRECTORY(osgmanipulator)
-    ADD_SUBDIRECTORY(osgmemorytest)
     ADD_SUBDIRECTORY(osgmovie)
     ADD_SUBDIRECTORY(osgmultiplerendertargets)
@@ -108,5 +107,4 @@
     ADD_SUBDIRECTORY(osgtexturecompression)
     ADD_SUBDIRECTORY(osgthirdpersonview)
-    ADD_SUBDIRECTORY(osgunittests)
     ADD_SUBDIRECTORY(osgvertexprogram)
     ADD_SUBDIRECTORY(osgvertexattributes)
@@ -138,14 +136,19 @@
     ADD_SUBDIRECTORY(osgwidgetwindow)
 
-IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
-    ADD_SUBDIRECTORY(osgscreencapture)
-    ADD_SUBDIRECTORY(osgmotionblur)
-    ADD_SUBDIRECTORY(osgteapot)
-ENDIF()
-
-IF(OSG_GLU_AVAILABLE)
-    ADD_SUBDIRECTORY(osgphotoalbum)
-    ADD_SUBDIRECTORY(osgtessellate)
-ENDIF()
+    IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
+        ADD_SUBDIRECTORY(osgunittests)
+        ADD_SUBDIRECTORY(osgmemorytest)
+    ENDIF()
+
+    IF(NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
+        ADD_SUBDIRECTORY(osgscreencapture)
+        ADD_SUBDIRECTORY(osgmotionblur)
+        ADD_SUBDIRECTORY(osgteapot)
+    ENDIF()
+
+    IF(OSG_GLU_AVAILABLE)
+        ADD_SUBDIRECTORY(osgphotoalbum)
+        ADD_SUBDIRECTORY(osgtessellate)
+    ENDIF()
 
     ADD_SUBDIRECTORY(osgpdf)
