2007-03-08 23:29:53 +08:00
|
|
|
#---------------------------------------------------
|
2008-10-15 00:35:03 +08:00
|
|
|
# OSG CMAKE SUPPORT
|
2007-03-08 23:29:53 +08:00
|
|
|
# (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
|
2007-03-08 23:29:53 +08:00
|
|
|
#---------------------------------------------------
|
|
|
|
|
|
|
|
PROJECT(OSG_PLUGINS_MASTER)
|
|
|
|
|
2009-03-24 00:01:02 +08:00
|
|
|
IF(NOT DYNAMIC_OPENSCENEGRAPH)
|
2008-12-12 01:00:40 +08:00
|
|
|
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2007-08-30 18:41:15 +08:00
|
|
|
IF(NOT MSVC)
|
2007-09-06 01:03:43 +08:00
|
|
|
SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}")
|
2008-05-27 06:36:58 +08:00
|
|
|
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${OSG_PLUGINS}")
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2007-10-03 05:26:22 +08:00
|
|
|
SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2009-12-02 22:58:47 +08:00
|
|
|
IF(MSVC80 OR MSVC90)
|
2009-03-24 00:01:02 +08:00
|
|
|
IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
|
|
|
|
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2007-03-19 20:30:26 +08:00
|
|
|
SET(TARGET_DEFAULT_PREFIX "osgdb_")
|
|
|
|
SET(TARGET_DEFAULT_LABEL_PREFIX "Plugins")
|
2008-10-15 00:35:03 +08:00
|
|
|
SET(TARGET_COMMON_LIBRARIES
|
2007-10-03 05:26:22 +08:00
|
|
|
OpenThreads
|
2008-10-15 00:35:03 +08:00
|
|
|
osg
|
|
|
|
osgDB
|
2007-09-06 01:03:43 +08:00
|
|
|
osgUtil
|
2007-03-19 20:30:26 +08:00
|
|
|
)
|
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
############################################################
|
2007-03-19 20:30:26 +08:00
|
|
|
#
|
2007-07-14 03:22:09 +08:00
|
|
|
# NodeKit/Psudo loader plugins
|
2007-03-19 20:30:26 +08:00
|
|
|
#
|
2007-07-14 03:22:09 +08:00
|
|
|
ADD_SUBDIRECTORY(osga)
|
|
|
|
ADD_SUBDIRECTORY(rot)
|
|
|
|
ADD_SUBDIRECTORY(scale)
|
|
|
|
ADD_SUBDIRECTORY(trans)
|
|
|
|
ADD_SUBDIRECTORY(normals)
|
2009-05-30 02:24:47 +08:00
|
|
|
ADD_SUBDIRECTORY(revisions)
|
2010-01-19 20:26:37 +08:00
|
|
|
ADD_SUBDIRECTORY(view)
|
|
|
|
ADD_SUBDIRECTORY(shadow)
|
|
|
|
ADD_SUBDIRECTORY(terrain)
|
2007-07-14 03:22:09 +08:00
|
|
|
|
|
|
|
############################################################
|
|
|
|
#
|
|
|
|
# Main native plugins
|
|
|
|
#
|
|
|
|
ADD_SUBDIRECTORY(osg)
|
|
|
|
ADD_SUBDIRECTORY(ive)
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2007-12-05 19:23:27 +08:00
|
|
|
############################################################
|
|
|
|
#
|
|
|
|
# Viewer plugins
|
|
|
|
#
|
|
|
|
ADD_SUBDIRECTORY(cfg)
|
|
|
|
|
2008-03-04 22:04:48 +08:00
|
|
|
############################################################
|
|
|
|
#
|
|
|
|
# Shader plugins
|
|
|
|
#
|
|
|
|
ADD_SUBDIRECTORY(glsl)
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
############################################################
|
|
|
|
#
|
|
|
|
# Image plugins
|
|
|
|
#
|
|
|
|
ADD_SUBDIRECTORY(rgb)
|
|
|
|
ADD_SUBDIRECTORY(bmp)
|
|
|
|
ADD_SUBDIRECTORY(pnm)
|
|
|
|
ADD_SUBDIRECTORY(dds)
|
|
|
|
ADD_SUBDIRECTORY(tga)
|
|
|
|
ADD_SUBDIRECTORY(hdr)
|
2008-10-15 00:35:03 +08:00
|
|
|
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)
|
2007-07-14 03:22:09 +08:00
|
|
|
|
|
|
|
IF(JPEG_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(jpeg)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(JASPER_FOUND)
|
2008-10-15 00:35:03 +08:00
|
|
|
ADD_SUBDIRECTORY(jp2)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2008-11-26 20:35:25 +08:00
|
|
|
IF(OPENEXR_FOUND)
|
2008-11-27 17:36:35 +08:00
|
|
|
ADD_SUBDIRECTORY(exr)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(GIFLIB_FOUND)
|
2008-10-15 00:35:03 +08:00
|
|
|
ADD_SUBDIRECTORY(gif)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(PNG_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(png)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(TIFF_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(tiff)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-08-07 18:33:25 +08:00
|
|
|
IF(GDAL_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(gdal)
|
2008-01-21 20:01:55 +08:00
|
|
|
ADD_SUBDIRECTORY(ogr)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
2008-11-20 19:27:36 +08:00
|
|
|
IF(XUL_FOUND)
|
2009-03-24 00:01:02 +08:00
|
|
|
IF(WIN32 OR APPLE OR GTK_FOUND)
|
2008-11-20 19:27:36 +08:00
|
|
|
ADD_SUBDIRECTORY(gecko)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
2008-11-20 19:27:36 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-23 00:39:17 +08:00
|
|
|
############################################################
|
|
|
|
#
|
|
|
|
# 3D Image plugins
|
|
|
|
#
|
2009-03-24 00:01:02 +08:00
|
|
|
IF(DCMTK_FOUND AND ZLIB_FOUND)
|
2008-08-23 00:39:17 +08:00
|
|
|
ADD_SUBDIRECTORY(dicom)
|
2009-03-24 00:01:02 +08:00
|
|
|
ELSE()
|
|
|
|
IF(ITK_FOUND)
|
2009-01-13 18:15:04 +08:00
|
|
|
ADD_SUBDIRECTORY(dicom)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
2008-08-23 00:39:17 +08:00
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
############################################################
|
|
|
|
#
|
|
|
|
# 3rd party 3d plugins
|
|
|
|
#
|
|
|
|
|
|
|
|
ADD_SUBDIRECTORY(3dc)
|
|
|
|
|
2009-04-30 04:30:21 +08:00
|
|
|
ADD_SUBDIRECTORY(p3d)
|
2009-04-27 19:02:18 +08:00
|
|
|
|
2008-12-01 22:07:20 +08:00
|
|
|
IF(CURL_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(curl)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2008-12-01 22:07:20 +08:00
|
|
|
|
|
|
|
IF(ZLIB_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(gz)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2008-12-01 22:07:20 +08:00
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(INVENTOR_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(Inventor)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
|
|
|
IF(OPENVRML_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(vrml)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
|
|
|
IF(COLLADA_FOUND)
|
2007-09-06 01:03:43 +08:00
|
|
|
ADD_SUBDIRECTORY(dae)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
2009-11-19 19:44:44 +08:00
|
|
|
IF(FBX_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(fbx)
|
|
|
|
ENDIF()
|
|
|
|
|
2010-10-06 22:44:52 +08:00
|
|
|
ADD_SUBDIRECTORY(lwo)
|
|
|
|
ADD_SUBDIRECTORY(dw)
|
2009-10-08 03:42:32 +08:00
|
|
|
|
2008-12-01 22:07:20 +08:00
|
|
|
ADD_SUBDIRECTORY(bvh)
|
2007-07-14 03:22:09 +08:00
|
|
|
ADD_SUBDIRECTORY(x)
|
|
|
|
ADD_SUBDIRECTORY(dxf)
|
|
|
|
ADD_SUBDIRECTORY(OpenFlight)
|
2008-11-10 21:56:59 +08:00
|
|
|
# ADD_SUBDIRECTORY(flt)
|
2007-07-14 03:22:09 +08:00
|
|
|
ADD_SUBDIRECTORY(geo)
|
|
|
|
ADD_SUBDIRECTORY(obj)
|
|
|
|
|
|
|
|
IF(PERFORMER_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(pfb)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
|
|
|
ADD_SUBDIRECTORY(pic)
|
|
|
|
ADD_SUBDIRECTORY(stl)
|
|
|
|
ADD_SUBDIRECTORY(3ds)
|
|
|
|
ADD_SUBDIRECTORY(ac)
|
2010-07-31 18:33:20 +08:00
|
|
|
ADD_SUBDIRECTORY(pov)
|
2007-07-14 03:22:09 +08:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2009-11-17 20:55:52 +08:00
|
|
|
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
|
|
|
|
ADD_SUBDIRECTORY(ply)
|
|
|
|
ADD_SUBDIRECTORY(txp)
|
|
|
|
ENDIF()
|
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(XINE_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(xine)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
2009-02-26 00:05:12 +08:00
|
|
|
IF(FFMPEG_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(ffmpeg)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2009-02-26 00:05:12 +08:00
|
|
|
|
2009-11-20 18:48:51 +08:00
|
|
|
IF(DIRECTSHOW_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(directshow)
|
|
|
|
ENDIF()
|
|
|
|
|
2009-03-04 19:06:34 +08:00
|
|
|
# IF(OPENAL_FOUND)
|
|
|
|
# ADD_SUBDIRECTORY(OpenAL)
|
2009-03-24 00:01:02 +08:00
|
|
|
# ENDIF()
|
2009-03-04 00:51:01 +08:00
|
|
|
|
2009-03-10 18:30:34 +08:00
|
|
|
IF(APPLE)
|
|
|
|
ADD_SUBDIRECTORY(imageio)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2009-03-10 18:30:34 +08:00
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(QUICKTIME_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(quicktime)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-07-14 03:22:09 +08:00
|
|
|
|
2010-09-24 20:59:37 +08:00
|
|
|
IF(QTKIT_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(QTKit)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(FREETYPE_FOUND)
|
2008-10-15 00:35:03 +08:00
|
|
|
ADD_SUBDIRECTORY(freetype)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
|
|
|
|
2010-03-05 23:46:17 +08:00
|
|
|
IF (QT4_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(qfont)
|
|
|
|
ENDIF()
|
|
|
|
|
2007-07-14 03:22:09 +08:00
|
|
|
IF(ZLIB_FOUND)
|
|
|
|
ADD_SUBDIRECTORY(zip)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2008-05-11 22:26:27 +08:00
|
|
|
IF(RSVG_FOUND AND CAIRO_FOUND)
|
2008-05-11 22:23:19 +08:00
|
|
|
ADD_SUBDIRECTORY(svg)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-03-19 20:30:26 +08:00
|
|
|
|
2009-03-24 00:01:02 +08:00
|
|
|
IF(POPPLER_FOUND AND CAIRO_FOUND)
|
2008-12-08 01:02:30 +08:00
|
|
|
ADD_SUBDIRECTORY(pdf)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2008-07-16 01:21:25 +08:00
|
|
|
|
2009-03-24 00:01:02 +08:00
|
|
|
IF(LIBVNCSERVER_FOUND)
|
2008-11-03 23:57:21 +08:00
|
|
|
ADD_SUBDIRECTORY(vnc)
|
2009-03-24 00:01:02 +08:00
|
|
|
ENDIF()
|
2007-03-19 20:30:26 +08:00
|
|
|
|
2007-03-08 23:29:53 +08:00
|
|
|
##########to get all the variables of Cmake
|
2007-03-19 20:30:26 +08:00
|
|
|
#GET_CMAKE_PROPERTY(MYVARS VARIABLES)
|
|
|
|
#FOREACH(myvar ${MYVARS})
|
2007-09-06 01:03:43 +08:00
|
|
|
# FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
|
|
|
|
# "${myvar} -->${${myvar}}<-\n"
|
|
|
|
# )
|
2007-03-19 20:30:26 +08:00
|
|
|
#ENDFOREACH(myvar)
|
2007-03-08 23:29:53 +08:00
|
|
|
|
2008-10-15 00:35:03 +08:00
|
|
|
|