OpenSceneGraph/src/osgPlugins/CMakeLists.txt

258 lines
4.6 KiB
CMake
Raw Normal View History

#---------------------------------------------------
# OSG CMAKE SUPPORT
# (C) by Michael Wagner, mtw@shared-reality.com 2005
2007-05-05 23:36:03 +08:00
# (C) Eric Wing, Luigi Calori and Robert Osfield 2006-2007
#---------------------------------------------------
PROJECT(OSG_PLUGINS_MASTER)
IF(NOT DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF()
IF(NOT MSVC)
SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}")
From Philip Lowman, post 1: "Here is a collection of changes which should fix issues building the OSG with CMake 2.6.0 (along with some other changes) CMakeLists.txt: * Set CMP0003 to supress warning about linking against -lpthread (which is a non-absolute library location). (CMake 2.6.x fix) * Modified the WIN32_USE_MP and a couple of other Visual Studio specific flags to be in an IF(MSVC) block (minor tweak to reduce exposing this stuff on MinGW builds) * Includes my second set of glu tesselator autodetection changes that you seemed to want but haven't committed yet. src/OpenThreads/pthreads/CMakeLists.txt: * Eliminates warning when compiling on Linux about spaces in link line (CMake 2.6.x fix) CMakeModules/OsgMacroUtils.cmake: * Tweaks to make the macros behave properly under CMake 2.6.0 (doesn't change behavior under CMake 2.4.x) CMakeModules/Find3rdPartyDependencies.cmake: * Adds the NO_DEFAULT_PATH option to all of the search options so that things in C:\Program Files\OpenSceneGraph aren't accidently picked up during configure time and instead only things in the "3rdParty" folder are discovered. (general bugfix) " post 2: "Ok, hold the presses. I just discovered that for some odd reason the osgdb_* plugins under Linux aren't getting put under the osgPlugins-2.5.0 folder. Not exactly sure why this broke, the folder was there, just empty. I'll have to look into it this evening." post 3: "Fixed, was caused by the switch to CMAKE_LIBRARY_OUTPUT_DIRECTORY and some code in osgPlugins/CMakeLists.txt that effectively overrides LIBRARY_OUTPUT_PATH on non-MSVC compilers to dump the plugins in the plugins folder. I tweaked it to override CMAKE_LIBRARY_OUTPUT_DIRECTORY as well. Seems to work fine."
2008-05-27 06:36:58 +08:00
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${OSG_PLUGINS}")
ENDIF()
SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})
IF(MSVC80 OR MSVC90)
IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF()
ENDIF()
SET(TARGET_DEFAULT_PREFIX "osgdb_")
SET(TARGET_DEFAULT_LABEL_PREFIX "Plugins")
SET(TARGET_COMMON_LIBRARIES
OpenThreads
osg
osgDB
osgUtil
)
############################################################
#
# NodeKit/Psudo loader plugins
#
ADD_SUBDIRECTORY(osga)
ADD_SUBDIRECTORY(rot)
ADD_SUBDIRECTORY(scale)
ADD_SUBDIRECTORY(trans)
ADD_SUBDIRECTORY(normals)
ADD_SUBDIRECTORY(revisions)
ADD_SUBDIRECTORY(view)
ADD_SUBDIRECTORY(shadow)
ADD_SUBDIRECTORY(terrain)
############################################################
#
# Main native plugins
#
ADD_SUBDIRECTORY(osg)
ADD_SUBDIRECTORY(ive)
############################################################
#
# Viewer plugins
#
ADD_SUBDIRECTORY(cfg)
############################################################
#
# Shader plugins
#
ADD_SUBDIRECTORY(glsl)
############################################################
#
# Image plugins
#
ADD_SUBDIRECTORY(rgb)
ADD_SUBDIRECTORY(bmp)
ADD_SUBDIRECTORY(pnm)
ADD_SUBDIRECTORY(dds)
ADD_SUBDIRECTORY(tga)
ADD_SUBDIRECTORY(hdr)
ADD_SUBDIRECTORY(dot)
From Jason Daly, "'ve been busy working on the Source engine plugins. There are several contributions in this submission: osgDB/FileUtils.cpp: Needed this extra code to allow a true case-insensitive search. This is because the HL2 map and model files are often sloppy with case. For example, the file might look for materials/models/alyx/alyx_sheet.vtf, but the file is actually in materials/Models/Alyx/alyx_sheet.vtf. In case-insensitive mode, the new code recursively disassembles the path and checks each path element without regard to case. In case-sensitive mode, the code behaves exactly as it used to. The new code is also mostly skipped on Windows because of the case-insensitive file system. Previously, I did all of this with custom search code in the .bsp plugin, but this allows the user to tailor the search using OSGFILEPATH. There are some instructions in the plugins' README files about this. osgPlugins/mdl: This is a new plug-in for Half-Life 2 models (as opposed to maps). This allows you to load Source models individually, as well as allowing the .bsp plugin to load models (props) that are embedded into maps. Mdl files can contain simple object (crates, barrels, bottles), as well as fully articulated characters with skeletal animations. Currently, it can load the simple objects. It can also load the characters, but it can't load the skeletons or animations. osgPlugins/bsp: This contains all of the changes needed to load props along with the basic map geometry. There are also several bugs fixed. osgPlugins/vtf: This is the loader for Valve's texture format. Previously, we had agreed to put this in with the bsp plugin, but I didn't think of the .mdl plugin at that time. It's conceivable that a user might want to load models individually (not as part of a map), so the vtf reader does have to be separate. I also fixed a rather significant bug. I tested all of this code on RHEL 5.2 (32-bit), and Fedora 9 (64-bit). I'll be testing on Windows soon. I also attached a simple .mdl file, along with it's associated files and textures. Just extract the tarball into it's own directory, set your OSGFILEPATH to point at that directory, and load the model like this: osgviewer models/props_junk/gascan001a.mdl"
2008-12-20 21:35:49 +08:00
ADD_SUBDIRECTORY(vtf)
IF(JPEG_FOUND)
ADD_SUBDIRECTORY(jpeg)
ENDIF()
IF(JASPER_FOUND)
ADD_SUBDIRECTORY(jp2)
ENDIF()
IF(OPENEXR_FOUND)
2008-11-27 17:36:35 +08:00
ADD_SUBDIRECTORY(exr)
ENDIF()
IF(GIFLIB_FOUND)
ADD_SUBDIRECTORY(gif)
ENDIF()
IF(PNG_FOUND)
ADD_SUBDIRECTORY(png)
ENDIF()
IF(TIFF_FOUND)
ADD_SUBDIRECTORY(tiff)
ENDIF()
2007-08-07 18:33:25 +08:00
IF(GDAL_FOUND)
ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(ogr)
ENDIF()
IF(XUL_FOUND)
IF(WIN32 OR APPLE OR GTK_FOUND)
ADD_SUBDIRECTORY(gecko)
ENDIF()
ENDIF()
############################################################
#
# 3D Image plugins
#
IF(DCMTK_FOUND AND ZLIB_FOUND)
ADD_SUBDIRECTORY(dicom)
ELSE()
IF(ITK_FOUND)
ADD_SUBDIRECTORY(dicom)
ENDIF()
ENDIF()
############################################################
#
# 3rd party 3d plugins
#
ADD_SUBDIRECTORY(3dc)
ADD_SUBDIRECTORY(p3d)
From Wang Rui, "Attachment is a plugin reading Biovision hierarchical files (.BVH) to generate character motion animations. BVH format is widely used by Character Studio of 3dsmax, MotionBuilder and other softwares, also supported by most motion capture devices. The plugin is based on the latest osgAnimation library of OSG 2.7.6 and will return a osgAnimation::AnimationManager pointer if using readNodeFile() to load it. Source and CMake files are: CMakeLists.txt ReaderWriterBVH.cpp Also there are 3 example BVH files. The first two are captured from motions of human beings - maybe a kung-fu master here. PLEASE use command below to see the results: # osgviewer example1.bvh -O solids This will demonstrate the animating of a skeleton and render bones as solid boxes. Note that the motion assumes XOZ is the ground and has an offset from the center, so we should adjust our view to get best effects. You may also use "-O contours" to render bones as lines. The viewer shows nothing if without any options because osgAnimation::Bone does not render itself. User may add customized models to each named bones as osganimationskinning does to make uses of this plugin in their own applications. I was wondering to support a BvhNode in my osgModeling peoject before, but soon found it better be a plugin for animation. A problem is, how to bind real geometry models to the skeleton. Maybe we could have a bindingToNode() visitor in future to find geodes matching names of bones and add them as bones' children."
2008-12-01 22:07:20 +08:00
IF(CURL_FOUND)
ADD_SUBDIRECTORY(curl)
ENDIF()
From Wang Rui, "Attachment is a plugin reading Biovision hierarchical files (.BVH) to generate character motion animations. BVH format is widely used by Character Studio of 3dsmax, MotionBuilder and other softwares, also supported by most motion capture devices. The plugin is based on the latest osgAnimation library of OSG 2.7.6 and will return a osgAnimation::AnimationManager pointer if using readNodeFile() to load it. Source and CMake files are: CMakeLists.txt ReaderWriterBVH.cpp Also there are 3 example BVH files. The first two are captured from motions of human beings - maybe a kung-fu master here. PLEASE use command below to see the results: # osgviewer example1.bvh -O solids This will demonstrate the animating of a skeleton and render bones as solid boxes. Note that the motion assumes XOZ is the ground and has an offset from the center, so we should adjust our view to get best effects. You may also use "-O contours" to render bones as lines. The viewer shows nothing if without any options because osgAnimation::Bone does not render itself. User may add customized models to each named bones as osganimationskinning does to make uses of this plugin in their own applications. I was wondering to support a BvhNode in my osgModeling peoject before, but soon found it better be a plugin for animation. A problem is, how to bind real geometry models to the skeleton. Maybe we could have a bindingToNode() visitor in future to find geodes matching names of bones and add them as bones' children."
2008-12-01 22:07:20 +08:00
IF(ZLIB_FOUND)
ADD_SUBDIRECTORY(gz)
ENDIF()
From Wang Rui, "Attachment is a plugin reading Biovision hierarchical files (.BVH) to generate character motion animations. BVH format is widely used by Character Studio of 3dsmax, MotionBuilder and other softwares, also supported by most motion capture devices. The plugin is based on the latest osgAnimation library of OSG 2.7.6 and will return a osgAnimation::AnimationManager pointer if using readNodeFile() to load it. Source and CMake files are: CMakeLists.txt ReaderWriterBVH.cpp Also there are 3 example BVH files. The first two are captured from motions of human beings - maybe a kung-fu master here. PLEASE use command below to see the results: # osgviewer example1.bvh -O solids This will demonstrate the animating of a skeleton and render bones as solid boxes. Note that the motion assumes XOZ is the ground and has an offset from the center, so we should adjust our view to get best effects. You may also use "-O contours" to render bones as lines. The viewer shows nothing if without any options because osgAnimation::Bone does not render itself. User may add customized models to each named bones as osganimationskinning does to make uses of this plugin in their own applications. I was wondering to support a BvhNode in my osgModeling peoject before, but soon found it better be a plugin for animation. A problem is, how to bind real geometry models to the skeleton. Maybe we could have a bindingToNode() visitor in future to find geodes matching names of bones and add them as bones' children."
2008-12-01 22:07:20 +08:00
IF(INVENTOR_FOUND)
ADD_SUBDIRECTORY(Inventor)
ENDIF()
IF(OPENVRML_FOUND)
ADD_SUBDIRECTORY(vrml)
ENDIF()
IF(COLLADA_FOUND)
ADD_SUBDIRECTORY(dae)
ENDIF()
IF(FBX_FOUND)
ADD_SUBDIRECTORY(fbx)
ENDIF()
ADD_SUBDIRECTORY(lwo)
ADD_SUBDIRECTORY(dw)
From Wang Rui, "Attachment is a plugin reading Biovision hierarchical files (.BVH) to generate character motion animations. BVH format is widely used by Character Studio of 3dsmax, MotionBuilder and other softwares, also supported by most motion capture devices. The plugin is based on the latest osgAnimation library of OSG 2.7.6 and will return a osgAnimation::AnimationManager pointer if using readNodeFile() to load it. Source and CMake files are: CMakeLists.txt ReaderWriterBVH.cpp Also there are 3 example BVH files. The first two are captured from motions of human beings - maybe a kung-fu master here. PLEASE use command below to see the results: # osgviewer example1.bvh -O solids This will demonstrate the animating of a skeleton and render bones as solid boxes. Note that the motion assumes XOZ is the ground and has an offset from the center, so we should adjust our view to get best effects. You may also use "-O contours" to render bones as lines. The viewer shows nothing if without any options because osgAnimation::Bone does not render itself. User may add customized models to each named bones as osganimationskinning does to make uses of this plugin in their own applications. I was wondering to support a BvhNode in my osgModeling peoject before, but soon found it better be a plugin for animation. A problem is, how to bind real geometry models to the skeleton. Maybe we could have a bindingToNode() visitor in future to find geodes matching names of bones and add them as bones' children."
2008-12-01 22:07:20 +08:00
ADD_SUBDIRECTORY(bvh)
ADD_SUBDIRECTORY(x)
ADD_SUBDIRECTORY(dxf)
ADD_SUBDIRECTORY(OpenFlight)
# ADD_SUBDIRECTORY(flt)
ADD_SUBDIRECTORY(geo)
ADD_SUBDIRECTORY(obj)
IF(PERFORMER_FOUND)
ADD_SUBDIRECTORY(pfb)
ENDIF()
ADD_SUBDIRECTORY(pic)
ADD_SUBDIRECTORY(stl)
ADD_SUBDIRECTORY(3ds)
ADD_SUBDIRECTORY(ac)
ADD_SUBDIRECTORY(pov)
ADD_SUBDIRECTORY(logo)
ADD_SUBDIRECTORY(lws)
ADD_SUBDIRECTORY(md2)
ADD_SUBDIRECTORY(osgtgz)
ADD_SUBDIRECTORY(tgz)
ADD_SUBDIRECTORY(shp)
ADD_SUBDIRECTORY(txf)
From Jason Daly, "'ve been busy working on the Source engine plugins. There are several contributions in this submission: osgDB/FileUtils.cpp: Needed this extra code to allow a true case-insensitive search. This is because the HL2 map and model files are often sloppy with case. For example, the file might look for materials/models/alyx/alyx_sheet.vtf, but the file is actually in materials/Models/Alyx/alyx_sheet.vtf. In case-insensitive mode, the new code recursively disassembles the path and checks each path element without regard to case. In case-sensitive mode, the code behaves exactly as it used to. The new code is also mostly skipped on Windows because of the case-insensitive file system. Previously, I did all of this with custom search code in the .bsp plugin, but this allows the user to tailor the search using OSGFILEPATH. There are some instructions in the plugins' README files about this. osgPlugins/mdl: This is a new plug-in for Half-Life 2 models (as opposed to maps). This allows you to load Source models individually, as well as allowing the .bsp plugin to load models (props) that are embedded into maps. Mdl files can contain simple object (crates, barrels, bottles), as well as fully articulated characters with skeletal animations. Currently, it can load the simple objects. It can also load the characters, but it can't load the skeletons or animations. osgPlugins/bsp: This contains all of the changes needed to load props along with the basic map geometry. There are also several bugs fixed. osgPlugins/vtf: This is the loader for Valve's texture format. Previously, we had agreed to put this in with the bsp plugin, but I didn't think of the .mdl plugin at that time. It's conceivable that a user might want to load models individually (not as part of a map), so the vtf reader does have to be separate. I also fixed a rather significant bug. I tested all of this code on RHEL 5.2 (32-bit), and Fedora 9 (64-bit). I'll be testing on Windows soon. I also attached a simple .mdl file, along with it's associated files and textures. Just extract the tarball into it's own directory, set your OSGFILEPATH to point at that directory, and load the model like this: osgviewer models/props_junk/gascan001a.mdl"
2008-12-20 21:35:49 +08:00
ADD_SUBDIRECTORY(bsp)
ADD_SUBDIRECTORY(mdl)
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
ADD_SUBDIRECTORY(ply)
ADD_SUBDIRECTORY(txp)
ENDIF()
IF(XINE_FOUND)
ADD_SUBDIRECTORY(xine)
ENDIF()
IF(FFMPEG_FOUND)
ADD_SUBDIRECTORY(ffmpeg)
ENDIF()
IF(DIRECTSHOW_FOUND)
ADD_SUBDIRECTORY(directshow)
ENDIF()
2009-03-04 19:06:34 +08:00
# IF(OPENAL_FOUND)
# ADD_SUBDIRECTORY(OpenAL)
# ENDIF()
IF(APPLE)
ADD_SUBDIRECTORY(imageio)
ENDIF()
IF(QUICKTIME_FOUND)
ADD_SUBDIRECTORY(quicktime)
ENDIF()
IF(QTKIT_FOUND)
ADD_SUBDIRECTORY(QTKit)
ENDIF()
IF(FREETYPE_FOUND)
ADD_SUBDIRECTORY(freetype)
ENDIF()
IF (QT4_FOUND)
ADD_SUBDIRECTORY(qfont)
ENDIF()
IF(ZLIB_FOUND)
ADD_SUBDIRECTORY(zip)
ENDIF()
IF(RSVG_FOUND AND CAIRO_FOUND)
ADD_SUBDIRECTORY(svg)
ENDIF()
IF(POPPLER_FOUND AND CAIRO_FOUND)
ADD_SUBDIRECTORY(pdf)
ENDIF()
IF(LIBVNCSERVER_FOUND)
2008-11-03 23:57:21 +08:00
ADD_SUBDIRECTORY(vnc)
ENDIF()
##########to get all the variables of Cmake
#GET_CMAKE_PROPERTY(MYVARS VARIABLES)
#FOREACH(myvar ${MYVARS})
# FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
# "${myvar} -->${${myvar}}<-\n"
# )
#ENDFOREACH(myvar)