OpenSceneGraph/src/osg/CMakeLists.txt

419 lines
10 KiB
CMake
Raw Normal View History

2007-03-08 23:31:36 +08:00
# FIXME: For OS X, need flag for Framework or dylib
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF()
2007-03-08 23:31:36 +08:00
SET(LIB_NAME osg)
#
# Enable workaround for OpenGL driver crash with occlusion query
#
OPTION(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL "Set to ON to build OcclussionQueryNode with a workaround for multi-threaded OpenGL driver occlussion query crash. " OFF)
IF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
ADD_DEFINITIONS(-DFORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
ENDIF()
2007-03-08 23:31:36 +08:00
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})
SET(TARGET_H
${HEADER_PATH}/AlphaFunc
${HEADER_PATH}/AnimationPath
${HEADER_PATH}/ApplicationUsage
${HEADER_PATH}/ArgumentParser
${HEADER_PATH}/Array
${HEADER_PATH}/ArrayDispatchers
${HEADER_PATH}/AudioStream
${HEADER_PATH}/AutoTransform
${HEADER_PATH}/Billboard
${HEADER_PATH}/BlendColor
${HEADER_PATH}/BlendEquation
${HEADER_PATH}/BlendFunc
${HEADER_PATH}/BoundingBox
${HEADER_PATH}/BoundingSphere
${HEADER_PATH}/BoundsChecking
${HEADER_PATH}/buffered_value
${HEADER_PATH}/BufferIndexBinding
${HEADER_PATH}/BufferObject
${HEADER_PATH}/Callback
${HEADER_PATH}/Camera
${HEADER_PATH}/CameraView
${HEADER_PATH}/ClampColor
${HEADER_PATH}/ClearNode
${HEADER_PATH}/ClipNode
${HEADER_PATH}/ClipPlane
${HEADER_PATH}/ClusterCullingCallback
${HEADER_PATH}/CollectOccludersVisitor
${HEADER_PATH}/ColorMask
${HEADER_PATH}/ColorMatrix
${HEADER_PATH}/ComputeBoundsVisitor
${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}/DeleteHandler
${HEADER_PATH}/Depth
${HEADER_PATH}/DisplaySettings
${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}/GL2Extensions
${HEADER_PATH}/GLExtensions
${HEADER_PATH}/GLBeginEndAdapter
${HEADER_PATH}/GLObjects
${HEADER_PATH}/GLU
${HEADER_PATH}/GraphicsCostEstimator
${HEADER_PATH}/GraphicsContext
${HEADER_PATH}/GraphicsThread
${HEADER_PATH}/Group
${HEADER_PATH}/Hint
${HEADER_PATH}/Image
2008-07-21 17:46:53 +08:00
${HEADER_PATH}/ImageSequence
${HEADER_PATH}/ImageStream
${HEADER_PATH}/ImageUtils
${HEADER_PATH}/io_utils
${HEADER_PATH}/KdTree
${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}/Matrixd
${HEADER_PATH}/Matrixf
${HEADER_PATH}/MatrixTransform
${HEADER_PATH}/MixinVector
${HEADER_PATH}/Multisample
${HEADER_PATH}/Node
${HEADER_PATH}/NodeCallback
${HEADER_PATH}/NodeTrackerCallback
${HEADER_PATH}/NodeVisitor
${HEADER_PATH}/Notify
${HEADER_PATH}/Object
${HEADER_PATH}/observer_ptr
${HEADER_PATH}/Observer
${HEADER_PATH}/ObserverNodePath
${HEADER_PATH}/OccluderNode
${HEADER_PATH}/OcclusionQueryNode
${HEADER_PATH}/OperationThread
${HEADER_PATH}/PatchParameter
${HEADER_PATH}/PagedLOD
${HEADER_PATH}/Plane
${HEADER_PATH}/Point
${HEADER_PATH}/PointSprite
${HEADER_PATH}/PolygonMode
${HEADER_PATH}/PolygonOffset
${HEADER_PATH}/PolygonStipple
${HEADER_PATH}/Polytope
${HEADER_PATH}/PositionAttitudeTransform
${HEADER_PATH}/PrimitiveSet
From Aurelien Albert, Added support for glPrimitiveRestartIndex. "The idea of this new OpenGL feature is : - set RestartIndex = "n" - draw elements strip -> when the index is "n", the strip is "stopped" and restarted It's very usefull for drawing tiles with a single strip and a "restart" at the end of each row. The idea a an OSG StateAttribute is : Usually we use to build geometry from code, because software modelers rarely support it (and 3d file formats doesn't support it) : -RootNode <= "PrimitiveRestartIndex=0" // So now, we know that our restart index is 0 for all drawables under this node | - Drawable 1 : triangles => as usual | - Drawable 2 : triangles strip => as usual | - Drawable 3 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index | - Drawable 4 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index | - Drawable 5 : triangles strip => as usual With a StateAttribute, it's easy for the developper to say "0 will be my restart index for all this object" and then activate the mode only on some nodes. The main problem is if you set and restart index value which is not included in the vertex array (for exemple set restart index = 100 but you have only 50 vertex). There is no problem with OpenGL, but some OSG algorithms will try to access the vertex[100] and will segfault. To solve this, I think there is two ways : 1/ add restart index in osg::PrimitiveSet and use this value in all algorithms. It's a lot of work, maybe dangerous, and it concern only a few situations : developpers who use this extension should be aware of advanced OpenGL (and OSG) data management 2/ use a StateAttribute, and choose a "correct" restart index. In my applications, I always use "0" as a restart index and duplicate the first vertex (vertex[0] = vertex[1]). So there is no difference for OpenGL and all OSG algorithms works properly. "
2013-06-28 21:43:46 +08:00
${HEADER_PATH}/PrimitiveRestartIndex
${HEADER_PATH}/Program
${HEADER_PATH}/Projection
${HEADER_PATH}/ProxyNode
${HEADER_PATH}/Quat
${HEADER_PATH}/Referenced
${HEADER_PATH}/ref_ptr
${HEADER_PATH}/RenderInfo
${HEADER_PATH}/SampleMaski
${HEADER_PATH}/Scissor
${HEADER_PATH}/ScriptEngine
${HEADER_PATH}/Sequence
${HEADER_PATH}/ShadeModel
${HEADER_PATH}/Shader
${HEADER_PATH}/ShaderAttribute
${HEADER_PATH}/ShaderComposer
${HEADER_PATH}/ShadowVolumeOccluder
${HEADER_PATH}/Shape
${HEADER_PATH}/ShapeDrawable
${HEADER_PATH}/State
${HEADER_PATH}/StateAttribute
${HEADER_PATH}/StateAttributeCallback
${HEADER_PATH}/StateSet
${HEADER_PATH}/Stats
${HEADER_PATH}/Stencil
${HEADER_PATH}/StencilTwoSided
${HEADER_PATH}/Switch
${HEADER_PATH}/TemplatePrimitiveFunctor
${HEADER_PATH}/TexEnv
${HEADER_PATH}/TexEnvCombine
${HEADER_PATH}/TexEnvFilter
${HEADER_PATH}/TexGen
${HEADER_PATH}/TexGenNode
${HEADER_PATH}/TexMat
${HEADER_PATH}/Texture
${HEADER_PATH}/Texture1D
${HEADER_PATH}/Texture2D
${HEADER_PATH}/Texture2DMultisample
${HEADER_PATH}/Texture2DArray
${HEADER_PATH}/Texture3D
${HEADER_PATH}/TextureBuffer
${HEADER_PATH}/TextureCubeMap
${HEADER_PATH}/TextureRectangle
${HEADER_PATH}/Timer
${HEADER_PATH}/TransferFunction
${HEADER_PATH}/Transform
${HEADER_PATH}/TriangleFunctor
${HEADER_PATH}/TriangleIndexFunctor
${HEADER_PATH}/Uniform
${HEADER_PATH}/UserDataContainer
${HEADER_PATH}/ValueObject
${HEADER_PATH}/Vec2
${HEADER_PATH}/Vec2b
${HEADER_PATH}/Vec2d
${HEADER_PATH}/Vec2f
${HEADER_PATH}/Vec2i
${HEADER_PATH}/Vec2s
${HEADER_PATH}/Vec2ub
${HEADER_PATH}/Vec2ui
${HEADER_PATH}/Vec2us
${HEADER_PATH}/Vec3
${HEADER_PATH}/Vec3b
${HEADER_PATH}/Vec3d
${HEADER_PATH}/Vec3f
${HEADER_PATH}/Vec3i
${HEADER_PATH}/Vec3s
${HEADER_PATH}/Vec3ub
${HEADER_PATH}/Vec3ui
${HEADER_PATH}/Vec3us
${HEADER_PATH}/Vec4
${HEADER_PATH}/Vec4b
${HEADER_PATH}/Vec4d
${HEADER_PATH}/Vec4f
${HEADER_PATH}/Vec4i
${HEADER_PATH}/Vec4s
${HEADER_PATH}/Vec4ub
${HEADER_PATH}/Vec4ui
${HEADER_PATH}/Vec4us
${HEADER_PATH}/Version
${HEADER_PATH}/VertexProgram
${HEADER_PATH}/View
${HEADER_PATH}/Viewport
${OPENSCENEGRAPH_CONFIG_HEADER}
${OPENSCENEGRAPH_OPENGL_HEADER}
2007-03-08 23:31:36 +08:00
)
#ADD_LIBRARY(${LIB_NAME}
# ${OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC}
# ${LIB_PUBLIC_HEADERS}
SET(TARGET_SRC
AlphaFunc.cpp
AnimationPath.cpp
ApplicationUsage.cpp
ArgumentParser.cpp
Array.cpp
ArrayDispatchers.cpp
AudioStream.cpp
AutoTransform.cpp
Billboard.cpp
BlendColor.cpp
BlendEquation.cpp
BlendFunc.cpp
BufferIndexBinding.cpp
BufferObject.cpp
Callback.cpp
Camera.cpp
CameraView.cpp
ClampColor.cpp
ClearNode.cpp
ClipNode.cpp
ClipPlane.cpp
ClusterCullingCallback.cpp
CollectOccludersVisitor.cpp
ColorMask.cpp
ColorMatrix.cpp
ComputeBoundsVisitor.cpp
ConvexPlanarOccluder.cpp
ConvexPlanarPolygon.cpp
CoordinateSystemNode.cpp
CopyOp.cpp
CullFace.cpp
CullingSet.cpp
CullSettings.cpp
CullStack.cpp
DeleteHandler.cpp
Depth.cpp
DisplaySettings.cpp
Drawable.cpp
DrawPixels.cpp
dxtctool.cpp
dxtctool.h
Fog.cpp
FragmentProgram.cpp
FrameBufferObject.cpp
FrameStamp.cpp
FrontFace.cpp
Geode.cpp
Geometry.cpp
GL2Extensions.cpp
GLExtensions.cpp
GLBeginEndAdapter.cpp
GLObjects.cpp
GLStaticLibrary.h
GLStaticLibrary.cpp
GraphicsCostEstimator.cpp
GraphicsContext.cpp
GraphicsThread.cpp
Group.cpp
Hint.cpp
Image.cpp
2008-07-21 17:46:53 +08:00
ImageSequence.cpp
ImageStream.cpp
ImageUtils.cpp
KdTree.cpp
Light.cpp
LightModel.cpp
LightSource.cpp
LineSegment.cpp
LineStipple.cpp
LineWidth.cpp
LOD.cpp
LogicOp.cpp
Material.cpp
Math.cpp
Matrixd.cpp
MatrixDecomposition.cpp
Matrixf.cpp
# We don't build this one
# Matrix_implementation.cpp
MatrixTransform.cpp
Multisample.cpp
Node.cpp
NodeTrackerCallback.cpp
NodeVisitor.cpp
Notify.cpp
Object.cpp
Observer.cpp
ObserverNodePath.cpp
OccluderNode.cpp
OcclusionQueryNode.cpp
OperationThread.cpp
PatchParameter.cpp
PagedLOD.cpp
Point.cpp
PointSprite.cpp
PolygonMode.cpp
PolygonOffset.cpp
PolygonStipple.cpp
PositionAttitudeTransform.cpp
PrimitiveSet.cpp
From Aurelien Albert, Added support for glPrimitiveRestartIndex. "The idea of this new OpenGL feature is : - set RestartIndex = "n" - draw elements strip -> when the index is "n", the strip is "stopped" and restarted It's very usefull for drawing tiles with a single strip and a "restart" at the end of each row. The idea a an OSG StateAttribute is : Usually we use to build geometry from code, because software modelers rarely support it (and 3d file formats doesn't support it) : -RootNode <= "PrimitiveRestartIndex=0" // So now, we know that our restart index is 0 for all drawables under this node | - Drawable 1 : triangles => as usual | - Drawable 2 : triangles strip => as usual | - Drawable 3 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index | - Drawable 4 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index | - Drawable 5 : triangles strip => as usual With a StateAttribute, it's easy for the developper to say "0 will be my restart index for all this object" and then activate the mode only on some nodes. The main problem is if you set and restart index value which is not included in the vertex array (for exemple set restart index = 100 but you have only 50 vertex). There is no problem with OpenGL, but some OSG algorithms will try to access the vertex[100] and will segfault. To solve this, I think there is two ways : 1/ add restart index in osg::PrimitiveSet and use this value in all algorithms. It's a lot of work, maybe dangerous, and it concern only a few situations : developpers who use this extension should be aware of advanced OpenGL (and OSG) data management 2/ use a StateAttribute, and choose a "correct" restart index. In my applications, I always use "0" as a restart index and duplicate the first vertex (vertex[0] = vertex[1]). So there is no difference for OpenGL and all OSG algorithms works properly. "
2013-06-28 21:43:46 +08:00
PrimitiveRestartIndex.cpp
Program.cpp
Projection.cpp
ProxyNode.cpp
Quat.cpp
Referenced.cpp
SampleMaski.cpp
Scissor.cpp
ScriptEngine.cpp
Sequence.cpp
ShadeModel.cpp
Shader.cpp
ShaderAttribute.cpp
ShaderComposer.cpp
ShadowVolumeOccluder.cpp
Shape.cpp
ShapeDrawable.cpp
StateAttribute.cpp
State.cpp
StateSet.cpp
Stats.cpp
Stencil.cpp
StencilTwoSided.cpp
Switch.cpp
TexEnvCombine.cpp
TexEnv.cpp
TexEnvFilter.cpp
TexGen.cpp
TexGenNode.cpp
TexMat.cpp
Texture1D.cpp
Texture2DArray.cpp
Texture2D.cpp
Texture2DMultisample.cpp
Texture3D.cpp
Texture.cpp
TextureBuffer.cpp
TextureCubeMap.cpp
TextureRectangle.cpp
Timer.cpp
TransferFunction.cpp
Transform.cpp
Uniform.cpp
UserDataContainer.cpp
Version.cpp
VertexProgram.cpp
View.cpp
Viewport.cpp
glu/libutil/error.cpp
glu/libutil/mipmap.cpp
glu/libtess/normal.cpp
glu/libtess/memalloc.cpp
glu/libtess/dict-list.h
glu/libtess/alg-outline
glu/libtess/priorityq.cpp
glu/libtess/normal.h
glu/libtess/dict.h
glu/libtess/render.cpp
glu/libtess/tessmono.h
glu/libtess/mesh.cpp
glu/libtess/render.h
glu/libtess/tessmono.cpp
glu/libtess/priorityq.h
glu/libtess/sweep.h
glu/libtess/priorityq-sort.h
glu/libtess/sweep.cpp
glu/libtess/tess.h
glu/libtess/geom.h
glu/libtess/memalloc.h
glu/libtess/dict.cpp
glu/libtess/priorityq-heap.h
glu/libtess/geom.cpp
glu/libtess/tess.cpp
glu/libtess/mesh.h
${OPENSCENEGRAPH_VERSIONINFO_RC}
2007-03-08 23:31:36 +08:00
)
SET(TARGET_LIBRARIES OpenThreads)
2007-03-08 23:31:36 +08:00
SET(TARGET_EXTERNAL_LIBRARIES
2013-08-09 19:00:55 +08:00
${CMAKE_THREAD_LIBS_INIT}
${MATH_LIBRARY}
${RT_LIBRARY}
${DL_LIBRARY}
)
2007-03-08 23:31:36 +08:00
2013-08-09 19:00:55 +08:00
#LINK_INTERNAL(${LIB_NAME}
# OpenThreads
#)
#LINK_EXTERNAL(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} ${RT_LIBRARY} ${DL_LIBRARY})
#LINK_CORELIB_DEFAULT(${LIB_NAME} ${CMAKE_THREAD_LIBS_INIT} ${MATH_LIBRARY} ${RT_LIBRARY} )
#INCLUDE(ModuleInstall OPTIONAL)
SETUP_LIBRARY(${LIB_NAME})