diff --git a/CMakeLists.txt b/CMakeLists.txt index 2efc1ee1d..99aaba382 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,27 +184,15 @@ ENDIF(WIN32) OPTION(OSG_USE_FLOAT_MATRIX "Set to ON to build OpenSceneGraph with float Matrix instead of double." OFF) MARK_AS_ADVANCED(OSG_USE_FLOAT_MATRIX) -IF(OSG_USE_FLOAT_MATRIX) - ADD_DEFINITIONS(-DOSG_USE_FLOAT_MATRIX) -ENDIF(OSG_USE_FLOAT_MATRIX) OPTION(OSG_USE_FLOAT_PLANE "Set to ON to build OpenSceneGraph with float Plane instead of double." OFF) MARK_AS_ADVANCED(OSG_USE_FLOAT_PLANE) -IF(OSG_USE_FLOAT_PLANE) - ADD_DEFINITIONS(-DOSG_USE_FLOAT_PLANE) -ENDIF(OSG_USE_FLOAT_PLANE) OPTION(OSG_USE_FLOAT_BOUNDINGSPHERE "Set to ON to build OpenSceneGraph with float BoundingSphere instead of double." ON) MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE) -IF(NOT OSG_USE_FLOAT_BOUNDINGSPHERE) - ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGSPHERE) -ENDIF(NOT OSG_USE_FLOAT_BOUNDINGSPHERE) OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON) MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX) -IF(NOT OSG_USE_FLOAT_BOUNDINGBOX) - ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGBOX) -ENDIF(NOT OSG_USE_FLOAT_BOUNDINGBOX) ################################################################################ # 3rd Party Dependency Stuff @@ -596,6 +584,11 @@ IF(BUILD_DOCUMENTATION) ) ENDIF(BUILD_DOCUMENTATION) +SET(OPENSCENEGRAPH_CONFIG_HEADER "${PROJECT_BINARY_DIR}/include/osg/Config") +CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in" + "${OPENSCENEGRAPH_CONFIG_HEADER}") +INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}") + # This needs to be run very last so other parts of the scripts can take # advantage of this. IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) diff --git a/include/osg/BoundingBox b/include/osg/BoundingBox index 6b01da1e4..f4ca8e0d8 100644 --- a/include/osg/BoundingBox +++ b/include/osg/BoundingBox @@ -14,6 +14,7 @@ #ifndef OSG_BOUNDINGBOX #define OSG_BOUNDINGBOX 1 +#include #include #include #include @@ -31,12 +32,12 @@ class OSG_EXPORT BoundingBox { public: -#ifdef OSG_USE_DOUBLE_BOUNDINGBOX - typedef Vec3d vec_type; - typedef double value_type; -#else +#ifdef OSG_USE_FLOAT_BOUNDINGBOX typedef Vec3f vec_type; typedef float value_type; +#else + typedef Vec3d vec_type; + typedef double value_type; #endif diff --git a/include/osg/BoundingSphere b/include/osg/BoundingSphere index b2d5723aa..4a44229f5 100644 --- a/include/osg/BoundingSphere +++ b/include/osg/BoundingSphere @@ -14,6 +14,7 @@ #ifndef OSG_BOUNDINGSPHERE #define OSG_BOUNDINGSPHERE 1 +#include #include #include #include @@ -32,12 +33,12 @@ class OSG_EXPORT BoundingSphere { public: -#ifdef OSG_USE_DOUBLE_BOUNDINGSPHERE - typedef Vec3d vec_type; - typedef double value_type; -#else +#ifdef OSG_USE_FLOAT_BOUNDINGSPHERE typedef Vec3f vec_type; typedef float value_type; +#else + typedef Vec3d vec_type; + typedef double value_type; #endif vec_type _center; diff --git a/include/osg/Matrix b/include/osg/Matrix index 18d923b19..0e6d93acd 100644 --- a/include/osg/Matrix +++ b/include/osg/Matrix @@ -14,6 +14,7 @@ #ifndef OSG_MATRIX #define OSG_MATRIX 1 +#include #include #include diff --git a/include/osg/Plane b/include/osg/Plane index 750ac4454..4fd60911e 100644 --- a/include/osg/Plane +++ b/include/osg/Plane @@ -14,6 +14,7 @@ #ifndef OSG_PLANE #define OSG_PLANE 1 +#include #include #include #include diff --git a/src/osg/CMakeLists.txt b/src/osg/CMakeLists.txt index 3a79a264c..3c93e0809 100644 --- a/src/osg/CMakeLists.txt +++ b/src/osg/CMakeLists.txt @@ -23,6 +23,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/BoundingBox ${HEADER_PATH}/BoundingSphere ${HEADER_PATH}/BoundsChecking + ${HEADER_PATH}/buffered_value ${HEADER_PATH}/BufferObject ${HEADER_PATH}/Camera ${HEADER_PATH}/CameraNode @@ -36,53 +37,56 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/ColorMask ${HEADER_PATH}/ColorMatrix ${HEADER_PATH}/ComputeBoundsVisitor + ${HEADER_PATH}/Config ${HEADER_PATH}/ConvexPlanarOccluder ${HEADER_PATH}/ConvexPlanarPolygon ${HEADER_PATH}/CoordinateSystemNode ${HEADER_PATH}/CopyOp ${HEADER_PATH}/CullFace + ${HEADER_PATH}/CullingSet ${HEADER_PATH}/CullSettings ${HEADER_PATH}/CullStack - ${HEADER_PATH}/CullingSet ${HEADER_PATH}/DeleteHandler ${HEADER_PATH}/Depth ${HEADER_PATH}/DisplaySettings - ${HEADER_PATH}/DrawPixels ${HEADER_PATH}/Drawable + ${HEADER_PATH}/DrawPixels ${HEADER_PATH}/Endian ${HEADER_PATH}/Export + ${HEADER_PATH}/fast_back_stack ${HEADER_PATH}/Fog ${HEADER_PATH}/FragmentProgram ${HEADER_PATH}/FrameBufferObject ${HEADER_PATH}/FrameStamp ${HEADER_PATH}/FrontFace + ${HEADER_PATH}/Geode + ${HEADER_PATH}/Geometry ${HEADER_PATH}/GL ${HEADER_PATH}/GL2Extensions ${HEADER_PATH}/GLExtensions ${HEADER_PATH}/GLObjects ${HEADER_PATH}/GLU - ${HEADER_PATH}/Geode - ${HEADER_PATH}/Geometry ${HEADER_PATH}/GraphicsContext ${HEADER_PATH}/GraphicsThread ${HEADER_PATH}/Group ${HEADER_PATH}/Hint ${HEADER_PATH}/Image ${HEADER_PATH}/ImageStream - ${HEADER_PATH}/LOD + ${HEADER_PATH}/io_utils ${HEADER_PATH}/Light ${HEADER_PATH}/LightModel ${HEADER_PATH}/LightSource ${HEADER_PATH}/LineSegment ${HEADER_PATH}/LineStipple ${HEADER_PATH}/LineWidth + ${HEADER_PATH}/LOD ${HEADER_PATH}/LogicOp ${HEADER_PATH}/Material ${HEADER_PATH}/Math ${HEADER_PATH}/Matrix - ${HEADER_PATH}/MatrixTransform ${HEADER_PATH}/Matrixd ${HEADER_PATH}/Matrixf + ${HEADER_PATH}/MatrixTransform ${HEADER_PATH}/Multisample ${HEADER_PATH}/Node ${HEADER_PATH}/NodeCallback @@ -90,6 +94,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/NodeVisitor ${HEADER_PATH}/Notify ${HEADER_PATH}/Object + ${HEADER_PATH}/observer_ptr ${HEADER_PATH}/OccluderNode ${HEADER_PATH}/OcclusionQueryNode ${HEADER_PATH}/OperationThread @@ -108,6 +113,7 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/ProxyNode ${HEADER_PATH}/Quat ${HEADER_PATH}/Referenced + ${HEADER_PATH}/ref_ptr ${HEADER_PATH}/RenderInfo ${HEADER_PATH}/Scissor ${HEADER_PATH}/Sequence @@ -138,10 +144,10 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/TextureCubeMap ${HEADER_PATH}/TextureRectangle ${HEADER_PATH}/Timer + ${HEADER_PATH}/TransferFunction ${HEADER_PATH}/Transform ${HEADER_PATH}/TriangleFunctor ${HEADER_PATH}/TriangleIndexFunctor - ${HEADER_PATH}/TransferFunction ${HEADER_PATH}/Uniform ${HEADER_PATH}/Vec2 ${HEADER_PATH}/Vec2b @@ -163,11 +169,6 @@ SET(LIB_PUBLIC_HEADERS ${HEADER_PATH}/VertexProgram ${HEADER_PATH}/View ${HEADER_PATH}/Viewport - ${HEADER_PATH}/buffered_value - ${HEADER_PATH}/fast_back_stack - ${HEADER_PATH}/io_utils - ${HEADER_PATH}/observer_ptr - ${HEADER_PATH}/ref_ptr ) ADD_LIBRARY(${LIB_NAME} diff --git a/src/osg/Config.in b/src/osg/Config.in new file mode 100644 index 000000000..e0c0455cd --- /dev/null +++ b/src/osg/Config.in @@ -0,0 +1,10 @@ +#ifndef OSG_CONFIG +#define OSG_CONFIG 1 + +#cmakedefine OSG_USE_FLOAT_MATRIX +#cmakedefine OSG_USE_FLOAT_PLANE +#cmakedefine OSG_USE_FLOAT_BOUNDINGSPHERE +#cmakedefine OSG_USE_FLOAT_BOUNDINGBOX +#cmakedefine OSG_ENFORCE_THREADSAFE + +#endif \ No newline at end of file