if(SIMGEAR_HEADLESS)
message(STATUS "headless mode")
- set(NO_OPENSCENEGRAPH_INTERFACE 1)
else()
find_package(OpenGL REQUIRED)
find_package(OpenAL REQUIRED)
get_property(publicHeaders GLOBAL PROPERTY PUBLIC_HEADERS)
add_library(SimGearCore SHARED ${coreSources})
- set_property(TARGET SimGearCore PROPERTY COMPILE_FLAGS "-DNO_OPENSCENEGRAPH_INTERFACE=1")
# set_property(TARGET SimGearCore PROPERTY FRAMEWORK 1)
# message(STATUS "public header: ${publicHeaders}")
#cmakedefine HAVE_LIBSVN_CLIENT_1
#cmakedefine GCC_ATOMIC_BUILTINS_FOUND
-
-// set if building headless (no OSG or OpenGL libs)
-#cmakedefine NO_OPENSCENEGRAPH_INTERFACE
#include "singleton.hpp"
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
-#include <osg/Referenced>
-#include <osg/ref_ptr>
-#endif
+#include "SGReferenced.hxx"
+#include "SGSharedPtr.hxx"
namespace simgear
{
}
};
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
template <typename RefClass>
class SingletonRefPtr
{
return singleton.ptr.get();
}
private:
- osg::ref_ptr<RefClass> ptr;
+ SGSharedPtr<RefClass> ptr;
};
template <typename RefClass>
-class ReferencedSingleton : public virtual osg::Referenced
+class ReferencedSingleton : public virtual SGReferenced
{
public:
static RefClass* instance()
return SingletonRefPtr<RefClass>::instance();
}
};
-#endif // of NO_OPENSCENEGRAPH_INTERFACE
}
#endif